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 protected
MenuButtonWrapper(javafx.scene.control.MenuButton button)
-
Method Summary
All Methods Instance Methods Concrete 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 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:MenuButton
Returns whether the button is disabled (greyed-out and un-clickable).- Specified by:
isDisabled
in interfaceMenuButton
- Returns:
- Disabled?
-
setDisabled
public void setDisabled(boolean disabled)
Description copied from interface:MenuButton
Sets whether the button is disabled or not (greyed-out and un-clickable).- Specified by:
setDisabled
in interfaceMenuButton
- Parameters:
disabled
- Disabled?
-
isVisible
public boolean isVisible()
Description copied from interface:MenuButton
Returns whether the button is visible or not.- Specified by:
isVisible
in interfaceMenuButton
- Specified by:
isVisible
in interfaceSubElement
- Returns:
- Visible?
-
setVisible
public void setVisible(boolean visible)
Description copied from interface:MenuButton
Sets whether the button is visible or not.- Specified by:
setVisible
in interfaceMenuButton
- Specified by:
setVisible
in interfaceSubElement
- Parameters:
visible
- Visible?
-
getText
public java.lang.String getText()
Description copied from interface:MenuButton
Returns the text displayed in the button.- Specified by:
getText
in interfaceMenuButton
- Returns:
- Text in button
-
setText
public void setText(java.lang.String text)
Description copied from interface:MenuButton
Changes the text displayed in the button.- Specified by:
setText
in interfaceMenuButton
- Parameters:
text
- New text to display
-
addItem
public Button addItem(java.lang.String text, SRunnable onClick)
Description copied from interface:MenuButton
Adds a menu item to the menu button's menu.- Specified by:
addItem
in 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:MenuButton
Removes all items from the menu button's menu.- Specified by:
removeAllItems
in interfaceMenuButton
-
addSeparator
public Separator addSeparator()
Description copied from interface:MenuButton
Adds a separator as the next item in the menu.- Specified by:
addSeparator
in interfaceMenuButton
- Returns:
- Separator object representing the separator
-
addSeparator
public Separator addSeparator(java.lang.String heading)
Description copied from interface:MenuButton
Adds a separator, with heading text, as the next item in the menu.- Specified by:
addSeparator
in interfaceMenuButton
- Parameters:
heading
- Heading text- Returns:
- Separator object representing the separator
-
-