Package jisa.gui

Class 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
    • Constructor Detail

      • MenuButtonWrapper

        protected MenuButtonWrapper​(javafx.scene.control.MenuButton button)
    • 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 interface MenuButton
        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 interface MenuButton
        Parameters:
        disabled - Disabled?
      • isVisible

        public boolean isVisible()
        Description copied from interface: MenuButton
        Returns whether the button is visible or not.
        Specified by:
        isVisible in interface MenuButton
        Specified by:
        isVisible in interface SubElement
        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 interface MenuButton
        Specified by:
        setVisible in interface SubElement
        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 interface MenuButton
        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 interface MenuButton
        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 interface MenuButton
        Parameters:
        text - Text to display
        onClick - 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 interface MenuButton
      • addSeparator

        public Separator addSeparator()
        Description copied from interface: MenuButton
        Adds a separator as the next item in the menu.
        Specified by:
        addSeparator in interface MenuButton
        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 interface MenuButton
        Parameters:
        heading - Heading text
        Returns:
        Separator object representing the separator