com.inline.feature.common
Class AbstractFeatureConstructor

java.lang.Object
  |
  +--com.inline.feature.ui.AbstractDisplayable
        |
        +--com.inline.feature.common.AbstractFeatureConstructor
Direct Known Subclasses:
RandomFieldConstructor, SimpleFeatureConstructor

public abstract class AbstractFeatureConstructor
extends AbstractDisplayable
implements FeatureConstructor

Recommended superclass for FeatureConstructors.


Fields inherited from class com.inline.feature.ui.AbstractDisplayable
displayProperties, featureModel
 
Fields inherited from interface com.inline.feature.FeatureConstructor
DISPLAY_TYPE_PREFIX
 
Constructor Summary
AbstractFeatureConstructor(Feature parent, java.lang.String featureType)
           
 
Method Summary
 Feature constructAndInsert()
          Constructs and inserts a feature at once.
 java.lang.String getDisplayType()
          Returns "constructor." + featureType + '.' + getName()
 java.lang.String getFeatureType()
           
 java.lang.String getName()
          Returns null
 Feature getParentFeature()
           
 boolean isAddFeatureActionAllowed()
          Returns true.
 boolean isDefault()
          Calls FeatureModel.isDefaultFeatureConstructor().
 boolean isEnabled()
          Calls FeatureModel.isConstructorEnabled().
 java.lang.String toString()
           
 
Methods inherited from class com.inline.feature.ui.AbstractDisplayable
getDisplayProperties, getFeatureModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractFeatureConstructor

public AbstractFeatureConstructor(Feature parent,
                                  java.lang.String featureType)
Method Detail

getFeatureType

public java.lang.String getFeatureType()

getParentFeature

public Feature getParentFeature()

isDefault

public boolean isDefault()
Calls FeatureModel.isDefaultFeatureConstructor(). It is the feature model's responsibility to choose between multiple constructors that could all be the default one. Overriding implementations of this method must call super.isDefault() and return false if it returns false.
Specified by:
isDefault in interface FeatureConstructor
See Also:
FeatureModel.isDefaultFeatureConstructor(Feature,String,FeatureConstructor)

isEnabled

public boolean isEnabled()
Calls FeatureModel.isConstructorEnabled(). Overriding implementations of this method must call super.isEnabled() and return false if it returns false.
Specified by:
isEnabled in interface FeatureConstructor
See Also:
FeatureModel.isDefaultFeatureConstructor(Feature,String,FeatureConstructor)

isAddFeatureActionAllowed

public boolean isAddFeatureActionAllowed()
Returns true.
Specified by:
isAddFeatureActionAllowed in interface FeatureConstructor

getDisplayType

public java.lang.String getDisplayType()
Returns "constructor." + featureType + '.' + getName()
Overrides:
getDisplayType in class AbstractDisplayable

getName

public java.lang.String getName()
Returns null
Specified by:
getName in interface FeatureConstructor

constructAndInsert

public Feature constructAndInsert()
                           throws InvalidFeatureException
Constructs and inserts a feature at once. It is implemented like this:
  Feature feature = construct();
  insert(feature);
  return feature;
  
Specified by:
constructAndInsert in interface FeatureConstructor

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object