com.smartgwt.client.tools

## Class PaletteNode

- java.lang.Object
- - com.smartgwt.client.core.JsObject
  - - com.smartgwt.client.core.DataClass
    - - com.smartgwt.client.core.RefDataClass
      - - com.smartgwt.client.data.Record
        - - com.smartgwt.client.widgets.grid.ListGridRecord
          - - com.smartgwt.client.widgets.tree.TreeNode
            - - com.smartgwt.client.tools.PaletteNode

- All Implemented Interfaces:
    com.google.gwt.event.shared.HasHandlers
  Direct Known Subclasses:
    EditNode

      public class PaletteNode
      extends TreeNode

  An object representing a component which the user may create dynamically within an application.

  A PaletteNode expresses visual properties for how the palette will display it (eg `title`, `icon`) as well as instructions for creating the component the paletteNode represents (`type`, `defaults`).

  Various types of palettes (`ListPalette`, `TreePalette`, `MenuPalette`, `TilePalette`) render a PaletteNode in different ways, and allow the user to trigger creation in different ways (eg drag and drop, or just click). All share a common pattern for how components are created from palettes.

  Note that in a TreePalette, a PaletteNode is essentially a `TreeNode` and can have properties expected for a TreeNode (eg, `showDropIcon`). Likewise a PaletteNode in a MenuPalette can have the properties of a `MenuItem`, such as `MenuItem.enableIf()`.

- - ### Field Summary

    - ### Fields inherited from class com.smartgwt.client.core.RefDataClass

      `id`

    - ### Fields inherited from class com.smartgwt.client.core.DataClass

      `factoryCreated, factoryProperties, readOnly`

    - ### Fields inherited from class com.smartgwt.client.core.JsObject

      `jsObj`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PaletteNode()`
    `PaletteNode(com.google.gwt.core.client.JavaScriptObject jsObj)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Canvas` | `getCanvasDefaults()` Defaults for the component to be created from this palette.
    `Canvas` | `getCanvasLiveObject()` For a paletteNode which should be a "singleton", that is, always provides the exact same object (==) rather than a dynamically created copy, provide the singleton object as `liveObject`.
    `DrawItem` | `getDrawItemDefaults()` Defaults for the component to be created from this palette.
    `DrawItem` | `getDrawItemLiveObject()` For a paletteNode which should be a "singleton", that is, always provides the exact same object (==) rather than a dynamically created copy, provide the singleton object as `liveObject`.
    `DrawPane` | `getDrawPaneDefaults()` Defaults for the component to be created from this palette.
    `DrawPane` | `getDrawPaneLiveObject()` For a paletteNode which should be a "singleton", that is, always provides the exact same object (==) rather than a dynamically created copy, provide the singleton object as `liveObject`.
    `EditNode` | `getEditNodeProperties()` Properties to be applied to the `editNode` when created.
    `EditProxy` | `getEditProxyProperties()` Properties to be applied to the `liveObject`.`editProxy` when created.
    `FormItem` | `getFormItemDefaults()` Defaults for the component to be created from this palette.
    `FormItem` | `getFormItemLiveObject()` For a paletteNode which should be a "singleton", that is, always provides the exact same object (==) rather than a dynamically created copy, provide the singleton object as `liveObject`.
    `java.lang.String` | `getIcon()` Icon for this paletteNode.
    `java.lang.String` | `getIdPrefix()` Prefix used to create unique component ID.
    `java.lang.Object` | `getLiveObject()` For a paletteNode which should be a "singleton", that is, always provides the exact same object (==) rather than a dynamically created copy, provide the singleton object as `liveObject`.
    `static PaletteNode` | `getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)`
    `java.lang.String` | `getTitle()` Textual title for this paletteNode.
    `java.lang.String` | `getType()` String this paletteNode creates, for example, "ListGrid".
    `void` | `setCanvasDefaults(Canvas defaults)` Defaults for the component to be created from this palette.
    `void` | `setCanvasLiveObject(Canvas liveObject)` For a paletteNode which should be a "singleton", that is, always provides the exact same object (==) rather than a dynamically created copy, provide the singleton object as `liveObject`.
    `void` | `setDrawItemDefaults(DrawItem defaults)` Defaults for the component to be created from this palette.
    `void` | `setDrawItemLiveObject(DrawItem liveObject)` For a paletteNode which should be a "singleton", that is, always provides the exact same object (==) rather than a dynamically created copy, provide the singleton object as `liveObject`.
    `void` | `setDrawPaneDefaults(DrawPane defaults)` Defaults for the component to be created from this palette.
    `void` | `setDrawPaneLiveObject(DrawPane liveObject)` For a paletteNode which should be a "singleton", that is, always provides the exact same object (==) rather than a dynamically created copy, provide the singleton object as `liveObject`.
    `void` | `setEditNodeProperties(EditNode editNodeProperties)` Properties to be applied to the `editNode` when created.
    `void` | `setEditProxyProperties(EditProxy editProxyProperties)` Properties to be applied to the `liveObject`.`editProxy` when created.
    `void` | `setFormItemDefaults(FormItem defaults)` Defaults for the component to be created from this palette.
    `void` | `setFormItemLiveObject(FormItem liveObject)` For a paletteNode which should be a "singleton", that is, always provides the exact same object (==) rather than a dynamically created copy, provide the singleton object as `liveObject`.
    `void` | `setIcon(java.lang.String icon)` Icon for this paletteNode.
    `void` | `setIdPrefix(java.lang.String idPrefix)` Prefix used to create unique component ID.
    `void` | `setTitle(java.lang.String title)` Textual title for this paletteNode.
    `void` | `setType(java.lang.String type)` String this paletteNode creates, for example, "ListGrid".

    - ### Methods inherited from class com.smartgwt.client.widgets.tree.TreeNode

      `getCanAcceptDrop, getCanDrag, getEnabled, getName, getShowDropIcon, getShowOpenIcon, setCanAcceptDrop, setCanDrag, setChildren, setEnabled, setID, setIsFolder, setName, setParentID, setShowDropIcon, setShowOpenIcon`

    - ### Methods inherited from class com.smartgwt.client.widgets.grid.ListGridRecord

      `get_baseStyle, get_canEdit, get_canRemove, getBackgroundComponent, getCanExpand, getCanSelect, getCustomStyle, getDetailDS, getEmbeddedComponent, getEmbeddedComponentFields, getEmbeddedComponentPosition, getIncludeInSummary, getIsGridSummary, getIsGroupSummary, getIsSeparator, getLinkText, getShowRollOver, getSingleCellValue, set_baseStyle, set_canEdit, set_canRemove, setBackgroundComponent, setCanExpand, setCanSelect, setCustomStyle, setDetailDS, setEmbeddedComponent, setEmbeddedComponentFields, setEmbeddedComponentPosition, setIncludeInSummary, setIsGridSummary, setIsGroupSummary, setIsSeparator, setLinkText, setShowRollOver, setSingleCellValue`

    - ### Methods inherited from class com.smartgwt.client.data.Record

      `convertToRecordArray, copyAttributes, copyAttributesInto, getAttributeAsRecordArray, getAttributeAsRecordList, isARecord, toMap`

    - ### Methods inherited from class com.smartgwt.client.core.RefDataClass

      `getRef, getRef, internalSetID`

    - ### Methods inherited from class com.smartgwt.client.core.DataClass

      `applyFactoryProperties, doAddHandler, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsDoubleArray, getAttributeAsFloat, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getAttributes, getHandlerCount, getReadOnly, isFactoryCreated, logConfiguration, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributeAsJavaObject, setFactoryCreated, setReadOnly`

    - ### Methods inherited from class com.smartgwt.client.core.JsObject

      `equals, getJsObj, hashCode, isCreated, setJavaScriptObject, setJsObj`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PaletteNode

          public PaletteNode()

    - #### PaletteNode

          public PaletteNode(com.google.gwt.core.client.JavaScriptObject jsObj)

  - ### Method Detail

    - #### getOrCreateRef

          public static PaletteNode getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)

    - #### setCanvasDefaults

          public void setCanvasDefaults(Canvas defaults)

      Defaults for the component to be created from this palette.

      For example, if `type` is "ListGrid", properties valid to pass to ListGrid.create().

      Note that event handlers or method overrides cannot be configured as `defaults`, as they cannot be serialized or restored. Instead, create a subclass that implements the desired behaviors, and use that subclass as `type`.

      See also `Reflection` for special concerns when making a GWT subclass usable in `Component XML` and `Dashboards & Tools` in general.

      Parameters:
        `defaults` - Default value is null
      See Also:
        `SGWTProperties`

    - #### getCanvasDefaults

          public Canvas getCanvasDefaults()

      Defaults for the component to be created from this palette.

      For example, if `type` is "ListGrid", properties valid to pass to ListGrid.create().

      Note that event handlers or method overrides cannot be configured as `defaults`, as they cannot be serialized or restored. Instead, create a subclass that implements the desired behaviors, and use that subclass as `type`.

      See also `Reflection` for special concerns when making a GWT subclass usable in `Component XML` and `Dashboards & Tools` in general.

      Returns:
        Canvas

    - #### setCanvasLiveObject

          public void setCanvasLiveObject(Canvas liveObject)

      For a paletteNode which should be a "singleton", that is, always provides the exact same object (==) rather than a dynamically created copy, provide the singleton object as `liveObject`.

      Instead of dynamically creating an object from defaults, the `liveObject` will simply be assigned to `EditNode.liveObject` for the created editNode.

      Parameters:
        `liveObject` - Default value is null

    - #### getCanvasLiveObject

          public Canvas getCanvasLiveObject()

      For a paletteNode which should be a "singleton", that is, always provides the exact same object (==) rather than a dynamically created copy, provide the singleton object as `liveObject`.

      Instead of dynamically creating an object from defaults, the `liveObject` will simply be assigned to `EditNode.liveObject` for the created editNode.

      Returns:
        Canvas

    - #### setDrawItemDefaults

          public void setDrawItemDefaults(DrawItem defaults)

      Defaults for the component to be created from this palette.

      For example, if `type` is "ListGrid", properties valid to pass to ListGrid.create().

      Note that event handlers or method overrides cannot be configured as `defaults`, as they cannot be serialized or restored. Instead, create a subclass that implements the desired behaviors, and use that subclass as `type`.

      See also `Reflection` for special concerns when making a GWT subclass usable in `Component XML` and `Dashboards & Tools` in general.

      Parameters:
        `defaults` - Default value is null
      See Also:
        `SGWTProperties`

    - #### getDrawItemDefaults

          public DrawItem getDrawItemDefaults()

      Defaults for the component to be created from this palette.

      For example, if `type` is "ListGrid", properties valid to pass to ListGrid.create().

      Note that event handlers or method overrides cannot be configured as `defaults`, as they cannot be serialized or restored. Instead, create a subclass that implements the desired behaviors, and use that subclass as `type`.

      See also `Reflection` for special concerns when making a GWT subclass usable in `Component XML` and `Dashboards & Tools` in general.

      Returns:
        DrawItem

    - #### setDrawItemLiveObject

          public void setDrawItemLiveObject(DrawItem liveObject)

      For a paletteNode which should be a "singleton", that is, always provides the exact same object (==) rather than a dynamically created copy, provide the singleton object as `liveObject`.

      Instead of dynamically creating an object from defaults, the `liveObject` will simply be assigned to `EditNode.liveObject` for the created editNode.

      Parameters:
        `liveObject` - Default value is null

    - #### getDrawItemLiveObject

          public DrawItem getDrawItemLiveObject()

      For a paletteNode which should be a "singleton", that is, always provides the exact same object (==) rather than a dynamically created copy, provide the singleton object as `liveObject`.

      Instead of dynamically creating an object from defaults, the `liveObject` will simply be assigned to `EditNode.liveObject` for the created editNode.

      Returns:
        DrawItem

    - #### setDrawPaneDefaults

          public void setDrawPaneDefaults(DrawPane defaults)

      Defaults for the component to be created from this palette.

      For example, if `type` is "ListGrid", properties valid to pass to ListGrid.create().

      Note that event handlers or method overrides cannot be configured as `defaults`, as they cannot be serialized or restored. Instead, create a subclass that implements the desired behaviors, and use that subclass as `type`.

      See also `Reflection` for special concerns when making a GWT subclass usable in `Component XML` and `Dashboards & Tools` in general.

      Parameters:
        `defaults` - Default value is null
      See Also:
        `SGWTProperties`

    - #### getDrawPaneDefaults

          public DrawPane getDrawPaneDefaults()

      Defaults for the component to be created from this palette.

      For example, if `type` is "ListGrid", properties valid to pass to ListGrid.create().

      Note that event handlers or method overrides cannot be configured as `defaults`, as they cannot be serialized or restored. Instead, create a subclass that implements the desired behaviors, and use that subclass as `type`.

      See also `Reflection` for special concerns when making a GWT subclass usable in `Component XML` and `Dashboards & Tools` in general.

      Returns:
        DrawPane

    - #### setDrawPaneLiveObject

          public void setDrawPaneLiveObject(DrawPane liveObject)

      For a paletteNode which should be a "singleton", that is, always provides the exact same object (==) rather than a dynamically created copy, provide the singleton object as `liveObject`.

      Instead of dynamically creating an object from defaults, the `liveObject` will simply be assigned to `EditNode.liveObject` for the created editNode.

      Parameters:
        `liveObject` - Default value is null

    - #### getDrawPaneLiveObject

          public DrawPane getDrawPaneLiveObject()

      For a paletteNode which should be a "singleton", that is, always provides the exact same object (==) rather than a dynamically created copy, provide the singleton object as `liveObject`.

      Instead of dynamically creating an object from defaults, the `liveObject` will simply be assigned to `EditNode.liveObject` for the created editNode.

      Returns:
        DrawPane

    - #### setEditNodeProperties

          public void setEditNodeProperties(EditNode editNodeProperties)

      Properties to be applied to the `editNode` when created.
      Parameters:
        `editNodeProperties` - Default value is null

    - #### getEditNodeProperties

          public EditNode getEditNodeProperties()

      Properties to be applied to the `editNode` when created.
      Returns:
        EditNode

    - #### setEditProxyProperties

          public void setEditProxyProperties(EditProxy editProxyProperties)

      Properties to be applied to the `liveObject`.`editProxy` when created.
      Parameters:
        `editProxyProperties` - Default value is null
      See Also:
        `SGWTProperties`

    - #### getEditProxyProperties

          public EditProxy getEditProxyProperties()

      Properties to be applied to the `liveObject`.`editProxy` when created.
      Returns:
        EditProxy

    - #### setFormItemDefaults

          public void setFormItemDefaults(FormItem defaults)

      Defaults for the component to be created from this palette.

      For example, if `type` is "ListGrid", properties valid to pass to ListGrid.create().

      Note that event handlers or method overrides cannot be configured as `defaults`, as they cannot be serialized or restored. Instead, create a subclass that implements the desired behaviors, and use that subclass as `type`.

      See also `Reflection` for special concerns when making a GWT subclass usable in `Component XML` and `Dashboards & Tools` in general.

      Parameters:
        `defaults` - Default value is null

    - #### getFormItemDefaults

          public FormItem getFormItemDefaults()

      Defaults for the component to be created from this palette.

      For example, if `type` is "ListGrid", properties valid to pass to ListGrid.create().

      Note that event handlers or method overrides cannot be configured as `defaults`, as they cannot be serialized or restored. Instead, create a subclass that implements the desired behaviors, and use that subclass as `type`.

      See also `Reflection` for special concerns when making a GWT subclass usable in `Component XML` and `Dashboards & Tools` in general.

      Returns:
        FormItem

    - #### setFormItemLiveObject

          public void setFormItemLiveObject(FormItem liveObject)

      For a paletteNode which should be a "singleton", that is, always provides the exact same object (==) rather than a dynamically created copy, provide the singleton object as `liveObject`.

      Instead of dynamically creating an object from defaults, the `liveObject` will simply be assigned to `EditNode.liveObject` for the created editNode.

      Parameters:
        `liveObject` - Default value is null

    - #### getFormItemLiveObject

          public FormItem getFormItemLiveObject()

      For a paletteNode which should be a "singleton", that is, always provides the exact same object (==) rather than a dynamically created copy, provide the singleton object as `liveObject`.

      Instead of dynamically creating an object from defaults, the `liveObject` will simply be assigned to `EditNode.liveObject` for the created editNode.

      Returns:
        FormItem

    - #### setIcon

          public void setIcon(java.lang.String icon)

      Icon for this paletteNode.
      Overrides:
        `setIcon` in class `TreeNode`
      Parameters:
        `icon` -
      See Also:
        `SCImgURL . Default value is null`

    - #### getIcon

          public java.lang.String getIcon()

      Icon for this paletteNode.
      Overrides:
        `getIcon` in class `TreeNode`
      Returns:
      See Also:
        `SCImgURL`

    - #### setIdPrefix

          public void setIdPrefix(java.lang.String idPrefix)

      Prefix used to create unique component ID. If not specified, `type` is used.
      Parameters:
        `idPrefix` - Default value is null

    - #### getIdPrefix

          public java.lang.String getIdPrefix()

      Prefix used to create unique component ID. If not specified, `type` is used.
      Returns:
        String

    - #### setTitle

          public void setTitle(java.lang.String title)

      Textual title for this paletteNode.
      Overrides:
        `setTitle` in class `TreeNode`
      Parameters:
        `title` - Default value is null
      See Also:
        `Tree.setTitleProperty(java.lang.String)`, `Tree.getTitle(com.smartgwt.client.widgets.tree.TreeNode)`

    - #### getTitle

          public java.lang.String getTitle()

      Textual title for this paletteNode.
      Overrides:
        `getTitle` in class `TreeNode`
      Returns:
        String
      See Also:
        `Tree.getTitleProperty()`, `Tree.getTitle(com.smartgwt.client.widgets.tree.TreeNode)`

    - #### setType

          public void setType(java.lang.String type)

      String this paletteNode creates, for example, "ListGrid".
      Parameters:
        `type` -
      See Also:
        `SCClassName . Default value is null`

    - #### getType

          public java.lang.String getType()

      String this paletteNode creates, for example, "ListGrid".
      Returns:
      See Also:
        `SCClassName`

    - #### getLiveObject

          public java.lang.Object getLiveObject()

      For a paletteNode which should be a "singleton", that is, always provides the exact same object (==) rather than a dynamically created copy, provide the singleton object as `liveObject`.

      Instead of dynamically creating an object from defaults, the `liveObject` will simply be assigned to `EditNode.liveObject` for the created editNode.

      Use the more specific live object getter API, such as `getCanvasLiveObject()` if you are sure of the type.

      Returns:
        Object
      See Also:
        `getCanvasLiveObject()`, `getDrawItemLiveObject()`, `getDrawPaneLiveObject()`, `getFormItemLiveObject()`