Class WTChooser
- All Implemented Interfaces:
ActionListener,ItemListener,PropertyChangeListener,EventListener
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:
-
ChooserOptionsWTQueryWTQueryListenerWTQueryEvent
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionDefault no-arg constructor.Constructor specifying a fully qualified class name and title.Constructor specifying a fully qualified class name, title and parent component.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.Constructor specifying a fully qualified class name, title and search filter.Constructor specifying a fully qualified class name, title, parent component and search filter. -
Method Summary
Modifier and TypeMethodDescriptionvoidSet the class name to be used.voidsetVisible(boolean a_value) This will either show or hide theWTChooserpanel.Methods inherited from class wt.clients.beans.query.WTQuery
addHelpListener, addListener, getColumnSizes, getColumnWidth, getDetail, getMultipleMode, getSchema, getSelectedDetail, getSelectedDetails, removeHelpListener, removeListener, setColumnSizes, setColumnWidth, setMultipleMode, setSchema, setStatusVisible, totalDetails
-
Constructor Details
-
WTChooser
public WTChooser()Default no-arg constructor. If you use this constructor it is necessary to call thesetClassmethod with a fully qualified class name that has an associated definition in theChooserOptionsobject.
Supported API: true -
WTChooser
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 theChooserOptionsobject.a_title- The title displayed above the tab panel.
-
WTChooser
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 theChooserOptionsobject.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. Seewt.query.SearchTaskfor search filter string constants.- See Also:
-
SearchTask
-
WTChooser
Constructor specifying a fully qualified class name, title and parent component. This will create a dialog window to containWTChooser. The parent component must either be ajava.awt.frameor 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 theChooserOptionsobject.a_title- The title displayed above the tab panel.a_parent- The parent for the dialog window.
-
WTChooser
Constructor specifying a fully qualified class name, title, parent component and search filter. This will create a dialog window to containWTChooser. The parent component must either be ajava.awt.frameor 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 theChooserOptionsobject.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. Seewt.query.SearchTaskfor 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 containWTChooser. The parent component must either be ajava.awt.frameor 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 theChooserOptionsobject.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. Seewt.query.SearchTaskfor search filter string constants.show_iba- set to false if no IBA panel is required- See Also:
-
SearchTask
-
WTChooser
Constructor specifying a fully qualified class name, title, parent component and search filter. This will create a dialog window to containWTChooser. The parent component must either be ajava.awt.frameor 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. Seewt.query.SearchTaskfor search filter string constants.- See Also:
-
SearchTask
-
-
Method Details
-
setVisible
public void setVisible(boolean a_value) This will either show or hide theWTChooserpanel.
Supported API: true- Parameters:
a_value- Set to true to show or false to hide.
-
setClass
Set the class name to be used. The class name must have an associated definition in theChoserOptionsclass. 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 theChooserOptionsobject.- See Also:
-
ChooserOptions
-