Author: julien(a)jboss.com
Date: 2007-08-17 07:59:10 -0400 (Fri, 17 Aug 2007)
New Revision: 7971
Added:
modules/common/trunk/build/ide/intellij/idea60/modules/portal/
modules/common/trunk/build/ide/intellij/idea60/modules/portal/portal.iml
modules/common/trunk/portal/
modules/common/trunk/portal/.classpath
modules/common/trunk/portal/.cvsignore
modules/common/trunk/portal/.project
modules/common/trunk/portal/build.bat
modules/common/trunk/portal/build.sh
modules/common/trunk/portal/build.xml
modules/common/trunk/portal/src/
modules/common/trunk/portal/src/main/
modules/common/trunk/portal/src/main/org/
modules/common/trunk/portal/src/main/org/jboss/
modules/common/trunk/portal/src/main/org/jboss/portal/
modules/common/trunk/portal/src/main/org/jboss/portal/Mode.java
modules/common/trunk/portal/src/main/org/jboss/portal/WindowState.java
Modified:
modules/common/trunk/build/build.xml
modules/common/trunk/build/ide/intellij/idea60/jboss-portal-common.ipr
Log:
have the classes from API under org.jboss.portal in the common/portal module as they are
used everywhere
Modified: modules/common/trunk/build/build.xml
===================================================================
--- modules/common/trunk/build/build.xml 2007-08-17 10:17:39 UTC (rev 7970)
+++ modules/common/trunk/build/build.xml 2007-08-17 11:59:10 UTC (rev 7971)
@@ -112,12 +112,13 @@
<!-- Modules -->
<module name="common"/>
+ <module name="portal"/>
<!-- Module groups -->
<group name="common">
<include
- modules="common"/>
+ modules="common,portal"/>
</group>
<group name="default">
Modified: modules/common/trunk/build/ide/intellij/idea60/jboss-portal-common.ipr
===================================================================
--- modules/common/trunk/build/ide/intellij/idea60/jboss-portal-common.ipr 2007-08-17
10:17:39 UTC (rev 7970)
+++ modules/common/trunk/build/ide/intellij/idea60/jboss-portal-common.ipr 2007-08-17
11:59:10 UTC (rev 7971)
@@ -253,6 +253,7 @@
<component name="ProjectModuleManager">
<modules>
<module
fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea60/modules/common/common.iml"
filepath="$PROJECT_DIR$/build/ide/intellij/idea60/modules/common/common.iml"
/>
+ <module
fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea60/modules/portal/portal.iml"
filepath="$PROJECT_DIR$/build/ide/intellij/idea60/modules/portal/portal.iml"
/>
<module
fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea60/modules/testsuite/testsuite.iml"
filepath="$PROJECT_DIR$/build/ide/intellij/idea60/modules/testsuite/testsuite.iml"
/>
<module
fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea60/modules/thirdparty/thirdparty.iml"
filepath="$PROJECT_DIR$/build/ide/intellij/idea60/modules/thirdparty/thirdparty.iml"
/>
<module
fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea60/modules/tools/tools.iml"
filepath="$PROJECT_DIR$/build/ide/intellij/idea60/modules/tools/tools.iml"
/>
Added: modules/common/trunk/build/ide/intellij/idea60/modules/portal/portal.iml
===================================================================
--- modules/common/trunk/build/ide/intellij/idea60/modules/portal/portal.iml
(rev 0)
+++ modules/common/trunk/build/ide/intellij/idea60/modules/portal/portal.iml 2007-08-17
11:59:10 UTC (rev 7971)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true"
type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager"
inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$/../../../../../../portal">
+ <sourceFolder
url="file://$MODULE_DIR$/../../../../../../portal/src/main"
isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntryProperties />
+ </component>
+</module>
+
Added: modules/common/trunk/portal/.classpath
===================================================================
--- modules/common/trunk/portal/.classpath (rev 0)
+++ modules/common/trunk/portal/.classpath 2007-08-17 11:59:10 UTC (rev 7971)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Property changes on: modules/common/trunk/portal/.classpath
___________________________________________________________________
Name: svn:executable
+ *
Added: modules/common/trunk/portal/.cvsignore
===================================================================
--- modules/common/trunk/portal/.cvsignore (rev 0)
+++ modules/common/trunk/portal/.cvsignore 2007-08-17 11:59:10 UTC (rev 7971)
@@ -0,0 +1,2 @@
+bin
+output
Property changes on: modules/common/trunk/portal/.cvsignore
___________________________________________________________________
Name: svn:executable
+ *
Added: modules/common/trunk/portal/.project
===================================================================
--- modules/common/trunk/portal/.project (rev 0)
+++ modules/common/trunk/portal/.project 2007-08-17 11:59:10 UTC (rev 7971)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>api</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Property changes on: modules/common/trunk/portal/.project
___________________________________________________________________
Name: svn:executable
+ *
Added: modules/common/trunk/portal/build.bat
===================================================================
--- modules/common/trunk/portal/build.bat (rev 0)
+++ modules/common/trunk/portal/build.bat 2007-08-17 11:59:10 UTC (rev 7971)
@@ -0,0 +1,54 @@
+@echo off
+rem
+rem Invokes a script of the same name in the 'tools' module.
+rem
+rem The 'tools' module is expected to be a peer directory of the directory
+rem in which this script lives.
+rem
+rem @author Jason Dillon <jason(a)planet57.com>
+rem
+
+rem $Id: build.bat 2 2005-01-14 23:01:32Z vietj $
+
+setlocal
+
+set PROGNAME=%~nx0
+set DIRNAME=%~dp0
+
+rem Legacy shell support
+if x%PROGNAME%==x set PROGNAME=build.bat
+if x%DIRNAME%==x set DIRNAME=.\
+
+set MODULE_ROOT=%DIRNAME%
+if x%TOOLS_ROOT%==x set TOOLS_ROOT=%DIRNAME%..\tools
+set TARGET=%TOOLS_ROOT%\bin\build.bat
+set ARGS=%*
+
+rem Start'er up yo
+goto main
+
+:debug
+if not x%DEBUG%==x echo %PROGNAME%: %*
+goto :EOF
+
+:main
+call :debug PROGNAME=%PROGNAME%
+call :debug DIRNAME=%DIRNAME%
+call :debug TOOLS_ROOT=%TOOLS_ROOT%
+call :debug TARGET=%TARGET%
+
+if exist %TARGET% call :call-script & goto :EOF
+rem else fail, we can not go on
+
+echo %PROGNAME%: *ERROR* The target executable does not exist:
+echo %PROGNAME%:
+echo %PROGNAME%: %TARGET%
+echo %PROGNAME%:
+echo %PROGNAME%: Please make sure you have checked out the 'tools' module
+echo %PROGNAME%: and make sure it is up to date.
+goto :EOF
+
+:call-script
+call :debug Executing %TARGET% %ARGS%
+call %TARGET% %ARGS%
+goto :EOF
Property changes on: modules/common/trunk/portal/build.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: modules/common/trunk/portal/build.sh
===================================================================
--- modules/common/trunk/portal/build.sh (rev 0)
+++ modules/common/trunk/portal/build.sh 2007-08-17 11:59:10 UTC (rev 7971)
@@ -0,0 +1,49 @@
+#!/bin/sh
+##
+## Invokes a script of the same name in the 'tools' module.
+##
+## The 'tools' module is expected to be a peer directory of the directory
+## in which this script lives.
+##
+## @author Jason Dillon <jason(a)planet57.com>
+##
+
+# $Id: build.sh 2 2005-01-14 23:01:32Z vietj $
+
+PROGNAME=`basename $0`
+DIRNAME=`dirname $0`
+
+# Buss it yo
+main() {
+ if [ "x$TOOLS_ROOT" = "x" ]; then
+ TOOLS_ROOT=`cd $DIRNAME/../tools && pwd`
+ fi
+
+ MODULE_ROOT=`cd $DIRNAME; pwd`
+ export TOOLS_ROOT MODULE_ROOT DEBUG TRACE
+
+ # Where is the target script?
+ target="$TOOLS_ROOT/bin/$PROGNAME"
+ if [ ! -f "$target" ]; then
+ echo "${PROGNAME}: *ERROR* The target executable does not exist:"
+ echo "${PROGNAME}:"
+ echo "${PROGNAME}: $target"
+ echo "${PROGNAME}:"
+ echo "${PROGNAME}: Please make sure you have checked out the 'tools'
module"
+ echo "${PROGNAME}: and make sure it is up to date."
+ exit 2
+ fi
+
+ # Get busy yo!
+ if [ "x$DEBUG" != "x" ]; then
+ echo "${PROGNAME}: Executing: /bin/sh $target $@"
+ fi
+ if [ "x$TRACE" = "x" ]; then
+ exec /bin/sh $target "$@"
+ else
+ exec /bin/sh -x $target "$@"
+ fi
+}
+
+# Lets get ready to rumble!
+main "$@"
Property changes on: modules/common/trunk/portal/build.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: modules/common/trunk/portal/build.xml
===================================================================
--- modules/common/trunk/portal/build.xml (rev 0)
+++ modules/common/trunk/portal/build.xml 2007-08-17 11:59:10 UTC (rev 7971)
@@ -0,0 +1,181 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE project [
+ <!ENTITY libraries SYSTEM "../thirdparty/libraries.ent">
+ <!ENTITY buildmagic SYSTEM
"../tools/etc/buildfragments/buildmagic.ent">
+ <!ENTITY tools SYSTEM "../tools/etc/buildfragments/tools.ent">
+ <!ENTITY modules SYSTEM "../tools/etc/buildfragments/modules.ent">
+ <!ENTITY defaults SYSTEM
"../tools/etc/buildfragments/defaults.ent">
+ <!ENTITY targets SYSTEM "../tools/etc/buildfragments/targets.ent">
+ ]>
+
+<!-- $Id: build.xml 7910 2007-08-14 09:46:27Z julien(a)jboss.com $ -->
+
+<!--+======================================================================+-->
+<!--| JBoss Portal (The OpenSource Portal) Build File |-->
+<!--| |-->
+<!--| Distributable under LGPL license. |-->
+<!--| See terms of license at
http://www.gnu.org. |-->
+<!--| |-->
+<!--| This file has been designed to work with the 'tools' module and
|-->
+<!--| Buildmagic extentions. |-->
+<!--+======================================================================+-->
+
+<project default="main" name="JBoss Portal">
+
+ <!--+====================================================================+-->
+ <!--| Setup |-->
+ <!--| |-->
+ <!--| Include the common build elements. |-->
+ <!--| |-->
+ <!--| This defines several different targets, properties and paths. |-->
+ <!--| It also sets up the basic extention tasks amoung other things. |-->
+ <!--+====================================================================+-->
+
+ &buildmagic;
+
+ &modules;
+ &defaults;
+ &tools;
+ &targets;
+
+ <!-- ================================================================== -->
+ <!-- Initialization -->
+ <!-- ================================================================== -->
+
+ <!--
+ | Initialize the build system. Must depend on '_buildmagic:init'.
+ | Other targets should depend on 'init' or things will mysteriously fail.
+ -->
+
+ <target name="init" unless="init.disable"
depends="_buildmagic:init">
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Configuration |-->
+ <!--| |-->
+ <!--| This target is invoked by the Buildmagic initialization logic |-->
+ <!--| and should contain module specific configuration elements. |-->
+ <!--+====================================================================+-->
+
+ <target name="configure" unless="configure.disable">
+
+ <!-- Override the javadoc packages to javax.portlet.* -->
+ <property name="javadoc.packages"
value="org.jboss.portal.*"/>
+
+ <!-- Configure thirdparty libraries -->
+ &libraries;
+ <path id="library.classpath">
+ <path refid="junit.junit.classpath"/>
+ </path>
+
+ <!-- Configure modules -->
+ <call target="configure-modules"/>
+ <path id="dependentmodule.classpath">
+ </path>
+
+ <!--+=======================================+-->
+ <!--| Override any default properties here. |-->
+ <!--+=======================================+-->
+
+ <!-- Configure defaults & build tools -->
+ <call target="configure-defaults"/>
+ <call target="configure-tools"/>
+
+ <!--+=======================================+-->
+ <!--| Define module specific elements here. |-->
+ <!--+=======================================+-->
+ <property name="javadoc.private" value="true"/>
+ <property name="javadoc.protected" value="false"/>
+
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Compile |-->
+ <!--| |-->
+ <!--| This target should depend on other compile-* targets for each |-->
+ <!--| different type of compile that needs to be performed, short of |-->
+ <!--| documentation compiles. |-->
+ <!--+====================================================================+-->
+
+ <target name="compile"
+ description="Compile all source files."
+ depends="_default:compile-classes,
+ _default:compile-etc,
+ _default:compile-resources">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Generate Output |-->
+ <!--| |-->
+ <!--| Generates the target output for this module. Target output is |-->
+ <!--| the output which is ment to be released or used by external |-->
+ <!--| modules. |-->
+ <!--+====================================================================+-->
+
+ <target name="output"
+ description="Generate all target output."
+ depends="compile">
+
+ <mkdir dir="${build.lib}"/>
+
+ <jar jarfile="${build.lib}/portal-common-portal-lib.jar">
+ <fileset dir="${build.classes}"/>
+ </jar>
+
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Cleaning -->
+ <!-- ================================================================== -->
+
+ <!-- Clean up all build output -->
+ <target name="clean" depends="_default:clean">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Documents |-->
+ <!--| |-->
+ <!--| Generate all documentation for this module. |-->
+ <!--+====================================================================+-->
+
+ <target name="docs" depends="_default:docs">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Misc. -->
+ <!-- ================================================================== -->
+
+ <target name="main" depends="most"/>
+ <target name="all" depends="_default:all"/>
+ <target name="most" depends="_default:most"/>
+ <target name="help" depends="_default:help"/>
+
+ <target name="package-tests"></target>
+
+</project>
Property changes on: modules/common/trunk/portal/build.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: modules/common/trunk/portal/src/main/org/jboss/portal/Mode.java
===================================================================
--- modules/common/trunk/portal/src/main/org/jboss/portal/Mode.java
(rev 0)
+++ modules/common/trunk/portal/src/main/org/jboss/portal/Mode.java 2007-08-17 11:59:10
UTC (rev 7971)
@@ -0,0 +1,162 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, 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;
+
+import java.io.Serializable;
+import java.util.Locale;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 7867 $
+ */
+public final 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");
+
+ /** . */
+ public static final Mode ADMIN = new Mode("admin");
+
+ /** . */
+ private String name;
+
+ public Mode(String name)
+ {
+ this(name, false);
+ }
+
+ /**
+ * @param name
+ * @param preserveCase
+ * @since 2.4.2
+ */
+ private Mode(String name, boolean preserveCase)
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException("Mode cannot be null");
+ }
+ this.name = (preserveCase ? name : name.toLowerCase(Locale.ENGLISH));
+ }
+
+
+ public boolean equals(Object o)
+ {
+ if (o == this)
+ {
+ return true;
+ }
+ if (o instanceof Mode)
+ {
+ Mode that = (Mode)o;
+ return name.equals(that.name);
+ }
+ return false;
+ }
+
+ public int hashCode()
+ {
+ return name.hashCode();
+ }
+
+ public String toString()
+ {
+ return name;
+ }
+
+ private Object readResolve()
+ {
+ if (VIEW.name.equals(name))
+ {
+ return VIEW;
+ }
+ else if (EDIT.name.equals(name))
+ {
+ return EDIT;
+ }
+ else if (HELP.name.equals(name))
+ {
+ return HELP;
+ }
+ else if (EDIT_DEFAULTS.name.equals(name))
+ {
+ return EDIT_DEFAULTS;
+ }
+ else
+ {
+ return this;
+ }
+ }
+
+ public static Mode create(String name)
+ {
+ return create(name, false);
+ }
+
+ /**
+ * @param name
+ * @param preserveCase
+ * @return
+ * @since 2.4.2
+ */
+ public static Mode create(String name, boolean preserveCase)
+ {
+ if (Mode.VIEW.name.equals(name))
+ {
+ return Mode.VIEW;
+ }
+ else if (Mode.EDIT.name.equals(name))
+ {
+ return Mode.EDIT;
+ }
+ else if (Mode.HELP.name.equals(name))
+ {
+ return Mode.HELP;
+ }
+ else if (Mode.ADMIN.name.equals(name))
+ {
+ return Mode.ADMIN;
+ }
+ else if (Mode.EDIT_DEFAULTS.name.equals(name))
+ {
+ return Mode.EDIT_DEFAULTS;
+ }
+ else
+ {
+ return new Mode(name, preserveCase);
+ }
+ }
+}
Property changes on: modules/common/trunk/portal/src/main/org/jboss/portal/Mode.java
___________________________________________________________________
Name: svn:executable
+ *
Added: modules/common/trunk/portal/src/main/org/jboss/portal/WindowState.java
===================================================================
--- modules/common/trunk/portal/src/main/org/jboss/portal/WindowState.java
(rev 0)
+++ modules/common/trunk/portal/src/main/org/jboss/portal/WindowState.java 2007-08-17
11:59:10 UTC (rev 7971)
@@ -0,0 +1,144 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, 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;
+
+import java.io.Serializable;
+import java.util.Locale;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6901 $
+ */
+public final 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)
+ {
+ this(name, false);
+ }
+
+ /**
+ * @param name
+ * @param preserveCase
+ * @since 2.4.2
+ */
+ private WindowState(String name, boolean preserveCase)
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException("Window state name cannot be
null");
+ }
+
+ this.name = (preserveCase ? name : name.toLowerCase(Locale.ENGLISH));
+ }
+
+ public boolean equals(Object o)
+ {
+ if (o == this)
+ {
+ return true;
+ }
+ if (o instanceof WindowState)
+ {
+ WindowState that = (WindowState)o;
+ return name.equals(that.name);
+ }
+ return false;
+ }
+
+ public int hashCode()
+ {
+ return name.hashCode();
+ }
+
+ public String toString()
+ {
+ return name;
+ }
+
+ private Object readResolve()
+ {
+ if (NORMAL.name.equals(name))
+ {
+ return NORMAL;
+ }
+ else if (MAXIMIZED.name.equals(name))
+ {
+ return MAXIMIZED;
+ }
+ else if (MINIMIZED.name.equals(name))
+ {
+ return MINIMIZED;
+ }
+ else
+ {
+ return this;
+ }
+ }
+
+ public static WindowState create(String name)
+ {
+ return create(name, false);
+ }
+
+ /**
+ * @param name
+ * @param preserveCase
+ * @return
+ * @since 2.4.2
+ */
+ public static WindowState create(String name, boolean preserveCase)
+ {
+ if (WindowState.NORMAL.name.equals(name))
+ {
+ return WindowState.NORMAL;
+ }
+ else if (WindowState.MINIMIZED.name.equals(name))
+ {
+ return WindowState.MINIMIZED;
+ }
+ else if (WindowState.MAXIMIZED.name.equals(name))
+ {
+ return WindowState.MAXIMIZED;
+ }
+ else
+ {
+ return new WindowState(name, preserveCase);
+ }
+ }
+}
Property changes on:
modules/common/trunk/portal/src/main/org/jboss/portal/WindowState.java
___________________________________________________________________
Name: svn:executable
+ *