Class EditorContextMenuListener
- java.lang.Object
-
- net.ssehub.easy.producer.ui.productline_editor.configuration.EditorContextMenuListener
-
- All Implemented Interfaces:
java.util.EventListener,org.eclipse.swt.events.SelectionListener,org.eclipse.swt.internal.SWTEventListener
public class EditorContextMenuListener extends java.lang.Object implements org.eclipse.swt.events.SelectionListenerListener for the context menu of theConfigurationTableEditor.- Author:
- El-Sharkawy
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classEditorContextMenuListener.ActionSpecifies the action which should be handled by theEditorContextMenuListenerinstance.
-
Field Summary
Fields Modifier and Type Field Description private EditorContextMenuListener.Actionactionprivate org.eclipse.jface.viewers.StructuredViewerviewer
-
Constructor Summary
Constructors Constructor Description EditorContextMenuListener(org.eclipse.jface.viewers.StructuredViewer viewer, EditorContextMenuListener.Action action)Sole constructor for this listener.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidchangeCompoundValueType(GUIVariable var)Asks the user for changing the type of the compound value invaralong the refinement hierarchy.private voidcopyValues(Compound type, CompoundValue orig, java.util.List<java.lang.Object> target, java.util.Set<java.lang.Object> done)Copies values to achieve an instance oftypebased on values fromorig.private GUIVariablegetSelectedVariable()Returns the current selected variable, i.e.voidwidgetDefaultSelected(org.eclipse.swt.events.SelectionEvent evt)voidwidgetSelected(org.eclipse.swt.events.SelectionEvent evt)
-
-
-
Field Detail
-
viewer
private org.eclipse.jface.viewers.StructuredViewer viewer
-
action
private EditorContextMenuListener.Action action
-
-
Constructor Detail
-
EditorContextMenuListener
public EditorContextMenuListener(org.eclipse.jface.viewers.StructuredViewer viewer, EditorContextMenuListener.Action action)Sole constructor for this listener.- Parameters:
viewer- TheConfigurationTableEditorhaving a context menu.action- Specifies the action which shall be performed by the specific menu item (must not be null).
-
-
Method Detail
-
widgetSelected
public void widgetSelected(org.eclipse.swt.events.SelectionEvent evt)
- Specified by:
widgetSelectedin interfaceorg.eclipse.swt.events.SelectionListener
-
changeCompoundValueType
private void changeCompoundValueType(GUIVariable var)
Asks the user for changing the type of the compound value invaralong the refinement hierarchy. Nothing happens ifvardoes not contain aCompoundValue.- Parameters:
var- the variable to change the compound value tpye
-
copyValues
private void copyValues(Compound type, CompoundValue orig, java.util.List<java.lang.Object> target, java.util.Set<java.lang.Object> done)
Copies values to achieve an instance oftypebased on values fromorig. Values are stored intargetin the format required forValueFactory. Already processed slots are stored indone.- Parameters:
type- the target typeorig- the original valuetarget- the target values forValueFactory- to be turned into an arraydone- already processed slots
-
widgetDefaultSelected
public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent evt)
- Specified by:
widgetDefaultSelectedin interfaceorg.eclipse.swt.events.SelectionListener
-
getSelectedVariable
private GUIVariable getSelectedVariable()
Returns the current selected variable, i.e. which the user has clicked with the right mouse button.- Returns:
- The selected
GUIVariable.
-
-