be.ac.vub.cocompose.eclipse.model.datatypes
Class ModelElementsPropertySource

java.lang.Object
  extended bybe.ac.vub.cocompose.eclipse.model.datatypes.ModelElementsPropertySource
All Implemented Interfaces:
IPropertySource
Direct Known Subclasses:
ConstrainedElementsPropertySource, InheritsFromPropertySource, ModelElementPropertySource, PartOfPropertySource, SuperimposesOnPropertySource

public abstract class ModelElementsPropertySource
extends Object
implements IPropertySource

Eclipse property source for multiple ModelElements.

Since:
0.2.10
Version:
0.2.10, 10/05/2004
Author:
Dennis Wagelaar

Constructor Summary
ModelElementsPropertySource(ModelElement subject, List values, Class elementClass)
          Creates a PartOfPropertySource.
ModelElementsPropertySource(ModelElement subject, List values, Namespace namespace, Class elementClass)
          Creates a PartOfPropertySource.
 
Method Summary
protected  void addElement(int index, ModelElement element)
          Responsible for adding an element to the property.
protected  IPropertyDescriptor[] createDescriptorsArray(Collection desc)
          Creates the property descriptors array from a Collection.
protected  List createPropertyDescriptors()
          Creates the property descriptors list
protected  String[] createStringArray(Collection coll)
          Creates a string array from a Collection.
 Object getEditableValue()
           
protected  String getFullName(ModelElement element)
          Returns the full model-wide unique name of the given element
protected  be.ac.vub.cocompose.log.Log getLog()
          Gets the logging object.
protected  List getPossibleValues()
          Gets the possible values for this property.
 IPropertyDescriptor[] getPropertyDescriptors()
           
 Object getPropertyValue(Object id)
           
protected  be.ac.vub.cocompose.CoCompose getSettings()
          Gets the settings object.
protected  List getValues()
          Gets the values for this property.
protected  List getValueStrings()
          Gets the possible value strings for this property.
 boolean isPropertySet(Object id)
           
protected  void removeElement(ModelElement element)
          Responsible for removing an element from the property.
 void resetPropertyValue(Object id)
           
 void setPropertyValue(Object id, Object value)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ModelElementsPropertySource

public ModelElementsPropertySource(ModelElement subject,
                                   List values,
                                   Namespace namespace,
                                   Class elementClass)
Creates a PartOfPropertySource.

Parameters:
subject - the subject for which to set the property.
values - the current values of the property.
namespace - the Namespace in which to look for the property.
elementClass - the class of the possible value elements.

ModelElementsPropertySource

public ModelElementsPropertySource(ModelElement subject,
                                   List values,
                                   Class elementClass)
Creates a PartOfPropertySource. Looks in all models that are currently loaded in CoCompose.

Parameters:
subject - the subject for which to set the property.
values - the current values of the property.
elementClass - the class of the possible value elements.
Method Detail

getEditableValue

public Object getEditableValue()
Specified by:
getEditableValue in interface IPropertySource
See Also:
IPropertySource.getEditableValue()

getPropertyDescriptors

public IPropertyDescriptor[] getPropertyDescriptors()
Specified by:
getPropertyDescriptors in interface IPropertySource
See Also:
IPropertySource.getPropertyDescriptors()

getPropertyValue

public Object getPropertyValue(Object id)
Specified by:
getPropertyValue in interface IPropertySource
See Also:
IPropertySource.getPropertyValue(java.lang.Object)

isPropertySet

public boolean isPropertySet(Object id)
Specified by:
isPropertySet in interface IPropertySource
See Also:
IPropertySource.isPropertySet(java.lang.Object)

resetPropertyValue

public void resetPropertyValue(Object id)
Specified by:
resetPropertyValue in interface IPropertySource
See Also:
IPropertySource.resetPropertyValue(java.lang.Object)

setPropertyValue

public void setPropertyValue(Object id,
                             Object value)
Specified by:
setPropertyValue in interface IPropertySource
See Also:
IPropertySource.setPropertyValue(java.lang.Object, java.lang.Object)

toString

public String toString()
See Also:
Object.toString()

removeElement

protected void removeElement(ModelElement element)
Responsible for removing an element from the property. Currently only updates the dependencies on the shared models defined in CoCompose.

Parameters:
element - the element to remove.

addElement

protected void addElement(int index,
                          ModelElement element)
Responsible for adding an element to the property. Currently only updates the dependencies on the shared models defined in CoCompose.

Parameters:
index - the index where to add or -1 to append.
element - the element to add.

getFullName

protected String getFullName(ModelElement element)
Returns the full model-wide unique name of the given element

Parameters:
element - the element to return the name for
Returns:
the full element name

getSettings

protected be.ac.vub.cocompose.CoCompose getSettings()
Gets the settings object.

Returns:
the settings object.

getLog

protected be.ac.vub.cocompose.log.Log getLog()
Gets the logging object.

Returns:
the logging object.

getValueStrings

protected List getValueStrings()
Gets the possible value strings for this property.

Returns:
the possible value strings for this property.

getPossibleValues

protected List getPossibleValues()
Gets the possible values for this property.

Returns:
the possible values for this property.

getValues

protected List getValues()
Gets the values for this property.

Returns:
the values for this property.

createPropertyDescriptors

protected List createPropertyDescriptors()
Creates the property descriptors list

Returns:
the property descriptors list

createDescriptorsArray

protected IPropertyDescriptor[] createDescriptorsArray(Collection desc)
Creates the property descriptors array from a Collection.

Parameters:
desc - - the descriptors collection.
Returns:
the property descriptors array.

createStringArray

protected String[] createStringArray(Collection coll)
Creates a string array from a Collection.

Parameters:
coll - - the collection.
Returns:
the string array.