com.xpn.xwiki.wysiwyg.client.ui.cmd.internal
Class DefaultCommandManager

java.lang.Object
  extended by com.xpn.xwiki.wysiwyg.client.ui.cmd.internal.AbstractCommandManager
      extended by com.xpn.xwiki.wysiwyg.client.ui.cmd.internal.DefaultCommandManager
All Implemented Interfaces:
com.google.gwt.user.client.ui.FocusListener, CommandManager, SourcesCommandEvents, java.util.EventListener

public class DefaultCommandManager
extends AbstractCommandManager
implements com.google.gwt.user.client.ui.FocusListener


Field Summary
static java.util.Map<Command,Executable> EXECUTABLES
           
 
Fields inherited from class com.xpn.xwiki.wysiwyg.client.ui.cmd.internal.AbstractCommandManager
commandListeners
 
Constructor Summary
DefaultCommandManager(com.google.gwt.user.client.ui.FocusWidget widget)
           
DefaultCommandManager(com.google.gwt.user.client.ui.FocusWidget widget, java.util.Map<Command,Executable> executables)
           
 
Method Summary
 boolean execute(Command cmd, java.lang.String param)
          Executes a command on the current document, current selection, or the given range.
 java.lang.String getStringValue(Command cmd)
          Returns the current value of the document, range, or current selection for the given command.
 boolean isEnabled(Command cmd)
          Returns a boolean value that indicates whether a specified command can be successfully executed using CommandManager.execute(Command, String), given the current state of the document.
 boolean isExecuted(Command cmd)
          Returns a boolean value that indicates the current state of the command.
 boolean isSupported(Command cmd)
          Returns a boolean value that indicates whether the current command is supported on the current range.
 void onFocus(com.google.gwt.user.client.ui.Widget sender)
          
 void onLostFocus(com.google.gwt.user.client.ui.Widget sender)
          
 Executable registerCommand(Command command, Executable executable)
           
 Executable unregisterCommand(Command command)
           
 
Methods inherited from class com.xpn.xwiki.wysiwyg.client.ui.cmd.internal.AbstractCommandManager
addCommandListener, execute, execute, execute, getBooleanValue, getIntegerValue, removeCommandListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXECUTABLES

public static final java.util.Map<Command,Executable> EXECUTABLES
Constructor Detail

DefaultCommandManager

public DefaultCommandManager(com.google.gwt.user.client.ui.FocusWidget widget)

DefaultCommandManager

public DefaultCommandManager(com.google.gwt.user.client.ui.FocusWidget widget,
                             java.util.Map<Command,Executable> executables)
Method Detail

execute

public boolean execute(Command cmd,
                       java.lang.String param)
Executes a command on the current document, current selection, or the given range.

Specified by:
execute in interface CommandManager
Parameters:
cmd - The command to execute.
param - Variant that specifies the string, number, or other value to assign. Possible values depend on the command.
Returns:
true if the command is successful.
See Also:
CommandManager.execute(Command, String)

isEnabled

public boolean isEnabled(Command cmd)
Returns a boolean value that indicates whether a specified command can be successfully executed using CommandManager.execute(Command, String), given the current state of the document.

Specified by:
isEnabled in interface CommandManager
Parameters:
cmd - The command to test.
Returns:
true if the command is enabled.
See Also:
CommandManager.isEnabled(Command)

isExecuted

public boolean isExecuted(Command cmd)
Returns a boolean value that indicates the current state of the command.

Specified by:
isExecuted in interface CommandManager
Parameters:
cmd - The command to test.
Returns:
true if the given command has been executed on the object.
See Also:
CommandManager.isExecuted(Command)

isSupported

public boolean isSupported(Command cmd)
Returns a boolean value that indicates whether the current command is supported on the current range.

Specified by:
isSupported in interface CommandManager
Parameters:
cmd - The command to test
Returns:
true if the command is supported.
See Also:
CommandManager.isSupported(Command)

getStringValue

public java.lang.String getStringValue(Command cmd)
Returns the current value of the document, range, or current selection for the given command.

Specified by:
getStringValue in interface CommandManager
Parameters:
cmd - The command to query.
Returns:
the command value for the document, range, or current selection, if supported. Possible values depend on the given command.
See Also:
CommandManager.getStringValue(Command)

registerCommand

public Executable registerCommand(Command command,
                                  Executable executable)

unregisterCommand

public Executable unregisterCommand(Command command)

onFocus

public void onFocus(com.google.gwt.user.client.ui.Widget sender)

Specified by:
onFocus in interface com.google.gwt.user.client.ui.FocusListener
See Also:
FocusListener.onFocus(Widget)

onLostFocus

public void onLostFocus(com.google.gwt.user.client.ui.Widget sender)

Specified by:
onLostFocus in interface com.google.gwt.user.client.ui.FocusListener
See Also:
FocusListener.onLostFocus(Widget)


Copyright © 2004-2008 XWiki. All Rights Reserved.