Class AbstractEditor<T extends AbstractVisualizationSingleDatastreamInput>
- java.lang.Object
-
- org.eclipse.core.commands.common.EventManager
-
- org.eclipse.ui.part.WorkbenchPart
-
- org.eclipse.ui.part.EditorPart
-
- org.palladiosimulator.edp2.visualization.editors.AbstractEditor<T>
-
- All Implemented Interfaces:
IAdaptable
,IExecutableExtension
,IEditorPart
,IPersistable
,IPersistableEditor
,ISaveablePart
,IWorkbenchPart
,IWorkbenchPart2
,IWorkbenchPart3
,IWorkbenchPartOrientation
,ITabbedPropertySheetPageContributor
,IVisualisationInputListener
,IVisualization<T>
- Direct Known Subclasses:
JFreeChartEditor
public abstract class AbstractEditor<T extends AbstractVisualizationSingleDatastreamInput> extends EditorPart implements IVisualization<T>, IVisualisationInputListener
Default implementation of anEditorPart
. Provides common functionality, which all editors that want to display experiment data must have. Also enables the tabbed properties view.
-
-
Field Summary
Fields Modifier and Type Field Description static String
EDITOR_ID
This editor's ID, e.g.protected AbstractVisualizationInput<T>
input
The input for this Editor.protected Composite
parent
The composite of the parent element, for reference if a new chart is added.protected TabbedPropertySheetPage
propertySheetPage
Reference on the currentTabbedPropertySheetPage
.-
Fields inherited from interface org.eclipse.ui.IEditorPart
PROP_DIRTY, PROP_INPUT
-
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
-
-
Constructor Summary
Constructors Constructor Description AbstractEditor()
Default constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addDropSupport(Control control)
void
createPartControl(Composite parent)
protected ISelectionProvider
createSelectionProvider()
Creates a simple selection provider, which always returns just the input.void
doSave(IProgressMonitor monitor)
void
doSaveAs()
Object
getAdapter(Class adapter)
String
getContributorId()
IEditorInput
getEditorInput()
protected abstract String
getEditorName()
IVisualisationInput<T>
getVisualisationInput()
void
init(IEditorSite site, IEditorInput input)
boolean
isDirty()
boolean
isSaveAsAllowed()
void
restoreState(IMemento memento)
void
saveState(IMemento memento)
void
setFocus()
protected void
setInput(IEditorInput input)
abstract void
updateEditorContents()
void
visualisationInputChanged(boolean needsDatasetReload)
-
Methods inherited from class org.eclipse.ui.part.EditorPart
checkSite, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setInputWithNotify, setPartName
-
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, dispose, firePartPropertyChanged, firePropertyChange, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, 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.IWorkbenchPart
addPropertyListener, dispose, getSite, getTitle, getTitleImage, removePropertyListener
-
-
-
-
Field Detail
-
EDITOR_ID
public static final String EDITOR_ID
This editor's ID, e.g. for Referencing in extension points.- See Also:
- Constant Field Values
-
input
protected AbstractVisualizationInput<T extends AbstractVisualizationSingleDatastreamInput> input
The input for this Editor.
-
propertySheetPage
protected TabbedPropertySheetPage propertySheetPage
Reference on the currentTabbedPropertySheetPage
.
-
parent
protected Composite parent
The composite of the parent element, for reference if a new chart is added.
-
-
Method Detail
-
doSave
public void doSave(IProgressMonitor monitor)
- Specified by:
doSave
in interfaceISaveablePart
- Specified by:
doSave
in classEditorPart
-
doSaveAs
public void doSaveAs()
- Specified by:
doSaveAs
in interfaceISaveablePart
- Specified by:
doSaveAs
in classEditorPart
-
setInput
protected void setInput(IEditorInput input)
- Overrides:
setInput
in classEditorPart
-
init
public void init(IEditorSite site, IEditorInput input) throws PartInitException
- Specified by:
init
in interfaceIEditorPart
- Specified by:
init
in classEditorPart
- Throws:
PartInitException
-
isDirty
public boolean isDirty()
- Specified by:
isDirty
in interfaceISaveablePart
- Specified by:
isDirty
in classEditorPart
-
isSaveAsAllowed
public boolean isSaveAsAllowed()
- Specified by:
isSaveAsAllowed
in interfaceISaveablePart
- Specified by:
isSaveAsAllowed
in classEditorPart
-
saveState
public void saveState(IMemento memento)
- Specified by:
saveState
in interfaceIPersistable
-
setFocus
public void setFocus()
- Specified by:
setFocus
in interfaceIWorkbenchPart
- Specified by:
setFocus
in classWorkbenchPart
-
restoreState
public void restoreState(IMemento memento)
- Specified by:
restoreState
in interfaceIPersistableEditor
-
createSelectionProvider
protected ISelectionProvider createSelectionProvider()
Creates a simple selection provider, which always returns just the input. This selectionProvider is needed for displaying of the properties view for this editor.- Returns:
- a selection provider which selection is always the the editor input in the attribute
input
-
getAdapter
public Object getAdapter(Class adapter)
- Specified by:
getAdapter
in interfaceIAdaptable
- Overrides:
getAdapter
in classWorkbenchPart
-
getContributorId
public String getContributorId()
- Specified by:
getContributorId
in interfaceITabbedPropertySheetPageContributor
-
getEditorInput
public IEditorInput getEditorInput()
- Specified by:
getEditorInput
in interfaceIEditorPart
- Overrides:
getEditorInput
in classEditorPart
-
addDropSupport
protected void addDropSupport(Control control)
-
getVisualisationInput
public IVisualisationInput<T> getVisualisationInput()
- Specified by:
getVisualisationInput
in interfaceIVisualization<T extends AbstractVisualizationSingleDatastreamInput>
-
createPartControl
public void createPartControl(Composite parent)
- Specified by:
createPartControl
in interfaceIWorkbenchPart
- Specified by:
createPartControl
in classWorkbenchPart
-
getEditorName
protected abstract String getEditorName()
-
visualisationInputChanged
public void visualisationInputChanged(boolean needsDatasetReload)
- Specified by:
visualisationInputChanged
in interfaceIVisualisationInputListener
-
updateEditorContents
public abstract void updateEditorContents()
-
-