org.xwiki.gwt.user.client.ui.rta.cmd.internal
Class DefaultExecutable

java.lang.Object
  extended by org.xwiki.gwt.user.client.ui.rta.cmd.internal.AbstractRichTextAreaExecutable
      extended by org.xwiki.gwt.user.client.ui.rta.cmd.internal.DefaultExecutable
All Implemented Interfaces:
Executable
Direct Known Subclasses:
DeleteExecutable, ListExecutable

public class DefaultExecutable
extends AbstractRichTextAreaExecutable

Executes a predefined command on a specific document.


Field Summary
protected  String command
          The predefined command executed by this executable.
 
Fields inherited from class org.xwiki.gwt.user.client.ui.rta.cmd.internal.AbstractRichTextAreaExecutable
rta
 
Constructor Summary
DefaultExecutable(RichTextArea rta, String command)
          Creates a new instance that will execute the specified command.
 
Method Summary
 boolean execute(String parameter)
          Runs this executable with the given parameter.
 String getParameter()
           
 boolean isEnabled()
           
 boolean isExecuted()
           
 boolean isSupported()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

command

protected String command
The predefined command executed by this executable.

Constructor Detail

DefaultExecutable

public DefaultExecutable(RichTextArea rta,
                         String command)
Creates a new instance that will execute the specified command.

Parameters:
rta - the execution target
command - A predefined command to be executed by this executable.
Method Detail

execute

public boolean execute(String parameter)
Description copied from interface: Executable
Runs this executable with the given parameter.

Parameters:
parameter - the execution parameter
Returns:
true if the execution succeeds, false otherwise
See Also:
CommandManager.execute(Command, String)

getParameter

public String getParameter()
Returns:
the previous execution parameter, if Executable.isExecuted() returns true, null otherwise

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface Executable
Overrides:
isEnabled in class AbstractRichTextAreaExecutable
Returns:
true if this executable can be executed on its underlying execution target, false otherwise
See Also:
CommandManager.isEnabled(Command)

isExecuted

public boolean isExecuted()
Returns:
true if this executable has been executed on its underlying execution target, false otherwise area.
See Also:
CommandManager.isExecuted(Command)

isSupported

public boolean isSupported()
Specified by:
isSupported in interface Executable
Overrides:
isSupported in class AbstractRichTextAreaExecutable
Returns:
true if this executable is supported by its underlying execution target, false otherwise
See Also:
CommandManager.isSupported(Command)