Package net.ssehub.easy.producer.eclipse
Class PLPWorkspaceListener
- java.lang.Object
-
- net.ssehub.easy.producer.eclipse.PLPWorkspaceListener
-
- All Implemented Interfaces:
java.util.EventListener,org.eclipse.core.resources.IResourceChangeListener
public class PLPWorkspaceListener extends java.lang.Object implements org.eclipse.core.resources.IResourceChangeListenerChangeListener 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 java.util.Set<org.eclipse.core.resources.IProject>DISABLEDprivate static PLPWorkspaceListenerinstanceprivate static EASyLoggerFactory.EASyLoggerLOGGER
-
Constructor Summary
Constructors Modifier Constructor Description privatePLPWorkspaceListener()Sole constructor for this class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidaddProject(org.eclipse.core.resources.IProject project)Adds the plp of a newly opened or imported EASY project to the SPLsManager.static voiddisableFor(org.eclipse.core.resources.IProject project)Disables the automatic background mechanisms for the givenproject.private voidhandleOpenedResource(org.eclipse.core.resources.IResourceChangeEvent postChangeEvent)This method checks whether the opened/imported resource was an EASy project.private voidhandleRemovedResource(org.eclipse.core.resources.IResourceChangeEvent preChangeEvent)This method checks whether the closed/deleted resource was an EASy project.static voidreenableFor(org.eclipse.core.resources.IProject project)Reenables the automatic background mechanisms for the givenproject.static voidregister()Registers the default instance.private voidremoveProject(org.eclipse.core.resources.IProject deletedProject)Removes a plp from a closed or deleted EASy project from theSPLsManager.voidresourceChanged(org.eclipse.core.resources.IResourceChangeEvent event)static voidunregister()Unregisters the default instance.
-
-
-
Field Detail
-
DISABLED
private static final java.util.Set<org.eclipse.core.resources.IProject> DISABLED
-
LOGGER
private static final EASyLoggerFactory.EASyLogger LOGGER
-
instance
private static PLPWorkspaceListener instance
-
-
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 givenproject. 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 givenproject. 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:
resourceChangedin interfaceorg.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 theSPLsManager.- 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 theSPLsManager.- 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 theSPLsManager.- 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.
-
-