Project: com.ibm.rational.teamapi.scout

com.ibm.rational.teamapi.scout
Class ResourceSource

java.lang.Object
  extended by com.ibm.rational.teamapi.scout.DefaultPropertySource
      extended by com.ibm.rational.teamapi.scout.ResourceSource
All Implemented Interfaces:
org.eclipse.ui.views.properties.IPropertySource
Direct Known Subclasses:
ProxyElement

public class ResourceSource
extends DefaultPropertySource

An implementation of IPropertySource for displaying the properties of a CM API Resource. ProperyName objects are used for the property identifiers.


Nested Class Summary
(package private) static class ResourceSource.ArraySource
          A PropertySource for displaying properties whose value is an array.
(package private) static class ResourceSource.ListSource
          A PropertySource for displaying properties whose value is a list.
(package private) static class ResourceSource.PropertySource
          A PropertySource for displaying properties whose value is a StpProperty.
(package private) static class ResourceSource.ResourcePropertyDescriptor
          A PropertyDescriptor for CM API resource properties.
 
Field Summary
(package private) static java.lang.String[] ADVANCED_PROPERTY_FLAGS
          The value used to flag properties with errors
(package private)  org.eclipse.ui.views.properties.IPropertyDescriptor[] m_descriptors
          The cached property descriptors for the properties read.
protected  com.ibm.rational.wvcm.stp.StpResource m_resource
          The proxy for the resource whose properties are displayed by this source
(package private) static javax.wvcm.PropertyRequestItem.PropertyRequest WANTED_PROPS
          The PropertyRequest used to request all properties from the resource
 
Constructor Summary
ResourceSource(com.ibm.rational.wvcm.stp.StpResource resource)
          Constructs a ResourceSource object for displaying the properties of a resource identified by a Resource proxy.
 
Method Summary
private static java.lang.String getDisplayName(java.lang.Object item, int index)
          Constructs an appropriate display name for an item in a compound value.
 org.eclipse.ui.views.properties.IPropertyDescriptor[] getPropertyDescriptors()
          Requests all properties from the server and then constructs a property descriptor for each property returned.
private static java.lang.Object getPropertySource(java.lang.Object val)
          Selects a possible PropertySource for a given value based on the data type of the value.
 java.lang.Object getPropertyValue(java.lang.Object id)
          Retrieves the value of a property from the resource proxy.
 
Methods inherited from class com.ibm.rational.teamapi.scout.DefaultPropertySource
getEditableValue, isPropertySet, resetPropertyValue, setPropertyValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_resource

protected com.ibm.rational.wvcm.stp.StpResource m_resource
The proxy for the resource whose properties are displayed by this source


m_descriptors

org.eclipse.ui.views.properties.IPropertyDescriptor[] m_descriptors
The cached property descriptors for the properties read.


WANTED_PROPS

static final javax.wvcm.PropertyRequestItem.PropertyRequest WANTED_PROPS
The PropertyRequest used to request all properties from the resource


ADVANCED_PROPERTY_FLAGS

static final java.lang.String[] ADVANCED_PROPERTY_FLAGS
The value used to flag properties with errors

Constructor Detail

ResourceSource

ResourceSource(com.ibm.rational.wvcm.stp.StpResource resource)
Constructs a ResourceSource object for displaying the properties of a resource identified by a Resource proxy.

Parameters:
resource - A Resource proxy for the resource whose properties are to be displayed.
Method Detail

getPropertyDescriptors

public org.eclipse.ui.views.properties.IPropertyDescriptor[] getPropertyDescriptors()
Requests all properties from the server and then constructs a property descriptor for each property returned. For efficiently, the descriptors are cached after the properties are read from the resource. The possibility of displaying stale data could be avoided by re-reading the properties each time the descriptors are requested.

Returns:
An array of ResourcePropertyDescriptors, one for each property of the resource represented by this object.

getPropertyValue

public java.lang.Object getPropertyValue(java.lang.Object id)
Retrieves the value of a property from the resource proxy. Compound values are wrapped by a type-specific PropertySource for viewing the values.

Parameters:
id - The property identifier, which, in this case, is the PropertyName of the CM API property.
Returns:
Either a PropertySource (for compound values) or the value itself.

getPropertySource

private static java.lang.Object getPropertySource(java.lang.Object val)
Selects a possible PropertySource for a given value based on the data type of the value. A PropertySource is used for a value that is a Resource, StpProperty, List (including ResourceList or StpProperty.List), or an array.

Parameters:
val - The value to be displayed
Returns:
The input value or an appropriate PropertySource for it.

getDisplayName

private static java.lang.String getDisplayName(java.lang.Object item,
                                               int index)
Constructs an appropriate display name for an item in a compound value.

Parameters:
item - The item to be displayed
index - the index of the item in it's list.
Returns:
A String containing a display name for the item.

Generated Thu 30-Oct-2008 05:19 PM

Copyright © IBM 2008. All rights reserved.