Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

oracle.jdeveloper.audit.bean
Class AbstractEnumerationField

java.lang.Object
  extended by oracle.jdeveloper.audit.bean.PropertyItem
      extended by oracle.jdeveloper.audit.bean.PropertyField
          extended by oracle.jdeveloper.audit.bean.AbstractEnumerationField
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.FocusListener, java.util.EventListener, javax.swing.ComboBoxModel, javax.swing.ListModel
Direct Known Subclasses:
DefaultTransformField, TypeSafeEnumerationField

public abstract class AbstractEnumerationField
extends PropertyField
implements java.awt.event.ActionListener, javax.swing.ComboBoxModel

An abstract property field for types to be presented in a combo box. Note that a default implementation is supplied for types which implement the marker interface TypeSafeEnumeration and follow the conventions described there. Additional implementations can be supplied to support the display of other enumerating types, in particular dynamic ones that cannot be fit into the TypeSafeEnumeration conventions.

For example, the field that allows the "Default Fix" to be selected for a rule to be selected is a subclass of AbstractEnumerationField which accepts a rule instance in its constructor and overrides the stringOf(java.lang.Object) and valueOf(java.lang.String) to map between the rule's transforms and their names, and between null and "None". A BeanCustomizer associated with the Rule class sets up this field.


Constructor Summary
AbstractEnumerationField()
          Creates an enumeration property field.
AbstractEnumerationField(java.lang.String[] enumerals)
          Creates an enumeration property field with an initial set of enumerals.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void addListDataListener(javax.swing.event.ListDataListener listener)
           
 void fireContentsChanged(int index0, int index1)
           
 void fireIntervalAdded(int index0, int index1)
           
 void fireIntervalRemoved(int index0, int index1)
           
 java.awt.Component getComponent()
          
 java.lang.Object getElementAt(int index)
           
 java.lang.Object getSelectedItem()
           
 int getSize()
           
 java.lang.Object getValue()
           The AbstractEnumerationField implementation maps the text selected by the user to a value by invoking valueOf(java.lang.String).
 void removeListDataListener(javax.swing.event.ListDataListener listener)
           
 void setEnumerals(java.lang.String[] newValue)
          Sets the enumerals allowed for this property.
 void setSelectedItem(java.lang.Object item)
           
 void setValue(java.lang.Object value)
           The AbstractEnumerationField implementation maps the value to the text presented to the user by invoking stringOf(java.lang.Object).
 java.lang.String stringOf(java.lang.Object value)
          Gets the presentation string for a value of the property type.
 java.lang.Object valueOf(java.lang.String text)
          Gets the value of the property type corresponding to a presentation string.
 
Methods inherited from class oracle.jdeveloper.audit.bean.PropertyField
addFieldListener, apply, equals, fireFieldChanged, fireFieldCommitted, fireFieldEntered, fireFieldExited, focusGained, focusLost, getDescriptor, getType, handleException, load, removeFieldListener, setDescriptor, setType, toString
 
Methods inherited from class oracle.jdeveloper.audit.bean.PropertyItem
getLabel, getLabelText, getMnemonic, getMnemonicIndex, getName, setLabelText, setMnemonic, setMnemonicIndex, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractEnumerationField

public AbstractEnumerationField()
Creates an enumeration property field.


AbstractEnumerationField

public AbstractEnumerationField(java.lang.String[] enumerals)
Creates an enumeration property field with an initial set of enumerals.

Parameters:
enumerals - The text to be displayed for each enumeral allowed for this property.
Method Detail

setEnumerals

public void setEnumerals(java.lang.String[] newValue)
Sets the enumerals allowed for this property.

Parameters:
newValue - The text to be displayed for each enumeral allowed for this property.

setValue

public void setValue(java.lang.Object value)
The AbstractEnumerationField implementation maps the value to the text presented to the user by invoking stringOf(java.lang.Object).

Specified by:
setValue in class PropertyField

getValue

public java.lang.Object getValue()
The AbstractEnumerationField implementation maps the text selected by the user to a value by invoking valueOf(java.lang.String).

Specified by:
getValue in class PropertyField

getComponent

public java.awt.Component getComponent()

The AbstractEnumerationField implementation returns a combo box created by the constructor with this field as its co

Specified by:
getComponent in class PropertyItem

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

valueOf

public java.lang.Object valueOf(java.lang.String text)
Gets the value of the property type corresponding to a presentation string. The AbstractEnumerationField implementation simply returns the text, and so must be overridden unless the property type is String.


stringOf

public java.lang.String stringOf(java.lang.Object value)
Gets the presentation string for a value of the property type. The AbstractEnumerationField implementation simply casts the value to String, and so must be overridden unless the property type is String.


getSelectedItem

public java.lang.Object getSelectedItem()
Specified by:
getSelectedItem in interface javax.swing.ComboBoxModel

setSelectedItem

public void setSelectedItem(java.lang.Object item)
Specified by:
setSelectedItem in interface javax.swing.ComboBoxModel

getElementAt

public java.lang.Object getElementAt(int index)
Specified by:
getElementAt in interface javax.swing.ListModel

getSize

public int getSize()
Specified by:
getSize in interface javax.swing.ListModel

addListDataListener

public void addListDataListener(javax.swing.event.ListDataListener listener)
Specified by:
addListDataListener in interface javax.swing.ListModel

removeListDataListener

public void removeListDataListener(javax.swing.event.ListDataListener listener)
Specified by:
removeListDataListener in interface javax.swing.ListModel

fireIntervalAdded

public void fireIntervalAdded(int index0,
                              int index1)

fireIntervalRemoved

public void fireIntervalRemoved(int index0,
                                int index1)

fireContentsChanged

public void fireContentsChanged(int index0,
                                int index1)

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

Copyright © 1997, 2011, Oracle. All rights reserved.