Class PLPWorkspaceListener

  • All Implemented Interfaces:
    java.util.EventListener, org.eclipse.core.resources.IResourceChangeListener

    public class PLPWorkspaceListener
    extends java.lang.Object
    implements org.eclipse.core.resources.IResourceChangeListener
    ChangeListener for the workspace, informs the SPLsManger, if ProductLineProjects were added or remove to the workspace.
    Author:
    El-Sharkawy
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private PLPWorkspaceListener()
      Sole constructor for this class.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void addProject​(org.eclipse.core.resources.IProject project)
      Adds the plp of a newly opened or imported EASY project to the SPLsManager.
      static void disableFor​(org.eclipse.core.resources.IProject project)
      Disables the automatic background mechanisms for the given project.
      private void handleOpenedResource​(org.eclipse.core.resources.IResourceChangeEvent postChangeEvent)
      This method checks whether the opened/imported resource was an EASy project.
      private void handleRemovedResource​(org.eclipse.core.resources.IResourceChangeEvent preChangeEvent)
      This method checks whether the closed/deleted resource was an EASy project.
      static void reenableFor​(org.eclipse.core.resources.IProject project)
      Reenables the automatic background mechanisms for the given project.
      static void register()
      Registers the default instance.
      private void removeProject​(org.eclipse.core.resources.IProject deletedProject)
      Removes a plp from a closed or deleted EASy project from the SPLsManager.
      void resourceChanged​(org.eclipse.core.resources.IResourceChangeEvent event)  
      static void unregister()
      Unregisters the default instance.
      • Methods inherited from class java.lang.Object

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

      • PLPWorkspaceListener

        private PLPWorkspaceListener()
        Sole constructor for this class.
    • Method Detail

      • register

        public static void register()
        Registers the default instance. Shall be called from an activator.
      • unregister

        public static void unregister()
        Unregisters the default instance.
      • disableFor

        public static void disableFor​(org.eclipse.core.resources.IProject project)
        Disables the automatic background mechanisms for the given project. This provides a kind of safe region.
        Parameters:
        project - the project to disable the background mechanisms
      • reenableFor

        public static void reenableFor​(org.eclipse.core.resources.IProject project)
        Reenables the automatic background mechanisms for the given project. This provides a kind of safe region.
        Parameters:
        project - the project to reenable the background mechanisms
      • resourceChanged

        public void resourceChanged​(org.eclipse.core.resources.IResourceChangeEvent event)
        Specified by:
        resourceChanged in interface org.eclipse.core.resources.IResourceChangeListener
      • handleRemovedResource

        private void handleRemovedResource​(org.eclipse.core.resources.IResourceChangeEvent preChangeEvent)
        This method checks whether the closed/deleted resource was an EASy project. If the closed/deleted resource was an EASy project, the included plp will be added to the SPLsManager.
        Parameters:
        preChangeEvent - A IResourceChangeEvent.PRE_CLOSE or IResourceChangeEvent.PRE_DELETE event triggered by the workspace.
      • removeProject

        private void removeProject​(org.eclipse.core.resources.IProject deletedProject)
        Removes a plp from a closed or deleted EASy project from the SPLsManager.
        Parameters:
        deletedProject - The deleted or removed EASy project.
      • handleOpenedResource

        private void handleOpenedResource​(org.eclipse.core.resources.IResourceChangeEvent postChangeEvent)
        This method checks whether the opened/imported resource was an EASy project. If the opened/imported resource was an EASy project, the included plp will be added to the SPLsManager.
        Parameters:
        postChangeEvent - A IResourceChangeEvent.POST_CHANGE event triggered by the workspace.
      • addProject

        public static void addProject​(org.eclipse.core.resources.IProject project)
        Adds the plp of a newly opened or imported EASY project to the SPLsManager.
        Parameters:
        project - The (EASy) IProject which contains the PLP and was opened/imported within the current action.