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 IdeCommandItemBase

All Known Subinterfaces:
  IdeCommandGroup, IdeCommandItem

public interface IdeCommandItemBase

A visual entity, representing a base of a command item. The entity has its own icon, tooltip text, a shortcut (keys combination) and can be made visible or not, and enabled or disabled, as well.

For entities being inserted into menus (main menu or popup menu) this interface provides methods for inserting a separation line before or after this entity.

`IdeCommandManager` is responsible for creating and inserting command items (`IdeCommandItem`s and `IdeCommandGroup`s) into command containers (main menu, main toolbar, diagram toolbar, popup menu or `IdeCommandGroup`s).

The two actual kinds of command items - `IdeCommandItem` and `IdeCommandGroup` extend this interface.

Author:
  TogetherSoft
See Also: IdeCommandManager, IdeCommandItem, IdeCommandGroup

Method Summary
`void` | `addShortcut(KeyStroke value)` Adds the specified shortcut to the list of shortcuts for this command item.
`Icon` | `getIcon(String type)` Returns the `Icon` of the specified kind for this command item.
`String` | `getId()` Returns a string with the ID of this command item.
`String` | `getText()` Returns the string with a tooltip text of this command item.
`boolean` | `isEnabled()` Checks whether this command item is enabled.
`boolean` | `isSeparatorAfter()` Checks whether there is a separation line after this command item.
`boolean` | `isSeparatorBefore()` Checks whether there is a separation line before this command item.
`boolean` | `isVisible()` Checks whether this command item is visible.
`void` | `removeShortcut(KeyStroke value)` Removes the specified shortcut from the list of shortcuts for this command item.
`void` | `setEnabled(boolean value)` Sets whether this command item is enabled.
`void` | `setIcon(String type, Icon icon)` Sets the icon of the specified type for this command item.
`void` | `setSeparatorAfter(boolean value)` Sets a separation line after this command item.
`void` | `setSeparatorBefore(boolean value)` Sets a separation line before this command item.
`void` | `setText(String text)` Sets the content of a tooltip text for this command item.
`void` | `setVisible(boolean value)` Sets the visibility of this command item.
`KeyStrokeEnumeration` | `shortcuts()` Returns the shortcuts for this command item.

Method Detail

### addShortcut

    public void addShortcut(KeyStroke value)

  Adds the specified shortcut to the list of shortcuts for this command item.
  Parameters:
    value - the `KeyStroke` instance.
  See Also:
    KeyStroke

### getIcon

    public Icon getIcon(String type)

  Returns the `Icon` of the specified kind for this command item.
  Parameters:
    type - `string` with the kind of the icon. Possible types are defined in `IdeCommandIconType` interface.
  Returns: the `Icon` of the specified `type` for this command item
  See Also:
    IdeCommandIconType

### getId

    public String getId()

  Returns a string with the ID of this command item.
  Returns: a string with the ID of this command item

### getText

    public String getText()

  Returns the string with a tooltip text of this command item.
  Returns: The string with a tooltip text of this command item. If this command item is inserted into menus, this string is a name of this item in the menu.

### isEnabled

    public boolean isEnabled()

  Checks whether this command item is enabled.
  Returns: `true` if enabled, `false` otherwise

### isSeparatorAfter

    public boolean isSeparatorAfter()

  Checks whether there is a separation line after this command item.
  Returns: `true` if there is a separation line after this command item, `false` otherwise

### isSeparatorBefore

    public boolean isSeparatorBefore()

  Checks whether there is a separation line before this command item.
  Returns: `true` if there is a separation line before this command item, `false` otherwise

### isVisible

    public boolean isVisible()

  Checks whether this command item is visible.
  Returns: `true` if this command item is visible, `false` otherwise

### removeShortcut

    public void removeShortcut(KeyStroke value)

  Removes the specified shortcut from the list of shortcuts for this command item.
  Parameters:
    value - the `KeyStroke` instance.
  See Also:
    KeyStroke

### setEnabled

    public void setEnabled(boolean value)

  Sets whether this command item is enabled.
  Parameters:
    value - `boolean` value. If `true` then this command item will be made enabled, if `false` then this command item will be made disabled.

### setIcon

    public void setIcon(String type, Icon icon)

  Sets the icon of the specified type for this command item.
  Parameters:
    type - `string` with the kind of the icon. Possible kinds are defined in `IdeCommandIconType` interface.
  See Also:
    IdeCommandIconType

### setSeparatorAfter

    public void setSeparatorAfter(boolean value)

  Sets a separation line after this command item.
  Parameters:
    value - `boolean` value. If `true` then a separation line will be inserted after this command item. If `false`, then deletes the separatino line if any

### setSeparatorBefore

    public void setSeparatorBefore(boolean value)

  Sets a separation line before this command item.
  Parameters:
    value - `boolean` value. If `true` then a separation line will be inserted before this command item. If `false`, then deletes the separation line if any

### setText

    public void setText(String text)

  Sets the content of a tooltip text for this command item.
  Parameters:
    text - The string with the tooltip text. If this command item is inserted into menus, this string is a name of this item in the menu.

### setVisible

    public void setVisible(boolean value)

  Sets the visibility of this command item.
  Parameters:
    value - `boolean` value. If `true` then this command item will be made visible, if `false` then this command item will be made invisible.

### shortcuts

    public KeyStrokeEnumeration shortcuts()

  Returns the shortcuts for this command item.
  Returns: the enumeration of shortcuts for this command item - a `KeyStrokeEnumeration` instance
  See Also:
    KeyStroke

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