Package jisa.gui
Interface MenuButton
-
- All Superinterfaces:
SubElement
- All Known Implementing Classes:
MenuButton.MenuButtonWrapper
public interface MenuButton extends SubElement
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classMenuButton.MenuButtonWrapper
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ButtonaddItem(java.lang.String text, SRunnable onClick)Adds a menu item to the menu button's menu.SeparatoraddSeparator()Adds a separator as the next item in the menu.SeparatoraddSeparator(java.lang.String heading)Adds a separator, with heading text, as the next item in the menu.java.lang.StringgetText()Returns the text displayed in the button.booleanisDisabled()Returns whether the button is disabled (greyed-out and un-clickable).booleanisVisible()Returns whether the button is visible or not.voidremoveAllItems()Removes all items from the menu button's menu.voidsetDisabled(boolean disabled)Sets whether the button is disabled or not (greyed-out and un-clickable).voidsetText(java.lang.String text)Changes the text displayed in the button.voidsetVisible(boolean visible)Sets whether the button is visible or not.-
Methods inherited from interface jisa.gui.SubElement
remove
-
-
-
-
Method Detail
-
isDisabled
boolean isDisabled()
Returns whether the button is disabled (greyed-out and un-clickable).- Returns:
- Disabled?
-
setDisabled
void setDisabled(boolean disabled)
Sets whether the button is disabled or not (greyed-out and un-clickable).- Parameters:
disabled- Disabled?
-
isVisible
boolean isVisible()
Returns whether the button is visible or not.- Specified by:
isVisiblein interfaceSubElement- Returns:
- Visible?
-
setVisible
void setVisible(boolean visible)
Sets whether the button is visible or not.- Specified by:
setVisiblein interfaceSubElement- Parameters:
visible- Visible?
-
getText
java.lang.String getText()
Returns the text displayed in the button.- Returns:
- Text in button
-
setText
void setText(java.lang.String text)
Changes the text displayed in the button.- Parameters:
text- New text to display
-
addItem
Button addItem(java.lang.String text, SRunnable onClick)
Adds a menu item to the menu button's menu.- Parameters:
text- Text to displayonClick- Action to perform when clicked- Returns:
- Button object representing the menu item
-
removeAllItems
void removeAllItems()
Removes all items from the menu button's menu.
-
addSeparator
Separator addSeparator()
Adds a separator as the next item in the menu.- Returns:
- Separator object representing the separator
-
addSeparator
Separator addSeparator(java.lang.String heading)
Adds a separator, with heading text, as the next item in the menu.- Parameters:
heading- Heading text- Returns:
- Separator object representing the separator
-
-