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 class
MenuButton.MenuButtonWrapper
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Button
addItem(java.lang.String text, SRunnable onClick)
Adds a menu item to the menu button's menu.Separator
addSeparator()
Adds a separator as the next item in the menu.Separator
addSeparator(java.lang.String heading)
Adds a separator, with heading text, as the next item in the menu.java.lang.String
getText()
Returns the text displayed in the button.boolean
isDisabled()
Returns whether the button is disabled (greyed-out and un-clickable).boolean
isVisible()
Returns whether the button is visible or not.void
removeAllItems()
Removes all items from the menu button's menu.void
setDisabled(boolean disabled)
Sets whether the button is disabled or not (greyed-out and un-clickable).void
setText(java.lang.String text)
Changes the text displayed in the button.void
setVisible(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:
isVisible
in interfaceSubElement
- Returns:
- Visible?
-
setVisible
void setVisible(boolean visible)
Sets whether the button is visible or not.- Specified by:
setVisible
in 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
-
-