Overview | Package | Class | Use | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.togethersoft.openapi.ide.command
Interface IdeCommandEvent

public interface IdeCommandEvent

An event which indicates that a command item-related action occurred. Event is generated by an element when the element-specific action occurs:

- An element is being passed over by a mouse pointer, or the user invoked the popup menu for that element. In this case Together scans all the registered command items and command groups (in the toolbars and popup menus). For those items whose constraints allow the item to deal with the element (otherwise an item will be made invisible), Together invokes in the item's associated `IdeCommandCheckListener` the checkStatus method passing this event. This method is used for last-minute decisions like whether the item should be disabled/enabled or visible/invisible for this specific element (the element for which this event is fired is incapsulated in the `IdeContext` object returned by the `getElementContext` method).
- The user activates the command item by clicking a mouse or using a shortcut. In this case Together invokes in the item's `IdeCommandListener` the actionPerformed method passing this event.

The listener is assigned to the item at the moment of creation of this item.

Author:
  TogetherSoft
See Also: IdeCommandManager.createItem(java.lang.String,com.togethersoft.openapi.ide.command.IdeCommandConstraints,com.togethersoft.openapi.ide.command.IdeCommandListener), IdeCommandManager.createGroup(java.lang.String,com.togethersoft.openapi.ide.command.IdeCommandConstraints,com.togethersoft.openapi.ide.command.IdeCommandCheckListener)

Method Summary
`IdeCommandItem` | `getCommandItem()` Returns the command item this event relates to.
`IdeContext` | `getElementContext()` This method is used in `IdeCommandCheckListener` for getting `IdeContext` containing the element this event was fired for.
`boolean` | `isInvokedByShortcut()` Checks whether the command item relating to this event was invoked by using a shortcut.

Method Detail

### getCommandItem

    public IdeCommandItem getCommandItem()

  Returns the command item this event relates to.
  Returns: `IdeCommandItem`

### getElementContext

    public IdeContext getElementContext()

  This method is used in `IdeCommandCheckListener` for getting `IdeContext` containing the element this event was fired for.
  Returns: `IdeContext`
  See Also:
    IdeCommandCheckListener

### isInvokedByShortcut

    public boolean isInvokedByShortcut()

  Checks whether the command item relating to this event was invoked by using a shortcut.
  Returns: `true` if the command item relating to this event was invoked by using a shortcut, `false` otherwise

Overview | Package | Class | Use | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD