wt.clients.beans
Class AttributeSelectorList

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended bywt.clients.beans.AttributeSelectorList
All Implemented Interfaces:
EventListener, ImageObserver, ItemListener, ItemSelectable, MenuContainer, Serializable

public class AttributeSelectorList
extends Container
implements ItemSelectable, ItemListener

This is a composite object combining a ClassExplorer and a SortableList object to allow the selection of attributes for a class and the ordering of those selected attributes in a list.

This class is only currently intended for use by the SchemaEditor class as part of a PropertyEditor for a Schema property of a JavaBean.



Supported API: false

Extendable: false

See Also:
Schema, ClassExplorer, SchemaEditor,

, Serialized Form


Nested Class Summary
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  ClassExplorer classExplorer
          The contained ClassExplorer.
(package private)  ItemListener itemListener
          An ItemListener.
protected  SortableList sortableList
          The contained SortableList.
protected  WTSplitterBar splitterBar
          Splitter bar separating the ClassExplorer and the SortableList.
 
Fields inherited from class java.awt.Container
 
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
AttributeSelectorList()
          Construct a new AttributeSelectorList.
 
Method Summary
 void addClass(String classname)
          Add a class to the top level of the tree in the ClassExplorer.
 void addItemListener(ItemListener l)
          Add an ItemListener.
protected  void checkIfDeselect()
          Check if an object selected in the ClassExplorer needs to be de-selected.
 Object[] getSelectedObjects()
          Return the objects in the contained SortableList.
 void itemStateChanged(ItemEvent itemEvent)
          Handle incoming ItemEvents from the ClassExplorer and the SortableList.
static void main(String[] args)
          A short main routine to allow standalone testing and demonstrate usage of the class.
protected  void processItemEvent(ItemEvent e)
          Process an ItemEvent.
 void removeItemListener(ItemListener l)
          Remove an ItemListener.
 void setSelectedSchema(Schema schema)
          Set the currently selected Schema ( class name and list of attributes).
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, 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

classExplorer

protected ClassExplorer classExplorer
The contained ClassExplorer.


sortableList

protected SortableList sortableList
The contained SortableList.


itemListener

transient ItemListener itemListener
An ItemListener.


splitterBar

protected WTSplitterBar splitterBar
Splitter bar separating the ClassExplorer and the SortableList.

Constructor Detail

AttributeSelectorList

public AttributeSelectorList()
Construct a new AttributeSelectorList.

Method Detail

itemStateChanged

public void itemStateChanged(ItemEvent itemEvent)
Handle incoming ItemEvents from the ClassExplorer and the SortableList. Resend appropriate events to registered listeners.

Specified by:
itemStateChanged in interface ItemListener
Parameters:
itemEvent - the incoming ItemEvent

checkIfDeselect

protected void checkIfDeselect()
Check if an object selected in the ClassExplorer needs to be de-selected.


setSelectedSchema

public void setSelectedSchema(Schema schema)
Set the currently selected Schema ( class name and list of attributes). The selected class is added as a root node to the ClassExplorer, and the the appropriate tree node and list rows are selected.

Parameters:
schema - the new selected schema

addClass

public void addClass(String classname)
Add a class to the top level of the tree in the ClassExplorer.

Parameters:
classname - the name of the class to add.

getSelectedObjects

public Object[] getSelectedObjects()
Return the objects in the contained SortableList.

Specified by:
getSelectedObjects in interface ItemSelectable
Returns:
an array of exactly one object, the object is a Schema
See Also:
Schema

addItemListener

public void addItemListener(ItemListener l)
Add an ItemListener.

Specified by:
addItemListener in interface ItemSelectable
Parameters:
l - a new listener

removeItemListener

public void removeItemListener(ItemListener l)
Remove an ItemListener.

Specified by:
removeItemListener in interface ItemSelectable
Parameters:
l - the listener to remove.

processItemEvent

protected void processItemEvent(ItemEvent e)
Process an ItemEvent. Notify registered listeners.

Parameters:
e - the new ItemEvent.

main

public static void main(String[] args)
A short main routine to allow standalone testing and demonstrate usage of the class.