Class PaletteNode
- All Implemented Interfaces:
HasHandlers
- Direct Known Subclasses:
EditNode
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
idFields inherited from class com.smartgwt.client.core.DataClass
factoryCreated, factoryProperties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionIf set to true, indicates that a Placeholder should always be shown in place of the actual component.If set to false, indicates that this node cannot becopy & pasted, including disallowing calls toEditContext.makePaletteNode()forEditNodescreated from thisPaletteNode.Defaults for the component to be created from this palette.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 asliveObject.Defaults for the component to be created from this palette.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 asliveObject.Defaults for the component to be created from this palette.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 asliveObject.Properties to be applied to theeditNodewhen created.Properties to be applied to theliveObject.editProxywhen created.Defaults for the component to be created from this palette.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 asliveObject.getIcon()Icon for this paletteNode.Name used to create unique component ID.Deprecated.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 asliveObject.static PaletteNodegetOrCreateRef(JavaScriptObject jsObj) Image to display in lieu of the usual placeholder text.Properties to be applied to theliveObjectwhen created as a Placeholder.If set to true, indicates instead of updating the changed property on the target live component a new live component is created with the current configured properties.Comma separated list of properties for this component that must be provided inEditNode.defaultsbefore the component will be created.getTitle()Textual title for this paletteNode.getType()String this paletteNode creates, for example, "ListGrid".setAlwaysUsePlaceholder(Boolean alwaysUsePlaceholder) If set to true, indicates that a Placeholder should always be shown in place of the actual component.setCanDuplicate(Boolean canDuplicate) If set to false, indicates that this node cannot becopy & pasted, including disallowing calls toEditContext.makePaletteNode()forEditNodescreated from thisPaletteNode.setCanvasDefaults(Canvas defaults) Defaults for the component to be created from this palette.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 asliveObject.setDrawItemDefaults(DrawItem defaults) Defaults for the component to be created from this palette.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 asliveObject.setDrawPaneDefaults(DrawPane defaults) Defaults for the component to be created from this palette.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 asliveObject.setEditNodeProperties(EditNode editNodeProperties) Properties to be applied to theeditNodewhen created.setEditProxyProperties(EditProxy editProxyProperties) Properties to be applied to theliveObject.editProxywhen created.setFormItemDefaults(FormItem defaults) Defaults for the component to be created from this palette.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 asliveObject.Icon for this paletteNode.Name used to create unique component ID.setIdPrefix(String idPrefix) Deprecated.As of Smart GWT version 12.1, deprecated in favor ofidNamesetPlaceholderImage(String placeholderImage) Image to display in lieu of the usual placeholder text.setPlaceholderProperties(Label placeholderProperties) Properties to be applied to theliveObjectwhen created as a Placeholder.setRecreateOnChange(Boolean recreateOnChange) If set to true, indicates instead of updating the changed property on the target live component a new live component is created with the current configured properties.setRequiredProperties(String requiredProperties) Comma separated list of properties for this component that must be provided inEditNode.defaultsbefore the component will be created.Textual title for this paletteNode.String this paletteNode creates, for example, "ListGrid".Methods inherited from class com.smartgwt.client.widgets.tree.TreeNode
getCanAcceptDrop, getCanDrag, getEnabled, getIconPadding, getName, getShowDropIcon, getShowOpenIcon, getShowSelectedIcon, setCanAcceptDrop, setCanDrag, setChildren, setEnabled, setIconPadding, setID, setIsFolder, setName, setParentID, setShowDropIcon, setShowOpenIcon, setShowSelectedIconMethods 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, setSingleCellValueMethods inherited from class com.smartgwt.client.data.Record
convertToRecordArray, copyAttributes, copyAttributesInto, getAttributeAsRecordArray, getAttributeAsRecordList, getPaletteDefaults, isARecord, toMapMethods inherited from class com.smartgwt.client.core.RefDataClass
getRef, getRef, internalSetIDMethods inherited from class com.smartgwt.client.core.DataClass
applyFactoryProperties, doAddHandler, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsDoubleArray, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getAttributes, getHandlerCount, isFactoryCreated, 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
-
Constructor Details
-
PaletteNode
public PaletteNode() -
PaletteNode
-
-
Method Details
-
getOrCreateRef
-
setAlwaysUsePlaceholder
If set to true, indicates that a Placeholder should always be shown in place of the actual component.- Parameters:
alwaysUsePlaceholder- New alwaysUsePlaceholder value. Default value is null- Returns:
PaletteNodeinstance, for chaining setter calls
-
getAlwaysUsePlaceholder
If set to true, indicates that a Placeholder should always be shown in place of the actual component.- Returns:
- Current alwaysUsePlaceholder value. Default value is null
-
setCanDuplicate
If set to false, indicates that this node cannot becopy & pasted, including disallowing calls toEditContext.makePaletteNode()forEditNodescreated from thisPaletteNode.- Parameters:
canDuplicate- New canDuplicate value. Default value is null- Returns:
PaletteNodeinstance, for chaining setter calls
-
getCanDuplicate
If set to false, indicates that this node cannot becopy & pasted, including disallowing calls toEditContext.makePaletteNode()forEditNodescreated from thisPaletteNode.- Returns:
- Current canDuplicate value. Default value is null
-
setCanvasDefaults
Defaults for the component to be created from this palette.For example, if
typeis "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 astype.See also
Reflectionfor special concerns when making a GWT subclass usable inComponent XMLandDashboards & Toolsin general.- Parameters:
defaults- New defaults value. Default value is null- Returns:
PaletteNodeinstance, for chaining setter calls- See Also:
-
getCanvasDefaults
Defaults for the component to be created from this palette.For example, if
typeis "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 astype.See also
Reflectionfor special concerns when making a GWT subclass usable inComponent XMLandDashboards & Toolsin general.- Returns:
- Current defaults value. Default value is null
-
setCanvasLiveObject
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 asliveObject.Instead of dynamically creating an object from defaults, the
liveObjectwill simply be assigned toEditNode.liveObjectfor the created editNode.- Parameters:
liveObject- New liveObject value. Default value is null- Returns:
PaletteNodeinstance, for chaining setter calls
-
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 asliveObject.Instead of dynamically creating an object from defaults, the
liveObjectwill simply be assigned toEditNode.liveObjectfor the created editNode.- Returns:
- Current liveObject value. Default value is null
-
setDrawItemDefaults
Defaults for the component to be created from this palette.For example, if
typeis "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 astype.See also
Reflectionfor special concerns when making a GWT subclass usable inComponent XMLandDashboards & Toolsin general.- Parameters:
defaults- New defaults value. Default value is null- Returns:
PaletteNodeinstance, for chaining setter calls- See Also:
-
getDrawItemDefaults
Defaults for the component to be created from this palette.For example, if
typeis "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 astype.See also
Reflectionfor special concerns when making a GWT subclass usable inComponent XMLandDashboards & Toolsin general.- Returns:
- Current defaults value. Default value is null
-
setDrawItemLiveObject
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 asliveObject.Instead of dynamically creating an object from defaults, the
liveObjectwill simply be assigned toEditNode.liveObjectfor the created editNode.- Parameters:
liveObject- New liveObject value. Default value is null- Returns:
PaletteNodeinstance, for chaining setter calls
-
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 asliveObject.Instead of dynamically creating an object from defaults, the
liveObjectwill simply be assigned toEditNode.liveObjectfor the created editNode.- Returns:
- Current liveObject value. Default value is null
-
setDrawPaneDefaults
Defaults for the component to be created from this palette.For example, if
typeis "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 astype.See also
Reflectionfor special concerns when making a GWT subclass usable inComponent XMLandDashboards & Toolsin general.- Parameters:
defaults- New defaults value. Default value is null- Returns:
PaletteNodeinstance, for chaining setter calls- See Also:
-
getDrawPaneDefaults
Defaults for the component to be created from this palette.For example, if
typeis "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 astype.See also
Reflectionfor special concerns when making a GWT subclass usable inComponent XMLandDashboards & Toolsin general.- Returns:
- Current defaults value. Default value is null
-
setDrawPaneLiveObject
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 asliveObject.Instead of dynamically creating an object from defaults, the
liveObjectwill simply be assigned toEditNode.liveObjectfor the created editNode.- Parameters:
liveObject- New liveObject value. Default value is null- Returns:
PaletteNodeinstance, for chaining setter calls
-
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 asliveObject.Instead of dynamically creating an object from defaults, the
liveObjectwill simply be assigned toEditNode.liveObjectfor the created editNode.- Returns:
- Current liveObject value. Default value is null
-
setEditNodeProperties
Properties to be applied to theeditNodewhen created.- Parameters:
editNodeProperties- New editNodeProperties value. Default value is null- Returns:
PaletteNodeinstance, for chaining setter calls
-
getEditNodeProperties
Properties to be applied to theeditNodewhen created.- Returns:
- Current editNodeProperties value. Default value is null
-
setEditProxyProperties
Properties to be applied to theliveObject.editProxywhen created.- Parameters:
editProxyProperties- New editProxyProperties value. Default value is null- Returns:
PaletteNodeinstance, for chaining setter calls- See Also:
-
getEditProxyProperties
Properties to be applied to theliveObject.editProxywhen created.- Returns:
- Current editProxyProperties value. Default value is null
-
setFormItemDefaults
Defaults for the component to be created from this palette.For example, if
typeis "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 astype.See also
Reflectionfor special concerns when making a GWT subclass usable inComponent XMLandDashboards & Toolsin general.- Parameters:
defaults- New defaults value. Default value is null- Returns:
PaletteNodeinstance, for chaining setter calls
-
getFormItemDefaults
Defaults for the component to be created from this palette.For example, if
typeis "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 astype.See also
Reflectionfor special concerns when making a GWT subclass usable inComponent XMLandDashboards & Toolsin general.- Returns:
- Current defaults value. Default value is null
-
setFormItemLiveObject
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 asliveObject.Instead of dynamically creating an object from defaults, the
liveObjectwill simply be assigned toEditNode.liveObjectfor the created editNode.- Parameters:
liveObject- New liveObject value. Default value is null- Returns:
PaletteNodeinstance, for chaining setter calls
-
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 asliveObject.Instead of dynamically creating an object from defaults, the
liveObjectwill simply be assigned toEditNode.liveObjectfor the created editNode.- Returns:
- Current liveObject value. Default value is null
-
setIcon
Icon for this paletteNode.- Overrides:
setIconin classTreeNode- Parameters:
icon- New icon value. Default value is null- Returns:
PaletteNodeinstance, for chaining setter calls- See Also:
-
getIcon
Icon for this paletteNode. -
setIdName
Name used to create unique component ID. If not specified,typeis used.Note: idName must follow all rules for a
Identifier.- Parameters:
idName- New idName value. Default value is null- Returns:
PaletteNodeinstance, for chaining setter calls
-
getIdName
Name used to create unique component ID. If not specified,typeis used.Note: idName must follow all rules for a
Identifier.- Returns:
- Current idName value. Default value is null
-
setIdPrefix
Deprecated.As of Smart GWT version 12.1, deprecated in favor ofidNamePrefix used to create unique component ID. If not specified,typeis used.- Parameters:
idPrefix- New idPrefix value. Default value is null- Returns:
PaletteNodeinstance, for chaining setter calls
-
getIdPrefix
Deprecated.As of Smart GWT version 12.1, deprecated in favor ofidNamePrefix used to create unique component ID. If not specified,typeis used.- Returns:
- Current idPrefix value. Default value is null
-
setPlaceholderImage
Image to display in lieu of the usual placeholder text.- Parameters:
placeholderImage- New placeholderImage value. Default value is null- Returns:
PaletteNodeinstance, for chaining setter calls- See Also:
-
getPlaceholderImage
Image to display in lieu of the usual placeholder text.- Returns:
- Current placeholderImage value. Default value is null
- See Also:
-
setPlaceholderProperties
Properties to be applied to theliveObjectwhen created as a Placeholder.- Parameters:
placeholderProperties- New placeholderProperties value. Default value is null- Returns:
PaletteNodeinstance, for chaining setter calls- See Also:
-
getPlaceholderProperties
Properties to be applied to theliveObjectwhen created as a Placeholder.- Returns:
- Current placeholderProperties value. Default value is null
-
setRecreateOnChange
If set to true, indicates instead of updating the changed property on the target live component a new live component is created with the current configured properties.This property is typically set when a custom component is being used that doesn't support setters for any or most of its properties and a change can be reflected by recreating the component.
Individual properties of the target component can be marked similarly on the component's schema for more fine-grained control. See
DataSourceField.recreateOnChange.- Parameters:
recreateOnChange- New recreateOnChange value. Default value is null- Returns:
PaletteNodeinstance, for chaining setter calls
-
getRecreateOnChange
If set to true, indicates instead of updating the changed property on the target live component a new live component is created with the current configured properties.This property is typically set when a custom component is being used that doesn't support setters for any or most of its properties and a change can be reflected by recreating the component.
Individual properties of the target component can be marked similarly on the component's schema for more fine-grained control. See
DataSourceField.recreateOnChange.- Returns:
- Current recreateOnChange value. Default value is null
-
setRequiredProperties
Comma separated list of properties for this component that must be provided inEditNode.defaultsbefore the component will be created. Otherwise a Placeholder will be used until the required properties are satisfied.- Parameters:
requiredProperties- New requiredProperties value. Default value is null- Returns:
PaletteNodeinstance, for chaining setter calls
-
getRequiredProperties
Comma separated list of properties for this component that must be provided inEditNode.defaultsbefore the component will be created. Otherwise a Placeholder will be used until the required properties are satisfied.- Returns:
- Current requiredProperties value. Default value is null
-
setTitle
Textual title for this paletteNode.- Overrides:
setTitlein classTreeNode- Parameters:
title- New title value. Default value is null- Returns:
PaletteNodeinstance, for chaining setter calls- See Also:
-
getTitle
Textual title for this paletteNode. -
setType
String this paletteNode creates, for example, "ListGrid".- Parameters:
type- New type value. Default value is null- Returns:
PaletteNodeinstance, for chaining setter calls- See Also:
-
getType
String this paletteNode creates, for example, "ListGrid".- Returns:
- Current type value. Default value is null
- See Also:
-
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 asliveObject.Instead of dynamically creating an object from defaults, the
liveObjectwill simply be assigned toEditNode.liveObjectfor 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:
-
idName