edu.usc.cse.desi.model.view
Class AbstractConnectionViewModel

java.lang.Object
  extended byedu.usc.cse.desi.model.AbstractDESIModel
      extended byedu.usc.cse.desi.model.view.AbstractViewModel
          extended byedu.usc.cse.desi.model.view.AbstractConnectionViewModel
All Implemented Interfaces:
java.util.EventListener, org.eclipse.ui.views.properties.IPropertySource, java.beans.PropertyChangeListener, java.io.Serializable
Direct Known Subclasses:
LogicalLinkViewModel, PhysicalLinkViewModel

public abstract class AbstractConnectionViewModel
extends AbstractViewModel
implements org.eclipse.ui.views.properties.IPropertySource

Slowly but surely, this class will encapsulate all the commonalities between PhysicalLinkViewModel and LogicalLinkViewModel. This class is new as of 7/21/04, so at this point it has adopted very little of those classes' common methods.

Author:
nbeckman Started on Jul 21, 2004
See Also:
Serialized Form

Field Summary
protected  AbstractNodeViewModel mySourceNode
           
protected  AbstractNodeViewModel myTargetNode
           
static java.lang.String P_DISPLAY_LINKTYPE
           
static java.lang.String P_DISPLAY_SRCNODE
           
static java.lang.String P_DISPLAY_TARNODE
           
static java.lang.String P_ID_LINKTYPE
           
static java.lang.String P_ID_SRCNODE
           
static java.lang.String P_ID_TARNODE
           
 
Fields inherited from class edu.usc.cse.desi.model.view.AbstractViewModel
myDataModel
 
Fields inherited from class edu.usc.cse.desi.model.AbstractDESIModel
listeners
 
Constructor Summary
AbstractConnectionViewModel()
           
 
Method Summary
 void attachSource()
          Delegator method that calls attachSource on the data model.
 void attachTarget()
          Delegator method that calls attachTarget on the data model.
protected  org.eclipse.ui.views.properties.IPropertyDescriptor[] buildPropertyDescriptor()
          This method will build a property descriptor from the properties held by this object and by three others which we already know we need for all links.
 void detachSource()
          Delegator method that calls detachSource on the data model.
 void detachTarget()
          Delegator method that calls detachTarget on the data model.
 java.lang.Object getEditableValue()
           
 AbstractNodeViewModel getMySourceNode()
           
 AbstractNodeViewModel getMyTargetNode()
           
 org.eclipse.ui.views.properties.IPropertyDescriptor[] getPropertyDescriptors()
          Returns the texts descriptions of the properties that will appear in the property sheet.
 java.lang.Object getPropertyValue(java.lang.Object obj)
          Return the value associated with the given property.
 boolean isPropertySet(java.lang.Object id)
          At this point I am not sure what this method does but it is necessary for the IPropertySource interface and in the Eclipse book they return false.
 void resetPropertyValue(java.lang.Object id)
          Same is true for this function as is isPropertySet() except that in the Eclipse book, they didn't mention this method AT ALL.
 void setPropertyValue(java.lang.Object obj, java.lang.Object value)
          Sets the values that are entered into a property sheet into the data model.
 
Methods inherited from class edu.usc.cse.desi.model.view.AbstractViewModel
getMyDataModel, getMyPropetyInitializer, getProperties, getPropertyDisplayName, getPropertyValue, hasProperty, reinitialize, setPropertyValue
 
Methods inherited from class edu.usc.cse.desi.model.AbstractDESIModel
addPropertyChangeListener, firePropertyChange, propertyChange, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mySourceNode

protected AbstractNodeViewModel mySourceNode

myTargetNode

protected AbstractNodeViewModel myTargetNode

P_ID_LINKTYPE

public static final java.lang.String P_ID_LINKTYPE
See Also:
Constant Field Values

P_DISPLAY_LINKTYPE

public static final java.lang.String P_DISPLAY_LINKTYPE
See Also:
Constant Field Values

P_ID_SRCNODE

public static final java.lang.String P_ID_SRCNODE
See Also:
Constant Field Values

P_DISPLAY_SRCNODE

public static final java.lang.String P_DISPLAY_SRCNODE
See Also:
Constant Field Values

P_ID_TARNODE

public static final java.lang.String P_ID_TARNODE
See Also:
Constant Field Values

P_DISPLAY_TARNODE

public static final java.lang.String P_DISPLAY_TARNODE
See Also:
Constant Field Values
Constructor Detail

AbstractConnectionViewModel

public AbstractConnectionViewModel()
Method Detail

attachSource

public void attachSource()
Delegator method that calls attachSource on the data model.


attachTarget

public void attachTarget()
Delegator method that calls attachTarget on the data model.


detachSource

public void detachSource()
Delegator method that calls detachSource on the data model.


detachTarget

public void detachTarget()
Delegator method that calls detachTarget on the data model.


getMySourceNode

public AbstractNodeViewModel getMySourceNode()
Returns:
Returns the mySource.

getMyTargetNode

public AbstractNodeViewModel getMyTargetNode()
Returns:
Returns the myTarget.

getPropertyDescriptors

public org.eclipse.ui.views.properties.IPropertyDescriptor[] getPropertyDescriptors()
Returns the texts descriptions of the properties that will appear in the property sheet.

Specified by:
getPropertyDescriptors in interface org.eclipse.ui.views.properties.IPropertySource
Returns:

buildPropertyDescriptor

protected org.eclipse.ui.views.properties.IPropertyDescriptor[] buildPropertyDescriptor()
This method will build a property descriptor from the properties held by this object and by three others which we already know we need for all links.

Returns:
IPropertyDescriptor[] - An array of property descriptors containing this object's properties.

getPropertyValue

public java.lang.Object getPropertyValue(java.lang.Object obj)
Return the value associated with the given property. Remember, this could be anything from size to amount of memory or name.

Specified by:
getPropertyValue in interface org.eclipse.ui.views.properties.IPropertySource
Parameters:
obj -
Returns:

setPropertyValue

public void setPropertyValue(java.lang.Object obj,
                             java.lang.Object value)
Sets the values that are entered into a property sheet into the data model.

Specified by:
setPropertyValue in interface org.eclipse.ui.views.properties.IPropertySource
Parameters:
obj - The id of the property.
value - The new value of the property.

isPropertySet

public boolean isPropertySet(java.lang.Object id)
At this point I am not sure what this method does but it is necessary for the IPropertySource interface and in the Eclipse book they return false.

Specified by:
isPropertySet in interface org.eclipse.ui.views.properties.IPropertySource
Parameters:
id -
Returns:

resetPropertyValue

public void resetPropertyValue(java.lang.Object id)
Same is true for this function as is isPropertySet() except that in the Eclipse book, they didn't mention this method AT ALL.

Specified by:
resetPropertyValue in interface org.eclipse.ui.views.properties.IPropertySource
Parameters:
id -

getEditableValue

public java.lang.Object getEditableValue()
Specified by:
getEditableValue in interface org.eclipse.ui.views.properties.IPropertySource