com.togethersoft.openapi.ide.inspector
Class IdeInspectorPropertySetComponent

java.lang.Object
  |
  +--java.beans.FeatureDescriptor
        |
        +--com.togethersoft.openapi.ide.inspector.IdeInspectorComponent
              |
              +--com.togethersoft.openapi.ide.inspector.IdeInspectorPropertySetComponent

public class IdeInspectorPropertySetComponent
extends IdeInspectorComponent
implements PropertyChangeListener

Represents inspector component that keeps a list of properties. This components handles the properties same way as IdeInspector handles the components.

Author:
TogetherSoft

Field Summary
 protected VectormyConditions
           
 protected IdeContextmyContext
           
 protected doublemyMaxWeight
           
 protected VectormyProperties
           
 protected VectormyVisibleProperties
           
 protected VectormyWeights
           
 final static StringPROP_VISIBLE_PROPERTIES
           

Constructor Summary
IdeInspectorPropertySetComponent(IdeContext context)
           Creates new component keeps properties inside an inspector for specified context.

Method Summary
 voidaddProperty(IdeInspectorProperty property, Condition condition)
           Adds new property to this component and sets weight for it to 1 more then maximum weight.
 voidaddProperty(IdeInspectorProperty property, Condition condition, double weight)
           Adds new property with specified visibility condition and weight.
 voidaddPropertyChangeListener(PropertyChangeListener listener)
           Adds new listener of property change event.
 IdeInspectorPropertyfindProperty(String name)
           Search for the property specified by it's name.
 protected voidfirePropertyChange(String propertyName, Object oldValue, Object newValue)
           Initiates change of specified porperty.
 ConditiongetCondition(IdeInspectorProperty property)
           Returns visibility condition for specified property.
 IdeInspectorProperty[]getProperties()
           Returns all properties.
 IdeInspectorProperty[]getVisibleProperties()
           Returns all visible properties.
 doublegetWeight(IdeInspectorProperty property)
           Returns weight for specified property.
 voidpropertyChange(PropertyChangeEvent e)
           
 voidremoveProperty(IdeInspectorProperty property)
           Removes specified property, it's visibility condition and weight.
 voidremovePropertyChangeListener(PropertyChangeListener listener)
           Removes listener of property change event.
 voidupdate()
           Rebuildes list of visible properties, weights of them and fires change of PROP_VISIBLE_PROPERTIES property.

Methods inherited from class com.togethersoft.openapi.ide.inspector.IdeInspectorComponent
getService, setService

Methods inherited from class java.beans.FeatureDescriptor
getName, setName, getDisplayName, setDisplayName, isExpert, setExpert, isHidden, setHidden, isPreferred, setPreferred, getShortDescription, setShortDescription, setValue, getValue, attributeNames

Methods inherited from class java.lang.Object
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize

Field Detail

myConditions

protected Vector myConditions
associates
clientCardinality 1..*

myContext

protected IdeContext myContext

myMaxWeight

protected double myMaxWeight

myProperties

protected Vector myProperties
associates
clientCardinality 1..*
label getComponents()
link aggregation

myVisibleProperties

protected Vector myVisibleProperties
associates
label getProperties()
clientCardinality 1..*

myWeights

protected Vector myWeights

PROP_VISIBLE_PROPERTIES

public final static String PROP_VISIBLE_PROPERTIES
Constructor Detail

IdeInspectorPropertySetComponent

public IdeInspectorPropertySetComponent(IdeContext context)
Creates new component keeps properties inside an inspector for specified context.
Method Detail

addProperty

public void addProperty(IdeInspectorProperty property, Condition condition)
Adds new property to this component and sets weight for it to 1 more then maximum weight.
Parameters:
property - Property to be added.
condition - Visibility condition for this property.

addProperty

public void addProperty(IdeInspectorProperty property, Condition condition, double weight)
Adds new property with specified visibility condition and weight.
Parameters:
property - Property to be added.
condition - Visibility condition.
weight - Specifies weight for this property to insert it between existing.

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Adds new listener of property change event.

findProperty

public IdeInspectorProperty findProperty(String name)
Search for the property specified by it's name.
Parameters:
name - Name of property as a String.
Returns: IdeInspectorProperty if found, null otherwise.

firePropertyChange

protected void firePropertyChange(String propertyName, Object oldValue, Object newValue)
Initiates change of specified porperty.

getCondition

public Condition getCondition(IdeInspectorProperty property)
Returns visibility condition for specified property.

getProperties

public IdeInspectorProperty[] getProperties()
Returns all properties.
Returns: Array of all properties.

getVisibleProperties

public IdeInspectorProperty[] getVisibleProperties()
Returns all visible properties.
Returns: Array of visible properties.

getWeight

public double getWeight(IdeInspectorProperty property)
Returns weight for specified property.
Returns: double weight for specified property.

propertyChange

public void propertyChange(PropertyChangeEvent e)

removeProperty

public void removeProperty(IdeInspectorProperty property)
Removes specified property, it's visibility condition and weight. If this property had maximum weight than recalculates maximum weight.
Parameters:
property - Property to be removed.

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Removes listener of property change event.

update

public void update()
Rebuildes list of visible properties, weights of them and fires change of PROP_VISIBLE_PROPERTIES property. Then updates all visible properties.

Association Links

to Class java.lang.String

to Class com.togethersoft.openapi.ide.IdeContext

to Class com.togethersoft.openapi.ide.inspector.IdeInspectorProperty

Label getProperties()
Client Cardinality 1..*
associates

to Class com.togethersoft.openapi.ide.inspector.IdeInspectorProperty

Label getComponents()
Client Cardinality 1..*
Type aggregation
associates

to Class com.togethersoft.openapi.ide.inspector.Condition

Client Cardinality 1..*
associates

to Class java.util.Vector

to Class java.beans.PropertyChangeSupport