Author: julien(a)jboss.com
Date: 2008-07-09 12:28:31 -0400 (Wed, 09 Jul 2008)
New Revision: 11372
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/AgentContext.java
Log:
a bit of javadoc
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/AgentContext.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/AgentContext.java 2008-07-09
16:19:56 UTC (rev 11371)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/AgentContext.java 2008-07-09
16:28:31 UTC (rev 11372)
@@ -30,6 +30,9 @@
import com.google.gwt.user.client.rpc.AsyncCallback;
/**
+ * The context of the agent which is the interface to be used to perform global
+ * actions.
+ *
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
* @version $Revision: 630 $
*/
@@ -45,8 +48,33 @@
/** . */
PresentationClientAgent agent;
- public void process(AjaxAction action)
+ /**
+ * Process the action and perform a refresh.
+ *
+ * @param action the action
+ * @throws IllegalArgumentException if the action is null
+ */
+ public void process(AjaxAction action) throws IllegalArgumentException
{
+ process(action, true);
+ }
+
+ /**
+ * Process the action and optionally performs a refresh. If the refresh is not
+ * performed we assume that the caller will perform a refresh by itself.
+ *
+ * @param action the action to process
+ * @param refresh true if a refresh is required
+ * @throws IllegalArgumentException if the action is null
+ */
+ public void process(AjaxAction action, final boolean refresh) throws
IllegalArgumentException
+ {
+ if (action == null)
+ {
+ throw new IllegalArgumentException("No null action accepted");
+ }
+
+ //
AjaxRequest request = new AjaxRequest();
request.setAction(action);
@@ -88,9 +116,11 @@
objectContext.update(response.getModelUpdates());
//
- objectContext.getRoot().refresh(false);
+ if (refresh)
+ {
+ objectContext.getRoot().refresh(false);
+ }
}
});
}
-
}