PaletteGenerator Class
- public abstract class PaletteGenerator
extends Object
Base class for design palette generators. Each generator is a top level
item in the palette which has 0 or more child palette items. If a
generator has 0 children it is not displayed in the palette.
Palette generators are specified in Tldx files using the
<palettegenerator> element. Following is a sample
Tldx file showing how to specify a palette generator for a tag library:
<taglib>
<uri>http://www.foo.com/mytags</uri>
<palettegenerator>com.foo.MyPaletteGenerator</palettegenerator>
<tag>
<name>mytag</name>
<attribute>
<name>myattr</name>
</attribute>
</tag>
</taglib>
Related Topics
PaletteItem
DefaultPaletteItem
-
Hierarchy
-
Object
PaletteGenerator
-
Direct Known Subclasses
-
EmptyPaletteGenerator
Methods from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PaletteGenerator
public PaletteGenerator()
- Default constructor.
getDocument() Method
public IDOMDocument
getDocument()
Returns the document for which this generator is generating items.
Returns
- DOM document associated with generator. May be null.
getLabel() Method
public String
getLabel()
Returns a string suitable for display on the insert palette,
identifying this group of items.
Returns
- Display string for palette generator.
getPaletteItems() Method
public abstract PaletteItem
[] getPaletteItems()
Returns an array of PaletteItem
s which should be displayed.
If the array is empty, the group will not appear on the palette at all.
Derived classes must override to return their palette items.
Returns
- Array of
PaletteItem
s.
getPriority() Method
public int getPriority()
Gets the priority with which the items should be displayed on the
insert palette. Lower priorities are displayed higher on the palette.
Returns
- Default behavior returns 0.
getTagLibraryInfo() Method
public TagLibraryInfo
getTagLibraryInfo()
Gets the TagLibraryInfo
for which this generator is supposed
to generate items to put on the insert palette.
Returns
- Tag library info associated with this generator.
setDocument(IDOMDocument) Method
public void setDocument(IDOMDocument
doc)
Sets the document for which this generator is generating items.
Parameters
-
doc
- DOM document associated with generator.
setTagLibraryInfo(TagLibraryInfo) Method
public void setTagLibraryInfo(TagLibraryInfo
tagLibraryInfo)
Sets the TagLibraryInfo
for which this generator is supposed
to generate items to put on the insert palette.
Parameters
-
tagLibraryInfo
- Tag library info associated with this
generator.