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()
          Create a new instance of a UserTransaction that may be used to read information.
 UserTransaction createWriteTransaction()
          Create a new instance of a UserTransaction that may be used to write and/or update information.
 UserTransaction createWriteTransaction(java.lang.Object p0)
          Create a new instance of a UserTransaction that may be used to write and/or update information.
protected  void fireChangedEvent(javax.swing.event.ChangeEvent e)
          Call stateChanged() for each listener.
 java.util.List getAllowedValues(PropertiedObject obj, PropertyDefinition def)
          Get the allowed values for the property on the specified object.
 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)
          Obtain the list of PropertyDefinitions that apply to the specified object's type.
 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)
Description copied from interface: PropertiedObjectEditor
Obtain the list of PropertyDefinitions that apply to the specified object's type.

Specified by:
getPropertyDefinitions in interface PropertiedObjectEditor
Parameters:
obj - the propertied object for which the PropertyDefinitions are to be obtained; may not be null
Returns:
an unmodifiable list of the PropertyDefinition objects that define the properties for the object; never null but possibly empty

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)
Description copied from interface: PropertiedObjectEditor
Get the allowed values for the property on the specified object.

Specified by:
getAllowedValues 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 unmodifiable list of allowed values for this property, or an empty set if the values do not have to conform to a fixed set.
See Also:
#hasAllowedValues

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()
Description copied from interface: UserTransactionFactory
Create a new instance of a UserTransaction that may be used to read information. Read transactions do not have a source object associated with them (since they never directly modify data).

The returned transaction object will not be bound to an underlying system transaction until begin() is called on the returned object.

Specified by:
createReadTransaction in interface UserTransactionFactory
Returns:
the new transaction object

createWriteTransaction

public UserTransaction createWriteTransaction()
Description copied from interface: UserTransactionFactory
Create a new instance of a UserTransaction that may be used to write and/or update information. The transaction will not have a source object associated with it.

The returned transaction object will not be bound to an underlying system transaction until begin() is called on the returned object.

Specified by:
createWriteTransaction in interface UserTransactionFactory
Returns:
the new transaction object

createWriteTransaction

public UserTransaction createWriteTransaction(java.lang.Object p0)
Description copied from interface: UserTransactionFactory
Create a new instance of a UserTransaction that may be used to write and/or update information. The source object will be used for all events that are fired as a result of or as a product of this transaction.

The returned transaction object will not be bound to an underlying system transaction until begin() is called on the returned object.

Specified by:
createWriteTransaction in interface UserTransactionFactory
Parameters:
p0 - the object that is considered to be the source of the transaction; may be null
Returns:
the new transaction object

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.