com.ibm.ftt.properties.local
Class LocalPropertyGroupManager

java.lang.Object
  extended by com.ibm.ftt.properties.util.AbstractPropertyGroupManager
      extended by com.ibm.ftt.properties.impl.InternalAbstractPropertyGroupManager
          extended by com.ibm.ftt.properties.local.InternalLocalPropertyGroupManager
              extended by com.ibm.ftt.properties.local.LocalPropertyGroupManager
All Implemented Interfaces:
IPropertyGroupManager, EventListener, org.eclipse.core.resources.IResourceChangeListener

public class LocalPropertyGroupManager
extends com.ibm.ftt.properties.local.InternalLocalPropertyGroupManager
implements IPropertyGroupManager, org.eclipse.core.resources.IResourceChangeListener

This property group manager provides access to a single property group container for the property groups that can be associated with local COBOL and PL/I projects and the resources in them.

This property group manager can also be used to set and get property groups for Eclipse IResources in local COBOL and PL/I projects, as well as set and get overrides.


Field Summary
static String COPY_RIGHT
           
static String LOCAL_NATURE_ID
           
static String OFFLINE_NATURE_ID
           
 
Method Summary
 void deleteOverriddenPropertiesInCategory(org.eclipse.core.resources.IResource resource, ICategory category)
          Delete the overrides for properties belonging to the given category for the given resource.
 void deleteOverride(org.eclipse.core.resources.IResource resource, IProperty property)
          Deletes the override for the given property for the given resource.
 IPropertyGroup getCurrentPropertyGroup(org.eclipse.core.resources.IResource resource)
          Gets the current property group for the given resource.
 IPropertyGroup getCurrentPropertyGroup(org.eclipse.core.resources.IResource resource, boolean searchParents)
          Return the current property group for this resource or a parent resource.
static LocalPropertyGroupManager getLocalPropertyGroupManager()
          Returns the singleton instance of the LocalPropertyGroupManager.
 List<IProperty> getOverriddenProperties(org.eclipse.core.resources.IResource resource)
          Return all of the overridden properties for the given resource.
 List<IPropertyGroupContainer> getPropertyGroupContainers()
          There will always be exactly one property group container for this property group manager.
static boolean isLegalResource(org.eclipse.core.resources.IResource resource)
          Returns true if the given resource is in a local COBOL or PL/I project; otherwise, this method returns false.
 void setCurrentPropertyGroup(org.eclipse.core.resources.IResource resource, IPropertyGroup group)
          Set the current property group for the given resource.
 void setOverride(org.eclipse.core.resources.IResource resource, IProperty property, String newValue)
          Sets the override for the given property for the given resource.
 
Methods inherited from interface com.ibm.ftt.properties.IPropertyGroupManager
deregister, getCategories, register
 

Field Detail

COPY_RIGHT

public static final String COPY_RIGHT
See Also:
Constant Field Values

LOCAL_NATURE_ID

public static final String LOCAL_NATURE_ID
See Also:
Constant Field Values

OFFLINE_NATURE_ID

public static final String OFFLINE_NATURE_ID
See Also:
Constant Field Values
Method Detail

getLocalPropertyGroupManager

public static LocalPropertyGroupManager getLocalPropertyGroupManager()
Returns the singleton instance of the LocalPropertyGroupManager.

Returns:
The LocalPropertyGroupManager.

getPropertyGroupContainers

public List<IPropertyGroupContainer> getPropertyGroupContainers()
There will always be exactly one property group container for this property group manager. The property groups for local COBOL and PL/I projects will be in it.

Specified by:
getPropertyGroupContainers in interface IPropertyGroupManager
Specified by:
getPropertyGroupContainers in class AbstractPropertyGroupManager
Returns:
The list of property group containers for the property group manager; this is an unmodifiable list.

isLegalResource

public static boolean isLegalResource(org.eclipse.core.resources.IResource resource)
Returns true if the given resource is in a local COBOL or PL/I project; otherwise, this method returns false.

Parameters:
resource - The resource to test
Returns:

setCurrentPropertyGroup

public void setCurrentPropertyGroup(org.eclipse.core.resources.IResource resource,
                                    IPropertyGroup group)
                             throws IllegalResourceException
Set the current property group for the given resource. If the group is null, there will be no current property group for the resource.

Parameters:
resource - An IResource in a local COBOL or PL/I project.
group - The current property group
Throws:
IllegalResourceException - If the IResource is not in a local COBOL or PL/I project.

getCurrentPropertyGroup

public IPropertyGroup getCurrentPropertyGroup(org.eclipse.core.resources.IResource resource)
                                       throws IllegalResourceException
Gets the current property group for the given resource.

Parameters:
resource - An IResource in a local COBOL or PL/I project.
Returns:
The current property group for this resource. It may be null.
Throws:
IllegalResourceException - If the IResource is not in a local COBOL or PL/I project.

setOverride

public void setOverride(org.eclipse.core.resources.IResource resource,
                        IProperty property,
                        String newValue)
                 throws IllegalPropertyException,
                        IllegalResourceException
Sets the override for the given property for the given resource.

Parameters:
resource - An IResource in a local COBOL or PL/I project.
property - The property to override
newValue - The overridden value
Throws:
IllegalPropertyException - If the resource does not have a current property group that has this property in one of its category instances.
IllegalResourceException - If the IResource is not in a local COBOL or PL/I project.

deleteOverride

public void deleteOverride(org.eclipse.core.resources.IResource resource,
                           IProperty property)
                    throws NoOverrideException,
                           IllegalResourceException
Deletes the override for the given property for the given resource.

Parameters:
resource - An IResource in a local COBOL or PL/I project.
property - The property that has an override to delete.
Throws:
NoOverrideException - If there is no override for the given property.
IllegalResourceException - If the IResource is not in a local COBOL or PL/I project.

getOverriddenProperties

public List<IProperty> getOverriddenProperties(org.eclipse.core.resources.IResource resource)
                                        throws IllegalResourceException
Return all of the overridden properties for the given resource.

Parameters:
resource - An IResource in a local COBOL or PL/I project.
Returns:
The list of overridden properties.
Throws:
IllegalResourceException - If the IResource is not in a local COBOL or PL/I project.

deleteOverriddenPropertiesInCategory

public void deleteOverriddenPropertiesInCategory(org.eclipse.core.resources.IResource resource,
                                                 ICategory category)
                                          throws NoOverrideException,
                                                 IllegalResourceException
Delete the overrides for properties belonging to the given category for the given resource.

Parameters:
resource - An IResource in a local COBOL or PL/I project.
category - A registered category.
Throws:
NoOverrideException - If there are no overrides for properties in the given category.
IllegalResourceException - If the IResource is not in a local COBOL or PL/I project.

getCurrentPropertyGroup

public IPropertyGroup getCurrentPropertyGroup(org.eclipse.core.resources.IResource resource,
                                              boolean searchParents)
                                       throws IllegalResourceException
Return the current property group for this resource or a parent resource.

Parameters:
resource - An IResource in a local COBOL or PL/I project.
searchParents - If true, parent resources are searched until a current property group is found. If false, only the given resource is checked.
Returns:
Throws:
IllegalResourceException - If the given IResource is not in a local COBOL or PL/I project.