|
|||||||||
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.JToggleButton com.levigo.util.swing.action.NonUglyActionJToggleButton com.levigo.util.swing.DropDownToggleButton
public class DropDownToggleButton
A DropDownButton is intended to be used in a toolbar as multiple action button.
It allows to add several actions, which are provided in popup menu to change this buttons action.
At creation time this button will be wired with the first action it gets as sub menu action. A
single click on this button fires the wired action. Each time a sub menu item action is clicked,
this button will be wired with this selected action and a single on it fires this selected
action. To work properly it is recommended to add sub menu items by a call of
addMenuItemAction(Action)
.
To indicate that this button provides a sub set of different actions a small arrow will be displayed at the right bottom of the icon.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.levigo.util.swing.action.NonUglyActionJToggleButton |
---|
NonUglyActionJToggleButton.AccessibleNonUglyActionJToggleButton |
Nested classes/interfaces inherited from class javax.swing.JToggleButton |
---|
JToggleButton.AccessibleJToggleButton, JToggleButton.ToggleButtonModel |
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 | |
---|---|
boolean |
popupIsVisible
|
boolean |
popupShouldBeVisible
|
Fields inherited from class com.levigo.util.swing.action.NonUglyActionJToggleButton |
---|
isValidateGraphicsConfigurationEnabled, TOOLBAR_APPLICATION, TOOLBAR_MAINOFFICE, WITH_BORDER, WITHOUT_BORDER |
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 | |
---|---|
DropDownToggleButton()
Construct this button |
Method Summary | |
---|---|
JMenuItem |
addMenuItemAction(Action a)
Appends a new menu item to the end of the menu which dispatches the specified Action object. |
protected void |
configurePropertiesFromAction(Action a)
This event adds a functionality for the action parameter "checked" |
Icon |
getFallbackIcon()
Gets the buttons fallback icon. |
String |
getFallbackToolTipText()
Gets the buttons fallback tool tip text. |
protected void |
paintComponent(Graphics g)
|
void |
setAction(Action a)
|
void |
setEnabled(boolean b)
|
void |
setFallbackIcon(Icon fallbackIcon)
Sets the buttons fallback icon. |
void |
setFallbackToolTipText(String fallbackToolTipText)
Sets the buttons fallback tooltip text. |
Methods inherited from class com.levigo.util.swing.action.NonUglyActionJToggleButton |
---|
getAccessibleContext, getGraphicsConfiguration, initialize, isValidateGraphicsConfigurationEnabled, setBorder, setRolloverEnabled, setValidateGraphicsConfigurationEnabled |
Methods inherited from class javax.swing.JToggleButton |
---|
getUIClassID, paramString, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public boolean popupIsVisible
public boolean popupShouldBeVisible
Constructor Detail |
---|
@CallOnEDT public DropDownToggleButton()
Method Detail |
---|
@CallOnEDT public JMenuItem addMenuItemAction(Action a)
Action
object.
a
- the Action
to add to the menu
Action
protected void configurePropertiesFromAction(Action a)
NonUglyActionJToggleButton
configurePropertiesFromAction
in class NonUglyActionJToggleButton
AbstractButton.configurePropertiesFromAction(javax.swing.Action)
protected void paintComponent(Graphics g)
paintComponent
in class JComponent
JComponent.paintComponent(java.awt.Graphics)
@CallOnEDT public Icon getFallbackIcon()
@CallOnEDT public String getFallbackToolTipText()
@CallOnEDT public void setAction(Action a)
setAction
in class AbstractButton
AbstractButton.setAction(javax.swing.Action)
@CallOnEDT public void setEnabled(boolean b)
setEnabled
in class AbstractButton
AbstractButton.setEnabled(boolean)
@CallOnEDT public void setFallbackIcon(Icon fallbackIcon)
fallbackIcon
- the icon used as the fallback image if the chosen menu item action provides
no icon resource.@CallOnEDT public void setFallbackToolTipText(String fallbackToolTipText)
fallbackToolTipText
- the text used as the fallback tool tip text if the chosen menu item
action provides no tool tip text.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |