qx.client
Class Command

java.lang.Object
  extended by qx.core.Object
      extended by qx.core.Target
          extended by qx.client.Command

public class Command
extends Target

Commands can be used to globally define keyboard shortcuts. They could also be used to assign a execution of a command sequence to multiple widgets. It is possible to use the same Command in a MenuButton and ToolBarButton for example.


Constructor Summary
Command()
          Create a new instance of Command
Command(java.lang.String shortcut)
          Create a new instance of Command
Command(java.lang.String shortcut, java.lang.Integer keyCode)
          Create a new instance of Command
 
Method Summary
 void _applyShortcut(java.lang.Object value, java.lang.Object old)
           
 void execute(java.lang.Object vTarget)
          Fire the “execute” event on this command.
 boolean getEnabled()
          Returns the (computed) value of the property enabled.
 int getKeyCode()
          Returns the (computed) value of the property keyCode.
 java.lang.String getKeyIdentifier()
          Returns the (computed) value of the property keyIdentifier.
 java.lang.String getShortcut()
          Returns the (computed) value of the property shortcut.
 void initEnabled(boolean arg)
          Calls the apply method and dispatches the change event of the property enabled with the default value defined by the class developer.
 void initKeyCode(int arg)
          Calls the apply method and dispatches the change event of the property keyCode with the default value defined by the class developer.
 void initKeyIdentifier(java.lang.String arg)
          Calls the apply method and dispatches the change event of the property keyIdentifier with the default value defined by the class developer.
 void initShortcut(java.lang.String arg)
          Calls the apply method and dispatches the change event of the property shortcut with the default value defined by the class developer.
 boolean isEnabled()
          Check whether the (computed) value of the boolean property enabled equals true.
 boolean matchesKeyEvent(KeyEvent e)
          Checks whether the given key event matches the command’s shortcut
 void resetEnabled()
          Resets the user value of the property enabled.
 void resetKeyCode()
          Resets the user value of the property keyCode.
 void resetKeyIdentifier()
          Resets the user value of the property keyIdentifier.
 void resetShortcut()
          Resets the user value of the property shortcut.
 void setEnabled(boolean arg)
          Sets the user value of the property enabled.
 void setKeyCode(int arg)
          Sets the user value of the property keyCode.
 void setKeyIdentifier(java.lang.String arg)
          Sets the user value of the property keyIdentifier.
 void setShortcut(java.lang.String arg)
          Sets the user value of the property shortcut.
 boolean toggleEnabled()
          Toggles the (computed) value of the boolean property enabled.
 java.lang.String toString_()
          Returns the shortcut as string
 
Methods inherited from class qx.core.Target
_dispatchEvent, addChangeSelectionListener, addChangeValueListener, addEventListener, addExecuteListener, addJavaEventListener, createDispatchChangeEvent, createDispatchDataEvent, createDispatchEvent, dispatchEvent, hasEventListeners, removeEventListener
 
Methods inherited from class qx.core.Object
_disposeFields, _disposeObjectDeep, _disposeObjects, base, dispose, get, getDisposed, isDisposed, reset, self, set, toHashCode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Command

public Command()

Create a new instance of Command


Command

public Command(java.lang.String shortcut)

Create a new instance of Command


Command

public Command(java.lang.String shortcut,
               java.lang.Integer keyCode)

Create a new instance of Command

Method Detail

_applyShortcut

public void _applyShortcut(java.lang.Object value,
                           java.lang.Object old)

execute

public void execute(java.lang.Object vTarget)

Fire the “execute” event on this command.


getEnabled

public boolean getEnabled()

Returns the (computed) value of the property enabled.

For further details take a look at the property definition: enabled.


getKeyCode

public int getKeyCode()

Returns the (computed) value of the property keyCode.

For further details take a look at the property definition: keyCode.


getKeyIdentifier

public java.lang.String getKeyIdentifier()

Returns the (computed) value of the property keyIdentifier.

For further details take a look at the property definition: keyIdentifier.


getShortcut

public java.lang.String getShortcut()

Returns the (computed) value of the property shortcut.

For further details take a look at the property definition: shortcut.


initEnabled

public void initEnabled(boolean arg)

Calls the apply method and dispatches the change event of the property enabled with the default value defined by the class developer. This function can only be called from the constructor of a class.

For further details take a look at the property definition: enabled.


initKeyCode

public void initKeyCode(int arg)

Calls the apply method and dispatches the change event of the property keyCode with the default value defined by the class developer. This function can only be called from the constructor of a class.

For further details take a look at the property definition: keyCode.


initKeyIdentifier

public void initKeyIdentifier(java.lang.String arg)

Calls the apply method and dispatches the change event of the property keyIdentifier with the default value defined by the class developer. This function can only be called from the constructor of a class.

For further details take a look at the property definition: keyIdentifier.


initShortcut

public void initShortcut(java.lang.String arg)

Calls the apply method and dispatches the change event of the property shortcut with the default value defined by the class developer. This function can only be called from the constructor of a class.

For further details take a look at the property definition: shortcut.


isEnabled

public boolean isEnabled()

Check whether the (computed) value of the boolean property enabled equals true.

For further details take a look at the property definition: enabled.


matchesKeyEvent

public boolean matchesKeyEvent(KeyEvent e)

Checks whether the given key event matches the command’s shortcut


resetEnabled

public void resetEnabled()

Resets the user value of the property enabled.

The computed value falls back to the next available value e.g. appearance, init or inheritance value depeneding on the property configuration and value availability.

For further details take a look at the property definition: enabled.


resetKeyCode

public void resetKeyCode()

Resets the user value of the property keyCode.

The computed value falls back to the next available value e.g. appearance, init or inheritance value depeneding on the property configuration and value availability.

For further details take a look at the property definition: keyCode.


resetKeyIdentifier

public void resetKeyIdentifier()

Resets the user value of the property keyIdentifier.

The computed value falls back to the next available value e.g. appearance, init or inheritance value depeneding on the property configuration and value availability.

For further details take a look at the property definition: keyIdentifier.


resetShortcut

public void resetShortcut()

Resets the user value of the property shortcut.

The computed value falls back to the next available value e.g. appearance, init or inheritance value depeneding on the property configuration and value availability.

For further details take a look at the property definition: shortcut.


setEnabled

public void setEnabled(boolean arg)

Sets the user value of the property enabled.

For further details take a look at the property definition: enabled.


setKeyCode

public void setKeyCode(int arg)

Sets the user value of the property keyCode.

For further details take a look at the property definition: keyCode.


setKeyIdentifier

public void setKeyIdentifier(java.lang.String arg)

Sets the user value of the property keyIdentifier.

For further details take a look at the property definition: keyIdentifier.


setShortcut

public void setShortcut(java.lang.String arg)

Sets the user value of the property shortcut.

For further details take a look at the property definition: shortcut.


toggleEnabled

public boolean toggleEnabled()

Toggles the (computed) value of the boolean property enabled.

For further details take a look at the property definition: enabled.


toString_

public java.lang.String toString_()

Returns the shortcut as string

Overrides:
toString_ in class Object


Copyright © 2008 1&1. All Rights Reserved.