com.inline.feature.common
Class AbstractFeatureSet

java.lang.Object
  |
  +--com.inline.feature.common.AbstractResourceListener
        |
        +--com.inline.feature.common.AbstractFeatureSet
Direct Known Subclasses:
AbstractTypedFeatureSet, AggregateFeatureSet

public abstract class AbstractFeatureSet
extends AbstractResourceListener
implements FeatureSet

A superclass of FeatureSets; the recommended superclass of typed FeatureSets is AbstractTypedFeatureSet.

See Also:
AbstractTypedFeatureSet

Fields inherited from class com.inline.feature.common.AbstractResourceListener
active, featureModel, parent, resourceAdapters, resourceSetAdapters, revalidate
 
Constructor Summary
AbstractFeatureSet(Feature parent)
           
 
Method Summary
 void addFeatureSetListener(FeatureSetListener listener)
          Registers the listener and calls activate() if this is the first listener.
protected  void fireFeatureAdded(Feature feature)
           
protected  void fireFeatureRemoved(Feature feature)
           
protected  void fireFeatureReplaced(Feature oldFeature, Feature newFeature)
           
 FeatureConstructor getDefaultFeatureConstructor(java.lang.String type)
          Returns the constructor of the specified type that returns true to both isEnabled() and isDefault().
 FeatureConstructor getFeatureConstructor(java.lang.String type, java.lang.String name)
          Returns the FeatureConstructor for the specified type and name.
 com.sun.java.util.collections.Set getFeatureConstructors(java.lang.String type)
          Retutns a list of feature constructors combined of results of getPrimitiveFeatureConstructors() and FeatureModel.getAdditionalFeatureConstructors().
protected abstract  com.sun.java.util.collections.Set getPrimitiveFeatureConstructors(java.lang.String type)
          Returns a set of basic feature constructors which can be used to build features of the specified type.
 void removeFeatureSetListener(FeatureSetListener listener)
          Unregisters the listener and calls passivate() if this was the last listener.
 boolean shouldCheckHasChildren()
          Override this method to return false.
 
Methods inherited from class com.inline.feature.common.AbstractResourceListener
activate, getFeatureModel, getParent, invalidate, passivate, propertyChange, registerDependencies, registerResourceAdapter, registerResourceAdapter, registerResourceSetAdapter, registerResourceSetAdapter, release, resourceAdded, resourceChanged, resourceRemoved, unregisterResourceAdapter, unregisterResourceSetAdapter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractFeatureSet

public AbstractFeatureSet(Feature parent)
Method Detail

shouldCheckHasChildren

public boolean shouldCheckHasChildren()
Override this method to return false. If you do that, the child feature set will always claim that this feature has children, even if there are really none. The visible effect of this is that the node in the tree will always appear to be expandable. The user may need to click on the handle to make it disappear.

addFeatureSetListener

public void addFeatureSetListener(FeatureSetListener listener)
Registers the listener and calls activate() if this is the first listener.
Specified by:
addFeatureSetListener in interface FeatureSet
See Also:
AbstractResourceListener.activate()

removeFeatureSetListener

public void removeFeatureSetListener(FeatureSetListener listener)
Unregisters the listener and calls passivate() if this was the last listener.
Specified by:
removeFeatureSetListener in interface FeatureSet
See Also:
AbstractResourceListener.passivate()

getFeatureConstructors

public com.sun.java.util.collections.Set getFeatureConstructors(java.lang.String type)
Retutns a list of feature constructors combined of results of getPrimitiveFeatureConstructors() and FeatureModel.getAdditionalFeatureConstructors().
Specified by:
getFeatureConstructors in interface FeatureSet
See Also:
getPrimitiveFeatureConstructors(String)

getFeatureConstructor

public FeatureConstructor getFeatureConstructor(java.lang.String type,
                                                java.lang.String name)
Returns the FeatureConstructor for the specified type and name. The default implementation maintains a cache of constructors by type and name.
Specified by:
getFeatureConstructor in interface FeatureSet

getDefaultFeatureConstructor

public FeatureConstructor getDefaultFeatureConstructor(java.lang.String type)
Returns the constructor of the specified type that returns true to both isEnabled() and isDefault().
Specified by:
getDefaultFeatureConstructor in interface FeatureSet

getPrimitiveFeatureConstructors

protected abstract com.sun.java.util.collections.Set getPrimitiveFeatureConstructors(java.lang.String type)
Returns a set of basic feature constructors which can be used to build features of the specified type. Other, non-primitive, constructors will have to be coded in terms of other constructors, they cannot produce features directly. The non-primitive constructors are produced by FeatureConstructorFactories.

fireFeatureAdded

protected void fireFeatureAdded(Feature feature)

fireFeatureRemoved

protected void fireFeatureRemoved(Feature feature)

fireFeatureReplaced

protected void fireFeatureReplaced(Feature oldFeature,
                                   Feature newFeature)