|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Feature is the key interface in the InLine tool architecture; a feature is a node in a hierarchicaly organized feature model. A lot of methods declared by this interface are implemented by the class AbstractFeature. It is recommended, but not required, that you inherit all feature classes from that class.
The tree of features is rooted in the FeatureModel. Call featureModel.getRootFeature() to obtain the root of the tree. Then invoke feature.getChildren().getFeatureSet() recursively to traverse the tree.
Each feature has a unique identifier withing the model - its URL. Given a URL FeatureModel can find any feature.
Each feature represents some data in persistent resources it represents. For example, a JavaFieldFeature may represent a field declaration in a Java source file. The features representing those persistent resources are allocated lazily during the model parse process. When you traverse the tree or access features' properties the parsing occurs automatically behind the scenes. If any of the underlying resources change, that triggers invalidation of the model, which in turn restarts the parse process.
Features are capable of modifying underlying resources to reflect changes made
their properties and to the feature tree structure. Individual changes made to the
feature model do not automatically cause changes in the resources. To trigger that
process call commit()
on the model. Do not call commit()
on individual features. That method will be called during the model commit process.
It only represents one phase of the overall model commit process.
You can add and remove features. There are two situations when features are added to the model:
commit
on the
feature model.
There are two situations when features are removed from the model:
release
on the feature.
markForDeletion
on the feature itself, followed by commit()
on the feature model.
FeatureModel
,
FeatureSet
,
FeatureConstructor
,
AbstractFeature
Method Summary | |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Registration for property change events. |
boolean |
canChange(java.lang.String property)
Returns true if the specified property is changeable. |
boolean |
canDelete()
Returns true if the feature can be removed. |
void |
commit()
Applies changes made to the feature's properties to the appropriate resources. |
com.sun.java.util.collections.Set |
getActions()
Returns a list of FeatureAction objects that can be applied to this feature. |
FeatureSet |
getChildren()
Get all the subfeatures for this feature. |
FeatureModel |
getFeatureModel()
Returns the feature model that owns this feature |
com.sun.java.util.collections.List |
getMessages(java.lang.String messageType)
Returns a list of FeatureMessage 's of the specified type. |
Feature |
getParent()
Get the parent for this feature. |
java.lang.String |
getSignature()
Signature uniquely identifies a feature within the scope of the feature type within the feature model. |
java.lang.String |
getType()
Returns the feature type. |
java.net.URL |
getURL()
Returns a unique URL for the feature. |
void |
invalidate()
Undo all changes made to the feature and restart the parsing process. |
boolean |
isMarkedForDeletion()
Returns true if the feature has been marked for deletion. |
boolean |
isNew()
Returns true if the feature is new and has not been committed yet. |
void |
markForDeletion()
Marks the feature for deletion. |
void |
release()
This method is called when the feature is removed from the feature tree. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
|
Methods inherited from interface com.inline.feature.ui.Displayable |
getDisplayProperties,
getDisplayType |
Method Detail |
public FeatureModel getFeatureModel()
public java.net.URL getURL()
feature:type:signature
public java.lang.String getType()
The recommended type declaration syntax is:
class MyFeature ... { public static final String TYPE = "foo-bar-myfeature"; public String getType() { return TYPE; } ... }
public java.lang.String getSignature()
Signature can not change during the lifetime of a feature. If it is required to change a feature's signature, that feature should be removed and a new feature with the changed signature created
public com.sun.java.util.collections.Set getActions()
FeatureAction
objects that can be applied to this feature.
Some of them may be disabled.FeatureAction
public Feature getParent()
public FeatureSet getChildren()
public boolean canChange(java.lang.String property)
public boolean isNew()
public boolean canDelete()
public void markForDeletion()
public boolean isMarkedForDeletion()
public void commit() throws InvalidFeatureException
Do not call this directly. Call feature.getFeatureModel().commit()
instead.
public com.sun.java.util.collections.List getMessages(java.lang.String messageType)
FeatureMessage
's of the specified type. A typical
kind of feature message is ConstraintViolation.FeatureMessage
public void release()
release
message to the child feature set.public void invalidate()
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |