|
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
public class DiagramDocumentEditor
A Diagram Editor with optional flyout palette.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette |
|---|
org.eclipse.gmf.runtime.diagram.ui.parts.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 |
|---|
DIAGRAM_CONTEXT_ID, 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()
|
protected org.eclipse.gmf.runtime.common.ui.action.ActionManager |
createActionManager()
|
protected 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. |
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 org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette |
|---|
configurePaletteViewer, createActivityManagerListener, createPaletteRoot, createPaletteViewerProvider, getInitialPaletteSize, getInitialPaletteState, getPaletteViewerProvider, handlePaletteDefaultStateChanged, handlePaletteResized, initializeGraphicalViewer, setEditDomain, setFocus, startListening, stopListening |
| Methods inherited from class org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor |
|---|
addDefaultPreferences, addDefaultPreferences, clearGraphicalViewerContents, closeEditor, configureGraphicalViewer, createActions, createDiagramEditDomain, createGraphicalViewer, createHistoryListener, createScrollingGraphicalViewer, getActionManager, getContextID, getContributorId, getDefaultOutlineViewMode, getDiagramEditDomain, getDiagramEditPart, getDiagramGraphicalViewer, getElements, getGraphicalControl, getKeyHandler, getOperationHistory, getOutlineViewEditPartFactory, getPreferencesHint, getRulerComposite, getShowInContext, getSite, getUndoContext, getWorkspaceViewerPreferenceStore, getZoomManager, initializeGraphicalViewerContents, isWritable, persistViewerSettings, setRulerComposite, setUndoContext, shouldAddUndoContext |
| 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 |
|---|
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getTitle, getTitleImage, removePartPropertyListener, removePropertyListener, setPartProperty, 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)
getAdapter in interface IAdaptablegetAdapter in class org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette
public void init(IEditorSite site,
IEditorInput input)
throws PartInitException
init in interface IEditorPartinit in class org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorPartInitExceptionprotected final void setSite(IWorkbenchPartSite site)
setSite in class org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorpublic void dispose()
dispose in interface IWorkbenchPartdispose in class org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorpublic Diagram getDiagram()
getDiagram in interface org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPartgetDiagram in class org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorpublic IDiagramDocument getDiagramDocument()
public boolean askUserSaveOverwrite()
public int askUserSaveClose()
public boolean askUserReload()
protected void configureDiagramEditDomain()
configureDiagramEditDomain in class org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorDiagramEditor.configureDiagramEditDomain()protected org.eclipse.gmf.runtime.common.ui.action.ActionManager createActionManager()
createActionManager in class org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorprotected IOperationHistory createOperationHistory()
createOperationHistory in class org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorprotected java.lang.Object getDefaultPaletteContent()
getDefaultPaletteContent in class org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette
public void selectionChanged(IWorkbenchPart part,
ISelection selection)
selectionChanged in interface ISelectionListenerselectionChanged in class GraphicalEditorpublic 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()
file - The new file editor inputpublic void setInput(IEditorInput input)
setInput in interface IReusableEditorsetInput in class org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor
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 ISaveablePartdoSaveAs in class GraphicalEditorprotected 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 ISaveablePartdoSave in class EditorPartprogressMonitor - 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 ISaveablePartisSaveAsAllowed in class GraphicalEditorfalsepublic boolean isDirty()
isDirty in interface ISaveablePartisDirty in class GraphicalEditorprotected void handleElementContentReplaced()
Clients may extended this method.
protected void handleElementContentAboutToBeReplaced()
Clients may extended this method.
protected void editorSaved()
protected void firePropertyChange(int property)
firePropertyChange in class GraphicalEditorpublic 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)
createPartControl in interface IWorkbenchPartcreatePartControl in class org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalettepublic TransactionalEditingDomain getEditingDomain()
getEditingDomain in class org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorprotected 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.