com.metamatrix.console.ui.views.properties
Class ConsolePropertiedEditor

java.lang.Object
  extended by com.metamatrix.console.ui.views.properties.ConsolePropertiedEditor
All Implemented Interfaces:
PropertiedObjectEditor, PropertyAccessPolicy, UserTransactionFactory, java.util.EventListener, javax.swing.event.ChangeListener

public class ConsolePropertiedEditor
extends java.lang.Object
implements PropertiedObjectEditor, javax.swing.event.ChangeListener


Field Summary
static boolean DEFAULT_READ_ONLY_PRIVILEGE
           
static short NSUCONFIGINDICATOR
           
static short STARTUPCONFIGINDICATOR
           
 
Fields inherited from interface com.metamatrix.common.object.PropertiedObjectEditor
NO_VALUE
 
Constructor Summary
ConsolePropertiedEditor(PropertiesManager mgr)
           
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener listener)
          Method to add any kind of a ChangeListener.
 UserTransaction createReadTransaction()
           
 UserTransaction createWriteTransaction()
           
 UserTransaction createWriteTransaction(java.lang.Object p0)
           
protected  void fireChangedEvent(javax.swing.event.ChangeEvent e)
          Call stateChanged() for each listener.
 java.util.List getAllowedValues(PropertiedObject obj, PropertyDefinition def)
           
 java.util.HashMap getChangeHM()
           
 javax.swing.event.EventListenerList getListeners()
           
 java.util.List getNSUDefns(java.util.List propDefnsList)
           
 java.util.Properties getNSUProperties()
           
 PropertyAccessPolicy getPolicy()
           
 java.util.Collection getPropDefn()
           
 java.util.List getPropertyDefinitions(PropertiedObject obj)
           
 ConsolePropertyObjectId getPropertyObjectId(java.lang.String gName, PropertyFilter pFilter)
           
 java.lang.String getPropertyValue()
           
 java.util.List getSUDefns(java.util.List propDefnsList)
           
 java.lang.Object getValue(PropertiedObject obj, PropertyDefinition def)
          Obtain from the specified PropertiedObject the property value that corresponds to the specified PropertyDefinition.
 boolean isReadOnly(PropertiedObject obj)
          Return whether this editor may be used to set property values on the specified PropertiedObject.
 boolean isReadOnly(PropertiedObject obj, PropertyDefinition def)
           
 boolean isValidValue(PropertiedObject obj, PropertyDefinition def, java.lang.Object value)
          Return whether the specified value is considered valid.
 void refreshData()
           
 void removeChangeListener(javax.swing.event.ChangeListener listener)
          Method to remove a ChangeListener.
 void reset(PropertiedObject obj)
           
 void setGroupDefn(java.lang.String groupName, java.util.List groupPropDefns)
           
 void setPolicy(PropertyAccessPolicy policy)
           
 void setReadOnly(PropertiedObject obj, boolean readOnly)
           
 void setReadOnly(PropertiedObject obj, PropertyDefinition def, boolean readOnly)
           
 void setValue(PropertiedObject obj, PropertyDefinition def, java.lang.Object value)
          Set on the specified PropertiedObject the value defined by the specified PropertyDefinition.
 void stateChanged(javax.swing.event.ChangeEvent e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NSUCONFIGINDICATOR

public static final short NSUCONFIGINDICATOR
See Also:
Constant Field Values

STARTUPCONFIGINDICATOR

public static final short STARTUPCONFIGINDICATOR
See Also:
Constant Field Values

DEFAULT_READ_ONLY_PRIVILEGE

public static final boolean DEFAULT_READ_ONLY_PRIVILEGE
See Also:
Constant Field Values
Constructor Detail

ConsolePropertiedEditor

public ConsolePropertiedEditor(PropertiesManager mgr)
Method Detail

getPropertyObjectId

public ConsolePropertyObjectId getPropertyObjectId(java.lang.String gName,
                                                   PropertyFilter pFilter)

getChangeHM

public java.util.HashMap getChangeHM()

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent e)
Specified by:
stateChanged in interface javax.swing.event.ChangeListener

getNSUProperties

public java.util.Properties getNSUProperties()

getPropDefn

public java.util.Collection getPropDefn()

setGroupDefn

public void setGroupDefn(java.lang.String groupName,
                         java.util.List groupPropDefns)

getNSUDefns

public java.util.List getNSUDefns(java.util.List propDefnsList)

getSUDefns

public java.util.List getSUDefns(java.util.List propDefnsList)

refreshData

public void refreshData()

getPropertyDefinitions

public java.util.List getPropertyDefinitions(PropertiedObject obj)
Specified by:
getPropertyDefinitions in interface PropertiedObjectEditor

isReadOnly

public boolean isReadOnly(PropertiedObject obj)
                   throws java.lang.UnsupportedOperationException
Return whether this editor may be used to set property values on the specified PropertiedObject.

Specified by:
isReadOnly in interface PropertiedObjectEditor
Specified by:
isReadOnly in interface PropertyAccessPolicy
Parameters:
obj - the propertied object; may not be null
Returns:
true if the object may not be modified, or false otherwise.
Throws:
java.lang.AssertionError - if obj is null
java.lang.UnsupportedOperationException

getValue

public java.lang.Object getValue(PropertiedObject obj,
                                 PropertyDefinition def)
Obtain from the specified PropertiedObject the property value that corresponds to the specified PropertyDefinition. The return type and cardinality (including whether the value may be null) depend upon the PropertyDefinition.

Specified by:
getValue in interface PropertiedObjectEditor
Parameters:
obj - the propertied object whose property value is to be obtained; may not be null
def - the reference to the PropertyDefinition describing the property whose value is to be returned; may not be null
Returns:
the value for the property, which may be an empty collection if the property is multi-valued, or may be null if the multiplicity includes "0", or the NO_VALUE reference if the specified object does not contain the specified PropertyDefinition
Throws:
java.lang.AssertionError - if either of obj or def is null

isValidValue

public boolean isValidValue(PropertiedObject obj,
                            PropertyDefinition def,
                            java.lang.Object value)
Return whether the specified value is considered valid. The value is not valid if the propertied object does not have the specified property definition, or if it does but the value is inconsistent with the requirements of the property definition.

Specified by:
isValidValue in interface PropertiedObjectEditor
Parameters:
obj - the propertied object whose property value is to be validated; may not be null
def - the reference to the PropertyDefinition describing the property whose value is to be validated; may not be null
value - the proposed value for the property, which may be a collection if the property is multi-valued, or may be null if the multiplicity includes "0"
Returns:
true if the value is considered valid, or false otherwise.
Throws:
java.lang.AssertionError - if either of obj or def is null

getPropertyValue

public java.lang.String getPropertyValue()

setValue

public void setValue(PropertiedObject obj,
                     PropertyDefinition def,
                     java.lang.Object value)
Set on the specified PropertiedObject the value defined by the specified PropertyDefinition.

Specified by:
setValue in interface PropertiedObjectEditor
Parameters:
obj - the propertied object whose property value is to be set; may not be null
def - the reference to the PropertyDefinition describing the property whose value is to be changed; may not be null
value - the new value for the property; the cardinality and type must conform PropertyDefinition
Throws:
java.lang.IllegalArgumentException - if the value does not correspond to the PropertyDefinition requirements.
java.lang.AssertionError - if either of obj or def is null

getAllowedValues

public java.util.List getAllowedValues(PropertiedObject obj,
                                       PropertyDefinition def)
Specified by:
getAllowedValues in interface PropertiedObjectEditor

isReadOnly

public boolean isReadOnly(PropertiedObject obj,
                          PropertyDefinition def)
                   throws java.lang.UnsupportedOperationException
Specified by:
isReadOnly in interface PropertyAccessPolicy
Throws:
java.lang.UnsupportedOperationException

setReadOnly

public void setReadOnly(PropertiedObject obj,
                        PropertyDefinition def,
                        boolean readOnly)
Specified by:
setReadOnly in interface PropertyAccessPolicy

setReadOnly

public void setReadOnly(PropertiedObject obj,
                        boolean readOnly)
Specified by:
setReadOnly in interface PropertyAccessPolicy

reset

public void reset(PropertiedObject obj)
Specified by:
reset in interface PropertyAccessPolicy

createReadTransaction

public UserTransaction createReadTransaction()
Specified by:
createReadTransaction in interface UserTransactionFactory

createWriteTransaction

public UserTransaction createWriteTransaction()
Specified by:
createWriteTransaction in interface UserTransactionFactory

createWriteTransaction

public UserTransaction createWriteTransaction(java.lang.Object p0)
Specified by:
createWriteTransaction in interface UserTransactionFactory

getPolicy

public PropertyAccessPolicy getPolicy()
                               throws java.lang.UnsupportedOperationException
Specified by:
getPolicy in interface PropertiedObjectEditor
Throws:
java.lang.UnsupportedOperationException

setPolicy

public void setPolicy(PropertyAccessPolicy policy)
Specified by:
setPolicy in interface PropertiedObjectEditor

addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener listener)
Method to add any kind of a ChangeListener.

Parameters:
listener - Listener to add

removeChangeListener

public void removeChangeListener(javax.swing.event.ChangeListener listener)
Method to remove a ChangeListener.

Parameters:
listener - Listener to remove

getListeners

public javax.swing.event.EventListenerList getListeners()

fireChangedEvent

protected void fireChangedEvent(javax.swing.event.ChangeEvent e)
Call stateChanged() for each listener.

Parameters:
e - event to be fired


Copyright © 2009. All Rights Reserved.