Class EditProductLineAction

  • All Implemented Interfaces:
    org.eclipse.ui.IActionDelegate, org.eclipse.ui.IObjectActionDelegate

    public class EditProductLineAction
    extends java.lang.Object
    implements org.eclipse.ui.IObjectActionDelegate
    EASy contribution for the context menu of eclipse's package explorer. This class is needed to open the product line editor via the context menu.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.eclipse.core.resources.IProject selectedProject  
      private org.eclipse.jface.viewers.IStructuredSelection selection  
      private org.eclipse.swt.widgets.Shell shell  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Object getAdapter​(java.lang.Object adaptable, java.lang.Class clazz)
      Returns an adaptable object or null if the Object adaptable is neither an instance of the Class clazz nor an instance of IAdaptable.
      private org.eclipse.core.resources.IProject getProject()
      Returns the selected Project.
      private static java.lang.Object[] getSelectedAdaptables​(org.eclipse.jface.viewers.ISelection selection, java.lang.Class clazz)
      Returns adaptable objects for the selected objects of the selection.
      void run​(org.eclipse.jface.action.IAction action)  
      void selectionChanged​(org.eclipse.jface.action.IAction action, org.eclipse.jface.viewers.ISelection selection)  
      void setActivePart​(org.eclipse.jface.action.IAction action, org.eclipse.ui.IWorkbenchPart targetPart)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • shell

        private org.eclipse.swt.widgets.Shell shell
      • selection

        private org.eclipse.jface.viewers.IStructuredSelection selection
      • selectedProject

        private org.eclipse.core.resources.IProject selectedProject
    • Constructor Detail

      • EditProductLineAction

        public EditProductLineAction()
        Constructor for Action1.
    • Method Detail

      • setActivePart

        public void setActivePart​(org.eclipse.jface.action.IAction action,
                                  org.eclipse.ui.IWorkbenchPart targetPart)
        Specified by:
        setActivePart in interface org.eclipse.ui.IObjectActionDelegate
      • run

        public void run​(org.eclipse.jface.action.IAction action)
        Specified by:
        run in interface org.eclipse.ui.IActionDelegate
      • selectionChanged

        public void selectionChanged​(org.eclipse.jface.action.IAction action,
                                     org.eclipse.jface.viewers.ISelection selection)
        Specified by:
        selectionChanged in interface org.eclipse.ui.IActionDelegate
      • getSelectedAdaptables

        private static java.lang.Object[] getSelectedAdaptables​(org.eclipse.jface.viewers.ISelection selection,
                                                                java.lang.Class clazz)
        Returns adaptable objects for the selected objects of the selection.
        Parameters:
        selection - Selected resources for which the adapter should be retrieved
        clazz - the comparing class
        Returns:
        The selected objects
        See Also:
        getAdapter(Object, Class)
      • getAdapter

        public static java.lang.Object getAdapter​(java.lang.Object adaptable,
                                                  java.lang.Class clazz)
        Returns an adaptable object or null if the Object adaptable is neither an instance of the Class clazz nor an instance of IAdaptable.
        Parameters:
        adaptable - the object in queston
        clazz - the comparing class
        Returns:
        An adaptable object or null if the Object adaptable is neither an instance of the Class c nor an instance of IAdaptable
      • getProject

        private org.eclipse.core.resources.IProject getProject()
        Returns the selected Project.
        Returns:
        The selected project