Class PLPWorkspaceListener

java.lang.Object
net.ssehub.easy.producer.eclipse.PLPWorkspaceListener
All Implemented Interfaces:
EventListener, org.eclipse.core.resources.IResourceChangeListener

public class PLPWorkspaceListener extends 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
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final Set<org.eclipse.core.resources.IProject>
     
    private static PLPWorkspaceListener
     
    private static final net.ssehub.easy.basics.logger.EASyLoggerFactory.EASyLogger
     

    Fields inherited from interface org.eclipse.core.resources.IResourceChangeListener

    PROPERTY_EVENT_MASK
  • Constructor Summary

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

    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
    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
    Unregisters the default instance.

    Methods inherited from class java.lang.Object

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

    • DISABLED

      private static final Set<org.eclipse.core.resources.IProject> DISABLED
    • LOGGER

      private static final net.ssehub.easy.basics.logger.EASyLoggerFactory.EASyLogger LOGGER
    • instance

      private static PLPWorkspaceListener instance
  • Constructor Details

    • PLPWorkspaceListener

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

    • 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.