[jboss-cvs] jboss-portal/theme/src/main/org/jboss/portal/theme/page ...
Chris Laprun
chris.laprun at jboss.com
Wed Jul 19 13:17:41 EDT 2006
User: claprun
Date: 06/07/19 13:17:41
Modified: theme/src/main/org/jboss/portal/theme/page
WindowResult.java
Log:
JBPORTAL-958:
- Separated concerns: states and modes do not contain ordering logic anymore.
- Ordering is done in DivDecorationRenderer.
- Removed Actionable and BaseActionable.
- Moved constants for action map to WindowResult.
Revision Changes Path
1.12 +22 -13 jboss-portal/theme/src/main/org/jboss/portal/theme/page/WindowResult.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: WindowResult.java
===================================================================
RCS file: /cvsroot/jboss/jboss-portal/theme/src/main/org/jboss/portal/theme/page/WindowResult.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- WindowResult.java 18 Jul 2006 22:29:27 -0000 1.11
+++ WindowResult.java 19 Jul 2006 17:17:41 -0000 1.12
@@ -21,7 +21,8 @@
*/
package org.jboss.portal.theme.page;
-import org.jboss.portal.portlet.Actionable;
+import org.jboss.portal.portlet.Mode;
+import org.jboss.portal.portlet.WindowState;
import org.jboss.portal.server.util.Properties;
import org.jboss.portal.theme.render.MarkupResult;
@@ -38,7 +39,7 @@
* </li>
*
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision: 1.11 $
+ * @version $Revision: 1.12 $
*/
public class WindowResult extends MarkupResult
{
@@ -48,6 +49,8 @@
private final Properties properties;
private final String headerContent;
private final Map windowProperties;
+ public static final String MODES_KEY = "mode";
+ public static final String WINDOWSTATES_KEY = "windowstate";
/**
* Create a new WindowResult with the information about the renderered portlet.
@@ -140,12 +143,12 @@
*
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
*/
- public static class Action implements Comparable
+ public static class Action
{
/**
* The origin of the action.
*/
- private final Actionable origin;
+ private final Object origin;
/**
* The action url.
@@ -157,16 +160,28 @@
*/
private final boolean enabled;
- public Action(Actionable origin, String url, boolean enabled)
+ public Action(Object origin, String url, boolean enabled)
+ {
+ if (origin instanceof WindowState || origin instanceof Mode)
{
this.origin = origin;
+ }
+ else
+ {
+ throw new IllegalArgumentException("Action can only have a WindowState or Mode for origin. Was: " + origin);
+ }
this.url = url;
this.enabled = enabled;
}
public String getName()
{
- return origin.getName();
+ return origin.toString();
+ }
+
+ public Object getOrigin()
+ {
+ return origin;
}
public String getURL()
@@ -178,11 +193,5 @@
{
return enabled;
}
-
- public int compareTo(Object o)
- {
- Action action = (Action)o;
- return origin.compareTo(action.origin);
- }
}
}
More information about the jboss-cvs-commits
mailing list