org.eclipse.wst.common.frameworks.datamodel
Interface IDataModelProvider

All Superinterfaces:
IDataModelProperties
All Known Implementing Classes:
AbstractDataModelProvider

public interface IDataModelProvider
extends IDataModelProperties

IDataModelProviders are used by the DataMdoelFactory to construct IDataModels.

This interface is not intended to be implemented by clients. Clients should subclass AbstractDataModelProvider.

Since:
1.0

Field Summary
static IStatus OK_STATUS
           
 
Fields inherited from interface org.eclipse.wst.common.frameworks.datamodel.IDataModelProperties
ALLOW_EXTENSIONS, RESTRICT_EXTENSIONS
 
Method Summary
 void dispose()
           
 IDataModel getDataModel()
           Returns the backing IDataModel for this provider.
 IDataModelOperation getDefaultOperation()
           
 java.lang.Object getDefaultProperty(java.lang.String propertyName)
           This is where the provider should define how default properties should be computed.
 java.util.List getExtendedContext()
           
 java.lang.String getID()
           
 DataModelPropertyDescriptor getPropertyDescriptor(java.lang.String propertyName)
           
 java.util.Set getPropertyNames()
           Returns a list of property names for which this provider is responsible.
 DataModelPropertyDescriptor[] getValidPropertyDescriptors(java.lang.String propertyName)
           
 void init()
           Providers should perform additional initialization here.
 boolean isPropertyEnabled(java.lang.String propertyName)
           This is where the provider should define how property enablements are computed.
 boolean propertySet(java.lang.String propertyName, java.lang.Object propertyValue)
           This is a special callback hook for the IDataModel provider to be notified of a setProperty() call invoked on the backing IDataModel.
 void setDataModel(IDataModel dataModel)
           
 IStatus validate(java.lang.String name)
          IDataModelProviders should perform property validation here.
 

Field Detail

OK_STATUS

public static final IStatus OK_STATUS
Method Detail

setDataModel

public void setDataModel(IDataModel dataModel)

getDataModel

public IDataModel getDataModel()

Returns the backing IDataModel for this provider.

Returns:
the backing IDataModel

getPropertyNames

public java.util.Set getPropertyNames()

Returns a list of property names for which this provider is responsible. This method is called only once during initialization.

Returns:
the array of valid property names.

init

public void init()

Providers should perform additional initialization here.


getDefaultProperty

public java.lang.Object getDefaultProperty(java.lang.String propertyName)

This is where the provider should define how default properties should be computed.

Parameters:
propertyName - the specified property
Returns:
the default property value

isPropertyEnabled

public boolean isPropertyEnabled(java.lang.String propertyName)

This is where the provider should define how property enablements are computed.

Parameters:
propertyName - the specified property
Returns:
true if the property is enabled, false otherwise.

validate

public IStatus validate(java.lang.String name)
IDataModelProviders should perform property validation here. All calls to IDataModel.validateProperty(String) are routed to the appropriate IDatModelProvider. When IDataModel.validate() or IDataModel.validate(boolean) are called to validate the entire IDataModel, any nested model names are also passed through to the IDataModelProvider for a chance to validate the nested IDataModel in an appropriate manner.

Parameters:
name -
Returns:
an IStatus

propertySet

public boolean propertySet(java.lang.String propertyName,
                           java.lang.Object propertyValue)

This is a special callback hook for the IDataModel provider to be notified of a setProperty() call invoked on the backing IDataModel. This method is called after the actual value has been stored by the IDataModel but before any general notifications are fired to its listeners. Thus this IDataModelProvider may react to updates apropriately by setting other properties, notifying default changes, notifying valid value changes, etc.

Parameters:
propertyName -
propertyValue -
Returns:
true to fire a VALUE_CHG DataModelEvent.

getPropertyDescriptor

public DataModelPropertyDescriptor getPropertyDescriptor(java.lang.String propertyName)

getValidPropertyDescriptors

public DataModelPropertyDescriptor[] getValidPropertyDescriptors(java.lang.String propertyName)

getExtendedContext

public java.util.List getExtendedContext()

getDefaultOperation

public IDataModelOperation getDefaultOperation()

getID

public java.lang.String getID()

dispose

public void dispose()