Oracle Fusion Middleware extensions for Applications Core API Reference
11g Release 1 (11.1.2)

E22562-02

oracle.apps.fnd.applcore.dt.patterns.piLayout.gui
Class CustomGuiField

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.Box
                  extended by oracle.apps.fnd.applcore.dt.patterns.piLayout.gui.CustomGuiField
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class CustomGuiField
extends javax.swing.Box

Provides a custom field for editing XMLEF Element attributes. It includes a label, change lamp and custom editor buttons to be used in generic form based (as opposed to tabular) layouts as follows:

 
 <--Label---> <---Field---->
  getLabel()   (this Object)
 +-----------+--------------+
 |* Label    |Editor field V|
 +-----------+--------------+
  ^                        ^
  +-- Change Lamp          +- Custom editor buttons
 
 
The label part is separate from the rest of the component to allow the label and field to be layed out seperatly in custom layouts and align with other fields.

The value of this field is bound, and can be listened to using the Property Change listener mechanism and the property "value" available through constant VALUE_PROPERTY.

Author:
David Groves <david.groves@oracle.com>
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.Box
javax.swing.Box.AccessibleBox, javax.swing.Box.Filler
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static java.lang.String FOCUS_LOST_PROPERTY
          Property name to listen on via the PropertyChangeListener mechanisms for focus lost events.
static java.lang.String VALUE_PROPERTY
          property name to listen on via the PropertyChangeListener mechanisms.
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
CustomGuiField(oracle.bali.xml.gui.jdev.JDevXmlContext xmlContext, oracle.bali.inspector.PropertyModel model, java.lang.String labelString, oracle.bali.xml.metadata.XmlKey attrKey)
          Construct the field, setting up all fields.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds a PropertyChangeListener to the listener list.
static javax.swing.JLabel createLabel(java.lang.String labelString)
          Setup the label so it can be obtained via getLabel().
 java.lang.Object getEditorValue()
          Get the editor value, that is the value in the JComponent shown on screen.
 javax.swing.JLabel getLabel()
          Get the Label to layout in custom gui.
 java.lang.String getLocalName()
          Obtain the local Name of this field - the attribute name.
 java.lang.Object getValue()
          Get the current value as it's native object type.
 void onUpdate(oracle.bali.xml.gui.jdev.JDevXmlContext xmlContext, oracle.bali.inspector.PropertyModel model, java.lang.String value)
          Refresh the component after a change in the XMLEF PropertyModel, possibly due to the user editing the value in another editor (such as the xml on screen).
 void refreshValue()
          Refresh the editor screen value in response to component hiding/unhiding.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes a PropertyChangeListener from the listener list.
 void setEditorValue(java.lang.String value)
          Set the editor value, that is the value in the JComponent shown on screen.
 void setEnabled(boolean enabled)
          Sets whether or not this component is enabled.
 void setValue(java.lang.Object o)
          Set the value for this GuiField.
 
Methods inherited from class javax.swing.Box
createGlue, createHorizontalBox, createHorizontalGlue, createHorizontalStrut, createRigidArea, createVerticalBox, createVerticalGlue, createVerticalStrut, getAccessibleContext, paintComponent, setLayout
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VALUE_PROPERTY

public static final java.lang.String VALUE_PROPERTY
property name to listen on via the PropertyChangeListener mechanisms.

See Also:
Constant Field Values

FOCUS_LOST_PROPERTY

public static final java.lang.String FOCUS_LOST_PROPERTY
Property name to listen on via the PropertyChangeListener mechanisms for focus lost events.

See Also:
Constant Field Values
Constructor Detail

CustomGuiField

public CustomGuiField(oracle.bali.xml.gui.jdev.JDevXmlContext xmlContext,
                      oracle.bali.inspector.PropertyModel model,
                      java.lang.String labelString,
                      oracle.bali.xml.metadata.XmlKey attrKey)
Construct the field, setting up all fields. The Label component is seperated out for layout purposes and can be obtained via getLabel().

Parameters:
xmlContext - context to use
model - PropertyModel contains all info on this XMLEF property.
labelString - String to use for Label
attrKey - key pointing to XMLEF attribute, used to obtin correct index into the propertyModel. Must be correct with respect to the namespace, Element and attribute.
Method Detail

createLabel

public static javax.swing.JLabel createLabel(java.lang.String labelString)
Setup the label so it can be obtained via getLabel(). The label can be used in searches in the PD.

Parameters:
labelString - non-null string representing the label.
Returns:
Label to use.

onUpdate

public void onUpdate(oracle.bali.xml.gui.jdev.JDevXmlContext xmlContext,
                     oracle.bali.inspector.PropertyModel model,
                     java.lang.String value)
Refresh the component after a change in the XMLEF PropertyModel, possibly due to the user editing the value in another editor (such as the xml on screen). The change lamp icon will be updated as apporpriate to signify the change status of the field from it's default value. It is likely this method will b esomehow hooked up to the CustomGUIComponent onUpdate(PropertyModel model) method.

Parameters:
xmlContext - context to use
model - PropertyModel in use - source of truth.
value - the new value

setValue

public void setValue(java.lang.Object o)
Set the value for this GuiField. It will be propogated to the XMLEF and a PropertyChangeEvent sent to registered listeners.

Parameters:
o - value to set. Needs to be of correct type.

getValue

public java.lang.Object getValue()
Get the current value as it's native object type.

Returns:
current value.

getLabel

public javax.swing.JLabel getLabel()
Get the Label to layout in custom gui. This label may be positioned in the UI, but should not be modified as this class will modify the lamp icon in response to model changes.

Returns:
JLabel with lamp icon and labelString (from constructor).

getEditorValue

public java.lang.Object getEditorValue()
Get the editor value, that is the value in the JComponent shown on screen.

Returns:
editor value.

setEditorValue

public void setEditorValue(java.lang.String value)
Set the editor value, that is the value in the JComponent shown on screen.

Parameters:
value - editor value.

refreshValue

public void refreshValue()
Refresh the editor screen value in response to component hiding/unhiding.


setEnabled

public void setEnabled(boolean enabled)
Sets whether or not this component is enabled.

Overrides:
setEnabled in class javax.swing.JComponent
Parameters:
enabled - true if this component should be enabled, false otherwise

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener to the listener list. The listener is registered for all Accessible properties and will be called when those properties change.

Overrides:
addPropertyChangeListener in class java.awt.Container
Parameters:
listener - The PropertyChangeListener to be added

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties.

Overrides:
removePropertyChangeListener in class java.awt.Component
Parameters:
listener - The PropertyChangeListener to be removed

getLocalName

public java.lang.String getLocalName()
Obtain the local Name of this field - the attribute name.

Returns:
attribute name.

Oracle Fusion Middleware extensions for Applications Core API Reference
11g Release 1 (11.1.2)

E22562-02

Copyright © 2011 Oracle. All Rights Reserved.