|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.inline.feature.common.AbstractFeatureModel
Recommended superclass for FeatureModels. In cooperation with FeatureService, this class uses all kinds of factories (FeatureFactories, FeatureActionFactories, FeatureConstructorFactories, FeatureConfigurationFactories, DisplayPropertyFactories) to manage a self-assembling hierarchy of Features.
Fields inherited from interface com.inline.feature.FeatureModel |
DISPLAY_MODE,
STANDARD_DISPLAY_MODE,
TYPE |
Constructor Summary | |
AbstractFeatureModel(com.inline.resources.ResourceRepository repository)
|
Method Summary | |
protected void |
addFeatureActionFactory(FeatureActionFactory factory,
java.lang.String featureType)
Called during model initialization for each available FeatureActionFactory that will supply FeatureActions for the features of the specified feature type. |
protected void |
addFeatureConstructorFactory(FeatureConstructorFactory factory,
java.lang.String parentType,
java.lang.String childType)
Called during model initialization for each available FeatureConstructorFactory that will supply feature constructors of the specified child type for the features of the specified parent type. |
protected void |
addFeatureFactory(FeatureFactory factory,
java.lang.String parentType,
java.lang.String childType)
Called during model initialization for each available feature factory that will supply feature sets of the specified child type for the features of the specified parent type. |
protected void |
appendVerboseDescription(java.lang.StringBuffer buffer,
Feature feature,
int indent)
|
void |
commit()
Saves changes made to the model in the persistent resources. |
void |
featureChanged(Feature feature,
java.lang.String property,
java.lang.Object oldValue,
java.lang.Object newValue)
Called by all features when they are modified. |
void |
featureDeleted(Feature feature)
Called by all features when they are deleted. |
void |
featureInserted(Feature feature)
Called by all FeatureSets when they are inserted into the model. |
com.sun.java.util.collections.Set |
getAdditionalActions(Feature parent)
Returns a set of FeatureActions provided by FeatureActionFactories for the supplied feature. |
com.sun.java.util.collections.Set |
getAdditionalFeatureConstructors(Feature parent,
java.lang.String childType)
Returns a set of FeatureConstructors for the supplied parent and child type. |
FeatureSet |
getChildFeatureSet(Feature parent)
Allocates and configures an AggregateFeatureSet composed of individual FeatureSets produced by all participating FeatureFactories. |
protected DisplayPropertyFactory |
getDefaultDisplayPropertyFactory()
Override to provide a default display property factory. |
DisplayProperties |
getDisplayProperties(Displayable object)
Invokes getDisplayProperties(object) on the appropriate
DisplayPropertyFactory. |
protected FeatureService |
getFeatureService()
|
ResourceAdapter |
getResourceAdapter(com.inline.resources.ResourceReference reference)
Resource adaptor will do a lot of resource management: create resources, post events when the resources change, maintain timestamps etc. |
com.inline.resources.ResourceRepository |
getResourceRepository()
Returns the resource repository this FeatureModel is associated with. |
ResourceSetAdapter |
getResourceSetAdapter(java.lang.String type,
com.inline.resources.ResourceQualifier qualifier)
Will post events when a resource of the corresponding type satisfying the qualifier is created/removed. |
boolean |
isDefaultFeatureConstructor(Feature parent,
java.lang.String childType,
FeatureConstructor constructor)
The model can select the default feature constructor. |
boolean |
isFeatureActionEnabled(Feature feature,
FeatureAction action)
The model can veto child allocation by a factory. |
boolean |
isFeatureActionFactoryEnabled(Feature feature,
FeatureActionFactory factory)
The model can veto feature action allocation by a factory. |
boolean |
isFeatureConstructorEnabled(Feature parent,
java.lang.String childType,
FeatureConstructor constructor)
The model can disable a FeatureConstructor. |
boolean |
isFeatureConstructorFactoryEnabled(Feature parent,
java.lang.String childType,
FeatureConstructorFactory factory)
The model can veto feature constructor allocation by a factory. |
boolean |
isFeatureFactoryEnabled(Feature parent,
java.lang.String type,
FeatureFactory factory)
The model can veto child recognition by a factory |
boolean |
isFeatureRecognitionEnabled(Feature parent,
java.net.URL url,
FeatureFactory factory)
The model can veto child allocation by a factory. |
void |
reparse()
Initiates the resource parsing process. |
void |
resourceModified(ResourceAdapter adapter)
Called by all feature during the commit process. |
java.lang.String |
toString()
|
java.lang.String |
toStringVerbose()
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public AbstractFeatureModel(com.inline.resources.ResourceRepository repository)
Method Detail |
protected FeatureService getFeatureService()
public com.inline.resources.ResourceRepository getResourceRepository()
public FeatureSet getChildFeatureSet(Feature parent)
AggregateFeatureSet
,
FeatureFactory
,
FeatureService.getFeatureFactories()
protected void addFeatureFactory(FeatureFactory factory, java.lang.String parentType, java.lang.String childType)
public DisplayProperties getDisplayProperties(Displayable object)
getDisplayProperties(object)
on the appropriate
DisplayPropertyFactory.DisplayPropertyFactory
protected DisplayPropertyFactory getDefaultDisplayPropertyFactory()
The default implementation returns null.
public com.sun.java.util.collections.Set getAdditionalFeatureConstructors(Feature parent, java.lang.String childType)
FeatureSet.getFeatureConstructors(type)
instead.FeatureConstructor
,
FeatureConstructorFactory
,
AbstractFeatureSet.getFeatureConstructors(String)
protected void addFeatureConstructorFactory(FeatureConstructorFactory factory, java.lang.String parentType, java.lang.String childType)
public com.sun.java.util.collections.Set getAdditionalActions(Feature parent)
Feature.getActions()
instead.FeatureAction
,
FeatureActionFactory
,
AbstractFeature.getActions()
protected void addFeatureActionFactory(FeatureActionFactory factory, java.lang.String featureType)
public boolean isFeatureFactoryEnabled(Feature parent, java.lang.String type, FeatureFactory factory)
public boolean isFeatureRecognitionEnabled(Feature parent, java.net.URL url, FeatureFactory factory)
public boolean isFeatureActionFactoryEnabled(Feature feature, FeatureActionFactory factory)
public boolean isFeatureActionEnabled(Feature feature, FeatureAction action)
public boolean isFeatureConstructorFactoryEnabled(Feature parent, java.lang.String childType, FeatureConstructorFactory factory)
public boolean isFeatureConstructorEnabled(Feature parent, java.lang.String childType, FeatureConstructor constructor)
public boolean isDefaultFeatureConstructor(Feature parent, java.lang.String childType, FeatureConstructor constructor)
public ResourceAdapter getResourceAdapter(com.inline.resources.ResourceReference reference)
public ResourceSetAdapter getResourceSetAdapter(java.lang.String type, com.inline.resources.ResourceQualifier qualifier)
public void reparse()
reparse()
on all registered ResourceAdapters and ResourceSetAdapters.
Those adapters can then post resourceChange events to their listeners, which may
initiate the resource parsing by those listeners.public void commit() throws InvalidFeatureException
Feature.commit()
on all modified features.
That method will call resourceModified()
on the model. The second
phase of the commit process is to call commit(SHALLOW_COMMIT)
on
all modified resources. Finally, commit invokes reparse()
on itself.public void featureChanged(Feature feature, java.lang.String property, java.lang.Object oldValue, java.lang.Object newValue)
AbstractFeature.firePropertyChange()
public void featureInserted(Feature feature)
AbstractTypedFeatureSet.insert()
public void featureDeleted(Feature feature)
AbstractFeature.markForDeletion()
public void resourceModified(ResourceAdapter adapter)
AbstractFeature.commit()
public java.lang.String toStringVerbose()
protected void appendVerboseDescription(java.lang.StringBuffer buffer, Feature feature, int indent)
public java.lang.String toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |