wt.clients.step
Class WTChooser

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Panel
              extended bysymantec.itools.awt.BorderPanel
                  extended bywt.clients.beans.query.WTPanel
                      extended bywt.clients.beans.query.WTQuery
                          extended bywt.clients.step.WTChooser
All Implemented Interfaces:
Accessible, ActionListener, symantec.itools.awt.AlignStyle, symantec.itools.awt.BevelStyle, ContainerListener, EventListener, ImageObserver, ItemListener, MenuContainer, PropertyChangeListener, Serializable

public class WTChooser
extends WTQuery

WTChooser provides a tool that allows you to include in your application the ability to search for objects in the local Windchill database. WTChooser is comprised of an optional title, a tab panel containing an input area for search criteria, six buttons, a check box indicating whether to append to or replace the search results and a list area for displaying search results.

The WTChooser object provides the ability to search for objects of a specified class. The ChooserOptions class is distributed as source code and is used to configure what attributes and classes are available to WTChooser. The ChooserOptions object consists of strings that associate a fully qualified class name with attributes to be used for restricting the query and attributes to be displayed in the results list area. When calling WTChooser it is necessary to specify a fully qualified class name that is defined appropriately in the ChooserOptions object.

The search results list area presents the results of the database query. The user can clear this area by clicking the clear button. There is a check box available to the user that determines whether to clear the list area between invocations of clicking the Find button. By default the list area allows multiple objects to be selected. To restrict the list area to single selection use the setMultipleMode() method. To obtain the list of selected objects use either the getSelectedDetails() or getSelectedDetail() method depending on whether multiple or single selection mode is in use.

The buttons display in two columns. One column contains Find, Stop and Clear. The other contains Ok, Close and Help. For the most part the functionality for these buttons is handled by WTChooser. The calling application can register a listener to be notified when the Ok or Close buttons are clicked. To register a listener, create a WTQueryListener object and call the addListener() method using the WTQueryListener object as input.

The WTChooser panel can either be embedded in an existing Frame or you can instruct WTChooser to create a dialog window. If a dialog window is used, it is necessary to specify a java.awt.Component as the parent. The dialog will be centered over the parent.

For example to create a WTChooser in a dialog:

    Frame frame = getParentFrame();

    WTChooser chooser = new WTChooser("wt.part.WTPartMaster", "Find Part", frame);

    chooser.addListener ( new WTQueryListener() {
       public void queryEvent(WTQueryEvent e)
       {
          if (e.getType().equals(WTQueryEvent.COMMAND ))
          {
             if (e.getCommand().equals(WTQuery.OkCMD) )
             {
                // The Ok button is clicked, get the selected objects.
                WTChooser chooser_source = (WTChooser)e.getSource();
	              WTObject[] objs = chooser_source.getSelectedDetails();
                // Continue with code that will process the selected object array
             }
         }
      }
  


Supported API: true

Extendable: true

See Also:
ChooserOptions, WTQuery, WTQueryListener, WTQueryEvent, Serialized Form

Nested Class Summary
(package private)  class WTChooser.QueryListener
           
(package private)  class WTChooser.SymAction
           
 
Nested classes inherited from class wt.clients.beans.query.WTQuery
 
Nested classes inherited from class symantec.itools.awt.BorderPanel
 
Nested classes inherited from class java.awt.Panel
Panel.AccessibleAWTPanel
 
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
private  JDialog myDialog
           
private  WTScheme myScheme
           
private  SchemeDB mySchemeDB
           
private static String OPTIONS_RESOURCE
           
private static String versionID
           
 
Fields inherited from class wt.clients.beans.query.WTQuery
additionalSearchConditions, cancelInProgress, ClearCMD, FindCMD, HelpCMD, my_search_filter, myList, mySchema, myTP, OkCMD, QuitCMD, StopCMD
 
Fields inherited from class wt.clients.beans.query.WTPanel
BOTH, CENTER, EAST, EQUATOR, FLAT, HORIZONTAL, LEFT, LINE, LOWER, NONE, NORTH, RAISE, RIGHT, SOUTH, VERTICAL, WEST
 
Fields inherited from class symantec.itools.awt.BorderPanel
bevelDarkerColor, bevelLighterColor, borderColor, cachedBackground, errors, internalInsets, ixPad, iyPadBottom, iyPadTop, label, labelAlignment, labelColor, labelipadx, labelpadx, padbottom, padleft, padright, padtop, panel, style
 
Fields inherited from class java.awt.Panel
 
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 symantec.itools.awt.AlignStyle
ALIGN_CENTERED, ALIGN_LEFT, ALIGN_RIGHT
 
Fields inherited from interface symantec.itools.awt.BevelStyle
BEVEL_LINE, BEVEL_LOWERED, BEVEL_NONE, BEVEL_RAISED
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
WTChooser()
          Default no-arg constructor.
WTChooser(String a_class, String a_title)
          Constructor specifying a fully qualified class name and title.
WTChooser(String a_class, String a_title, Component a_parent)
          Constructor specifying a fully qualified class name, title and parent component.
WTChooser(String a_class, String a_title, Component a_parent, String a_search_filter)
          Constructor specifying a fully qualified class name, title, parent component and search filter.
WTChooser(String a_class, String a_title, Component a_parent, String a_search_filter, boolean show_iba)
          Constructor specifying a fully qualified class name, title, parent component and search filter.
WTChooser(String a_class, String a_title, String a_search_filter)
          Constructor specifying a fully qualified class name, title and search filter.
WTChooser(WTScheme a_scheme, String a_title, Component a_parent, String a_search_filter)
          Constructor specifying a fully qualified class name, title, parent component and search filter.
 
Method Summary
private  void myList_ActionPerformed(ActionEvent event)
           
(package private)  PropertyChangeListener newHelpListener()
           
private  void processEvent(WTQueryEvent aEvent)
           
 void setClass(String a_class)
          Set the class name to be used.
private  void setup(WTScheme a_scheme, String a_title, Component a_parent, String a_search_filter)
           
 void setVisible(boolean a_value)
          This will either show or hide the WTChooser panel.
 
Methods inherited from class wt.clients.beans.query.WTQuery
actionPerformed, addHelpListener, addListener, addNotify, buildIBASearchExpressions, clearResults, deselectReselect, getCanvasBackground, getCanvasForeground, getColumnSizes, getColumnWidth, getDetail, getMultipleMode, getMyList, getMyListener, getSchema, getSelectedDetail, getSelectedDetails, handleCreateEvent, handleDeleteEvent, handleUpdateEvent, isCancelInProgress, isDialogButtonsVisible, isIbaTabVisible, isStatusVisible, itemStateChanged, processQuery, propertyChange, refresh, removeHelpListener, removeListener, setAdditionalSearchConditions, setBackground, setButtons, setCancelInProgress, setCanvasBackground, setCanvasForeground, setColumnSizes, setColumnWidth, setDialogButtonsVisible, setForeground, setIbaTabVisible, setMultipleMode, setSchema, setStatus, setStatusVisible, totalDetails
 
Methods inherited from class wt.clients.beans.query.WTPanel
add, add, add, add, getPad, PAD, setPad
 
Methods inherited from class symantec.itools.awt.BorderPanel
addBevelStyleListener, addBevelStyleListener, addContainerListener, addImpl, addPropertyChangeListener, addVetoableChangeListener, calculateHilightColors, componentAdded, componentRemoved, countComponents, draw, drawBorder, drawLabel, getAlignStyle, getBevelStyle, getBorderColor, getComponent, getComponentCount, getComponents, getInternalInsets, getIPadBottom, getIPadSides, getIPadTop, getLabel, getLabelColor, getLabelTopMargin, getLabelWidthMargin, getLayout, getMinimumSize, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getPreferredSize, insets, isValidBevelStyle, layout, minimumSize, paint, preferredSize, remove, remove, removeAll, removeBevelStyleListener, removeBevelStyleListener, removeContainerListener, removeNotify, removePropertyChangeListener, removeVetoableChangeListener, reshape, setAlignStyle, setBevelStyle, setBorderColor, setBorderColor, setBounds, setInternalInsets, setIPadBottom, setIPadSides, setIPadTop, setLabel, setLabelColor, setLayout, setPadding, setPaddingBottom, setPaddingLeft, setPaddingRight, setPaddingTop, sizepanel, update
 
Methods inherited from class java.awt.Panel
getAccessibleContext
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponentAt, getComponentAt, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getListeners, getMaximumSize, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, list, list, locate, paintComponents, paramString, print, printComponents, processContainerEvent, processEvent, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, 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, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, 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

versionID

private static final String versionID
See Also:
Constant Field Values

myScheme

private WTScheme myScheme

mySchemeDB

private SchemeDB mySchemeDB

myDialog

private JDialog myDialog

OPTIONS_RESOURCE

private static String OPTIONS_RESOURCE
Constructor Detail

WTChooser

public WTChooser()
Default no-arg constructor. If you use this constructor it is necessary to call the setClass method with a fully qualified class name that has an associated definition in the ChooserOptions object.

Supported API: true


WTChooser

public WTChooser(String a_class,
                 String a_title)
Constructor specifying a fully qualified class name and title.

Supported API: true

Parameters:
a_class - A fully qualified class name. There must be an associated definition for this class name in the ChooserOptions object.
a_title - The title displayed above the tab panel.

WTChooser

public WTChooser(String a_class,
                 String a_title,
                 String a_search_filter)
Constructor specifying a fully qualified class name, title and search filter.

Supported API: true

Parameters:
a_class - A fully qualified class name. There must be a associated definition for this class name in the ChooserOptions object.
a_title - The title displayed above the tab panel.
a_search_filter - A search filter type to pass to the method server when processing the query command. See wt.query.SearchTask for search filter string constants.
See Also:
SearchTask

WTChooser

public WTChooser(String a_class,
                 String a_title,
                 Component a_parent)
Constructor specifying a fully qualified class name, title and parent component. This will create a dialog window to contain WTChooser. The parent component must either be a java.awt.frame or have one in it's hierarchy for the dialog to associate itself with.

Supported API: true

Parameters:
a_class - A fully qualified class name. There must be an associated definition for this class name in the ChooserOptions object.
a_title - The title displayed above the tab panel.
a_parent - The parent for the dialog window.

WTChooser

public WTChooser(String a_class,
                 String a_title,
                 Component a_parent,
                 String a_search_filter)
Constructor specifying a fully qualified class name, title, parent component and search filter. This will create a dialog window to contain WTChooser. The parent component must either be a java.awt.frame or have one in it's hierarchy for the dialog to associate itself with.

Supported API: true

Parameters:
a_class - A fully qualified class name. There must be an associated definition for this class name in the ChooserOptions object.
a_title - The title displayed above the tab panel.
a_parent - The parent for the dialog window.
a_search_filter - A search filter type to pass to the method server when processing the query command. See wt.query.SearchTask for search filter string constants.
See Also:
SearchTask

WTChooser

public WTChooser(String a_class,
                 String a_title,
                 Component a_parent,
                 String a_search_filter,
                 boolean show_iba)
Constructor specifying a fully qualified class name, title, parent component and search filter. This will create a dialog window to contain WTChooser. The parent component must either be a java.awt.frame or have one in it's hierarchy for the dialog to associate itself with.

Supported API: true

Parameters:
a_class - A fully qualified class name. There must be an associated definition for this class name in the ChooserOptions object.
a_title - The title displayed above the tab panel.
a_parent - The parent for the dialog window.
a_search_filter - A search filter type to pass to the method server when processing the query command. See wt.query.SearchTask for search filter string constants.
show_iba - set to false if no IBA panel is required
See Also:
SearchTask

WTChooser

public WTChooser(WTScheme a_scheme,
                 String a_title,
                 Component a_parent,
                 String a_search_filter)
Constructor specifying a fully qualified class name, title, parent component and search filter. This will create a dialog window to contain WTChooser. The parent component must either be a java.awt.frame or have one in it's hierarchy for the dialog to associate itself with.

Supported API: true

Parameters:
a_scheme - The scheme to be used to setup the search criteria tab panels and columns in the results area.
a_title - The title displayed above the tab panel.
a_parent - The parent for the dialog window.
a_search_filter - A search filter type to pass to the method server when processing the query command. See wt.query.SearchTask for search filter string constants.
See Also:
SearchTask
Method Detail

setup

private void setup(WTScheme a_scheme,
                   String a_title,
                   Component a_parent,
                   String a_search_filter)

myList_ActionPerformed

private void myList_ActionPerformed(ActionEvent event)

processEvent

private void processEvent(WTQueryEvent aEvent)

setVisible

public void setVisible(boolean a_value)
This will either show or hide the WTChooser panel.

Supported API: true

Parameters:
a_value - Set to true to show or false to hide.

newHelpListener

PropertyChangeListener newHelpListener()

setClass

public void setClass(String a_class)
Set the class name to be used. The class name must have an associated definition in the ChoserOptions class. This method is required if the no-arg constructor is used.

Supported API: true

Parameters:
a_class - A fully qualified class name. There must be an associated definition for this class name in the ChooserOptions object.
See Also:
ChooserOptions