IDocumentInfo.ITemplate Interface

com.bea.ide.document
IDocumentInfo.ITemplate Interface

public static interface IDocumentInfo.ITemplate

The ITemplate interface is used for creation of new documents. A Template represents a set of static or dynamic content that will be inserted into the newly created document. Templates may be declared in the XML for the document handler. They are only used if the canCreate attribute is present and set to true. The descriptions and categories are used to create the new file user interface. The id string will be passed to the IDocumentHandler.createNewFile(URI, String) method. In order for the user to be presented with the option to create a document using a given handler. That handler must have at least one template.

Enclosing interface

IDocumentInfo

Method Summary

public String[]
getCategories()
Array of category strings for this template.
public String
getDescription()
Returns a textual description of the type of file this template will create.
public IDocumentInfo
getDocInfo()
IDocumentInfo object that owns this template.
public String
getId()
Id string for the template.
public String
getLabel()
Description string for the template.
public int
getPriority()
Priority for the template.
public boolean
hasWizard()
Whether or not this template will launch a wizard.
public boolean
hidePathAndFilename()
Returns a boolean value indicating whether this template allows choosing a file name.

Method Detail

getCategories() Method

public String[] getCategories()
Array of category strings for this template. Each category represents a grouping used to limit the set of options in the new file wizard. All templates with the same group name (across all document handlers) will be available when the category name is selected.

Returns

array of category names

getDescription() Method

public String getDescription()
Returns a textual description of the type of file this template will create.

Returns

string describing the type of file created by this template

getDocInfo() Method

public IDocumentInfo getDocInfo()
IDocumentInfo object that owns this template.

Returns

owning IDocumentInfo

getId() Method

public String getId()
Id string for the template. This will be passed to the IDocumentHandler.createNewFile(URI, String) method. The template ids are extracted from extension xml of the handler declaration. Each should be unique for a given document handler. One may be null to indicate the default template.

Returns

string representing the handler id, or null for the default template

getLabel() Method

public String getLabel()
Description string for the template. This will be used as a short label for the user when choosing a new document to create.

Returns

short string description of the file type represented by the template

getPriority() Method

public int getPriority()
Priority for the template. This is used for ordering templates when presented to the user.

Returns

priority for this template when sorting

hasWizard() Method

public boolean hasWizard()
Whether or not this template will launch a wizard. This is used to give visual feedback to the user that a wizard will be run

Returns

true if the template will be launching a wizard to actually create the file, false if there is no further user input upon completion of the new file dialog

hidePathAndFilename() Method

public boolean hidePathAndFilename()
Returns a boolean value indicating whether this template allows choosing a file name. If the template doesn't have a wizard this value is ignored. If the template does have a wizard, this value determines whether the filename text box and path chooser are enabled. NOTE: In the current release, this value should be true if using a wizard. The combination of hasWizard() == true and hidePathAndFilename() == false is not supported. Support will be added in a later version. In the extension.xml, if setting the wizard=true attribute, you should also set hideFilePath=true or confusing behavior will result. Generally, it is the responsibility of the wizard to obtain the filename and set the path.

Returns

true if the filename and path information should be disabled