com.intellij.openapi.actionSystem
Class Presentation

java.lang.Object
  extended by com.intellij.openapi.actionSystem.Presentation
All Implemented Interfaces:
java.lang.Cloneable

public final class Presentation
extends java.lang.Object
implements java.lang.Cloneable

The presentation of an action in a specific place in the user interface.

See Also:
AnAction, ActionPlaces

Field Summary
static java.lang.String PROP_DESCRIPTION
          value: String
static java.lang.String PROP_DISABLED_ICON
          value: Icon
static java.lang.String PROP_ENABLED
          The actual value is a Boolean.
static java.lang.String PROP_ICON
          value: Icon
static java.lang.String PROP_MNEMONIC_KEY
          value: Integer
static java.lang.String PROP_TEXT
          Defines tool tip for button at tool bar or text for element at menu value: String
static java.lang.String PROP_VISIBLE
          value: Boolean
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
           
 java.lang.Object clone()
           
 java.lang.Object getClientProperty(java.lang.String key)
           
 java.lang.String getDescription()
           
 javax.swing.Icon getDisabledIcon()
           
 javax.swing.Icon getIcon()
           
 int getMnemonic()
           
 java.lang.String getText()
           
 boolean isEnabled()
          Returns the state of this action.
 boolean isVisible()
           
 void putClientProperty(java.lang.String key, java.lang.Object value)
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
           
 void restoreTextWithMnemonic(Presentation presentation)
           
 void setDescription(java.lang.String description)
           
 void setDisabledIcon(javax.swing.Icon icon)
           
 void setEnabled(boolean enabled)
          Sets whether the action enabled or not.
 void setIcon(javax.swing.Icon icon)
           
 void setText(java.lang.String text)
           
 void setText(java.lang.String text, boolean mayContainMnemonic)
           
 void setVisible(boolean visible)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_TEXT

public static final java.lang.String PROP_TEXT
Defines tool tip for button at tool bar or text for element at menu value: String

See Also:
Constant Field Values

PROP_MNEMONIC_KEY

public static final java.lang.String PROP_MNEMONIC_KEY
value: Integer

See Also:
Constant Field Values

PROP_DESCRIPTION

public static final java.lang.String PROP_DESCRIPTION
value: String

See Also:
Constant Field Values

PROP_ICON

public static final java.lang.String PROP_ICON
value: Icon

See Also:
Constant Field Values

PROP_DISABLED_ICON

public static final java.lang.String PROP_DISABLED_ICON
value: Icon

See Also:
Constant Field Values

PROP_VISIBLE

public static final java.lang.String PROP_VISIBLE
value: Boolean

See Also:
Constant Field Values

PROP_ENABLED

public static final java.lang.String PROP_ENABLED
The actual value is a Boolean.

See Also:
Constant Field Values
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)

getText

public java.lang.String getText()

setText

public void setText(java.lang.String text,
                    boolean mayContainMnemonic)

setText

public void setText(java.lang.String text)

restoreTextWithMnemonic

public void restoreTextWithMnemonic(Presentation presentation)

getDescription

public java.lang.String getDescription()

setDescription

public void setDescription(java.lang.String description)

getIcon

public javax.swing.Icon getIcon()

setIcon

public void setIcon(javax.swing.Icon icon)

getDisabledIcon

public javax.swing.Icon getDisabledIcon()

setDisabledIcon

public void setDisabledIcon(javax.swing.Icon icon)

getMnemonic

public int getMnemonic()

isVisible

public boolean isVisible()

setVisible

public void setVisible(boolean visible)

isEnabled

public boolean isEnabled()
Returns the state of this action.

Returns:
true if action is enabled, false otherwise

setEnabled

public void setEnabled(boolean enabled)
Sets whether the action enabled or not. If an action is disabled, AnAction.actionPerformed(com.intellij.openapi.actionSystem.AnActionEvent) won't be called. In case when action represents a button or a menu item, the representing button or item will be greyed out.

Parameters:
enabled - true if you want to enable action, false otherwise

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

getClientProperty

public java.lang.Object getClientProperty(java.lang.String key)

putClientProperty

public void putClientProperty(java.lang.String key,
                              java.lang.Object value)