org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider Maven / Gradle / Ivy
/*******************************************************************************
* Copyright (c) 2003, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.wst.common.frameworks.datamodel;
import java.util.List;
import java.util.Set;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
/**
* IDataModelProviders are used by the DataMdoelFactory to construct IDataModels.
*
*
* This interface is not intended to be implemented by clients. Clients should subclass
* {@link AbstractDataModelProvider}.
*
*
* @since 1.0
*/
public interface IDataModelProvider extends IDataModelProperties {
public static IStatus OK_STATUS = new Status(IStatus.OK, "org.eclipse.wst.common.frameworks.internal", 0, "OK", null); //$NON-NLS-1$ //$NON-NLS-2$
public void setDataModel(IDataModel dataModel);
/**
*
* Returns the backing IDataModel for this provider.
*
*
* @return the backing IDataModel
*/
public IDataModel getDataModel();
/**
*
* Returns a list of property names for which this provider is responsible. This method is
* called only once during initialization.
*
*
* @return the array of valid property names.
*/
public Set getPropertyNames();
/**
*
* Providers should perform additional initialization here.
*
*/
public void init();
/**
*
* This is where the provider should define how default properties should be computed.
*
*
* @param propertyName
* the specified property
* @return the default property value
*/
public Object getDefaultProperty(String propertyName);
/**
*
* This is where the provider should define how property enablements are computed.
*
*
* @param propertyName
* the specified property
* @return true
if the property is enabled, false
otherwise.
*/
public boolean isPropertyEnabled(String propertyName);
/**
* 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.
*
* @param name
* @return an IStatus
*/
public IStatus validate(String name);
/**
*
* 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.
*
*
* @param propertyName
* @param propertyValue
* @return true
to fire a VALUE_CHG DataModelEvent.
*/
public boolean propertySet(String propertyName, Object propertyValue);
public DataModelPropertyDescriptor getPropertyDescriptor(String propertyName);
public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName);
public List getExtendedContext();
public IDataModelOperation getDefaultOperation();
public String getID();
public void dispose();
}