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
FieldsModifier and TypeFieldDescriptionprotected org.eclipse.e4.core.commands.ECommandServiceprotected org.eclipse.e4.ui.model.application.ui.MDirtyableFields inherited from class org.palladiosimulator.measurementsui.abstractviewer.ComponentViewer
editingDomain, injector, modelRepository, resource -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSaveableComponentViewer(org.eclipse.swt.widgets.Composite parent, org.eclipse.e4.ui.model.application.ui.MDirtyable dirty, org.eclipse.e4.core.commands.ECommandService commandService, EObject modelRepository) -
Method Summary
Modifier and TypeMethodDescriptionabstract voidaddSelectionListener(org.eclipse.e4.ui.workbench.modeling.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(org.eclipse.e4.ui.model.application.ui.MDirtyable dirty) Saves the current state of the viewvoidundo()Undos one command on the command stackvoidundoAll()Undos every command on the command stackabstract voidprotected ResourceupdateResource(EObject model) Methods inherited from class org.palladiosimulator.measurementsui.abstractviewer.ComponentViewer
getModelRepository, getViewer, initContextMenu, initDragAndDrop, initEditingDomain, initInjector, initParsley, setModelRepository, update
-
Field Details
-
dirty
protected org.eclipse.e4.ui.model.application.ui.MDirtyable dirty -
commandService
protected org.eclipse.e4.core.commands.ECommandService commandService
-
-
Constructor Details
-
SaveableComponentViewer
protected SaveableComponentViewer(org.eclipse.swt.widgets.Composite parent, org.eclipse.e4.ui.model.application.ui.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 Details
-
addSelectionListener
public abstract void addSelectionListener(org.eclipse.e4.ui.workbench.modeling.ESelectionService selectionService) Connects the current selected item in the view with the eclipse selectionservice- Parameters:
selectionService- of the eclipse project
-
updateResource
- 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
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
-