Author: julien(a)jboss.com
Date: 2007-04-27 05:02:56 -0400 (Fri, 27 Apr 2007)
New Revision: 7100
Modified:
trunk/core/src/main/org/jboss/portal/core/model/portal/navstate/WindowNavigationalState.java
Log:
- fixed nav state bug
Modified:
trunk/core/src/main/org/jboss/portal/core/model/portal/navstate/WindowNavigationalState.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/navstate/WindowNavigationalState.java 2007-04-27
08:39:22 UTC (rev 7099)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/navstate/WindowNavigationalState.java 2007-04-27
09:02:56 UTC (rev 7100)
@@ -79,23 +79,39 @@
return state;
}
- public static WindowState getWindowState(AttributeResolver context, Object id)
+ public static WindowState getWindowState(AttributeResolver resolver, Object id)
{
NavigationalStateKey key = new NavigationalStateKey(WindowNavigationalState.class,
id);
//
- WindowNavigationalState wns = (WindowNavigationalState)context.getAttribute(key);
+ WindowNavigationalState wns = (WindowNavigationalState)resolver.getAttribute(key);
//
return wns != null ? wns.getWindowState() : null;
}
- public static void setWindowState(AttributeResolver context, Object id, WindowState
windowState)
+ public static void setWindowState(AttributeResolver resolver, Object id, WindowState
windowState)
{
- NavigationalStateKey key = new NavigationalStateKey(WindowNavigationalState.class,
id);
+ setWindowState(resolver, new NavigationalStateKey(WindowNavigationalState.class,
id), windowState);
+ }
+ public static void setWindowState(AttributeResolver resolver, NavigationalStateKey
key, WindowState windowState)
+ {
+ if (resolver == null)
+ {
+ throw new IllegalArgumentException("No null resolver");
+ }
+ if (key == null)
+ {
+ throw new IllegalArgumentException("No null key");
+ }
+ if (windowState == null)
+ {
+ throw new IllegalArgumentException("No null window state");
+ }
+
//
- WindowNavigationalState wns = (WindowNavigationalState)context.getAttribute(key);
+ WindowNavigationalState wns = (WindowNavigationalState)resolver.getAttribute(key);
//
if (wns == null)
@@ -108,15 +124,15 @@
}
//
- context.setAttribute(key, wns);
+ resolver.setAttribute(key, wns);
}
- public static Mode getMode(AttributeResolver context, Object id)
+ public static Mode getMode(AttributeResolver resolver, Object id)
{
NavigationalStateKey key = new NavigationalStateKey(WindowNavigationalState.class,
id);
//
- WindowNavigationalState wns = (WindowNavigationalState)context.getAttribute(key);
+ WindowNavigationalState wns = (WindowNavigationalState)resolver.getAttribute(key);
//
return wns != null ? wns.getMode() : null;
@@ -124,10 +140,26 @@
public static void setMode(AttributeResolver context, Object id, Mode mode)
{
- NavigationalStateKey key = new NavigationalStateKey(WindowNavigationalState.class,
id);
+ setMode(context, new NavigationalStateKey(WindowNavigationalState.class, id),
mode);
+ }
+ public static void setMode(AttributeResolver resolver, NavigationalStateKey key, Mode
mode)
+ {
+ if (resolver == null)
+ {
+ throw new IllegalArgumentException("No null resolver");
+ }
+ if (key == null)
+ {
+ throw new IllegalArgumentException("No null key");
+ }
+ if (mode == null)
+ {
+ throw new IllegalArgumentException("No null mode");
+ }
+
//
- WindowNavigationalState wns = (WindowNavigationalState)context.getAttribute(key);
+ WindowNavigationalState wns = (WindowNavigationalState)resolver.getAttribute(key);
//
if (wns == null)
@@ -140,26 +172,42 @@
}
//
- context.setAttribute(key, wns);
+ resolver.setAttribute(key, wns);
}
- public static StateString getState(AttributeResolver context, Object id)
+ public static StateString getState(AttributeResolver resolver, Object id)
{
NavigationalStateKey key = new NavigationalStateKey(WindowNavigationalState.class,
id);
//
- WindowNavigationalState wns = (WindowNavigationalState)context.getAttribute(key);
+ WindowNavigationalState wns = (WindowNavigationalState)resolver.getAttribute(key);
//
return wns != null ? wns.getState() : null;
}
- public static void setState(AttributeResolver context, Object id, StateString state)
+ public static void setState(AttributeResolver resolver, Object id, StateString state)
{
- NavigationalStateKey key = new NavigationalStateKey(WindowNavigationalState.class,
id);
+ setState(resolver, new NavigationalStateKey(WindowNavigationalState.class, id),
state);
+ }
+ public static void setState(AttributeResolver resolver, NavigationalStateKey key,
StateString state)
+ {
+ if (resolver == null)
+ {
+ throw new IllegalArgumentException("No null resolver");
+ }
+ if (key == null)
+ {
+ throw new IllegalArgumentException("No null key");
+ }
+ if (state == null)
+ {
+ throw new IllegalArgumentException("No null state");
+ }
+
//
- WindowNavigationalState wns = (WindowNavigationalState)context.getAttribute(key);
+ WindowNavigationalState wns = (WindowNavigationalState)resolver.getAttribute(key);
//
if (wns == null)
@@ -172,6 +220,6 @@
}
//
- context.setAttribute(key, wns);
+ resolver.setAttribute(key, wns);
}
}