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 tim
13 */
14 public class ObjectSourceSaveAction extends AbstractAction {
15 public ActionState getActionState(ActionContainer targetObject)
16 throws Exception
17 {
18 ObjectSource ds = (ObjectSource)targetObject;
19 return new ActionStateImpl(ds.getSelectedObjectSet()!=null, true);
20 }
21
22 public Object execute(ActionContainer targetObject) throws Exception {
23 ObjectSource ds = (ObjectSource)targetObject;
24 ds.saveModification();
25 return null;
26 }
27
28 }