|
Runtime | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.eclipse.core.commands.common.EventManager
org.eclipse.ui.part.WorkbenchPart
org.eclipse.ui.part.EditorPart
org.eclipse.gef.ui.parts.GraphicalEditor
org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor
org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette
org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor
A Diagram Editor with optional flyout palette.
| Nested Class Summary |
| Nested classes inherited from class org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette |
DiagramEditorWithFlyOutPalette.CustomPalettePage |
| 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 class org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette |
COLLAPSED, UNCOLLAPSED_PINNED |
| Fields inherited from class org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor |
ID_OUTLINE, ID_OVERVIEW, workspaceViewerPreferenceStore |
| 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()
Configures my diagram edit domain with its command stack. |
protected ActionManager |
createActionManager()
|
protected org.eclipse.emf.transaction.TransactionalEditingDomain |
createEditingDomain()
Gets an editing domain from the editing domain registry using the id returned from DiagramDocumentEditor.getEditingDomainID() if an editing domain has been
registered already with this id. |
protected IOperationHistory |
createOperationHistory()
Create my operation history. |
void |
createPartControl(Composite parent)
Creates a splitter composite that will contain 2 parts one is for the diagram and the other is for the palette. |
void |
dispose()
Disposes this editor by: 3. |
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)
Adapts to PalettePage.class PaletteViewer.class other wise delegates to super.getAdapter() |
protected java.lang.Object |
getDefaultPaletteContent()
Gets the palette content to be sent to the palette service when creating the palette. |
Diagram |
getDiagram()
Method 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()
Gets my editing domain derived from my diagram editor input. |
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 org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette |
configurePaletteViewer, createPaletteRoot, createPaletteViewerProvider, getInitialPaletteSize, getInitialPaletteState, getPaletteViewerProvider, handlePaletteDefaultStateChanged, handlePaletteResized, initializeGraphicalViewer, setEditDomain, setFocus, startListening, stopListening |
| Methods inherited from class org.eclipse.gef.ui.parts.GraphicalEditor |
commandStackChanged, getActionRegistry, getCommandStack, getEditDomain, getGraphicalViewer, getPropertyActions, getSelectionActions, getSelectionSynchronizer, getStackActions, hookGraphicalViewer, initializeActionRegistry, setActionRegistry, setGraphicalViewer, updateActions |
| Methods inherited from class org.eclipse.ui.part.EditorPart |
checkSite, getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setInputWithNotify, setPartName |
| Methods inherited from class org.eclipse.ui.part.WorkbenchPart |
addPropertyListener, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getTitle, getTitleImage, removePropertyListener, setTitle, setTitleImage, setTitleToolTip, showBusy |
| Methods inherited from class org.eclipse.core.commands.common.EventManager |
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject |
| 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 palette| Method Detail |
public java.lang.Object getAdapter(java.lang.Class type)
DiagramEditorWithFlyOutPalette
getAdapter in interface IAdaptablegetAdapter in class DiagramEditorWithFlyOutPalette
public void init(IEditorSite site,
IEditorInput input)
throws PartInitException
init in interface IEditorPartinit in class DiagramEditorPartInitExceptionIEditorPart.init(IEditorSite, IEditorInput)protected final void setSite(IWorkbenchPartSite site)
setSite in class DiagramEditorWorkbenchPart.setSite(IWorkbenchPartSite)public void dispose()
DiagramEditor
dispose in interface IWorkbenchPartdispose in class DiagramEditorIWorkbenchPart.dispose()public Diagram getDiagram()
IDiagramWorkbenchPart
getDiagram in interface IDiagramWorkbenchPartgetDiagram in class DiagramEditorIDiagramWorkbenchPart.getDiagram()public IDiagramDocument getDiagramDocument()
public boolean askUserSaveOverwrite()
public int askUserSaveClose()
public boolean askUserReload()
protected void configureDiagramEditDomain()
DiagramEditor
configureDiagramEditDomain in class DiagramEditorDiagramEditor.configureDiagramEditDomain()protected ActionManager createActionManager()
createActionManager in class DiagramEditorprotected IOperationHistory createOperationHistory()
createOperationHistory in class DiagramEditorprotected java.lang.Object getDefaultPaletteContent()
DiagramEditorWithFlyOutPalette
getDefaultPaletteContent in class DiagramEditorWithFlyOutPalette
public void selectionChanged(IWorkbenchPart part,
ISelection selection)
selectionChanged in interface ISelectionListenerpublic IDocumentProvider getDocumentProvider()
IDocumentEditor
getDocumentProvider in interface IDocumentEditornull if none, e.g. after closing the editorprotected void setDocumentProvider(IDocumentProvider provider)
provider - the document providerpublic boolean isEditable()
IDocumentEditor
isEditable in interface IDocumentEditortrue 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()
public void setInput(IEditorInput input)
setInput in interface IReusableEditorsetInput in class DiagramEditorEditorPart.setInput(IEditorInput)
public void doSetInput(IEditorInput input,
boolean releaseEditorContents)
throws CoreException
CoreExceptionpublic void close(boolean save)
IDocumentEditor
close in interface IDocumentEditorsave - 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 ISaveablePartprotected void performSaveAs(IProgressMonitor progressMonitor)
progressMonitor - the progress monitor for communicating result state or nullpublic void doSave(IProgressMonitor progressMonitor)
AbstractDiagramEditor implementation of this
IEditorPart method may be extended by subclasses.
doSave in interface ISaveablePartprogressMonitor - the progress monitor for communicating result state or nullprotected 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 IDocumentEditortrue if the input was validated, false otherwiseprotected void updateState(IEditorInput input)
input - the input to be validated
protected void performSave(boolean overwrite,
IProgressMonitor progressMonitor)
overwrite - indicates whether or not overwriting is allowedprogressMonitor - the monitor in which to run the operation
protected 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 ISaveablePartfalsepublic boolean isDirty()
isDirty in interface ISaveablePartprotected 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()
IDocumentEditorisEditable as it talks about the
editor input, i.e. the domain element, and not about the editor
document.
isEditorInputReadOnly in interface IDocumentEditortrue if the editor input is read-onlypublic boolean isEditorInputModifiable()
IDocumentEditorITextEditorExtension.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 IDocumentEditortrue if the editor input is modifiableprotected final IEditorDescriptor getEditorDescriptor()
public void createPartControl(Composite parent)
DiagramEditorWithFlyOutPalette
createPartControl in interface IWorkbenchPartcreatePartControl in class DiagramEditorWithFlyOutPaletteIWorkbenchPart.createPartControl(Composite)public org.eclipse.emf.transaction.TransactionalEditingDomain getEditingDomain()
DiagramEditorIf subclasses have a known editing domain, they should override this method to return that editing domain as that will be more efficient that the generic implementation provided here.
getEditingDomain in class DiagramEditorprotected org.eclipse.emf.transaction.TransactionalEditingDomain createEditingDomain()
DiagramDocumentEditor.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.