PaletteItem Class
- public abstract class PaletteItem
extends Object
Base class for items which appear on the insert palette.
Related Topics
DefaultPaletteItem
-
Hierarchy
-
Object
PaletteItem
-
Direct Known Subclasses
-
DefaultPaletteItem
Methods from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PaletteItem
public PaletteItem()
- Default constructor.
canHaveParent(IDOMNode) Method
public boolean canHaveParent(IDOMNode
nodeParent)
Returns true if nodeParent
is a valid drop target for this
tag. This may be decided by examining the ancestors of nodeParent, or
the children, or any other aspect of the document. Default behavior is
to return true. Derived classes should override to implement desired
behavior.
Parameters
-
nodeParent
- Drop target parent to evaluate.
Returns
- Default behavior returns true.
getIcon() Method
public Icon
getIcon()
Returns an icon for display in the insert palette. Default behavior
returns null so that no icon appears in the palette. Derived classes
should override to implement desired behavior.
Returns
- Default behavior returns null.
getInsertDocument() Method
public abstract IDOMDocument
getInsertDocument()
Returns a document which contains the code to be inserted into the
document when this palette item is dropped. If the
PaletteItem
has an InsertWizard
then
this return value is only used to provide the user with feedback
as to where the element will be dropped. In this case, it is
acceptable for this method to return null, in which case the user
might not receive accurate feedback about where the drop will occur.
Returns
- JSP document to be inserted when the palette item is dropped.
getInsertWizard() Method
public InsertWizard
getInsertWizard()
Returns an InsertWizard
to be invoked when the item is dropped.
If this method returns null, then the document returned by
PaletteItem.getInsertDocument()
will be inserted into the user's document.
Returns
- Default behavior returns null.
getLabel() Method
public abstract String
getLabel()
Returns the string that should be displayed in the palette
to represent this item. Queries the associated TagInfo and
returns the display name attribute from the TLD file.
Returns
- Display name text for palette item.