Class TreeMenuButton

All Implemented Interfaces:
HasAttachHandlers, HasHandlers, EventListener, HasVisibility, IsWidget, LogicalStructure, HasClearHandlers, HasClickHandlers, HasDoubleClickHandlers, HasDragMoveHandlers, HasDragRepositionMoveHandlers, HasDragRepositionStartHandlers, HasDragRepositionStopHandlers, HasDragResizeMoveHandlers, HasDragResizeStartHandlers, HasDragResizeStopHandlers, HasDragStartHandlers, HasDragStopHandlers, HasDropHandlers, HasDropMoveHandlers, HasDropOutHandlers, HasDropOverHandlers, HasFocusChangedHandlers, HasHoverHandlers, HasHoverHiddenHandlers, HasIconClickHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseStillDownHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasMovedHandlers, HasParentMovedHandlers, HasResizedHandlers, HasRightMouseDownHandlers, HasRuleContextChangedHandlers, HasScrolledHandlers, HasShowContextMenuHandlers, HasTitleHoverHandlers, HasVisibilityChangedHandlers

public class TreeMenuButton extends MenuButton
Button used to display a hierarchical Menu group for representing / selecting tree data.

Important Note: this class should not be used directly - it is exposed purely for i18n reasons.

See Also:
  • Constructor Details

    • TreeMenuButton

      public TreeMenuButton()
    • TreeMenuButton

      public TreeMenuButton(JavaScriptObject jsObj)
  • Method Details

    • getOrCreateRef

      public static TreeMenuButton getOrCreateRef(JavaScriptObject jsObj)
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, Canvas defaults)
      Changes the defaults for Canvas AutoChildren named autoChildName.
      Parameters:
      autoChildName - name of an AutoChild to customize the defaults for.
      defaults - Canvas defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see SGWTProperties.
      See Also:
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, FormItem defaults)
      Changes the defaults for FormItem AutoChildren named autoChildName.
      Parameters:
      autoChildName - name of an AutoChild to customize the defaults for.
      defaults - FormItem defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see SGWTProperties.
      See Also:
    • create

      protected JavaScriptObject create()
      Overrides:
      create in class MenuButton
    • setEmptyMenuMessage

      public TreeMenuButton setEmptyMenuMessage(String emptyMenuMessage)
      If this button's menu (or any of its submenus) are empty, this property can be used to specify the message to display (as a disabled item) in the empty menu.
      Parameters:
      emptyMenuMessage - New emptyMenuMessage value. Default value is null
      Returns:
      TreeMenuButton instance, for chaining setter calls
      See Also:
    • getEmptyMenuMessage

      public String getEmptyMenuMessage()
      If this button's menu (or any of its submenus) are empty, this property can be used to specify the message to display (as a disabled item) in the empty menu.
      Returns:
      Current emptyMenuMessage value. Default value is null
      See Also:
    • setPathSeparatorString

      public TreeMenuButton setPathSeparatorString(String pathSeparatorString)
      If showPath is true, this property specifies what will appear between the folders in the selected value's path.
      Parameters:
      pathSeparatorString - New pathSeparatorString value. Default value is " > "
      Returns:
      TreeMenuButton instance, for chaining setter calls
      See Also:
    • getPathSeparatorString

      public String getPathSeparatorString()
      If showPath is true, this property specifies what will appear between the folders in the selected value's path.
      Returns:
      Current pathSeparatorString value. Default value is " > "
      See Also:
    • setSelectedBaseStyle

      public TreeMenuButton setSelectedBaseStyle(String selectedBaseStyle)
      Base style to apply to the selected path within the menu. (The "over" version of this style should also be defined in the stylesheet applied to this widget).
      Parameters:
      selectedBaseStyle - New selectedBaseStyle value. Default value is "treeMenuSelected"
      Returns:
      TreeMenuButton instance, for chaining setter calls
      See Also:
    • getSelectedBaseStyle

      public String getSelectedBaseStyle()
      Base style to apply to the selected path within the menu. (The "over" version of this style should also be defined in the stylesheet applied to this widget).
      Returns:
      Current selectedBaseStyle value. Default value is "treeMenuSelected"
      See Also:
    • setShowPath

      public TreeMenuButton setShowPath(boolean showPath)
      If title is null, when the user selects an item, should we show the full path to the item, or just the item's title as the button's title?
      Parameters:
      showPath - New showPath value. Default value is false
      Returns:
      TreeMenuButton instance, for chaining setter calls
    • getShowPath

      public boolean getShowPath()
      If title is null, when the user selects an item, should we show the full path to the item, or just the item's title as the button's title?
      Returns:
      Current showPath value. Default value is false
    • setTitle

      public void setTitle(String title)
      Title for this button. If not specified, the selected value from the tree will be displayed instead.
      Overrides:
      setTitle in class MenuButton
      Parameters:
      title - New title value. Default value is null
      See Also:
    • getTitle

      public String getTitle()
      Title for this button. If not specified, the selected value from the tree will be displayed instead.
      Overrides:
      getTitle in class MenuButton
      Returns:
      Current title value. Default value is null
      See Also:
    • getTreeMenu

      public Menu getTreeMenu() throws IllegalStateException
      AutoChild menu displayed when the button is clicked.

      This component is an AutoChild named "treeMenu". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current treeMenu value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setTreeMenuConstructor

      public TreeMenuButton setTreeMenuConstructor(String treeMenuConstructor) throws IllegalStateException
      Widget class for the menu created by this button. The default is SelectionTreeMenu.
      Parameters:
      treeMenuConstructor - New treeMenuConstructor value. Default value is "SelectionTreeMenu"
      Returns:
      TreeMenuButton instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getTreeMenuConstructor

      public String getTreeMenuConstructor()
      Widget class for the menu created by this button. The default is SelectionTreeMenu.
      Returns:
      Current treeMenuConstructor value. Default value is "SelectionTreeMenu"
      See Also:
    • setUnselectedTitle

      public TreeMenuButton setUnselectedTitle(String unselectedTitle)
      If title is null, this value will be displayed as a title when the user has not selected any value from the hierachichal menu.
      Parameters:
      unselectedTitle - New unselectedTitle value. Default value is "Choose a value"
      Returns:
      TreeMenuButton instance, for chaining setter calls
      See Also:
    • getUnselectedTitle

      public String getUnselectedTitle()
      If title is null, this value will be displayed as a title when the user has not selected any value from the hierachichal menu.
      Returns:
      Current unselectedTitle value. Default value is "Choose a value"
      See Also:
    • setDefaultProperties

      public static void setDefaultProperties(TreeMenuButton treeMenuButtonProperties)
      Class level method to set the default properties of this class. If set, then all existing and subsequently created instances of this class will automatically have default properties corresponding to the properties set on the SmartGWT class instance passed to this function before its underlying SmartClient JS object was created. This is a powerful feature that eliminates the need for users to create a separate hierarchy of subclasses that only alter the default properties of this class. Can also be used for skinning / styling purposes.

      Note: This method is intended for setting default attributes only and will affect all instances of the underlying class (including those automatically generated in JavaScript). This method should not be used to apply standard EventHandlers or override methods for a class - use a custom subclass instead. Calling this method after instances have been created can result in undefined behavior, since it bypasses any setters and a class instance may have already examined a particular property and not be expecting any changes through this route.

      Parameters:
      treeMenuButtonProperties - properties that should be used as new defaults when instances of this class are created
      See Also:
    • setDataProperties

      public void setDataProperties(Tree dataProperties) throws IllegalStateException
      For a TreeMenuButton that uses a DataSource, these properties will be passed to the automatically-created ResultTree. This can be used for various customizations such as modifying the automatically-chosen parentIdField.
      Parameters:
      dataProperties - dataProperties Default value is null
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • setLogicalStructure

      Setter implementing the LogicalStructure interface, which supports Eclipse's logical structure debugging facility.
    • getLogicalStructure

      public LogicalStructureObject getLogicalStructure()
      Getter implementing the LogicalStructure interface, which supports Eclipse's logical structure debugging facility.
      Specified by:
      getLogicalStructure in interface LogicalStructure
      Overrides:
      getLogicalStructure in class MenuButton