Enterprise Information Portal APIs

com.ibm.mm.beans.gui
Class CMBSearchPanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--com.ibm.mm.beans.gui.CMBSearchPanel
All Implemented Interfaces:
CMBSearchReplyListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class CMBSearchPanel
extends javax.swing.JComponent
implements CMBSearchReplyListener

The CMBSearchPanel displays the list of entities available on the datastore and the attributes of the selected entity to create a search. Each attribute criterion has a label, a list of operators, and a text field. For range operators, two text fields are displayed. The CMBSearchPanel also launches a search, and fires the CMBSearchResultsEvent to return the results of the search.

Implements interface: CMBSearchReplyListener, so it may listen to search result events from non-visual beans.

Source of events:

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
static int CONTROL_1
          Constant to indicate the first control of an STCriterion
static int CONTROL_2
          Constant to indicate the second control of an STCriterion.
static int NO_FOCUS
          Indicates that no criterion field currently has focus.
 
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
CMBSearchPanel()
          Constructor for the CMBSearchPanel.
 
Method Summary
 void addEntitySelectedListener(CMBEntitySelectedListener listener)
          Add the specified listener, which will receive CMBEntitySelectedEvents from the CMBSearchPanel
 void addNotify()
          Override addNotify
 void addSearchCompletedListener(CMBSearchCompletedListener listener)
          Add the specified listener, which will receive CMBSearchCompletedEvents from the CMBSearchPanel
 void addSearchFieldChangedListener(CMBSearchFieldChangedListener listener)
          Add the specified listener, which will receive CMBSearchFieldChangedEvents from the CMBSearchPanel
 void addSearchFieldEnterPressedListener(CMBSearchFieldEnterPressedListener listener)
          Add the specified listener, which will receive CMBSearchFieldEnterPressedEvents from the CMBSearchPanel
 void addSearchFieldPopupListener(CMBSearchFieldPopupListener listener)
          Add the specified listener, which will receive CMBSearchFieldPopupEvents from the CMBSearchPanel
 void addSearchResultsListener(CMBSearchResultsListener listener)
          Add the specified listener, which will receive CMBSearchResultsEvents from the CMBSearchPanel
 void addSearchStartedListener(CMBSearchStartedListener listener)
          Add the specified listener, which will receive CMBSearchStartedEvents from the CMBSearchPanel
 void cancelSearch()
          Cancel the currently executing search
 void clear()
          Clear out the search values of the current entity
 void deepReset()
           
 CMBConnection getConnection()
          Get the connection object for the CMBSearchPanel
 CMBEntity getEntity()
          Get the entity object currently being displayed
 java.lang.String getEntityName()
          Get the name of the entity currently being displayed.
 int getMaxResults()
          Get the maximum number of results to return from a search.
 java.lang.String getNameSeparator()
          Return the String that is used to separate levels of child components The default is " / "
 java.lang.String getQueryString()
           
 boolean isCancelButtonVisible()
          Determine whether the cancel button is currently shown
 boolean isLaunchSearchOnEnter()
          Determine if a search should be launched if enter is pressed in a template field The default value is true.
 boolean isResetButtonVisible()
          Determine whether the reset button is currently shown
 boolean isSearchButtonVisible()
          Determine whether the search button is currently shown
 boolean isSearchInProgress()
          Determine whether a search is currently in progress
 boolean isSearchUsingAllCriteria()
          Determine whether searches use all criteria or any criteria.
 boolean isShowOperators()
          Determine whether operators are currently shown.
 void onCMBSearchReply(CMBSearchReplyEvent event)
          Implementation of the CMBSearchReplyListener, for easy wiring to CMBSearchResults bean.
 void removeEntitySelectedListener(CMBEntitySelectedListener listener)
          Remove the specified listener so it will no longer receive CMBEntitySelectedEvents from the CMBSearchPanel
 void removeSearchCompletedListener(CMBSearchCompletedListener listener)
          Remove the specified listener so it will no longer receive CMBSearchCompletedEvents from the CMBSearchPanel
 void removeSearchFieldChangedListener(CMBSearchFieldChangedListener listener)
          Remove the specified listener so it will no longer receive CMBSearchFieldChangedEvents from the CMBSearchPanel
 void removeSearchFieldEnterPressedListener(CMBSearchFieldEnterPressedListener listener)
          Remove the specified listener so it will no longer receive CMBSearchFieldEnterPressedEvents from the CMBSearchPanel
 void removeSearchFieldPopupListener(CMBSearchFieldPopupListener listener)
          Remove the specified listener so it will no longer receive CMBSearchFieldPopupEvents from the CMBSearchPanel
 void removeSearchResultsListener(CMBSearchResultsListener listener)
          Remove the specified listener so it will no longer receive CMBSearchResultsEvents from the CMBSearchPanel
 void removeSearchStartedListener(CMBSearchStartedListener listener)
          Remove the specified listener so it will no longer receive CMBSearchStartedEvents from the CMBSearchPanel
 void reset()
          Reset the values of all entities' search fields back to the default values
 void retrieve()
           
 void setCancelButtonVisible(boolean newVal)
          Set the flag that indicates whether the cancel button should be shown
 void setConnection(CMBConnection newConn)
          Set the connection property for the CMBSearchPanel
 void setEntity(CMBEntity newEntity)
          Set the entity object to be displayed.
 void setEntity(java.lang.String entName)
          Set the name of the entity currently being displayed.
 void setLaunchSearchOnEnter(boolean newVal)
          Set whether a search should be launched if enter is pressed in a template field
 void setLayout(java.awt.LayoutManager mgr)
          Overridden to disable changing of the layout manager.
 void setLocale(java.util.Locale newLocale)
          Overrides the setLocale function
 void setMaxResults(int newResults)
          Set the maximum number of results to return from a search This maximum is set per backend, so the total results may be greater if the search involves multiple content servers.
 void setNameSeparator(java.lang.String newSep)
          Set the String that is used to separate levels of child components
 void setQueryString(java.lang.String newString)
           
 void setResetButtonVisible(boolean newVal)
          Set the flag that indicates whether the reset button should be shown
 void setSearchButtonVisible(boolean newVal)
          Set the flag that indicates whether the search button should be shown
 void setSearchInProgress(boolean newVal)
          Set the flag that indicates whether a search is currently in progress
 void setSearchUsingAllCriteria(boolean newVal)
          Set the flag that indicates whether searches use all criteria or any criteria.
 void setShowOperators(boolean newVal)
          Set the flag that indicates whether operators are currently shown.
 void showEntity(CMBEntity ent)
          Show the entity.
 void showEntity(java.lang.String entName)
          Show the entity with the given name.
 void startSearch()
          Start a search with the criteria currently entered on the panel.
 void updateUI()
          Override update UI to ensure proper update of components
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getUIClassID, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_FOCUS

public static final int NO_FOCUS
Indicates that no criterion field currently has focus.

CONTROL_1

public static final int CONTROL_1
Constant to indicate the first control of an STCriterion

CONTROL_2

public static final int CONTROL_2
Constant to indicate the second control of an STCriterion.
Constructor Detail

CMBSearchPanel

public CMBSearchPanel()
Constructor for the CMBSearchPanel.
Method Detail

getQueryString

public java.lang.String getQueryString()

setQueryString

public void setQueryString(java.lang.String newString)

setConnection

public void setConnection(CMBConnection newConn)
Set the connection property for the CMBSearchPanel
Parameters:
CMBConnection - newConn The new connection.

getConnection

public CMBConnection getConnection()
Get the connection object for the CMBSearchPanel

getEntity

public CMBEntity getEntity()
Get the entity object currently being displayed

getEntityName

public java.lang.String getEntityName()
Get the name of the entity currently being displayed.

setEntity

public void setEntity(java.lang.String entName)
Set the name of the entity currently being displayed.

setEntity

public void setEntity(CMBEntity newEntity)
Set the entity object to be displayed.

isLaunchSearchOnEnter

public boolean isLaunchSearchOnEnter()
Determine if a search should be launched if enter is pressed in a template field The default value is true.

setLaunchSearchOnEnter

public void setLaunchSearchOnEnter(boolean newVal)
Set whether a search should be launched if enter is pressed in a template field

isShowOperators

public boolean isShowOperators()
Determine whether operators are currently shown. If false, default operators are used.

setShowOperators

public void setShowOperators(boolean newVal)
Set the flag that indicates whether operators are currently shown.
Parameters:
boolean - newVal The new value for the flag.

isSearchUsingAllCriteria

public boolean isSearchUsingAllCriteria()
Determine whether searches use all criteria or any criteria. If true, all search criteria are combined for the search. (AND) If false, any search criteria may be used for the search. (OR) Default is true.

setSearchUsingAllCriteria

public void setSearchUsingAllCriteria(boolean newVal)
Set the flag that indicates whether searches use all criteria or any criteria.
Parameters:
boolean - newVal The new value for the flag. If true, all search criteria are combined for the search. (AND) If false, any search criteria may be used for the search. (OR) Default is true.

getMaxResults

public int getMaxResults()
Get the maximum number of results to return from a search. This maximum is set per backend, so the total results may be greater if the search involves multiple content servers. The default value is -1.

setMaxResults

public void setMaxResults(int newResults)
Set the maximum number of results to return from a search This maximum is set per backend, so the total results may be greater if the search involves multiple content servers.

getNameSeparator

public java.lang.String getNameSeparator()
Return the String that is used to separate levels of child components The default is " / "

setNameSeparator

public void setNameSeparator(java.lang.String newSep)
Set the String that is used to separate levels of child components
Parameters:
String - newSep The new separator string

isSearchInProgress

public boolean isSearchInProgress()
Determine whether a search is currently in progress

setSearchInProgress

public void setSearchInProgress(boolean newVal)
Set the flag that indicates whether a search is currently in progress
Parameters:
boolean - newVal The new value for the flag

isSearchButtonVisible

public boolean isSearchButtonVisible()
Determine whether the search button is currently shown

setSearchButtonVisible

public void setSearchButtonVisible(boolean newVal)
Set the flag that indicates whether the search button should be shown
Parameters:
boolean - newVal The visible property

isCancelButtonVisible

public boolean isCancelButtonVisible()
Determine whether the cancel button is currently shown

setCancelButtonVisible

public void setCancelButtonVisible(boolean newVal)
Set the flag that indicates whether the cancel button should be shown
Parameters:
boolean - newVal The visible property

isResetButtonVisible

public boolean isResetButtonVisible()
Determine whether the reset button is currently shown

setResetButtonVisible

public void setResetButtonVisible(boolean newVal)
Set the flag that indicates whether the reset button should be shown
Parameters:
boolean - newVal The visible property

addNotify

public void addNotify()
Override addNotify
Overrides:
addNotify in class javax.swing.JComponent

clear

public void clear()
Clear out the search values of the current entity

showEntity

public void showEntity(java.lang.String entName)
Show the entity with the given name. This function will find the entity object with the given name and display it in the search panel.
Parameters:
String - entName The name of the entity object to display.

showEntity

public void showEntity(CMBEntity ent)
Show the entity. This function displays the given entity in the search panel.
Parameters:
CMBEntity - ent The entity object to display

reset

public void reset()
Reset the values of all entities' search fields back to the default values

deepReset

public void deepReset()

retrieve

public void retrieve()

setLayout

public void setLayout(java.awt.LayoutManager mgr)
Overridden to disable changing of the layout manager.
Overrides:
setLayout in class java.awt.Container

setLocale

public void setLocale(java.util.Locale newLocale)
Overrides the setLocale function
Overrides:
setLocale in class java.awt.Component

updateUI

public void updateUI()
Override update UI to ensure proper update of components
Overrides:
updateUI in class javax.swing.JComponent

startSearch

public void startSearch()
Start a search with the criteria currently entered on the panel.

cancelSearch

public void cancelSearch()
Cancel the currently executing search

addEntitySelectedListener

public void addEntitySelectedListener(CMBEntitySelectedListener listener)
Add the specified listener, which will receive CMBEntitySelectedEvents from the CMBSearchPanel

removeEntitySelectedListener

public void removeEntitySelectedListener(CMBEntitySelectedListener listener)
Remove the specified listener so it will no longer receive CMBEntitySelectedEvents from the CMBSearchPanel

addSearchFieldChangedListener

public void addSearchFieldChangedListener(CMBSearchFieldChangedListener listener)
Add the specified listener, which will receive CMBSearchFieldChangedEvents from the CMBSearchPanel
Parameters:
listener - The new listener

removeSearchFieldChangedListener

public void removeSearchFieldChangedListener(CMBSearchFieldChangedListener listener)
Remove the specified listener so it will no longer receive CMBSearchFieldChangedEvents from the CMBSearchPanel
Parameters:
listener - The listener to be removed

addSearchFieldPopupListener

public void addSearchFieldPopupListener(CMBSearchFieldPopupListener listener)
Add the specified listener, which will receive CMBSearchFieldPopupEvents from the CMBSearchPanel
Parameters:
listener - The new listener

removeSearchFieldPopupListener

public void removeSearchFieldPopupListener(CMBSearchFieldPopupListener listener)
Remove the specified listener so it will no longer receive CMBSearchFieldPopupEvents from the CMBSearchPanel
Parameters:
listener - The listener to be removed

addSearchFieldEnterPressedListener

public void addSearchFieldEnterPressedListener(CMBSearchFieldEnterPressedListener listener)
Add the specified listener, which will receive CMBSearchFieldEnterPressedEvents from the CMBSearchPanel

removeSearchFieldEnterPressedListener

public void removeSearchFieldEnterPressedListener(CMBSearchFieldEnterPressedListener listener)
Remove the specified listener so it will no longer receive CMBSearchFieldEnterPressedEvents from the CMBSearchPanel

addSearchStartedListener

public void addSearchStartedListener(CMBSearchStartedListener listener)
Add the specified listener, which will receive CMBSearchStartedEvents from the CMBSearchPanel

removeSearchStartedListener

public void removeSearchStartedListener(CMBSearchStartedListener listener)
Remove the specified listener so it will no longer receive CMBSearchStartedEvents from the CMBSearchPanel

addSearchResultsListener

public void addSearchResultsListener(CMBSearchResultsListener listener)
Add the specified listener, which will receive CMBSearchResultsEvents from the CMBSearchPanel

removeSearchResultsListener

public void removeSearchResultsListener(CMBSearchResultsListener listener)
Remove the specified listener so it will no longer receive CMBSearchResultsEvents from the CMBSearchPanel

addSearchCompletedListener

public void addSearchCompletedListener(CMBSearchCompletedListener listener)
Add the specified listener, which will receive CMBSearchCompletedEvents from the CMBSearchPanel

removeSearchCompletedListener

public void removeSearchCompletedListener(CMBSearchCompletedListener listener)
Remove the specified listener so it will no longer receive CMBSearchCompletedEvents from the CMBSearchPanel

onCMBSearchReply

public void onCMBSearchReply(CMBSearchReplyEvent event)
Implementation of the CMBSearchReplyListener, for easy wiring to CMBSearchResults bean. This method gets the search reply, and fires off the appropriate events to its listeners. Depending on the attributes of the CMBSearchReplyEvent, it may fire off CMBSearchStartedEvent, CMBSearchResultsEvent, or CMBSearchCompletedEvent.
Specified by:
onCMBSearchReply in interface CMBSearchReplyListener
Parameters:
event - The search reply event received from the CMBQueryService bean.

EIP JavaBeans

(c) Copyright International Business Machines Corporation 1996, 2002. IBM Corp. All rights reserved.