ControlContainerDocument Class
- public abstract class ControlContainerDocument
extends JavaDocument
implements IRelatedDocument
A file handler for Control containers. This is fundamentally the same as a
JavaDocument, with a few added features. It defines control-specific
features in the compiler, and it has an extended element hierarchy.
Many of the IElements in the document structure implement ILinkedElement, and provide links
to controls which are contained by this document.
-
Hierarchy
-
Object
DefaultElement
DefaultDocument
DefaultSourceDocument
TextDocument
JavaDocument
ControlContainerDocument
-
All Implemented Interfaces
-
ICookieSupport
, IDocument
, IDriverSupport
, IElement
, IPropertySupport
, IRelatedDocument
, ISourceDocument
public static final Object |
-
NEW_KEY
- key to mark an element as new, used by actions that want to force
an immediate rename.
|
public static final String |
-
SCOPE
- The scope that indicates menu and palette items should be displayed.
|
public boolean |
-
breakRelationship ()
- Alter the contents of the document if necessary to remove the relationship between this document and it's parent.
|
public boolean |
-
confirmBreakDialog ()
- Show a dialog informing the user that their action will break the relationship this document
|
public void |
-
createDrivers ()
- Creates drivers for this Java document.
|
protected List |
-
findGeneratedFiles ()
|
protected Map |
-
getGeneratorActions ()
- Override this to return a mapping of documentHandlerID to the AbstractFileGenAction
that can create such a document from this document.
|
public URI |
-
getParentDocument ()
- Get the document from which this document was derived
|
public IDocumentViewInfo [] |
-
getViewInfo ()
- get all the views for this document type.
|
public boolean |
-
isAutogenerated ()
- Indicates whether this document was automatically generated from the parent document.
|
public void |
-
linkedDocumentRemoved (ILinkedElement link)
- Called when there is a link to another document (like a control reference), and that
document is removed.
|
public boolean |
-
onSave ()
- Method called by the document service when this document is saved.
|
protected boolean |
-
regenerate (URI destinationURI)
- By default, this will check the getGenerationActions map to figure out how
to regen files.
|
Methods from com.bea.ide.sourceeditor.DefaultSourceDocument |
createDrivers , createUndoableEditListener , createUndoManager , fireElementChildAdded , fireElementChildRemoved , fireElementModified , getElementFromOffset , getHandlerId , getReader , getSourceModel , getTokenFromOffset , isMerging , mergeMetadata , onOpen , onRemove , reload , requestTwoWayEdit , setRootElement , uriChanged , 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
|
NEW_KEY
public static final Object
NEW_KEY
- key to mark an element as new, used by actions that want to force
an immediate rename.
SCOPE
public static final String
SCOPE
- The scope that indicates menu and palette items should be displayed.
ControlContainerDocument
public ControlContainerDocument(Class
handler,
URI
fileURI)
- Constructor.
breakRelationship() Method
public boolean breakRelationship()
Description copied from IRelatedDocument.breakRelationship()
Alter the contents of the document if necessary to remove the relationship between this document and it's parent.
After this isAutogenerated() should always return false and getParentDocument() should return null. When this
document is next loaded, it may not implement the IRelatedDocument interface.
-
Overrides
-
JavaDocument.breakRelationship()
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()
Description copied from IRelatedDocument.confirmBreakDialog()
Show a dialog informing the user that their action will break the relationship this document
-
Overrides
-
JavaDocument.confirmBreakDialog()
Returns
- true if the user affirmed that they want to break the relationship, false otherwise
createDrivers() Method
public void createDrivers()
Description copied from JavaDocument.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
-
JavaDocument.createDrivers()
findGeneratedFiles() Method
protected List
findGeneratedFiles()
Returns
- a List of URIs that were autogenerated from this document.
getGeneratorActions() Method
protected Map
getGeneratorActions()
Override this to return a mapping of documentHandlerID to the AbstractFileGenAction
that can create such a document from this document. Often, it can be pulled from a
static on the specific document class.
getParentDocument() Method
public URI
getParentDocument()
Description copied from IRelatedDocument.getParentDocument()
Get the document from which this document was derived
-
Overrides
-
JavaDocument.getParentDocument()
Returns
- URI of the parent document or null if the relationship has been previously broken
getViewInfo() Method
public IDocumentViewInfo
[] getViewInfo()
get all the views for this document type. If we have a designviewdriver,
create the designview.
-
Overrides
-
DefaultSourceDocument.getViewInfo()
Returns
- Array of
IDocumentViewInfo
objects for this document.
isAutogenerated() Method
public boolean isAutogenerated()
Description copied from IRelatedDocument.isAutogenerated()
Indicates whether this document was automatically generated from the parent document. Typically this will cause
a warning to be displayed to the user to indicate that an editing action will break the relationship.
-
Overrides
-
JavaDocument.isAutogenerated()
Returns
- true if this document's contents were generated from another document and should be protected from editing,
false if the document may be edited without altering the relationship
linkedDocumentRemoved(ILinkedElement) Method
public void linkedDocumentRemoved(ILinkedElement
link)
Called when there is a link to another document (like a control reference), and that
document is removed.
Parameters
-
link
- the element which links to the other document.
onSave() Method
public boolean onSave()
Description copied from IDocument.onSave()
Method called by the document service when this document is saved. This is called automatically
by the document service. It may return false to indicate that this document should not be saved.
-
Overrides
-
DefaultSourceDocument.onSave()
Returns
- boolean indicating whether the document should be saved
regenerate(URI) Method
protected boolean regenerate(URI
destinationURI)
By default, this will check the getGenerationActions map to figure out how
to regen files. It can be overridden as needed.