View Javadoc

1   /*
2    * ClearEditorValueAction.java
3    *
4    * Created on 2 Июнь 2006 г., 13:10
5    */
6   
7   package org.weda.tapestry.actions;
8   
9   import org.weda.action.ActionContainer;
10  import org.weda.action.ActionState;
11  import org.weda.action.impl.AbstractAction;
12  import org.weda.action.impl.ActionStateImpl;
13  import org.weda.tapestry.component.AbstractEditor;
14  
15  /**
16   *
17   * @author Mikhail Titov
18   */
19  public class ClearEditorValueAction extends AbstractAction {
20      
21      public ActionState getActionState(ActionContainer targetObject) 
22          throws Exception 
23      {
24          return new ActionStateImpl(true, true);
25      }
26  
27      public Object execute(ActionContainer targetObject) throws Exception {
28          ((AbstractEditor)targetObject).getModel().setValuePretender(null);
29          return null;
30      }
31      
32  }