View Javadoc

1   package org.weda.store.actions;
2   
3   import org.weda.action.Action;
4   import org.weda.action.ActionContainer;
5   import org.weda.action.ActionState;
6   import org.weda.store.ObjectSource;
7   import org.weda.action.impl.AbstractAction;
8   import org.weda.action.impl.ActionStateImpl;
9   
10  /**
11   *
12   * @author Mikhail Titov
13   */
14  public class ObjectSourceRefreshAction extends AbstractAction {
15      
16      public ActionState getActionState(ActionContainer targetObject) 
17          throws Exception 
18      {
19          ObjectSource ds = (ObjectSource)targetObject;
20          return new ActionStateImpl(ds.getSelectedObjectSet()==null, true);
21      }
22  
23      public Object execute(ActionContainer targetObject) throws Exception {
24          ObjectSource ds=(ObjectSource)targetObject;
25          ds.refresh();
26          return null;
27      }
28      
29  }