DocumentSvc Class
- public class DocumentSvc
extends Object
The document service is the primary way that extensions in the Workshop IDE obtain and display
document objects. A document in the IDE is an abstract interface over a file. The implementation
of the document interface is dependent on the type of the file. Files are mapped to document handlers
to determine their type. The document service is responsible for mapping a file to a document handler.
It then invokes the document handler to create the document from the file. Document handlers are
registered using extension XML.
The extension XML for document handlers is as follows:
<document-handler class="{class}"
label="{label}" [icon="{image-resource}"]>
<file-extension [priority="{priority}]">{extension}</file-extension>*
<project-attributes><attribute name="{attr-name}" value="{attr-value}"/>*</project-attributes>*
<create-template id="{id}" label="{label}" priority="{priority}" [createCategories="{categories}"]
[wizard="true" [hideFilePath="true"]]>
[<description>{description}<description>]
</create-template>*
</document-handler>
Items in [] are optional.
Items followed by * indicate 0 or more may be present
Items in {} are values as defined below:
- class - The fully-qualified name of the class that implements the IDocumentHandler.
interface.
- label - A string that gives a descriptive name to the document type.
- image-resource - Path to an image resource to be used for the icon.
- categories - A comma-separated list of names for categories this document is in (HTML, Java, Webservices, etc...).
- priority - A priority level. For more information see
IDocumentHandler.Priority
. The default
priority is highest.
- extension - the characters following . that terminate a filename. usualy 3 or 4 characters.
- attr-name - The name of the project attribute that must be present.
- attr-value - The value the project attribute must have.
- id - a string to identify the template to the document handler. for more information
see
IDocumentInfo.ITemplate
.
- priority - an integer for sorting templates to present to the user.
- description - A string description of the template including information about what it creates and whether
it runs a wizard. The string will be stripped of newlines and all whitespace will be condensed to a single space (similar to html).
For more information on fluency see IDocumentHandler.Priority
.
For more information on templates see IDocumentInfo.ITemplate
.
For more information on project-attributes see IDocumentHandler
.
-
Hierarchy
-
Object
DocumentSvc
public static DocumentSvc.I |
-
get ()
- Returns the global static instance of the interface to this service.
|
Methods from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
instance
protected static DocumentSvc.I
instance
DocumentSvc
public DocumentSvc()
get() Method
public static DocumentSvc.I
get()
Returns the global static instance of the interface to this service.
Returns
- Instance object implementing the DocumentSvc.I interface