Class TreePalette

All Implemented Interfaces:
HasAttachHandlers, HasHandlers, EventListener, HasVisibility, IsWidget, LogicalStructure, Palette, DataBoundComponent, HasClearHandlers, HasClickHandlers, HasDoubleClickHandlers, HasDragCompleteHandlers, HasDragMoveHandlers, HasDragRepositionMoveHandlers, HasDragRepositionStartHandlers, HasDragRepositionStopHandlers, HasDragResizeMoveHandlers, HasDragResizeStartHandlers, HasDragResizeStopHandlers, HasDragStartHandlers, HasDragStopHandlers, HasDropCompleteHandlers, HasDropHandlers, HasDropMoveHandlers, HasDropOutHandlers, HasDropOverHandlers, HasFetchDataHandlers, HasFocusChangedHandlers, HasFormulaUpdatedHandlers, HasHoverHandlers, HasHoverHiddenHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseStillDownHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasMovedHandlers, HasParentMovedHandlers, HasResizedHandlers, HasRightMouseDownHandlers, HasRuleContextChangedHandlers, HasScrolledHandlers, HasShowContextMenuHandlers, HasVisibilityChangedHandlers, HasBodyKeyPressHandlers, HasCellClickHandlers, HasCellContextClickHandlers, HasCellDoubleClickHandlers, HasCellErrorIconHoverHandlers, HasCellErrorIconOutHandlers, HasCellErrorIconOverHandlers, HasCellHoverHandlers, HasCellMouseDownHandlers, HasCellMouseUpHandlers, HasCellOutHandlers, HasCellOverHandlers, HasCellSavedHandlers, HasCellSelectionChangedHandlers, HasCellValueHoverHandlers, HasCriteriaChangedHandlers, HasDataArrivedHandlers, HasDataChangedHandlers, HasDrawAreaChangedHandlers, HasEditCompleteHandlers, HasEditFailedHandlers, HasEditorEnterHandlers, HasEditorExitHandlers, HasFieldStateChangedHandlers, HasFilterEditorSubmitHandlers, HasGroupByCompleteHandlers, HasGroupByHandlers, HasGroupStateChangedHandlers, HasGroupTreeChangedHandlers, HasHeaderClickHandlers, HasHeaderDoubleClickHandlers, HasHeaderHoverHandlers, HasHilitesChangedHandlers, HasRecordClickHandlers, HasRecordCollapseHandlers, HasRecordDoubleClickHandlers, HasRecordDropHandlers, HasRecordExpandHandlers, HasRegroupHandlers, HasRemoveRecordClickHandlers, HasRowContextClickHandlers, HasRowEditorEnterHandlers, HasRowEditorExitHandlers, HasRowHoverHandlers, HasRowMouseDownHandlers, HasRowMouseUpHandlers, HasRowOutHandlers, HasRowOverHandlers, HasSelectionChangedHandlers, HasSelectionUpdatedHandlers, HasSetSortHandlers, HasSortChangedHandlers, HasSorterClickHandlers, HasSorterContextClickHandlers, HasViewStateChangedHandlers, HasMembersChangedHandlers, HasDataArrivedHandlers, HasDataChangedHandlers, HasFolderClickHandlers, HasFolderClosedHandlers, HasFolderContextClickHandlers, HasFolderDropHandlers, HasFolderOpenedHandlers, HasLeafClickHandlers, HasLeafContextClickHandlers, HasNodeClickHandlers, HasNodeContextClickHandlers

public class TreePalette extends TreeGrid implements Palette
A TreeGrid that implements the Palette behavior, so it can be used as the source for drag and drop instantiation of components when combined with an EditContext as the drop target.

Each TreeNode within TreeGrid.data can be a PaletteNode.

See Also:
  • Constructor Details

    • TreePalette

      public TreePalette()
    • TreePalette

      public TreePalette(JavaScriptObject jsObj)
  • Method Details

    • getOrCreateRef

      public static TreePalette 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 TreeGrid
    • setCanSaveSearches

      public TreePalette setCanSaveSearches(boolean canSaveSearches) throws IllegalStateException
      Option to save searches is disabled for treePalettes

      Note : This is an advanced setting

      Overrides:
      setCanSaveSearches in class ListGrid
      Parameters:
      canSaveSearches - New canSaveSearches value. Default value is false
      Returns:
      TreePalette instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getCanSaveSearches

      public boolean getCanSaveSearches()
      Option to save searches is disabled for treePalettes
      Overrides:
      getCanSaveSearches in class ListGrid
      Returns:
      Current canSaveSearches value. Default value is false
    • setCanShowFilterEditor

      public TreePalette setCanShowFilterEditor(boolean canShowFilterEditor) throws IllegalStateException
      Option to show filter editor is disabled for treePalettes

      Note : This is an advanced setting

      Overrides:
      setCanShowFilterEditor in class ListGrid
      Parameters:
      canShowFilterEditor - New canShowFilterEditor value. Default value is false
      Returns:
      TreePalette instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getCanShowFilterEditor

      public boolean getCanShowFilterEditor()
      Option to show filter editor is disabled for treePalettes
      Overrides:
      getCanShowFilterEditor in class ListGrid
      Returns:
      Current canShowFilterEditor value. Default value is false
      See Also:
    • setComponentDefaults

      public TreePalette setComponentDefaults(Record componentDefaults) throws IllegalStateException
      Defaults to apply to all components originating from this palette.
      Parameters:
      componentDefaults - New componentDefaults value. Default value is null
      Returns:
      TreePalette instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getComponentDefaults

      public Record getComponentDefaults()
      Defaults to apply to all components originating from this palette.
      Returns:
      Current componentDefaults value. Default value is null
      See Also:
    • setDefaultEditContext

      public TreePalette setDefaultEditContext(EditContext defaultEditContext)
      Default EditContext that this palette should use. Palettes generally create components via drag and drop, but may also support creation via double-click or other UI idioms when a defaultEditContext is set.

      If this method is called after the component has been drawn/initialized: Sets the default EditContext that this palette should use. Palettes generally create components via drag and drop, but may also support creation via double-click or other UI idioms when a defaultEditContext is set.
      Specified by:
      setDefaultEditContext in interface Palette
      Parameters:
      defaultEditContext - the default EditContext used by this Palette. Default value is null
      Returns:
      TreePalette instance, for chaining setter calls
    • getDefaultEditContext

      public EditContext getDefaultEditContext()
      Default EditContext that this palette should use. Palettes generally create components via drag and drop, but may also support creation via double-click or other UI idioms when a defaultEditContext is set.
      Specified by:
      getDefaultEditContext in interface Palette
      Returns:
      Current defaultEditContext value. Default value is null
    • setDefaultEditContext

      public TreePalette setDefaultEditContext(EditTree defaultEditContext)
      Default EditContext that this palette should use. Palettes generally create components via drag and drop, but may also support creation via double-click or other UI idioms when a defaultEditContext is set.

      If this method is called after the component has been drawn/initialized: Sets the default EditContext that this palette should use. Palettes generally create components via drag and drop, but may also support creation via double-click or other UI idioms when a defaultEditContext is set.
      Specified by:
      setDefaultEditContext in interface Palette
      Parameters:
      defaultEditContext - the default EditContext used by this Palette. Default value is null
      Returns:
      TreePalette instance, for chaining setter calls
    • getDefaultEditContextAsEditTree

      public EditTree getDefaultEditContextAsEditTree()
      Default EditContext that this palette should use. Palettes generally create components via drag and drop, but may also support creation via double-click or other UI idioms when a defaultEditContext is set.
      Specified by:
      getDefaultEditContextAsEditTree in interface Palette
      Returns:
      Current defaultEditContext value. Default value is null
    • setDefaultEditContext

      public TreePalette setDefaultEditContext(EditPane defaultEditContext)
      Default EditContext that this palette should use. Palettes generally create components via drag and drop, but may also support creation via double-click or other UI idioms when a defaultEditContext is set.

      If this method is called after the component has been drawn/initialized: Sets the default EditContext that this palette should use. Palettes generally create components via drag and drop, but may also support creation via double-click or other UI idioms when a defaultEditContext is set.
      Specified by:
      setDefaultEditContext in interface Palette
      Parameters:
      defaultEditContext - the default EditContext used by this Palette. Default value is null
      Returns:
      TreePalette instance, for chaining setter calls
    • getDefaultEditContextAsEditPane

      public EditPane getDefaultEditContextAsEditPane()
      Default EditContext that this palette should use. Palettes generally create components via drag and drop, but may also support creation via double-click or other UI idioms when a defaultEditContext is set.
      Specified by:
      getDefaultEditContextAsEditPane in interface Palette
      Returns:
      Current defaultEditContext value. Default value is null
    • setGenerateNames

      public TreePalette setGenerateNames(boolean generateNames) throws IllegalStateException
      Whether created components should have their "ID" or "name" property automatically set to a unique value based on the component's type, eg, "ListGrid0".
      Specified by:
      setGenerateNames in interface Palette
      Parameters:
      generateNames - New generateNames value. Default value is true
      Returns:
      TreePalette instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getGenerateNames

      public boolean getGenerateNames()
      Whether created components should have their "ID" or "name" property automatically set to a unique value based on the component's type, eg, "ListGrid0".
      Specified by:
      getGenerateNames in interface Palette
      Returns:
      Current generateNames value. Default value is true
      See Also:
    • makeEditNode

      public EditNode makeEditNode(PaletteNode paletteNode)
      Given a PaletteNode, make an EditNode from it by creating a liveObject from the PaletteNode.defaults and copying presentation properties (eg title to the editNode.

      If editNodeProperties is specified as an object on on the paletteNode, each property in this object will also be copied across to the editNode.

      Specified by:
      makeEditNode in interface Palette
      Parameters:
      paletteNode - paletteNode to create from
      Returns:
      created EditNode
    • makeEditNode

      public EditNode makeEditNode(PaletteNode paletteNode, EditContext editContext)
      Given a PaletteNode, make an EditNode from it by creating a liveObject from the PaletteNode.defaults and copying presentation properties (eg title to the editNode.

      If editNodeProperties is specified as an object on on the paletteNode, each property in this object will also be copied across to the editNode.

      Specified by:
      makeEditNode in interface Palette
      Parameters:
      paletteNode - paletteNode to create from
      editContext - the EditContext where the node will be added. Only required in +{EditContext.screenMode,screenMode}.
      Returns:
      created EditNode
    • setDefaultProperties

      public static void setDefaultProperties(TreePalette treePaletteProperties)
      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:
      treePaletteProperties - properties that should be used as new defaults when instances of this class are created
      See Also:
    • setLogicalStructure

      public LogicalStructureObject setLogicalStructure(TreePaletteLogicalStructure s)
      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 TreeGrid