Package jisa.gui
Class MenuButton.MenuButtonWrapper
- java.lang.Object
-
- jisa.gui.MenuButton.MenuButtonWrapper
-
- All Implemented Interfaces:
MenuButton,SubElement
- Enclosing interface:
- MenuButton
public abstract static class MenuButton.MenuButtonWrapper extends java.lang.Object implements MenuButton
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jisa.gui.MenuButton
MenuButton.MenuButtonWrapper
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMenuButtonWrapper(javafx.scene.control.MenuButton button)
-
Method Summary
All Methods Instance Methods Concrete 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 class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jisa.gui.SubElement
remove
-
-
-
-
Method Detail
-
isDisabled
public boolean isDisabled()
Description copied from interface:MenuButtonReturns whether the button is disabled (greyed-out and un-clickable).- Specified by:
isDisabledin interfaceMenuButton- Returns:
- Disabled?
-
setDisabled
public void setDisabled(boolean disabled)
Description copied from interface:MenuButtonSets whether the button is disabled or not (greyed-out and un-clickable).- Specified by:
setDisabledin interfaceMenuButton- Parameters:
disabled- Disabled?
-
isVisible
public boolean isVisible()
Description copied from interface:MenuButtonReturns whether the button is visible or not.- Specified by:
isVisiblein interfaceMenuButton- Specified by:
isVisiblein interfaceSubElement- Returns:
- Visible?
-
setVisible
public void setVisible(boolean visible)
Description copied from interface:MenuButtonSets whether the button is visible or not.- Specified by:
setVisiblein interfaceMenuButton- Specified by:
setVisiblein interfaceSubElement- Parameters:
visible- Visible?
-
getText
public java.lang.String getText()
Description copied from interface:MenuButtonReturns the text displayed in the button.- Specified by:
getTextin interfaceMenuButton- Returns:
- Text in button
-
setText
public void setText(java.lang.String text)
Description copied from interface:MenuButtonChanges the text displayed in the button.- Specified by:
setTextin interfaceMenuButton- Parameters:
text- New text to display
-
addItem
public Button addItem(java.lang.String text, SRunnable onClick)
Description copied from interface:MenuButtonAdds a menu item to the menu button's menu.- Specified by:
addItemin interfaceMenuButton- Parameters:
text- Text to displayonClick- Action to perform when clicked- Returns:
- Button object representing the menu item
-
removeAllItems
public void removeAllItems()
Description copied from interface:MenuButtonRemoves all items from the menu button's menu.- Specified by:
removeAllItemsin interfaceMenuButton
-
addSeparator
public Separator addSeparator()
Description copied from interface:MenuButtonAdds a separator as the next item in the menu.- Specified by:
addSeparatorin interfaceMenuButton- Returns:
- Separator object representing the separator
-
addSeparator
public Separator addSeparator(java.lang.String heading)
Description copied from interface:MenuButtonAdds a separator, with heading text, as the next item in the menu.- Specified by:
addSeparatorin interfaceMenuButton- Parameters:
heading- Heading text- Returns:
- Separator object representing the separator
-
-