This interface is used to describe a document type within the IDE. It is built primarly from the information
contained in the com-bea-ide:document extension xml (see DocumentSvc
). The information is primarily
used to display information to the user. The underlying handler object actually performs the operations.
An important concept is the idea that the document info for a paritcular URI can change. This information is
important for caching. If the handler relies on the contents of the URI for either displaying icon information, or
for resolving its fluency, the document info or handler may change. The IDocumentInfo records this information in
the methods
IDocumentInfo.canInfoChange()
and
IDocumentInfo.canHandlerChange()
so code that caches IDocumentInfo objects for
URIs can know that it cannot cache the particular information for the URI.
Nested Class Summary |
public static interface | IDocumentInfo.ITemplate
The ITemplate interface is used for creation of new documents. |
Method Summary |
public boolean |
|
public boolean |
|
public boolean |
|
public |
|
public |
|
public |
|
public |
|
public |
|
public |
|
public |
|
public |
|
public boolean |
|
public boolean |
|
public boolean |
|
public |
|
Method Detail |
public boolean canCreate()Indicates whether documents of this type can be created within the IDE. If so, the document handler has implemented the newDocument interface. An appropriate template may be passed to the newDocument method
Related Topics
public boolean canHandlerChange()Determines whether the IDocumentInfo's handler examined the file contents to assign this info to the URI. If so this method should return true, meaning that changes to the contents of the file could result in a different document handler being used. This has implications for the cachability of this IDocumentInfo object
public boolean canInfoChange()Determines whether the values returned by the IDocumentInfo methods may change if the contents of the document change. A return value of true from this method implies that the return values can change. If the {#canHandlerChange()} method returns true, then this method is irrelevant as it implies that the data returned can change.
publicDerives the base name for the given file, stripping away all extension and name suffix information. Generally, it simply removes the extension, but some handlers may also add a pre-extension suffix to a file. This method strips all of that out to determine the original name.String
getBaseName(String
sFile)
Related Topics
IDocumentHandler.getBaseName(String)
public String
getHandlerId()
String identifying the handler that generated this document info. The handler id is unique for each handler
thus, comparing handler id strings is the correct way to determine if to document info objects represent the same
handler.
public Icon
getIcon()
An icon representing this document type.
public String
getLabel()
A string description of the document type that this information represents.
publicObtain the parent document for the given file. If the isAutogenerated method returns true for a URI, this method should return the document from which the first was generated. This method should simply call through to the document handler to retrieve this information.URI
getParentDocument(URI
uriFile)
public IDocumentInfo.ITemplate
[] getTemplates()
The set of creation templates available for this document type. Valid only if canCreate() returns true. There
will always be at least a single ITemplate if canCreate is true representing the null (default) template.
Related Topics
publicObtain the virtual name for this document. All documents that share a virtual name are versions of the same document.String
getVirtualName(URI
uri)
publicChecks the given filename to see if it is a valid name for this handler. This check may include verification of the extension and any other requirements on the filename. For example, the java handler can require that the filename be a valid java identifier.String
invalidNameCheck(String
sFile)
Related Topics
IDocumentHandler.invalidNameCheck(String)
public boolean isAutogenerated(URI
uriFile)
This method allows the caller to determine if the specified file is autogenerated. This is
the equivalent of instantiating the document for the file and using the IRelatedDocument
interface to make the same method call. This method does not require instantiating the document
however and is therefore lighter weight.
public boolean isDefaultVersion(URI
uri)
Determines whether this document instance is the default version. The default version is the one that will be associated with the
virtual name when invoked (ex. when invoking a webservice using the virtual .jws. Note that if the URI does not refer to a version instance
(i.e. getVirtualName() returns null), this method should return false
public boolean isValidVersion(URI
uri)
Indicates whether the document is currently a valid version. If the document does not properly implement the
version's interface, then this method should return true in order to allow feedback to the user.
publicExamine the given filename and derive a valid filename from it. This method differs fromString
suggestValidName(String
sFile)
IDocumentInfo.invalidNameCheck(String)
in that rather than returning an error, it will attempt
to address any invalid characters in the name and correct them. An example is an
implementation that replaces spaces with '_' in a handler that does not allow spaces.
Related Topics