|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.AbstractButton javax.swing.JMenuItem com.levigo.util.swing.action.IconJMenuItem
public class IconJMenuItem
A menu item that is able to show or to suppress the appearance of an icon next to the menu text, although it is defined in the initializing action.
Explanation: If a menu item AND a toolbar button are based on the same action and the toolbar is generated AFTER the menu, then it is NOT sufficient to set menuItem.setIcon(null) because the toolbar will overwrite this setting when it is created. Therefore we have to use this specific class to create menu items without accompanying icons.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JMenuItem |
---|
JMenuItem.AccessibleJMenuItem |
Nested classes/interfaces inherited from class javax.swing.AbstractButton |
---|
AbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListener |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected boolean |
isValidateGraphicsConfigurationEnabled
|
protected boolean |
showIcon
flag, indicating whether an icon contained the given action should be displayed or not |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.SwingConstants |
---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
IconJMenuItem(Action a,
boolean showIcon)
Constructor. |
Method Summary | |
---|---|
protected void |
configurePropertiesFromAction(Action anAction)
Additional initializing of the menuitem. |
Icon |
getDisabledIcon()
|
GraphicsConfiguration |
getGraphicsConfiguration()
|
Icon |
getIcon()
|
Icon |
getPressedIcon()
|
Icon |
getRolloverIcon()
|
Icon |
getSelectedIcon()
|
boolean |
isValidateGraphicsConfigurationEnabled()
Returns the current state of this behavior. |
void |
setValidateGraphicsConfigurationEnabled(boolean enabled)
Changes the current state of this behavior. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected boolean isValidateGraphicsConfigurationEnabled
protected boolean showIcon
Constructor Detail |
---|
public IconJMenuItem(Action a, boolean showIcon)
a
- the initializing action, which defines the behavior and appearance of the menu itemshowIcon
- boolean value to suppress or to involve the icon defined by the given action aMethod Detail |
---|
protected void configurePropertiesFromAction(Action anAction)
configurePropertiesFromAction
in class JMenuItem
JMenuItem.configurePropertiesFromAction(javax.swing.Action)
public Icon getDisabledIcon()
getDisabledIcon
in class AbstractButton
AbstractButton.getDisabledIcon()
public GraphicsConfiguration getGraphicsConfiguration()
getGraphicsConfiguration
in class Component
public Icon getIcon()
getIcon
in class AbstractButton
AbstractButton.getIcon()
public Icon getPressedIcon()
getPressedIcon
in class AbstractButton
AbstractButton.getPressedIcon()
public Icon getRolloverIcon()
getRolloverIcon
in class AbstractButton
AbstractButton.getRolloverIcon()
public Icon getSelectedIcon()
getSelectedIcon
in class AbstractButton
AbstractButton.getSelectedIcon()
public boolean isValidateGraphicsConfigurationEnabled()
GraphicsConfigurationValidateable
isValidateGraphicsConfigurationEnabled
in interface GraphicsConfigurationValidateable
GraphicsConfigurationValidateable.isValidateGraphicsConfigurationEnabled()
public void setValidateGraphicsConfigurationEnabled(boolean enabled)
GraphicsConfigurationValidateable
setValidateGraphicsConfigurationEnabled
in interface GraphicsConfigurationValidateable
enabled
- new enabled stateGraphicsConfigurationValidateable.setValidateGraphicsConfigurationEnabled(boolean)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |