JavaDocument Class
- public class JavaDocument
extends TextDocument
implements IRelatedDocument
A file handler for Java source files.
-
Hierarchy
-
Object
DefaultElement
DefaultDocument
DefaultSourceDocument
TextDocument
JavaDocument
-
All Implemented Interfaces
-
ICookieSupport
, IDocument
, IDriverSupport
, IElement
, IPropertySupport
, IRelatedDocument
, ISourceDocument
-
Direct Known Subclasses
-
ControlContainerDocument
, ControlDocument
-
JavaDocument(
Class handler, URI fileURI)
- Creates a new document using the appropriate handler, initializing the document with data found at the specified
URI.
|
public boolean |
-
breakRelationship ()
- JavaDocument objects are not part of document relationships, so this method always returns null.
|
public boolean |
-
confirmBreakDialog ()
- JavaDocument objects are not part of document relationships, so this method always returns null.
|
protected void |
-
createDrivers ()
- Creates drivers for this Java document.
|
public JavaClass |
-
getMainClass ()
- Gets the main class in this document.
|
public URI |
-
getParentDocument ()
- Returns the URI of a document that should appear as this document's parent in the UI.
|
public boolean |
-
isAutogenerated ()
- Indicates whether this file is auto-generated.
|
protected void |
-
uriChanged (URI uriOld, URI uriNew)
- When a document's URI changes, the compiler is notified of the change and a recompilation is initiated.
|
Methods from com.bea.ide.sourceeditor.DefaultSourceDocument |
createUndoableEditListener , createUndoManager , fireElementChildAdded , fireElementChildRemoved , fireElementModified , getElementFromOffset , getHandlerId , getReader , getSourceModel , getTokenFromOffset , getViewInfo , isMerging , mergeMetadata , onOpen , onRemove , onSave , reload , requestTwoWayEdit , setRootElement , waitForPendingCompilations , waitForRootElement
|
Methods from com.bea.ide.document.DefaultDocument |
addCookie , addDriver , addElementChangeListener , addPropertyChangeListener , addPropertyChangeListener , computeEditable , createReadOnlyListener , fileSystemChanged , finalize , fireElementChildAdded , fireElementChildRemoved , fireElementModified , fireElementModified , fireElementModified , getCookie , getDriver , getIFile , getInputStream , getProperty , getRootElement , getRootElement , getURI , isBinary , isEditable , isModified , isReadOnly , makeEditable , onOpen , onRemove , onSave , removeCookie , removeElementChangeListener , removePropertyChangeListener , removePropertyChangeListener , setProperty , setRootElement , uriChanged , waitForRootElement
|
Methods from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods from interface com.bea.ide.document.IDocument |
addElementChangeListener , getHandlerId , getIFile , getInputStream , getReader , getRootElement , getRootElement , getURI , getViewInfo , isBinary , isEditable , isModified , isReadOnly , makeEditable , onOpen , onRemove , onSave , reload , removeElementChangeListener , waitForRootElement
|
JavaDocument
public JavaDocument(Class
handler,
URI
fileURI)
- Creates a new document using the appropriate handler, initializing the document with data found at the specified
URI.
breakRelationship() Method
public boolean breakRelationship()
JavaDocument objects are not part of document relationships, so this method always returns null. Derived
documents should override this method if document changes would be required to break a document relationship.
Returns
- true if the relationship was successfully broken, false otherwise. A false return value will prevent user
edits to the document
confirmBreakDialog() Method
public boolean confirmBreakDialog()
JavaDocument objects are not part of document relationships, so this method always returns null. Derived
documents should override this method if document changes would be required to break a document relationship.
Returns
- true if the user affirmed that they want to break the relationship, false otherwise
createDrivers() Method
protected void createDrivers()
Creates drivers for this Java document. By default, a JavaDocument has the following
driver types and implementations:
ISourceViewDriver
, implemented by JavaSourceViewDriver
IDebugDriver
, implemented by JavaDebugDriver
IStructureViewDriver
, implemented by JavaStructureViewDriver
ICompilerDriver
, implemented by JavaCompilerDriver
IPropertyViewDriver
, implementation retrieved by CompilerSvc.get().getPropertyViewDriver
-
Overrides
-
DefaultSourceDocument.createDrivers()
getMainClass() Method
public JavaClass
getMainClass()
Gets the main class in this document. This will return null if
the file doesn't yet have a parse tree.
Returns
- the JavaClass that represents the main class for this document.
getParentDocument() Method
public URI
getParentDocument()
Returns the URI of a document that should appear as this document's parent in the UI.
This often returns null, indicating that the file should appear as if it is a child only
of its enclosing directory.
Returns
- The parent file of this document.
isAutogenerated() Method
public boolean isAutogenerated()
Indicates whether this file is auto-generated. Derived types should override this method
if they can be auto-generated.
Returns
- false. Java documents are not auto-generated.
uriChanged(URI, URI) Method
protected void uriChanged(URI
uriOld,
URI
uriNew)
Description copied from DefaultSourceDocument.uriChanged(URI, URI)
When a document's URI changes, the compiler is notified of the change and a recompilation is initiated.
Document types which override this method must call uriChanged in their super class.
-
Overrides
-
DefaultSourceDocument.uriChanged(URI, URI)