RSE
Release 1.0

org.eclipse.rse.filters
Class SystemFilterPool

java.lang.Object
  extended byorg.eclipse.rse.core.model.PropertySetContainer
      extended byorg.eclipse.rse.core.model.RSEModelObject
          extended byorg.eclipse.rse.internal.references.SystemReferencedObject
              extended byorg.eclipse.rse.internal.references.SystemPersistableReferencedObject
                  extended byorg.eclipse.rse.filters.SystemFilterPool
All Implemented Interfaces:
IAdaptable, IPropertySetContainer, IRSEBasePersistableReferencedObject, IRSEBaseReferencedObject, IRSEModelObject, org.eclipse.rse.core.persistance.IRSEPersistableContainer, IRSEPersistableReferencedObject, IRSEReferencedObject, ISystemFilterConstants, ISystemFilterContainer, ISystemFilterPool, ISystemFilterSavePolicies

public class SystemFilterPool
extends org.eclipse.rse.internal.references.SystemPersistableReferencedObject
implements ISystemFilterPool, ISystemFilterSavePolicies, ISystemFilterConstants, ISystemFilterContainer, IAdaptable


Field Summary
protected  boolean default_
           
protected static boolean DEFAULT_EDEFAULT
          The default value of the 'Default' attribute
protected  boolean deletable
           
protected static boolean DELETABLE_EDEFAULT
          The default value of the 'Deletable' attribute
protected static String DELIMITER
           
protected  List filters
           
protected static String NAME_EDEFAULT
          The default value of the 'Name' attribute
protected static boolean NON_RENAMABLE_EDEFAULT
          The default value of the 'Non Renamable' attribute
protected  boolean nonRenamable
          The cached value of the 'Non Renamable' attribute
protected static String OWNING_PARENT_NAME_EDEFAULT
          The default value of the 'Owning Parent Name' attribute
protected  String owningParentName
          The cached value of the 'Owning Parent Name' attribute
protected  int release
           
protected static int RELEASE_EDEFAULT
          The default value of the 'Release' attribute
protected static boolean SINGLE_FILTER_STRING_ONLY_EDEFAULT
          The default value of the 'Single Filter String Only' attribute
protected  boolean singleFilterStringOnly
          The cached value of the 'Single Filter String Only' attribute
protected  boolean singleFilterStringOnlyESet
          This is true if the Single Filter String Only attribute has been set
protected  boolean specialCaseNoDataRestored
           
protected static boolean STRINGS_CASE_SENSITIVE_EDEFAULT
          The default value of the 'Strings Case Sensitive' attribute
protected  boolean stringsCaseSensitive
           
protected  boolean stringsCaseSensitiveESet
          This is true if the Strings Case Sensitive attribute has been set
protected static boolean SUPPORTS_DUPLICATE_FILTER_STRINGS_EDEFAULT
          The default value of the 'Supports Duplicate Filter Strings' attribute
protected static boolean SUPPORTS_NESTED_FILTERS_EDEFAULT
          The default value of the 'Supports Nested Filters' attribute
protected  boolean supportsDuplicateFilterStrings
           
protected  boolean supportsNestedFilters
           
protected  String type
           
protected static String TYPE_EDEFAULT
          The default value of the 'Type' attribute
 
Fields inherited from class org.eclipse.rse.internal.references.SystemReferencedObject
helper
 
Fields inherited from class org.eclipse.rse.core.model.RSEModelObject
_isDirty, _wasRestored
 
Fields inherited from interface org.eclipse.rse.core.filters.ISystemFilterSavePolicies
SAVE_POLICY_NONE, SAVE_POLICY_ONE_FILE_PER_FILTER, SAVE_POLICY_ONE_FILE_PER_MANAGER, SAVE_POLICY_ONE_FILE_PER_POOL_SAME_FOLDER, SAVE_POLICY_ONE_FILEANDFOLDER_PER_POOL
 
Fields inherited from interface org.eclipse.rse.core.filters.ISystemFilterConstants
DEFAULT_TYPE, SAVEFILE_SUFFIX, TRY_TO_RESTORE_NO, TRY_TO_RESTORE_YES
 
Constructor Summary
protected SystemFilterPool()
          Default constructor
 
Method Summary
 boolean addSystemFilter(ISystemFilter filter)
          Adds given filter to the list.
 boolean areStringsCaseSensitive()
          Same as isStringsCaseSensitive()
 ISystemFilter cloneSystemFilter(ISystemFilter filter, String aliasName)
          Duplicates a given filter in the list.
 void cloneSystemFilterPool(ISystemFilterPool targetPool)
          Clone this filter pools' attributes and filters into another filter pool.
 boolean commit()
          Request a persistence manager to persist this object.
 ISystemFilter copySystemFilter(ISystemFilterPool targetPool, ISystemFilter oldFilter, String newName)
          Copy a system filter to this or another filter pool.
protected static SystemFilterPool createPool()
           
 ISystemFilter createSystemFilter(String aliasName, Vector filterStrings)
          Creates a new system filter within this pool.
 ISystemFilterPool createSystemFilterPool(String name, boolean allowNestedFilters, boolean isDeletable, boolean tryToRestore)
          Static factory method for creating a new filter pool.
protected static Vector deduceFilterNames(IFolder folder, IRSEFilterNamingPolicy namingPolicy)
          Private helper method to deduce filter names from disk files.
 void deleteSystemFilter(ISystemFilter filter)
          Removes a given filter from the list.
 Object getAdapter(Class adapterType)
          This is the method required by the IAdaptable interface.
static SystemFilterPool getDefault()
           
 String getDescription()
           
 List getFilters()
           
 String getId()
           
 String getName()
           
 IRSEFilterNamingPolicy getNamingPolicy()
          Get the naming policy currently used when saving data to disk.
 String getOwningParentName()
           
 ISystemFilterPoolManagerProvider getProvider()
          Return the caller which instantiated the filter pool manager overseeing this filter framework instance
 String getReferenceName()
          Return the unique reference name of this object.
 int getRelease()
           
protected static String getRootSaveFileName(IRSEFilterNamingPolicy namingPolicy, String poolName)
          Return the root save file name without the extension .xmi
protected static String getRootSaveFileName(ISystemFilterPool pool)
          Return the root save file name without the extension .xmi
protected static String getRootSaveFileName(ISystemFilterPool pool, String newName)
          Return the root save file name without the extension .xmi
 ISystemFilter getSystemFilter(String aliasName)
          Return a filter object, given its aliasname.
 int getSystemFilterCount()
          Return how many filters are defined in this filter container
 Vector getSystemFilterNames()
          Return Vector of String objects: the names of existing filters in this container.
 ISystemFilterPool getSystemFilterPool()
          From SystemFilterContainer.
 Object getSystemFilterPoolData()
          Return transient data set via setFilterPoolData.
 ISystemFilterPoolManager getSystemFilterPoolManager()
          Return the filter pool manager managing this collection of filter pools and their filters.
 int getSystemFilterPosition(ISystemFilter filter)
          Return a given filter's zero-based location
 ISystemFilter[] getSystemFilters()
          Return filters in this pool, as an array.
 Vector getSystemFiltersVector()
          Return the nested filters as a Vector
 String getType()
          Returns the type attribute.
 String getTypeGen()
           
protected  void initialize(String name, boolean allowNestedFilters, boolean isDeletable)
           
protected  void initialize(String name, int savePolicy, IRSEFilterNamingPolicy namingPolicy)
           
protected  void initializeFilterStrings()
          Internal use method
protected  List internalGetFilters()
           
 boolean isDefault()
           
 boolean isDeletable()
           
 boolean isNonRenamable()
           
 boolean isSetSingleFilterStringOnly()
           
 boolean isSetStringsCaseSensitive()
           
 boolean isSingleFilterStringOnly()
          Returns true if this filter is limited to a single filter string.
 boolean isSingleFilterStringOnlyGen()
           
 boolean isStringsCaseSensitive()
           
 boolean isSupportsDuplicateFilterStrings()
           
 boolean isSupportsNestedFilters()
           
 void moveSystemFilter(int pos, ISystemFilter filter)
          Move a given filter to a given zero-based location
 void orderSystemFilters(String[] names)
          Order filters according to user preferences.
 void renameSystemFilter(ISystemFilter filter, String newName)
          Rename a given filter in the list.
protected static ISystemFilterPool restore(String name, int savePolicy, IRSEFilterNamingPolicy namingPolicy)
          Restore specific filter pool.
 void setDefault(boolean newDefault)
           
 void setDeletable(boolean newDeletable)
           
 void setName(String name)
          Set the name of this filter pool.
 void setNamingPolicy(IRSEFilterNamingPolicy namingPolicy)
          Set the naming policy used when saving data to disk.
 void setNonRenamable(boolean newNonRenamable)
           
 void setOwningParentName(String newOwningParentName)
           
 void setRelease(int newRelease)
           
 void setSavePolicy(int policy)
          Set the save file policy.
 void setSingleFilterStringOnly(boolean newSingleFilterStringOnly)
           
 void setStringsCaseSensitive(boolean supports)
          Set whether filters in this pool support case-sensitive filter strings.
 void setStringsCaseSensitiveGen(boolean newStringsCaseSensitive)
           
 void setSupportsDuplicateFilterStrings(boolean supports)
          Set whether filters in this pool support duplicate filter strings.
 void setSupportsDuplicateFilterStringsGen(boolean newSupportsDuplicateFilterStrings)
           
 void setSupportsNestedFilters(boolean supports)
          Set whether filters in this pool support nested filters.
 void setSupportsNestedFiltersGen(boolean newSupportsNestedFilters)
           
 void setSystemFilterPoolData(Object data)
          While setData is for global data to set in all objects in the filter framework, this is to set transient data that only the filter pool holds.
 void setSystemFilterPoolManager(ISystemFilterPoolManager mgr)
          Set the filter pool manager.
 void setType(String newType)
           
protected  void sortFilters()
          When saving one file per filter, we store the relative order of each filter within each filter.
 boolean supportsDuplicateFilterStrings()
          Does this support duplicate filter strings?
 boolean supportsNestedFilters()
          Does this support nested filters?
 String toString()
           
 void unsetSingleFilterStringOnly()
           
 void unsetStringsCaseSensitive()
           
 void updateSystemFilter(ISystemFilter filter, String newName, String[] newStrings)
          Updates a given filter in the list.
 
Methods inherited from class org.eclipse.rse.internal.references.SystemReferencedObject
addReference, getReferenceCount, getReferencingObjects, removeAllReferences, removeReference
 
Methods inherited from class org.eclipse.rse.core.model.RSEModelObject
compareStrings, isDirty, setDirty, setWasRestored, wasRestored
 
Methods inherited from class org.eclipse.rse.core.model.PropertySetContainer
addPropertySet, addPropertySets, createPropertySet, createPropertySet, getPropertySet, getPropertySets, removePropertySet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.rse.core.references.IRSEBaseReferencedObject
addReference, getReferenceCount, getReferencingObjects, removeAllReferences, removeReference
 
Methods inherited from interface org.eclipse.rse.core.persistance.IRSEPersistableContainer
isDirty, setDirty, setWasRestored, wasRestored
 
Methods inherited from interface org.eclipse.rse.core.model.IPropertySetContainer
addPropertySet, addPropertySets, createPropertySet, createPropertySet, getPropertySet, getPropertySets, removePropertySet
 

Field Detail

NAME_EDEFAULT

protected static final String NAME_EDEFAULT
The default value of the 'Name' attribute.

See Also:
getName()

TYPE_EDEFAULT

protected static final String TYPE_EDEFAULT
The default value of the 'Type' attribute.

See Also:
getType()

specialCaseNoDataRestored

protected boolean specialCaseNoDataRestored

DELIMITER

protected static final String DELIMITER
See Also:
Constant Field Values

type

protected String type

SUPPORTS_NESTED_FILTERS_EDEFAULT

protected static final boolean SUPPORTS_NESTED_FILTERS_EDEFAULT
The default value of the 'Supports Nested Filters' attribute.

See Also:
isSupportsNestedFilters(), Constant Field Values

supportsNestedFilters

protected boolean supportsNestedFilters

DELETABLE_EDEFAULT

protected static final boolean DELETABLE_EDEFAULT
The default value of the 'Deletable' attribute.

See Also:
isDeletable(), Constant Field Values

deletable

protected boolean deletable

DEFAULT_EDEFAULT

protected static final boolean DEFAULT_EDEFAULT
The default value of the 'Default' attribute.

See Also:
isDefault(), Constant Field Values

default_

protected boolean default_

STRINGS_CASE_SENSITIVE_EDEFAULT

protected static final boolean STRINGS_CASE_SENSITIVE_EDEFAULT
The default value of the 'Strings Case Sensitive' attribute.

See Also:
isStringsCaseSensitive(), Constant Field Values

stringsCaseSensitive

protected boolean stringsCaseSensitive

stringsCaseSensitiveESet

protected boolean stringsCaseSensitiveESet
This is true if the Strings Case Sensitive attribute has been set.


SUPPORTS_DUPLICATE_FILTER_STRINGS_EDEFAULT

protected static final boolean SUPPORTS_DUPLICATE_FILTER_STRINGS_EDEFAULT
The default value of the 'Supports Duplicate Filter Strings' attribute.

See Also:
isSupportsDuplicateFilterStrings(), Constant Field Values

supportsDuplicateFilterStrings

protected boolean supportsDuplicateFilterStrings

RELEASE_EDEFAULT

protected static final int RELEASE_EDEFAULT
The default value of the 'Release' attribute.

See Also:
getRelease(), Constant Field Values

release

protected int release

SINGLE_FILTER_STRING_ONLY_EDEFAULT

protected static final boolean SINGLE_FILTER_STRING_ONLY_EDEFAULT
The default value of the 'Single Filter String Only' attribute.

See Also:
isSingleFilterStringOnly(), Constant Field Values

singleFilterStringOnly

protected boolean singleFilterStringOnly
The cached value of the 'Single Filter String Only' attribute.

See Also:
isSingleFilterStringOnly()

singleFilterStringOnlyESet

protected boolean singleFilterStringOnlyESet
This is true if the Single Filter String Only attribute has been set.


OWNING_PARENT_NAME_EDEFAULT

protected static final String OWNING_PARENT_NAME_EDEFAULT
The default value of the 'Owning Parent Name' attribute.

See Also:
getOwningParentName()

owningParentName

protected String owningParentName
The cached value of the 'Owning Parent Name' attribute.

See Also:
getOwningParentName()

NON_RENAMABLE_EDEFAULT

protected static final boolean NON_RENAMABLE_EDEFAULT
The default value of the 'Non Renamable' attribute.

See Also:
isNonRenamable(), Constant Field Values

nonRenamable

protected boolean nonRenamable
The cached value of the 'Non Renamable' attribute.

See Also:
isNonRenamable()

filters

protected List filters
Constructor Detail

SystemFilterPool

protected SystemFilterPool()
Default constructor

Method Detail

getDefault

public static SystemFilterPool getDefault()

createSystemFilterPool

public ISystemFilterPool createSystemFilterPool(String name,
                                                boolean allowNestedFilters,
                                                boolean isDeletable,
                                                boolean tryToRestore)
Static factory method for creating a new filter pool. Will first try to restore it, and if that fails will create a new instance and return it.

Use this method only if you are not using a SystemFilterPoolManager, else use the createSystemFilterPool method in that class.

Specified by:
createSystemFilterPool in interface ISystemFilterPool
Parameters:
name - the name of the filter pool. Typically this is also the name of the given folder, but this is not required. For the save policy of one file per pool, the name of the file is derived from this.
allowNestedFilters - true if filters inside this filter pool are to allow nested filters.
isDeletable - true if this filter pool is allowed to be deleted by users.
tryToRestore - true to attempt a restore first, false if a pure create operation.

createPool

protected static SystemFilterPool createPool()

initialize

protected void initialize(String name,
                          boolean allowNestedFilters,
                          boolean isDeletable)

initialize

protected void initialize(String name,
                          int savePolicy,
                          IRSEFilterNamingPolicy namingPolicy)

internalGetFilters

protected List internalGetFilters()

getProvider

public ISystemFilterPoolManagerProvider getProvider()
Return the caller which instantiated the filter pool manager overseeing this filter framework instance

Specified by:
getProvider in interface ISystemFilterPool

setSavePolicy

public void setSavePolicy(int policy)
Set the save file policy. See constants in SystemFilterConstants. One of: This method is called by the SystemFilterPoolManager.

Specified by:
setSavePolicy in interface ISystemFilterPool

setNamingPolicy

public void setNamingPolicy(IRSEFilterNamingPolicy namingPolicy)
Set the naming policy used when saving data to disk.

Specified by:
setNamingPolicy in interface ISystemFilterPool
See Also:
IRSEFilterNamingPolicy

getNamingPolicy

public IRSEFilterNamingPolicy getNamingPolicy()
Get the naming policy currently used when saving data to disk.

Specified by:
getNamingPolicy in interface ISystemFilterPool
See Also:
IRSEFilterNamingPolicy

setSupportsNestedFilters

public void setSupportsNestedFilters(boolean supports)
Set whether filters in this pool support nested filters. Important to note this is stored in every filter as well as this filter pool.

Specified by:
setSupportsNestedFilters in interface ISystemFilterPool
Parameters:
supports - The new value of the SupportsNestedFilters attribute

setSupportsNestedFiltersGen

public void setSupportsNestedFiltersGen(boolean newSupportsNestedFilters)


setSupportsDuplicateFilterStrings

public void setSupportsDuplicateFilterStrings(boolean supports)
Set whether filters in this pool support duplicate filter strings. Important to note this is stored in every filter as well as this filter pool.

Specified by:
setSupportsDuplicateFilterStrings in interface ISystemFilterPool
Parameters:
supports - The new value of the SupportsDuplicateFilterStrings attribute

setSupportsDuplicateFilterStringsGen

public void setSupportsDuplicateFilterStringsGen(boolean newSupportsDuplicateFilterStrings)


setStringsCaseSensitive

public void setStringsCaseSensitive(boolean supports)
Set whether filters in this pool support case-sensitive filter strings. Important to note this is stored in every filter as well as this filter pool.

Specified by:
setStringsCaseSensitive in interface ISystemFilterPool
Parameters:
supports - The new value of the StringsCaseSensitive attribute

setStringsCaseSensitiveGen

public void setStringsCaseSensitiveGen(boolean newStringsCaseSensitive)


setSystemFilterPoolManager

public void setSystemFilterPoolManager(ISystemFilterPoolManager mgr)
Set the filter pool manager. Called by SystemFilterPoolManager

Specified by:
setSystemFilterPoolManager in interface ISystemFilterPool

getSystemFilterPoolManager

public ISystemFilterPoolManager getSystemFilterPoolManager()
Return the filter pool manager managing this collection of filter pools and their filters.

Specified by:
getSystemFilterPoolManager in interface ISystemFilterPool

setSystemFilterPoolData

public void setSystemFilterPoolData(Object data)
While setData is for global data to set in all objects in the filter framework, this is to set transient data that only the filter pool holds.

Specified by:
setSystemFilterPoolData in interface ISystemFilterPool

getSystemFilterPoolData

public Object getSystemFilterPoolData()
Return transient data set via setFilterPoolData.

Specified by:
getSystemFilterPoolData in interface ISystemFilterPool

getId

public String getId()
Specified by:
getId in interface ISystemFilterPool

getName

public String getName()
Specified by:
getName in interface ISystemFilterPool
Returns:
The value of the Name attribute
See Also:
ISystemFilterPool.getName()

getDescription

public String getDescription()
Specified by:
getDescription in interface IRSEModelObject
Overrides:
getDescription in class RSEModelObject

setName

public void setName(String name)
Set the name of this filter pool.

Specified by:
setName in interface ISystemFilterPool
Parameters:
name - The new value of the Name attribute

getType

public String getType()
Returns the type attribute. Intercepted to return SystemFilterConstants.DEFAULT_TYPE if it is currently null Allows tools to have typed filter pools

Specified by:
getType in interface ISystemFilterPool
Returns:
The value of the Type attribute Allows tools to have typed filter pools

getTypeGen

public String getTypeGen()

isDeletable

public boolean isDeletable()

Specified by:
isDeletable in interface ISystemFilterPool
Returns:
The value of the Deletable attribute

setDeletable

public void setDeletable(boolean newDeletable)

Specified by:
setDeletable in interface ISystemFilterPool
Parameters:
newDeletable - The new value of the Deletable attribute

isDefault

public boolean isDefault()

Specified by:
isDefault in interface ISystemFilterPool
Returns:
The value of the Default attribute Is this a default vendor-supplied pool versus user-created pool

setDefault

public void setDefault(boolean newDefault)

Specified by:
setDefault in interface ISystemFilterPool
Parameters:
newDefault - The new value of the Default attribute

supportsNestedFilters

public boolean supportsNestedFilters()
Does this support nested filters? Calls mof-generated isSupportsNestedFilters.

Specified by:
supportsNestedFilters in interface ISystemFilterPool

supportsDuplicateFilterStrings

public boolean supportsDuplicateFilterStrings()
Does this support duplicate filter strings? Calls mof-generated isSupportsDuplicateFilterStrings.

Specified by:
supportsDuplicateFilterStrings in interface ISystemFilterPool

isStringsCaseSensitive

public boolean isStringsCaseSensitive()
Specified by:
isStringsCaseSensitive in interface ISystemFilterPool
Returns:
The value of the StringsCaseSensitive attribute Are filter strings in this filter case sensitive? If not set locally, queries the parent filter pool manager's atttribute.

areStringsCaseSensitive

public boolean areStringsCaseSensitive()
Same as isStringsCaseSensitive()

Specified by:
areStringsCaseSensitive in interface ISystemFilterContainer
Returns:
The value of the StringsCaseSensitive attribute

cloneSystemFilterPool

public void cloneSystemFilterPool(ISystemFilterPool targetPool)
                           throws Exception
Clone this filter pools' attributes and filters into another filter pool. Assumes the core attributes were already set when filter pool was created: Attributes we clone:

Specified by:
cloneSystemFilterPool in interface ISystemFilterPool
Throws:
Exception

copySystemFilter

public ISystemFilter copySystemFilter(ISystemFilterPool targetPool,
                                      ISystemFilter oldFilter,
                                      String newName)
                               throws Exception
Copy a system filter to this or another filter pool.

Specified by:
copySystemFilter in interface ISystemFilterPool
Throws:
Exception

getSystemFilters

public ISystemFilter[] getSystemFilters()
Return filters in this pool, as an array.

Specified by:
getSystemFilters in interface ISystemFilterContainer

getSystemFilterPool

public ISystemFilterPool getSystemFilterPool()
From SystemFilterContainer. Returns "this".

Specified by:
getSystemFilterPool in interface ISystemFilterContainer

createSystemFilter

public ISystemFilter createSystemFilter(String aliasName,
                                        Vector filterStrings)
Creates a new system filter within this pool. This filter will inherit/store the following attributes from this pool:

Specified by:
createSystemFilter in interface ISystemFilterContainer
Parameters:
aliasName - The name to give the new filter. Must be unique for this pool.
filterStrings - The list of String objects that represent the filter strings.

getSystemFilterNames

public Vector getSystemFilterNames()
Return Vector of String objects: the names of existing filters in this container. Needed by name validators for New and Rename actions to verify new name is unique.

Specified by:
getSystemFilterNames in interface ISystemFilterContainer

getSystemFiltersVector

public Vector getSystemFiltersVector()
Return the nested filters as a Vector

Specified by:
getSystemFiltersVector in interface ISystemFilterContainer

getSystemFilterCount

public int getSystemFilterCount()
Return how many filters are defined in this filter container

Specified by:
getSystemFilterCount in interface ISystemFilterContainer

getSystemFilter

public ISystemFilter getSystemFilter(String aliasName)
Return a filter object, given its aliasname. Can be used to test if an aliasname is already used (non-null return).

Specified by:
getSystemFilter in interface ISystemFilterContainer
Parameters:
aliasName - unique aliasName (case insensitive) to search on.
Returns:
SystemFilter object with unique aliasName, or null if no filter object with this name exists.

addSystemFilter

public boolean addSystemFilter(ISystemFilter filter)
Adds given filter to the list.

PLEASE NOTE:

Specified by:
addSystemFilter in interface ISystemFilterContainer
Parameters:
filter - SystemFilter object to add
Returns:
true if added, false if filter with this aliasname already existed.

deleteSystemFilter

public void deleteSystemFilter(ISystemFilter filter)
Removes a given filter from the list.

Specified by:
deleteSystemFilter in interface ISystemFilterContainer
Parameters:
filter - SystemFilter object to remove

renameSystemFilter

public void renameSystemFilter(ISystemFilter filter,
                               String newName)
Rename a given filter in the list.

Specified by:
renameSystemFilter in interface ISystemFilterContainer
Parameters:
filter - SystemFilter object to remove
newName - New name to assign it. Assumes unique checking already done.

updateSystemFilter

public void updateSystemFilter(ISystemFilter filter,
                               String newName,
                               String[] newStrings)
Updates a given filter in the list.

Specified by:
updateSystemFilter in interface ISystemFilterContainer
Parameters:
filter - SystemFilter object to update
newName - New name to assign it. Assumes unique checking already done.
newStrings - New strings to assign it. Replaces current strings.

cloneSystemFilter

public ISystemFilter cloneSystemFilter(ISystemFilter filter,
                                       String aliasName)
Duplicates a given filter in the list.

Parameters:
filter - SystemFilter object to clone

getSystemFilterPosition

public int getSystemFilterPosition(ISystemFilter filter)
Return a given filter's zero-based location

Specified by:
getSystemFilterPosition in interface ISystemFilterContainer

moveSystemFilter

public void moveSystemFilter(int pos,
                             ISystemFilter filter)
Move a given filter to a given zero-based location

Specified by:
moveSystemFilter in interface ISystemFilterContainer

getAdapter

public Object getAdapter(Class adapterType)
This is the method required by the IAdaptable interface. Given an adapter class type, return an object castable to the type, or null if this is not possible.

Specified by:
getAdapter in interface IAdaptable

deduceFilterNames

protected static Vector deduceFilterNames(IFolder folder,
                                          IRSEFilterNamingPolicy namingPolicy)
Private helper method to deduce filter names from disk files. Will populate and return a list. Only makes sense to use if the save policy is one file per filter.


orderSystemFilters

public void orderSystemFilters(String[] names)
Order filters according to user preferences.

While the framework has all the code necessary to arrange filters and save/restore that arrangement, you may choose to use preferences instead of this support. In this case, call this method and pass in the saved and sorted filter name list.

Called by someone after restore.

Specified by:
orderSystemFilters in interface ISystemFilterPool

restore

protected static ISystemFilterPool restore(String name,
                                           int savePolicy,
                                           IRSEFilterNamingPolicy namingPolicy)
                                    throws Exception
Restore specific filter pool. You should not call this directly, as it is possible that certain data is not restored if the save policy is one file per filter. Rather, you should call the createSystemFilterPoolMethod.

Parameters:
name - name of pool to restore. Used to deduce file name for save policy of one file per pool.
savePolicy - policy used to save the pool. One of the following from SystemFilterPoolManager:
  • SAVE_POLICY_ONE_FILEANDFOLDER_PER_POOL - one file and folder per pool
  • SAVE_POLICY_ONE_FILE_PER_POOL_SAME_FOLDER - one file per pool, all files in one folder
  • SAVE_POLICY_ONE_FILE_PER_FILTER - one file per filter, one folder per pool
namingPolicy - The names to use for file and folders when persisting to disk. Pass null to just use the defaults.
Returns:
SystemFilterPool object if restored ok, null if error encountered. If null, call getLastException().
Throws:
Exception
See Also:
ISystemFilterConstants

initializeFilterStrings

protected void initializeFilterStrings()
Internal use method


sortFilters

protected void sortFilters()
When saving one file per filter, we store the relative order of each filter within each filter. After restoring, the filters are ordered by their file system existence, and so we must now re-order the internal list according to the relative order given in each filter


getRootSaveFileName

protected static String getRootSaveFileName(ISystemFilterPool pool)
Return the root save file name without the extension .xmi


getRootSaveFileName

protected static String getRootSaveFileName(ISystemFilterPool pool,
                                            String newName)
Return the root save file name without the extension .xmi


getRootSaveFileName

protected static String getRootSaveFileName(IRSEFilterNamingPolicy namingPolicy,
                                            String poolName)
Return the root save file name without the extension .xmi


getReferenceName

public String getReferenceName()
Return the unique reference name of this object.

As required by the IRSEPersistableReferencedObject interface.

Specified by:
getReferenceName in interface IRSEBasePersistableReferencedObject

toString

public String toString()

setType

public void setType(String newType)
Specified by:
setType in interface ISystemFilterPool
Parameters:
newType - The new value of the Type attribute

isSupportsNestedFilters

public boolean isSupportsNestedFilters()
Specified by:
isSupportsNestedFilters in interface ISystemFilterPool
Returns:
The value of the SupportsNestedFilters attribute

unsetStringsCaseSensitive

public void unsetStringsCaseSensitive()
Specified by:
unsetStringsCaseSensitive in interface ISystemFilterPool

isSetStringsCaseSensitive

public boolean isSetStringsCaseSensitive()
Specified by:
isSetStringsCaseSensitive in interface ISystemFilterPool
Returns:
true if the StringsCaseSensitive attribute has been set

getFilters

public List getFilters()
Specified by:
getFilters in interface ISystemFilterPool
Returns:
The list of Filters references

isSupportsDuplicateFilterStrings

public boolean isSupportsDuplicateFilterStrings()
Specified by:
isSupportsDuplicateFilterStrings in interface ISystemFilterPool
Returns:
The value of the SupportsDuplicateFilterStrings attribute

getRelease

public int getRelease()
Specified by:
getRelease in interface ISystemFilterPool
Returns:
The value of the Release attribute In what release was this created? Typically, will be the version and release times 10, as in 40 or 51.

setRelease

public void setRelease(int newRelease)
Specified by:
setRelease in interface ISystemFilterPool
Parameters:
newRelease - The new value of the Release attribute

isSingleFilterStringOnly

public boolean isSingleFilterStringOnly()
Returns true if this filter is limited to a single filter string. If not set here, it is queried from the parent manager.

Specified by:
isSingleFilterStringOnly in interface ISystemFilterPool
Returns:
the value of the 'Single Filter String Only' attribute.
See Also:
ISystemFilterPool.isSetSingleFilterStringOnly(), ISystemFilterPool.unsetSingleFilterStringOnly(), ISystemFilterPool.setSingleFilterStringOnly(boolean), org.eclipse.rse.filters.FiltersPackage#getSystemFilterPool_SingleFilterStringOnly()

isSingleFilterStringOnlyGen

public boolean isSingleFilterStringOnlyGen()


setSingleFilterStringOnly

public void setSingleFilterStringOnly(boolean newSingleFilterStringOnly)

Specified by:
setSingleFilterStringOnly in interface ISystemFilterPool
Parameters:
newSingleFilterStringOnly - the new value of the 'Single Filter String Only' attribute.
See Also:
ISystemFilterPool.isSetSingleFilterStringOnly(), ISystemFilterPool.unsetSingleFilterStringOnly(), ISystemFilterPool.isSingleFilterStringOnly()

unsetSingleFilterStringOnly

public void unsetSingleFilterStringOnly()

Specified by:
unsetSingleFilterStringOnly in interface ISystemFilterPool
See Also:
ISystemFilterPool.isSetSingleFilterStringOnly(), ISystemFilterPool.isSingleFilterStringOnly(), ISystemFilterPool.setSingleFilterStringOnly(boolean)

isSetSingleFilterStringOnly

public boolean isSetSingleFilterStringOnly()

Specified by:
isSetSingleFilterStringOnly in interface ISystemFilterPool
Returns:
whether the value of the 'Single Filter String Only' attribute is set.
See Also:
ISystemFilterPool.unsetSingleFilterStringOnly(), ISystemFilterPool.isSingleFilterStringOnly(), ISystemFilterPool.setSingleFilterStringOnly(boolean)

getOwningParentName

public String getOwningParentName()

Specified by:
getOwningParentName in interface ISystemFilterPool
Returns:
the value of the 'Owning Parent Name' attribute.
See Also:
ISystemFilterPool.setOwningParentName(String), org.eclipse.rse.filters.FiltersPackage#getSystemFilterPool_OwningParentName()

setOwningParentName

public void setOwningParentName(String newOwningParentName)

Specified by:
setOwningParentName in interface ISystemFilterPool
Parameters:
newOwningParentName - the new value of the 'Owning Parent Name' attribute.
See Also:
ISystemFilterPool.getOwningParentName()

isNonRenamable

public boolean isNonRenamable()

Specified by:
isNonRenamable in interface ISystemFilterPool
Returns:
the value of the 'Non Renamable' attribute.
See Also:
ISystemFilterPool.setNonRenamable(boolean), org.eclipse.rse.filters.FiltersPackage#getSystemFilterPool_NonRenamable()

setNonRenamable

public void setNonRenamable(boolean newNonRenamable)

Specified by:
setNonRenamable in interface ISystemFilterPool
Parameters:
newNonRenamable - the new value of the 'Non Renamable' attribute.
See Also:
ISystemFilterPool.isNonRenamable()

commit

public boolean commit()
Description copied from interface: org.eclipse.rse.core.persistance.IRSEPersistableContainer
Request a persistence manager to persist this object.

Specified by:
commit in interface org.eclipse.rse.core.persistance.IRSEPersistableContainer
Returns:
true if the object was persisted.

RSE
Release 1.0

Copyright (c) IBM Corporation and others 2000, 2006. All Rights Reserved.