From: Julien V. <ju...@jb...> - 2006-07-09 12:04:17
|
User: julien Date: 06/07/09 08:04:15 Modified: portlet/src/main/org/jboss/portal/portlet PortletRequestDecoder.java PortletURL.java Added: portlet/src/main/org/jboss/portal/portlet Mode.java WindowState.java Log: move Mode and WindowState to org.jboss.portal.portlet instead of org.jboss.portal Revision Changes Path 1.2 +0 -2 jboss-portal/portlet/src/main/org/jboss/portal/portlet/PortletRequestDecoder.java (In the diff below, changes in quantity of whitespace are not shown.) Index: PortletRequestDecoder.java =================================================================== RCS file: /cvsroot/jboss/jboss-portal/portlet/src/main/org/jboss/portal/portlet/PortletRequestDecoder.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -b -r1.1 -r1.2 --- PortletRequestDecoder.java 22 Jun 2006 02:11:13 -0000 1.1 +++ PortletRequestDecoder.java 9 Jul 2006 12:04:15 -0000 1.2 @@ -23,8 +23,6 @@ import org.jboss.portal.server.util.Parameters; import org.jboss.portal.server.request.RequestParameter; -import org.jboss.portal.Mode; -import org.jboss.portal.WindowState; import java.util.Iterator; import java.util.Map; @@ -34,7 +32,7 @@ * Which means that this implementation does not preclude other implementations. * * @author <a href="mailto:ju...@jb...">Julien Viet</a> - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ */ public class PortletRequestDecoder { 1.5 +1 -4 jboss-portal/portlet/src/main/org/jboss/portal/portlet/PortletURL.java (In the diff below, changes in quantity of whitespace are not shown.) Index: PortletURL.java =================================================================== RCS file: /cvsroot/jboss/jboss-portal/portlet/src/main/org/jboss/portal/portlet/PortletURL.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -b -r1.4 -r1.5 --- PortletURL.java 23 Jun 2006 16:17:26 -0000 1.4 +++ PortletURL.java 9 Jul 2006 12:04:15 -0000 1.5 @@ -21,12 +21,9 @@ */ package org.jboss.portal.portlet; -import org.jboss.portal.Mode; -import org.jboss.portal.WindowState; - /** * @author <a href="mailto:ju...@jb...">Julien Viet</a> - * @version $Revision: 1.4 $ + * @version $Revision: 1.5 $ */ public interface PortletURL { 1.1 date: 2006/07/09 12:04:15; author: julien; state: Exp;jboss-portal/portlet/src/main/org/jboss/portal/portlet/Mode.java Index: Mode.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.portal.portlet; import java.io.Serializable; /** * @author <a href="mailto:ju...@jb...">Julien Viet</a> * @version $Revision: 1.1 $ */ public class Mode implements Serializable { /** The serialVersionUID. */ private static final long serialVersionUID = 6033765240710422050L; /** . */ public static final Mode EDIT = new Mode("edit"); /** . */ public static final Mode HELP = new Mode("help"); /** . */ public static final Mode VIEW = new Mode("view"); /** . */ public static final Mode EDIT_DEFAULTS = new Mode("edit_defaults"); /** . */ private String name; public Mode(String name) { if (name == null) { throw new NullPointerException(); } this.name = name; } public boolean equals(Object o) { if (o instanceof Mode) { return o == this || name.equalsIgnoreCase(((Mode)o).name); } return false; } public int hashCode() { return name.hashCode(); } public String toString() { return name; } private Object readResolve() { if (VIEW.name.equalsIgnoreCase(name)) { return VIEW; } else if (EDIT.name.equalsIgnoreCase(name)) { return EDIT; } else if (HELP.name.equalsIgnoreCase(name)) { return HELP; } else if (EDIT_DEFAULTS.name.equalsIgnoreCase(name)) { return EDIT_DEFAULTS; } else { return this; } } public static Mode create(String s) { if (Mode.VIEW.name.equalsIgnoreCase(s)) { return Mode.VIEW; } else if (Mode.EDIT.name.equalsIgnoreCase(s)) { return Mode.EDIT; } else if (Mode.HELP.name.equalsIgnoreCase(s)) { return Mode.HELP; } else if (Mode.EDIT_DEFAULTS.name.equalsIgnoreCase(s)) { return Mode.VIEW; } else { return new Mode(s); } } } 1.1 date: 2006/07/09 12:04:15; author: julien; state: Exp;jboss-portal/portlet/src/main/org/jboss/portal/portlet/WindowState.java Index: WindowState.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.portal.portlet; import java.io.Serializable; /** * @author <a href="mailto:ju...@jb...">Julien Viet</a> * @version $Revision: 1.1 $ */ public class WindowState implements Serializable { /** The serialVersionUID */ private static final long serialVersionUID = -6305311518934458562L; public static final WindowState NORMAL = new WindowState("normal"); public static final WindowState MINIMIZED = new WindowState("minimized"); public static final WindowState MAXIMIZED = new WindowState("maximized"); private String name; public WindowState(String name) { if (name == null) { throw new IllegalArgumentException("Window state name cannot be null."); } this.name = name; } public boolean equals(Object o) { if (o instanceof WindowState) { return o == this || name.equalsIgnoreCase(((WindowState)o).name); } return false; } public int hashCode() { return name.hashCode(); } public String toString() { return name; } private Object readResolve() { if (NORMAL.name.equalsIgnoreCase(name)) { return NORMAL; } else if (MAXIMIZED.name.equalsIgnoreCase(name)) { return MAXIMIZED; } else if (MINIMIZED.name.equalsIgnoreCase(name)) { return MINIMIZED; } else { return this; } } public static WindowState create(String s) { if (WindowState.NORMAL.toString().equalsIgnoreCase(s)) { return WindowState.NORMAL; } else if (WindowState.MINIMIZED.toString().equalsIgnoreCase(s)) { return WindowState.MINIMIZED; } else if (WindowState.MAXIMIZED.toString().equalsIgnoreCase(s)) { return WindowState.MAXIMIZED; } else { return new WindowState(s); } } } |