|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectDiagramEditorWithFlyOutPalette
org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor
public class DiagramDocumentEditor
A Diagram Editor with optional flyout palette.
Field Summary | |
---|---|
protected java.lang.String |
fErrorLabel
The error message shown in the status line in case of failed information look up. |
Fields inherited from interface org.eclipse.ui.IEditorPart |
---|
PROP_DIRTY, PROP_INPUT |
Fields inherited from interface org.eclipse.ui.IWorkbenchPart |
---|
PROP_TITLE |
Constructor Summary | |
---|---|
DiagramDocumentEditor(boolean hasFlyoutPalette)
Constructs a diagram editor with optional flyout palette. |
Method Summary | |
---|---|
boolean |
askUserReload()
|
int |
askUserSaveClose()
|
boolean |
askUserSaveOverwrite()
|
void |
close(boolean save)
Closes this text editor after optionally saving changes. |
protected void |
configureDiagramEditDomain()
|
protected ActionManager |
createActionManager()
|
protected org.eclipse.emf.transaction.TransactionalEditingDomain |
createEditingDomain()
Gets an editing domain from the editing domain registry using the id returned from getEditingDomainID() if an editing domain has been
registered already with this id. |
protected IOperationHistory |
createOperationHistory()
Create my operation history. |
void |
createPartControl(Composite parent)
|
void |
dispose()
|
protected void |
disposeDocumentProvider()
Disposes of the connection with the document provider. |
void |
doSave(IProgressMonitor progressMonitor)
The AbstractDiagramEditor implementation of this
IEditorPart method may be extended by subclasses. |
void |
doSaveAs()
The AbstractDiagramEditor implementation of this
IEditorPart method calls performSaveAs . |
void |
doSetInput(IEditorInput input,
boolean releaseEditorContents)
|
protected void |
editorSaved()
Hook which gets called when the editor has been saved. |
protected void |
enableSanityChecking(boolean enable)
Enables/disables sanity checking. |
protected void |
enableStateValidation(boolean enable)
Enables/disables state validation. |
protected void |
firePropertyChange(int property)
|
java.lang.Object |
getAdapter(java.lang.Class type)
|
protected java.lang.Object |
getDefaultPaletteContent()
|
Diagram |
getDiagram()
|
IDiagramDocument |
getDiagramDocument()
|
IDocumentProvider |
getDocumentProvider()
Returns this text editor's document provider. |
protected IDocumentProvider |
getDocumentProvider(IEditorInput input)
Hook method for setting the document provider for the given input. |
org.eclipse.emf.transaction.TransactionalEditingDomain |
getEditingDomain()
|
protected java.lang.String |
getEditingDomainID()
Returns an editing domain id used to retrive an editing domain from the editing domain registry. |
protected IEditorDescriptor |
getEditorDescriptor()
Retrieves the descriptor for this editor |
protected IProgressMonitor |
getProgressMonitor()
Returns the progress monitor related to this editor. |
protected void |
handleEditorInputChanged()
Handles an external change of the editor's input element. |
protected void |
handleElementContentAboutToBeReplaced()
Performs any additional action necessary to perform after the input document's content has been replaced. |
protected void |
handleElementContentReplaced()
Performs any additional action necessary to perform after the input document's content has been replaced. |
protected void |
handleExceptionOnSave(CoreException exception,
IProgressMonitor progressMonitor)
Handles the given exception. |
void |
init(IEditorSite site,
IEditorInput input)
|
boolean |
isDirty()
|
boolean |
isEditable()
Returns whether the text in this text editor can be changed by the user. |
boolean |
isEditorInputModifiable()
Returns whether the editor's input can be persistently be modified. |
boolean |
isEditorInputReadOnly()
Returns whether the editor's input is read-only. |
boolean |
isSaveAsAllowed()
The AbstractDiagramEditor implementation of this
IEditorPart method returns false . |
protected void |
performSave(boolean overwrite,
IProgressMonitor progressMonitor)
Performs the save and handles errors appropriately. |
protected void |
performSaveAs(IProgressMonitor progressMonitor)
Performs a save as and reports the result state back to the given progress monitor. |
protected void |
releaseInput()
refreshes the editor with the given file by: 0 - resets resource modification stamp 1- Flushing the command stack 2- Clearing the graphical viewer's contents 3- Setting the new File input 4- Setting the new graphical viewer's contents 5- Clearing the graphical viewer's selection |
protected boolean |
reuseDiagramOnMove()
|
protected void |
safelySanityCheckState(IEditorInput input)
Checks the state of the given editor input if sanity checking is enabled. |
protected void |
sanityCheckState(IEditorInput input)
Checks the state of the given editor input. |
void |
selectionChanged(IWorkbenchPart part,
ISelection selection)
|
protected void |
setDocumentProvider(IDocumentProvider provider)
Sets this editor's document provider. |
protected void |
setDocumentProvider(IEditorInput input)
Hook method for setting the document provider for the given input. |
void |
setInput(IEditorInput input)
|
protected void |
setSite(IWorkbenchPartSite site)
|
protected void |
updateState(IEditorInput input)
Updates the state of the given editor input such as read-only flag. |
boolean |
validateEditorInputState()
Validates the state of the given editor input. |
protected void |
validateState(IEditorInput input)
Validates the state of the given editor input. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.ui.IEditorPart |
---|
getEditorInput, getEditorSite |
Methods inherited from interface org.eclipse.ui.IWorkbenchPart |
---|
addPropertyListener, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener, setFocus |
Methods inherited from interface org.eclipse.ui.ISaveablePart |
---|
isSaveOnCloseNeeded |
Field Detail |
---|
protected final java.lang.String fErrorLabel
Constructor Detail |
---|
public DiagramDocumentEditor(boolean hasFlyoutPalette)
hasFlyoutPalette
- creates a palette if true, else no paletteMethod Detail |
---|
public java.lang.Object getAdapter(java.lang.Class type)
getAdapter
in interface IAdaptable
public void init(IEditorSite site, IEditorInput input) throws PartInitException
init
in interface IEditorPart
PartInitException
protected final void setSite(IWorkbenchPartSite site)
public void dispose()
dispose
in interface IWorkbenchPart
public Diagram getDiagram()
public IDiagramDocument getDiagramDocument()
public boolean askUserSaveOverwrite()
public int askUserSaveClose()
public boolean askUserReload()
protected void configureDiagramEditDomain()
org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor#configureDiagramEditDomain()
protected ActionManager createActionManager()
protected IOperationHistory createOperationHistory()
protected java.lang.Object getDefaultPaletteContent()
public void selectionChanged(IWorkbenchPart part, ISelection selection)
public IDocumentProvider getDocumentProvider()
IDocumentEditor
getDocumentProvider
in interface IDocumentEditor
null
if none, e.g. after closing the editorprotected void setDocumentProvider(IDocumentProvider provider)
provider
- the document providerpublic boolean isEditable()
IDocumentEditor
isEditable
in interface IDocumentEditor
true
if it can be edited, and false
if it is read-onlyprotected void setDocumentProvider(IEditorInput input)
input
- the input of this editor.protected IDocumentProvider getDocumentProvider(IEditorInput input)
input
- the input of this editor.protected void releaseInput()
file
- The new file editor inputpublic void setInput(IEditorInput input)
setInput
in interface IReusableEditor
public void doSetInput(IEditorInput input, boolean releaseEditorContents) throws CoreException
CoreException
public void close(boolean save)
IDocumentEditor
close
in interface IDocumentEditor
save
- true
if unsaved changed should be saved, and
false
if unsaved changed should be discardedprotected void disposeDocumentProvider()
protected IProgressMonitor getProgressMonitor()
protected void handleEditorInputChanged()
public void doSaveAs()
AbstractDiagramEditor
implementation of this
IEditorPart
method calls performSaveAs
.
Subclasses may reimplement.
doSaveAs
in interface ISaveablePart
protected void performSaveAs(IProgressMonitor progressMonitor)
progressMonitor
- the progress monitor for communicating result state or null
public void doSave(IProgressMonitor progressMonitor)
AbstractDiagramEditor
implementation of this
IEditorPart
method may be extended by subclasses.
doSave
in interface ISaveablePart
progressMonitor
- the progress monitor for communicating result state or null
protected void enableSanityChecking(boolean enable)
enable
- true
if sanity checking should be enabled, false
otherwiseprotected void safelySanityCheckState(IEditorInput input)
input
- the editor input whose state is to be checkedprotected void sanityCheckState(IEditorInput input)
input
- the editor input whose state is to be checkedprotected void enableStateValidation(boolean enable)
enable
- true
if state validation should be enabled, false
otherwiseprotected void validateState(IEditorInput input)
input
- the input to be validatedpublic boolean validateEditorInputState()
IDocumentEditor
validateEditorInputState
in interface IDocumentEditor
true
if the input was validated, false
otherwiseprotected void updateState(IEditorInput input)
input
- the input to be validatedprotected void performSave(boolean overwrite, IProgressMonitor progressMonitor)
overwrite
- indicates whether or not overwriting is allowedprogressMonitor
- the monitor in which to run the operationprotected void handleExceptionOnSave(CoreException exception, IProgressMonitor progressMonitor)
exception
- the exception to handleprogressMonitor
- the progress monitorpublic boolean isSaveAsAllowed()
AbstractDiagramEditor
implementation of this
IEditorPart
method returns false
.
Subclasses may override.
isSaveAsAllowed
in interface ISaveablePart
false
public boolean isDirty()
isDirty
in interface ISaveablePart
protected void handleElementContentReplaced()
Clients may extended this method.
protected void handleElementContentAboutToBeReplaced()
Clients may extended this method.
protected void editorSaved()
protected void firePropertyChange(int property)
public boolean isEditorInputReadOnly()
IDocumentEditor
isEditable
as it talks about the
editor input, i.e. the domain element, and not about the editor
document.
isEditorInputReadOnly
in interface IDocumentEditor
true
if the editor input is read-onlypublic boolean isEditorInputModifiable()
IDocumentEditor
ITextEditorExtension.isEditorInputReadOnly
as read-only elements may be modifiable and
writable elements may not be modifiable. If the given element is not connected to this document
provider, the result is undefined. Document providers are allowed to use a cache to answer this
question, i.e. there can be a difference between the "real" state of the element and the return
value.
isEditorInputModifiable
in interface IDocumentEditor
true
if the editor input is modifiableprotected final IEditorDescriptor getEditorDescriptor()
public void createPartControl(Composite parent)
createPartControl
in interface IWorkbenchPart
public org.eclipse.emf.transaction.TransactionalEditingDomain getEditingDomain()
protected org.eclipse.emf.transaction.TransactionalEditingDomain createEditingDomain()
getEditingDomainID()
if an editing domain has been
registered already with this id. Use the
org.eclipse.emf.transaction.editingDomains
extension point
to register a shared editing domain.
If an editing domain is not found for the id, then a new editing domain will be created per editor instance.
protected java.lang.String getEditingDomainID()
protected boolean reuseDiagramOnMove()
|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.