Class SaveableComponentViewer
- java.lang.Object
-
- org.palladiosimulator.measurementsui.abstractviewer.ComponentViewer
-
- org.palladiosimulator.measurementsui.abstractviewer.SaveableComponentViewer
-
- Direct Known Subclasses:
MeasurementsTreeViewer
public abstract class SaveableComponentViewer extends ComponentViewer
A common saveable view based on a parsley view.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.eclipse.e4.core.commands.ECommandService
commandService
protected MDirtyable
dirty
-
Fields inherited from class org.palladiosimulator.measurementsui.abstractviewer.ComponentViewer
editingDomain, injector, modelRepository, resource
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SaveableComponentViewer(Composite parent, MDirtyable dirty, org.eclipse.e4.core.commands.ECommandService commandService, EObject modelRepository)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
addSelectionListener(ESelectionService selectionService)
Connects the current selected item in the view with the eclipse selectionservicevoid
redo()
Redos one command on the command stackvoid
save()
Saves the current state of the viewvoid
save(MDirtyable dirty)
Saves the current state of the viewvoid
undo()
Undos one command on the command stackvoid
undoAll()
Undos every command on the command stackabstract void
update(EObject modelRepository)
protected Resource
updateResource(EObject model)
-
Methods inherited from class org.palladiosimulator.measurementsui.abstractviewer.ComponentViewer
getModelRepository, getViewer, initContextMenu, initDragAndDrop, initEditingDomain, initInjector, initParsley, setModelRepository, update
-
-
-
-
Field Detail
-
dirty
protected MDirtyable dirty
-
commandService
protected org.eclipse.e4.core.commands.ECommandService commandService
-
-
Constructor Detail
-
SaveableComponentViewer
protected SaveableComponentViewer(Composite parent, MDirtyable dirty, org.eclipse.e4.core.commands.ECommandService commandService, EObject modelRepository)
- Parameters:
parent
- the container where the view is embeddeddirty
- the dirty state which indicates whether there were changes made in the viewercommandService
- a service of the eclipse application in order to make the tree view saveablemodelRepository
- EObject which is shown in the view
-
-
Method Detail
-
addSelectionListener
public abstract void addSelectionListener(ESelectionService selectionService)
Connects the current selected item in the view with the eclipse selectionservice- Parameters:
selectionService
- of the eclipse project
-
updateResource
protected Resource updateResource(EObject model)
- Overrides:
updateResource
in classComponentViewer
- Parameters:
model
- EMF Model of the shown data- Returns:
- the resource using the resource set of the editing domain
-
undo
public void undo()
Undos one command on the command stack
-
undoAll
public void undoAll()
Undos every command on the command stack
-
redo
public void redo()
Redos one command on the command stack
-
save
public void save(MDirtyable dirty) throws IOException
Saves the current state of the view- Parameters:
dirty
- describes whether the view was edited- Throws:
IOException
- if the save operation fails
-
save
public void save() throws IOException
Saves the current state of the view- Throws:
IOException
- if the save operation fails
-
update
public abstract void update(EObject modelRepository)
-
-