Class 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.SelectionListener
    Listener for the context menu of the ConfigurationTableEditor.
    Author:
    El-Sharkawy
    • Constructor Detail

      • EditorContextMenuListener

        public EditorContextMenuListener​(org.eclipse.jface.viewers.StructuredViewer viewer,
                                         EditorContextMenuListener.Action action)
        Sole constructor for this listener.
        Parameters:
        viewer - The ConfigurationTableEditor having 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:
        widgetSelected in interface org.eclipse.swt.events.SelectionListener
      • changeCompoundValueType

        private void changeCompoundValueType​(GUIVariable var)
        Asks the user for changing the type of the compound value in var along the refinement hierarchy. Nothing happens if var does not contain a CompoundValue.
        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 of type based on values from orig. Values are stored in target in the format required for ValueFactory. Already processed slots are stored in done.
        Parameters:
        type - the target type
        orig - the original value
        target - the target values for ValueFactory - to be turned into an array
        done - already processed slots
      • widgetDefaultSelected

        public void widgetDefaultSelected​(org.eclipse.swt.events.SelectionEvent evt)
        Specified by:
        widgetDefaultSelected in interface org.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.