Class SaveableComponentViewer
java.lang.Object
org.palladiosimulator.measurementsui.abstractviewer.ComponentViewer
org.palladiosimulator.measurementsui.abstractviewer.SaveableComponentViewer
- Direct Known Subclasses:
MeasurementsTreeViewer
A common saveable view based on a parsley view.
-
Field Summary
Fields inherited from class org.palladiosimulator.measurementsui.abstractviewer.ComponentViewer
editingDomain, injector, modelRepository, resource
-
Constructor Summary
ModifierConstructorDescriptionprotected
SaveableComponentViewer
(Composite parent, MDirtyable dirty, ECommandService commandService, EObject modelRepository) -
Method Summary
Modifier and TypeMethodDescriptionabstract 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
protected Resource
updateResource
(EObject model) Methods inherited from class org.palladiosimulator.measurementsui.abstractviewer.ComponentViewer
getModelRepository, getViewer, initContextMenu, initDragAndDrop, initEditingDomain, initInjector, initParsley, setModelRepository, update
-
Field Details
-
dirty
-
commandService
-
-
Constructor Details
-
SaveableComponentViewer
protected SaveableComponentViewer(Composite parent, MDirtyable dirty, 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 Details
-
addSelectionListener
Connects the current selected item in the view with the eclipse selectionservice- Parameters:
selectionService
- of the eclipse project
-
updateResource
- 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
Saves the current state of the view- Parameters:
dirty
- describes whether the view was edited- Throws:
IOException
- if the save operation fails
-
save
Saves the current state of the view- Throws:
IOException
- if the save operation fails
-
update
-