org.eclipse.rse.core.filters
Class SystemFilterReference
java.lang.Object
org.eclipse.rse.core.model.RSEPersistableObject
org.eclipse.rse.core.model.PropertySetContainer
org.eclipse.rse.core.model.RSEModelObject
org.eclipse.rse.core.references.SystemReferencingObject
org.eclipse.rse.core.filters.SystemFilterReference
-
All Implemented Interfaces:
-
IAdaptable,
ISystemFilterContainerReference,
ISystemFilterReference,
IPropertySetContainer,
IRSEModelObject,
IRSEPersistableContainer,
ISystemContainer,
IRSEBaseReferencingObject,
IRSEReferencingObject
-
public class SystemFilterReference
- extends
SystemReferencingObject
- implements
IAdaptable,
ISystemFilterReference
Represents a shadow or reference to a system filter.
Such references are only transient, not savable to disk.
All major function is inherited.
SystemFilter references typically exist for only one reason:
- As a simple shadow to enable a unique object in a GUI tree. For example,
if it is possible for the same filter to show up in different places in
the tree, then we must create shadows for each place it shows up.
persistent
protected boolean persistent
isStale
protected boolean isStale
_subSystem
protected
ISubSystem _subSystem
cachedContents
protected
HashMap cachedContents
PERSISTENT_YES
public static final boolean PERSISTENT_YES
-
See Also:
-
Constant Field Values
PERSISTENT_NO
public static final boolean PERSISTENT_NO
-
See Also:
-
Constant Field Values
SystemFilterReference
protected SystemFilterReference()
- Constructor.
createSystemFilterReference
public static
ISystemFilterReference createSystemFilterReference(
ISubSystem subSystem,
ISystemFilterContainerReference parent,
ISystemFilter filter,
boolean persistent)
- Create a new instance of this class.
-
-
-
Parameters:
-
parent
- The SystemFilterReference or SystemFilterPoolReference object that we are a child of. -
filter
- The master object to be referenced. -
persistent
- Whether we should formally register our reference with the target filter or not.
getSubSystem
public
ISubSystem getSubSystem()
- Gets the subsystem that contains this reference
-
-
Specified by:
-
getSubSystem
in interface
ISystemFilterReference
-
-
Returns:
- the subsystem
setSubSystem
public void setSubSystem(
ISubSystem subSystem)
- Sets the subsystem that contains this reference
-
-
Specified by:
-
setSubSystem
in interface
ISystemFilterReference
-
-
Parameters:
-
subSystem
- the subsystem that holds this reference
getFilterPoolReferenceManager
public
ISystemFilterPoolReferenceManager getFilterPoolReferenceManager()
- Return the reference manager which is managing this filter reference
framework object.
-
-
Specified by:
-
getFilterPoolReferenceManager
in interface
ISystemFilterReference
-
getProvider
public
ISystemFilterPoolReferenceManagerProvider getProvider()
- Return the object which instantiated the pool reference manager object.
Makes it easy to get back to the point of origin, given any filter reference
framework object
-
-
Specified by:
-
getProvider
in interface
ISystemFilterReference
-
setParent
public void setParent(
ISystemFilterContainerReference parent)
- If this is a reference to a nested filter, the parent is the
reference to the nested filter's parent. Else, it is the
reference to the parent filter pool
-
-
getParent
public
ISystemFilterContainerReference getParent()
- The parent will either by a SystemFilterPoolReference or
a SystemFilterReference.
-
-
Specified by:
-
getParent
in interface
ISystemFilterReference
-
getReferencedFilter
public
ISystemFilter getReferencedFilter()
- Return the filter to which we reference...
-
-
Specified by:
-
getReferencedFilter
in interface
ISystemFilterReference
-
setReferencedFilter
public void setReferencedFilter(
ISystemFilter filter)
- Set the filter to which we reference...
-
-
Specified by:
-
setReferencedFilter
in interface
ISystemFilterReference
-
getParentSystemFilterReferencePool
public
ISystemFilterPoolReference getParentSystemFilterReferencePool()
- If this is a reference to a nested filter, the parent is the
reference to the nested filter's parent. Else, it is the
reference to the parent filter pool
-
-
Specified by:
-
getParentSystemFilterReferencePool
in interface
ISystemFilterReference
-
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
-
getReferencedSystemFilterContainer
public
ISystemFilterContainer getReferencedSystemFilterContainer()
- Return the object to which we hold a reference. This is either
SystemFilter or SystemFilterPool. Since both implement
SystemFilterContainer, that is what we return.
Of course, this is a generic method, and in our case it is always
true that we only hold a SystemFilter. Hence, this is the same
as calling getReferenceFilter and casting the result.
-
-
Specified by:
-
getReferencedSystemFilterContainer
in interface
ISystemFilterContainerReference
-
-
Returns:
- the filter container object which is referenced.
getSystemFilterReferences
public
ISystemFilterReference[] getSystemFilterReferences(
ISubSystem subSystem)
- Build and return an array of SystemFilterReference objects.
Each object is created new. There is one for each of the filters
in the reference SystemFilter or SystemFilterPool.
For performance reasons, we will cache this array and only
return a fresh one if something changes in the underlying
filter list.
-
-
Specified by:
-
getSystemFilterReferences
in interface
ISystemFilterContainerReference
-
-
Parameters:
-
subSystem
- the subsystem from which to get the filter references.
getSystemFilterReference
public
ISystemFilterReference getSystemFilterReference(
ISubSystem subSystem,
ISystemFilter filter)
- Create a single filter refererence to a given filter.
If there already is a reference to this filter, it is returned.
If not, a new reference is created and appended to the end of the existing filter reference array.
-
-
Specified by:
-
getSystemFilterReference
in interface
ISystemFilterContainerReference
-
-
Parameters:
-
subSystem
- the subsystem in which to find or create the filter. -
filter
- the filter to for which to create a reference. -
See Also:
-
getExistingSystemFilterReference(ISubSystem, ISystemFilter)
getExistingSystemFilterReference
public
ISystemFilterReference getExistingSystemFilterReference(
ISubSystem subSystem,
ISystemFilter filter)
- Return an existing reference to a given system filter.
If no reference currently exists to this filter, returns null.
-
-
Specified by:
-
getExistingSystemFilterReference
in interface
ISystemFilterContainerReference
-
-
Parameters:
-
subSystem
- the subsystem in which to look for the filter reference. -
filter
- the filter for which to look.
-
Returns:
- an existing reference to a given system filter.
If no reference currently exists to this filter, returns null.
-
See Also:
-
getSystemFilterReference(ISubSystem, ISystemFilter)
hasFilters
public boolean hasFilters()
- Return true if the referenced pool or filter has filters.
-
-
Specified by:
-
hasFilters
in interface
ISystemFilterContainerReference
-
-
Returns:
- true if this container has filters.
getFilterCount
public int getFilterCount()
- Return count of the number of filters in the referenced pool or filter
-
-
Specified by:
-
getFilterCount
in interface
ISystemFilterContainerReference
-
-
Returns:
- the number of filters in the referenced container
getName
public
String getName()
- Return the name of the SystemFilter or SystemFilterPool that we reference.
For such objects this is what we show in the GUI.
-
-
Specified by:
-
getName
in interface
ISystemFilterContainerReference
-
Specified by:
-
getName
in interface
IRSEModelObject
-
-
Returns:
- the name of the SystemFilter or SystemFilterPool that we reference.
toString
public
String toString()
- Override of Object method. Turn this filter in an outputable string
-
-
Overrides:
-
toString
in class
Object
-
getSystemFilterStringCount
public int getSystemFilterStringCount()
- Return the number of filter strings in the referenced filter
-
-
Specified by:
-
getSystemFilterStringCount
in interface
ISystemFilterReference
-
getSystemFilterStringReferences
public
ISystemFilterStringReference[] getSystemFilterStringReferences()
- Get the filter strings contained by this filter. But get references to each,
not the masters.
-
-
Specified by:
-
getSystemFilterStringReferences
in interface
ISystemFilterReference
-
getSystemFilterStringReference
public
ISystemFilterStringReference getSystemFilterStringReference(
ISystemFilterString filterString)
- Create a single filter string refererence to a given filter string
-
-
Specified by:
-
getSystemFilterStringReference
in interface
ISystemFilterReference
-
setReferencedObject
public void setReferencedObject(
IRSEBaseReferencedObject obj)
- Set the object to which we reference. Override of inherited
-
-
Specified by:
-
setReferencedObject
in interface
IRSEBaseReferencingObject
-
Overrides:
-
setReferencedObject
in class
SystemReferencingObject
-
-
Parameters:
-
obj
- the object to reference
getReferencedObject
public
IRSEBaseReferencedObject getReferencedObject()
- Get the object which we reference. Override of inherited
-
-
Specified by:
-
getReferencedObject
in interface
IRSEBaseReferencingObject
-
Overrides:
-
getReferencedObject
in class
SystemReferencingObject
-
-
Returns:
- the object which we reference
removeReference
public int removeReference()
- Fastpath to getReferencedObject().removeReference(this).
-
-
Specified by:
-
removeReference
in interface
IRSEBaseReferencingObject
-
Overrides:
-
removeReference
in class
SystemReferencingObject
-
-
Returns:
- new reference count of master object
hasContents
public boolean hasContents(
ISystemContentsType contentsType)
-
Description copied from interface:
ISystemContainer
- Returns whether the object has contents of a particular type.
-
-
Specified by:
-
hasContents
in interface
ISystemContainer
-
-
Parameters:
-
contentsType
- type of contents
-
Returns:
-
true
if the object has contents, false
otherwise.
getContents
public
Object[] getContents(
ISystemContentsType contentsType)
-
Description copied from interface:
ISystemContainer
- Returns all the contents of the object (combining results of all filters
-
-
Specified by:
-
getContents
in interface
ISystemContainer
-
-
Parameters:
-
contentsType
- type of contents
-
Returns:
- an array of contents.
setContents
public void setContents(
ISystemContentsType type,
Object[] cachedContents)
-
-
Specified by:
-
setContents
in interface
ISystemFilterReference
-
isStale
public boolean isStale()
-
Description copied from interface:
ISystemContainer
- Indicates whether the cached object is stale
-
-
Specified by:
-
isStale
in interface
ISystemContainer
-
-
Returns:
- whether the container is stale
markStale
public void markStale(boolean isStale)
-
Description copied from interface:
ISystemContainer
- Marks the object as stale or not
-
-
Specified by:
-
markStale
in interface
ISystemContainer
-
-
Parameters:
-
isStale
- whether the object is to be marked stale or not
markStale
public void markStale(boolean isStale,
boolean clearCache)
-
Description copied from interface:
ISystemContainer
- Marks the object as stale or not
-
-
Specified by:
-
markStale
in interface
ISystemContainer
-
-
Parameters:
-
isStale
- whether the object is to be marked stale or not -
clearCache
- indicates whether or not to clear the cache
commit
public boolean commit()
-
Description copied from interface:
IRSEPersistableContainer
- Request a persistence manager to persist this object.
-
-
Specified by:
-
commit
in interface
IRSEPersistableContainer
-
-
Returns:
- true if the object was persisted.
getPersistableParent
public
IRSEPersistableContainer getPersistableParent()
-
Description copied from interface:
IRSEPersistableContainer
- Retrieve the parent of this object in the persistence containment hierarchy.
This is related to, but not necessarily the same as, the model hierarchy.
-
-
Specified by:
-
getPersistableParent
in interface
IRSEPersistableContainer
-
-
Returns:
- the parent persistent object. This is null if there is no parent.
getPersistableChildren
public
IRSEPersistableContainer[] getPersistableChildren()
-
Description copied from interface:
IRSEPersistableContainer
- Retrieves the children of this object in the persistence containment hierarchy.
This is related to, but not necessarily the same as, the model hierarchy.
-
-
Specified by:
-
getPersistableChildren
in interface
IRSEPersistableContainer
-
-
Returns:
- the array of persistent children in the order they are to be stored in the
persistent form. This is an empty array if there are no children.
See
IRSEPersistableContainer.NO_CHILDREN
.
Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.