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.ECommandServicecommandServiceprotected MDirtyabledirty-
Fields inherited from class org.palladiosimulator.measurementsui.abstractviewer.ComponentViewer
editingDomain, injector, modelRepository, resource
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSaveableComponentViewer(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 voidaddSelectionListener(ESelectionService selectionService)Connects the current selected item in the view with the eclipse selectionservicevoidredo()Redos one command on the command stackvoidsave()Saves the current state of the viewvoidsave(MDirtyable dirty)Saves the current state of the viewvoidundo()Undos one command on the command stackvoidundoAll()Undos every command on the command stackabstract voidupdate(EObject modelRepository)protected ResourceupdateResource(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:
updateResourcein 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 IOExceptionSaves the current state of the view- Throws:
IOException- if the save operation fails
-
update
public abstract void update(EObject modelRepository)
-
-