|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Panel
symantec.itools.awt.BorderPanel
wt.clients.beans.query.WTPanel
wt.clients.beans.query.WTQuery
WTQuery
provides a tool that allows you to include in your application the
ability to search for objects in the local Windchill database. WTQuery
is
comprised of an optional title, a Tab panel containing an input area for search criteria, 3 required
buttons, 3 optional buttons, a check box indicating whether to append to or replace the search
results and a list area for displaying search results.
A WTQuery
object provides the ability to search for objects
of a specified class. A WTSchema
object is
used to specify which modeled Windchill business class and associated attributes
are to be used in configuring the WTQuery
object. The Tab panel and
results viewing list are dynamically constructed based on the schema provided.
When calling WTQuery
it is necessary to specify a
WTSchema
object.
The search results viewing list 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. The required column contains Find, Stop and Clear.
The optional column contains OK, Close and Help. The functionality for the required
buttons and the Help button is handled by WTQuery
. 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.
For example to add WTQuery to a panel:
Panel queryPanel; try { // Create WTQuery without a status area. WTQuery myQuery = new WTQuery("My Query Panel", SearchTask.ALL_VERSIONS, false); myQuery.setSchema("C:wt.doc.WTDocument; G:Search Criteria; A:name; D:versionIdentifier; G:More Search Criteria; A:description;"); // Set single selection mode myQuery.setMultipleMode(false); // --- Hide the right column of buttons. myQuery.setDialogButtonsVisible(false); // Set Layout. queryPanel.setLayout(new BorderLayout()); queryPanel.add("Center", myQuery); // Add event listener. myQuery.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. WTQuery query_source = (WTQuery)e.getSource(); WTObject[] objs = query_source.getSelectedDetails(); // Continue with code that will process the selected object array } } } // Add help listener myQuery.addHelpListener(helpListener); }catch (Exception e) {}
WTSchema
,
WTQueryListener
,
WTQueryEvent
,
Serialized FormNested Class Summary | |
(package private) class |
WTQuery.ButtonKeyAdapter
|
(package private) class |
WTQuery.QueryRefreshListener
|
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 | |
protected SearchCondition[] |
additionalSearchConditions
|
protected boolean |
cancelInProgress
|
static String |
ClearCMD
The value for the "Clear button clicked" command event type. |
private int |
columnWidth
|
private static boolean |
CONTAINER_CHECK
|
private WTContext |
context
|
private boolean |
documentFinder
|
static String |
FindCMD
The value for the "Find button clicked" command event type. |
private static String |
HELP_RESOURCE
|
private static String |
HELP_TARGET
Defined constant String which defines the name of the browser
window to launch online help in. |
static String |
HelpCMD
For internal use only. |
private NFHelpContext |
helpContext
|
private NFHelpSystem |
helpSystem
|
private boolean |
ibaTabVisible
|
protected String |
my_search_filter
|
private Button |
myCB
|
private boolean |
myDialogButtonsVisible
|
private Button |
myFB
|
private Button |
myHB
|
protected WTMultiList |
myList
|
private Vector |
myListener
|
private Checkbox |
myMB
|
private Button |
myOB
|
private ProcessQuery |
myPQ
|
private Button |
myQB
|
private Label |
myQP
|
private Button |
mySB
|
protected WTSchema |
mySchema
|
private WTStatus |
myStatus
|
private boolean |
myStatusVisible
|
protected WTTabPanel |
myTP
|
static String |
OkCMD
The value for the "OK button clicked" command event type. |
private Frame |
parentFrame
|
static String |
QuitCMD
The value for the "Close button clicked" command event type. |
private WTQuery.QueryRefreshListener |
refreshListener
|
private static String |
RESOURCE
|
private static String |
SERVER_ID
|
static String |
StopCMD
The value for the "Stop button clicked" command event type. |
private ThreadGroup |
theThreadGroup
|
private static boolean |
VERBOSE
|
private static String |
versionID
|
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 | |
WTQuery()
Default no-arg constructor. |
|
WTQuery(boolean show_iba)
|
|
WTQuery(String a_title,
String search_filter)
Deprecated. Use the constructor which includes specifying whether to show the status area as part of this component. |
|
WTQuery(String a_title,
String search_filter,
boolean show_status)
Constructor specifying a title, search filter and whether to include a status display area as part of this component. |
|
WTQuery(String a_title,
String search_filter,
boolean show_status,
boolean show_iba)
Constructor specifying a title, search filter, status display flag and a IBA tab flag. |
|
WTQuery(String a_title,
String search_filter,
boolean show_status,
boolean show_iba,
boolean doc_finder)
Constructor specifying a title, search filter and whether to include a status display area as part of this component, as well as showing IBA associated and if to allow for the searching of Documents. |
Method Summary | |
void |
actionPerformed(ActionEvent e)
This method is for internal use only. |
private Button |
addButton(String a_label,
String a_name)
For internal use only. |
void |
addHelpListener(PropertyChangeListener pcl)
Method addHelpListener adds the given listener to be notified
of PropertyChangeEvents in the help system. |
void |
addListener(WTQueryListener a_listener)
Method addListener adds the given listener to be notified
of WTQueryEvents . |
void |
addNotify()
|
private SearchCondition |
appendContainerTypeCondition(Class classname,
String containerType)
|
protected Vector |
buildIBASearchExpressions()
|
private void |
cancel()
For internal use only. |
private boolean |
classInSearch(Class search_class,
Class oid_class)
|
void |
clearResults(boolean a_list_too)
Clear the status area and the results list area. |
void |
deselectReselect()
|
Color |
getCanvasBackground()
Return the background color of the cells in the results list area. |
Color |
getCanvasForeground()
Return the foreground color of the results list area. |
String[] |
getColumnSizes()
Returns a string array containing the width of each column in the results viewing area. |
int |
getColumnWidth()
Gets the default width for each column in the results viewing area. |
WTObject |
getDetail(int a_index)
Return the object at the specified row in the results list area. |
private HelpSystem |
getHelpSystem()
For internal use only. |
boolean |
getMultipleMode()
Return true if multiple selection mode is enabled in the results list area, false if single selection mode is in use. |
protected WTMultiList |
getMyList()
|
protected Vector |
getMyListener()
|
WTSchema |
getSchema()
Return the schema currently being used. |
WTObject |
getSelectedDetail()
Return the selected object in the results list area. |
WTObject[] |
getSelectedDetails()
Return the list of selected objects in the results list area. |
protected void |
handleCreateEvent(RefreshEvent evt)
This method is for internal use only. |
protected void |
handleDeleteEvent(RefreshEvent evt)
This method is for internal use only. |
protected void |
handleUpdateEvent(RefreshEvent evt)
This method is for internal use only. |
private void |
initializeHelp()
For internal use only. |
protected boolean |
isCancelInProgress()
For internal use only. |
boolean |
isDialogButtonsVisible()
Return true if the OK, Close and Help buttons are currently visible. |
boolean |
isIbaTabVisible()
|
boolean |
isStatusVisible()
Return true if the status area is visible. |
void |
itemStateChanged(ItemEvent e)
This method is for internal use only. |
private void |
myCBEnterKeyPress(KeyEvent event)
|
private void |
myFBEnterKeyPress(KeyEvent event)
|
private void |
myHBEnterKeyPress(KeyEvent event)
|
private void |
myOBEnterKeyPress(KeyEvent event)
|
private void |
myQBEnterKeyPress(KeyEvent event)
|
private void |
mySBEnterKeyPress(KeyEvent event)
|
private void |
processEvent(WTQueryEvent aEvent)
|
protected void |
processQuery(boolean aAddToResult)
This method is for internal use only. |
void |
propertyChange(PropertyChangeEvent e)
This method is for internal use only. |
void |
refresh()
For internal use only. |
void |
removeHelpListener(PropertyChangeListener pcl)
Method removeHelpListener removes a listener which was being
notified of PropertyChangeEvents in the help system. |
void |
removeListener(WTQueryListener a_listener)
Method removeHelpListener removes a listener which was being
notified of PropertyChangeEvents in the help system. |
void |
setAdditionalSearchConditions(SearchCondition[] sc)
|
void |
setBackground(Color aColor)
Set the background color of the Tab panel and results list area. |
protected void |
setButtons(boolean aEnabled)
For internal use only. |
protected void |
setCancelInProgress(boolean state)
For internal use only. |
void |
setCanvasBackground(Color aColor)
Set the background color of the cells in the Tab panel and results list area. |
void |
setCanvasForeground(Color a_color)
Set the foreground color of the Tab panel and results list area. |
void |
setColumnSizes(String[] list)
Sets the width of each column in the results viewing area. |
void |
setColumnWidth(int width)
Sets the default width for each column in the results viewing area. |
void |
setDialogButtonsVisible(boolean visible)
Set the visibility of the OK, Close and Help buttons. |
void |
setForeground(Color aColor)
Set the foreground color of the Tab panel and results list area. |
void |
setIbaTabVisible(boolean b)
|
void |
setMultipleMode(boolean mode)
Set the multiple selection mode in the results list area. |
void |
setSchema(WTSchema a_schema)
Set the schema to use. |
void |
setStatus(String a_value)
Set the specified string in the status area. |
void |
setStatusVisible(boolean visible)
Set the visibility of the status area. |
int |
totalDetails()
Return the current number of objects in the results list area. |
private void |
updateColumnWidth()
If the default column width has been set, update each column with the default column width. |
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.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final String versionID
private static final String HELP_RESOURCE
private static final String RESOURCE
private static final String HELP_TARGET
String
which defines the name of the browser
window to launch online help in.
public static final String FindCMD
WTQueryEvent
is fired when the Find button is clicked with a WTQueryEvent.COMMAND
type and command value of FindCMD
.
public static final String StopCMD
WTQueryEvent
is fired when the Stop button is clicked with a WTQueryEvent.COMMAND
type and command value of StopCMD
.
public static final String ClearCMD
WTQueryEvent
is fired when the Clear button is clicked with a WTQueryEvent.COMMAND
type and command value of ClearCMD
.
public static final String OkCMD
WTQueryEvent
is fired when the OK button is clicked with a WTQueryEvent.COMMAND
type and command value of OkCMD
.
public static final String QuitCMD
WTQueryEvent
is fired when the Close button is clicked with a WTQueryEvent.COMMAND
type and command value of QuitCMD
.
private Frame parentFrame
public static final String HelpCMD
private static boolean VERBOSE
private static String SERVER_ID
private static boolean CONTAINER_CHECK
protected WTSchema mySchema
protected WTTabPanel myTP
protected WTMultiList myList
private WTStatus myStatus
private Vector myListener
private Button myFB
private Button mySB
private Button myCB
private Button myOB
private Button myQB
private Button myHB
private Label myQP
private Checkbox myMB
private boolean myDialogButtonsVisible
private boolean myStatusVisible
private WTQuery.QueryRefreshListener refreshListener
private WTContext context
private NFHelpSystem helpSystem
private NFHelpContext helpContext
protected String my_search_filter
private ThreadGroup theThreadGroup
private int columnWidth
private ProcessQuery myPQ
protected boolean cancelInProgress
protected SearchCondition[] additionalSearchConditions
private boolean ibaTabVisible
private boolean documentFinder
Constructor Detail |
public WTQuery()
public WTQuery(boolean show_iba)
public WTQuery(String a_title, String search_filter)
public WTQuery(String a_title, String search_filter, boolean show_status)
a_title
- the title displayed above the Tab panel.
when processing the query command. See wt.query.SearchTask
for search filter string constants.show_status
- set to true if a status area should be created to
display status messages, otherwise false.SearchTask
public WTQuery(String a_title, String search_filter, boolean show_status, boolean show_iba, boolean doc_finder)
a_title
- the title displayed above the Tab panel.
when processing the query command. See wt.query.SearchTask
for search filter string constants.show_status
- set to true if a status area should be created to
display status messages, otherwise false.show_iba
- doc_finder
- SearchTask
public WTQuery(String a_title, String search_filter, boolean show_status, boolean show_iba)
a_title
- the title displayed above the Tab panel.search_filter
- used when processing the query command.
See wt.query.SearchTask
for search filter string constants.show_status
- set to true if a status area should be created to
display status messages, otherwise false.show_iba
- set to true if the IBA tab should be shownSearchTask
Method Detail |
private void updateColumnWidth()
public void setColumnSizes(String[] list) throws PropertyVetoException
list
- a string array containing results viewing area column sizes in pixels
PropertyVetoException
- if the specified property value is unacceptablegetColumnSizes()
public String[] getColumnSizes()
setColumnSizes(java.lang.String[])
public void setColumnWidth(int width)
setColumnSizes
. Setting this vaule to 0 turns,
auto resizing on.
width
- the default results viewing area column size in pixelssetColumnSizes
,
getColumnWidth
public int getColumnWidth()
setColumnWidth
protected void setCancelInProgress(boolean state)
protected boolean isCancelInProgress()
private void initializeHelp()
private HelpSystem getHelpSystem()
public void addHelpListener(PropertyChangeListener pcl)
addHelpListener
adds the given listener to be notified
of PropertyChangeEvents
in the help system. Tool description
PropertyChangeEvents
are generated when the user mouses over
the buttons and list of ContentItems
in this panel. The
given listener will be notified of those events.
pcl
- The PropertyChangeListener
to be notified of
PropertyChangeEvents
generated by the help system.removeHelpListener(java.beans.PropertyChangeListener)
,
HelpSystem
,
HelpContext
,
PropertyChangeListener
public void removeHelpListener(PropertyChangeListener pcl)
removeHelpListener
removes a listener which was being
notified of PropertyChangeEvents
in the help system. If
the given listener is not currently a listener, no changes are made.
pcl
- the PropertyChangeListener
to be removed as a
listener of events generated by the help system of this panel.addHelpListener(java.beans.PropertyChangeListener)
,
PropertyChangeListener
private Button addButton(String a_label, String a_name)
protected void setButtons(boolean aEnabled)
public void refresh()
public WTSchema getSchema()
private void cancel()
public void setSchema(WTSchema a_schema)
a_schema
- The schema used to obtain attributes for the Tab panel and
results list area.public boolean isDialogButtonsVisible()
public void setDialogButtonsVisible(boolean visible)
visible
- true if the OK, Close and Help buttons are visible,
otherwise false.public boolean isStatusVisible()
public void setStatusVisible(boolean visible)
visible
- true if the status area is visible, otherwise false.public Color getCanvasForeground()
public void setCanvasForeground(Color a_color)
a_color
- The foreground color to use in the Tab panel and results
list area.public Color getCanvasBackground()
public void setCanvasBackground(Color aColor)
public void setBackground(Color aColor)
public void setForeground(Color aColor)
public void setMultipleMode(boolean mode) throws PropertyVetoException
mode
- true enables multiple selection, false enables single
selection.
PropertyVetoException
- if the specified property value
is unacceptable.public boolean getMultipleMode()
public int totalDetails()
public WTObject getDetail(int a_index)
a_index
- The index of the row to obtain the object.
public WTObject getSelectedDetail()
public WTObject[] getSelectedDetails()
public void setStatus(String a_value)
WTQueryEvent.STATUS
event.
a_value
- The status message for display.public void clearResults(boolean a_list_too)
a_list_too
- true if the results list area is also cleared,
otherwise false.public void addListener(WTQueryListener a_listener)
addListener
adds the given listener to be notified
of WTQueryEvents
. A WTQueryEvent
is
fired when a button is clicked, a status message is ready or
the selection has been changed in the results viewing area.
a_listener
- The WTQueryListener
to be notified of
WTQueryEvents
.removeListener(wt.clients.beans.query.WTQueryListener)
,
WTQueryListener
,
WTQueryEvent
public void removeListener(WTQueryListener a_listener)
removeHelpListener
removes a listener which was being
notified of PropertyChangeEvents
in the help system. If
the given listener is not currently a listener, no changes are made.
a_listener
- the WTQueryistener
to be removed as a
listener of events generated by the help system of this panel.addListener(wt.clients.beans.query.WTQueryListener)
,
WTQueryListener
private void processEvent(WTQueryEvent aEvent)
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
public void itemStateChanged(ItemEvent e)
itemStateChanged
in interface ItemListener
public void propertyChange(PropertyChangeEvent e)
propertyChange
in interface PropertyChangeListener
protected void handleCreateEvent(RefreshEvent evt)
protected void handleUpdateEvent(RefreshEvent evt)
protected void handleDeleteEvent(RefreshEvent evt)
protected void processQuery(boolean aAddToResult)
private SearchCondition appendContainerTypeCondition(Class classname, String containerType) throws WTException
WTException
private boolean classInSearch(Class search_class, Class oid_class) throws ClassNotFoundException
ClassNotFoundException
private void myFBEnterKeyPress(KeyEvent event)
private void mySBEnterKeyPress(KeyEvent event)
private void myCBEnterKeyPress(KeyEvent event)
private void myOBEnterKeyPress(KeyEvent event)
private void myQBEnterKeyPress(KeyEvent event)
private void myHBEnterKeyPress(KeyEvent event)
public void addNotify()
public void deselectReselect()
protected WTMultiList getMyList()
protected Vector getMyListener()
public void setAdditionalSearchConditions(SearchCondition[] sc)
public void setIbaTabVisible(boolean b)
public boolean isIbaTabVisible()
protected Vector buildIBASearchExpressions()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |