|
Bean Builder | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--javax.swing.JPanel
|
+--com.adventnet.beans.probeans.ProSearchComponent
The ProSearchComponent is basically an UI component which can be used
in applications where a Search operation is to be performed based on some
criteria specified by the user. The component is an extension of a JPanel
and has multiple components like the ProTreeCombo and ProMoreFewerComponent
integrated in it.
How to use the component:
Since the ProSearchComponent is a JPanel, it has to be firstly embedded in
a container like a JDialog or a JFrame. Also, the class should implement an interface
called the SearchInterface. Typically, your class definition should look like
public class SearchDialogImplementation extends JFrame implements SearchInterface
You will have to then provide implementation for all of the methods listed in
the interface. This is to startoff with the UI aspect of the component.
The data to the component is actually fed through a Vector which is returned
by the getCriteriaVector() method in SearchInterface. Each and every element
in the Vector is an object of type CriteriaObject. Please refer to the Javadocs
of CriteriaObject for more details regarding this object. You will have to formulate
the vector in probably the constructor and finally make a call to the
method setSearchImpl() with "this" as the argument.Once this is done, the
ProSearchComponent makes a call to the getCriteriaObject() method to retrive the
data vector where you will have to return the vector constructed earlier with
CriteriaObjects. The following code sample will explain this procedure.
public class SearchDialogImplementation extends JFrame implements SearchInterface
{
private Vector criteriaVector = null;
public SearchDialogImplementation()
{
String name = "Name";
Vector v = new Vector();
v.addElement("Starts with");
v.addElement("Ends with");
v.addElement("Equals");
String className = "com.adventnet.beans.pro.TextFieldComponent";
criteriaVector.add(new CriteriaObject(name,v,className)); //criteriaVector to be
//populated before calling
//setSearchImpl() method.
ProSearchComponent searchCompnent = new ProSearchComponent();
searchCompnent.setSearchImpl(this); //When this call is made, the SearchComponent
//makes a call to the getCriteriaVector() method.
}
public Vector getCriteriaVector()
{
return criteriaVector;
}
//Implementations of other methods in SearchInterface should follow.
}
The ProSearchComponent is an integration of several other UI components
viz. ProTreeCombo, ProMoreFewerComponent,JButtons, JRadioButtons etc.
Whenever the various Buttons in the UI viz. Help, Close, Search etc. are
activated, the information is passed on to the Impl class through the
various methods listed in the Search Inteface. Users can give their implementations
for all these events. The methods of concern are handleHelpEvent(). handleCloseEvent(),
handleSearchEvent(),handleMoreEvent(), handleFewerEvent() and handleResultDisplayEvent().
Please refer to the javadocs of SearchInterface for more details on these methods.
Selective Search:
The ProSearchComponent has a ProTreeCombo which can be used for selective search. By selective search we mean that the search will be performed in a specific area. Say for example, we need to search for computers whose names starts with the letter "d" in a variety of networks present in an office. The ProTreeCombo can have entries for the various networks on which the search can be performed.
The component also uses the ProMoreFewerComponent for accepting the various search criteria. It is also possible to limit the number of "More" operations that can be performed by the user throught setMaximumCriteria() method. The "More" button gets automatically disabled whenever this upper limit is reached.
Whenever the Search button is activated in the UI, the search criteria that is specified by the user is passed on to the Implementation class through the handleSearchEvent() method.
| Inner classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
| Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
| 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 |
| Constructor Summary | |
ProSearchComponent()
Contructor used to instantiate a ProSearchComponent. |
|
ProSearchComponent(java.util.ResourceBundle bundle)
|
|
| Method Summary | |
void |
addComponentToStatusPanel(javax.swing.JComponent component)
Users can add additional components to the Status Panel using this method. |
static void |
centerWindow(java.awt.Component com)
This method can be used to center the container which is containing this SearchComponent in the window. |
int |
getMaximumCriteria()
This method can be used to get the maximum number of criterias that can be specified by the user (by using the "More" button). |
int |
getProgressBarBubbleShape()
This method can be used to get the Bubble shape that is configured for the the ProgressBar. |
ProMoreFewerComponent |
getProMoreFewerComponent()
Returns the ProMoreFewerComponent class as a
handle for the user to get the required values from the used
ProMoreFewerComponent. |
java.util.ResourceBundle |
getResourceBundle()
|
SearchInterface |
getSearchImpl()
This method can be used to get the instance of the class which has implemented the SearchInterface and set through the setSearchImpl() method. |
java.lang.String |
getStatus()
This method can be used to get the text that is appearing in the Status panel. |
java.awt.Color |
getStatusBackground()
This method can be used to get the Background color that is configured for the status panel. |
java.awt.Color |
getStatusForeground()
This method can be used to get the Foreground color that is configured for the status panel. |
static java.lang.String |
getString(java.lang.String key)
|
boolean |
isBubbleActive()
This methos returns if the bubble is currently active in the progress bar. |
boolean |
isBubbleVisible()
This method can be used to know whether the bubble in the progress bar is visible or not. |
boolean |
isMatchOptionEnabled()
This method returns whether the match option is set or not. |
boolean |
isProgressBarVisible()
This method return whether or not, the progress bar is visible in the status panel. |
boolean |
isResultDisplayEnabled()
This method is used to return if the Result display option is enabled for the component or not. |
boolean |
isStatusPanelVisible()
This method is used to return whether or not the Status Panel is visible. |
void |
registerForMoreFewerEvents(MoreFewerEventListener listener)
This method can be used to get notifications whenever the "More" or the "Fewer" button is activated in the UI. |
void |
removeComponentFromStatusPanel(javax.swing.JComponent component)
This method can be used to remove the component that was added to the status panel through the addComponentToStatusPanel() method. |
void |
removeShowResultComponent()
The user can remove the component he had added through the showResult() API. |
void |
setAllButtonsEnabled(boolean enable)
Use this method to enable or disable the various buttons viz. |
void |
setBubbleActive(boolean b)
This method can be used to set the Bubble to be active (i.e.to and fro movement). |
void |
setBubbleDelay(int speed)
This method can be used to set the speed with which the bubble in the progress bar has to be move. |
void |
setBubbleVisible(boolean b)
This method can be used to set whether the bubble inside the progress bar is visible or not. |
void |
setDataForSelectiveSearchCombo(javax.swing.tree.TreeModel model)
This method can be used to set a TreeModel to the ProTreeCombo which is used for selective search. |
void |
setDataForSelectiveSearchCombo(java.util.Vector v)
The data for the ProTreeCombo can either be a TreeModel or a set of Objects (String) contained in the Vector. |
void |
setMatchOptionEnabled(boolean b)
This method can be used to specify if the default options viz. |
void |
setMaximumCriteria(int i)
This method can be used to set the maximum permissible criterias that can be specified by the user in the UI. |
void |
setProgressBarBubbleShape(int shape)
This method is used to set the Bubble shape of the ProgressBar. |
void |
setProgressBarVisible(boolean b)
This method can be used to set if the Progress bar has to be visible in the status panel or not. |
void |
setResourceBundle(java.util.ResourceBundle bundle)
|
void |
setResultDisplayEnabled(boolean b)
Used this method to specify if the Result diaplay should be enabled after a Search operation. |
void |
setSearchImpl(SearchInterface impl)
This method is used to set the class instance which has provided an implementation for the SearchInterface. |
void |
setSelectiveSearchComboSize(java.awt.Dimension d)
This method can be used to set the Preferred size of the ProTreeCombo which is used for selective search. |
void |
setStatus(java.lang.String str)
This method can be used to set the Text in the Status Bar. |
void |
setStatusBackground(java.awt.Color c)
This method can be used to set the Background color of the Status Panel. |
void |
setStatusForeground(java.awt.Color c)
This method can be used to set the Foreground color of the Status Panel. |
void |
setStatusPanelVisible(boolean b)
This method can be used to specify if the Status panel has to be visible or not. |
void |
showResult(javax.swing.JComponent comp)
The result of the Search operation can be shown as part of the SearchComponent itself using this method. |
void |
updateSearchButton(java.lang.String str,
java.lang.String strArg)
The user can set the Search button name to toggle between the "Search" and "Stop" in his application . |
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext,
getUIClassID,
paramString,
updateUI |
| Methods inherited from class javax.swing.JComponent |
addAncestorListener,
addNotify,
addPropertyChangeListener,
addPropertyChangeListener,
addVetoableChangeListener,
computeVisibleRect,
contains,
createToolTip,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
fireVetoableChange,
getActionForKeyStroke,
getAlignmentX,
getAlignmentY,
getAutoscrolls,
getBorder,
getBounds,
getClientProperty,
getComponentGraphics,
getConditionForKeyStroke,
getDebugGraphicsOptions,
getGraphics,
getHeight,
getInsets,
getInsets,
getLocation,
getMaximumSize,
getMinimumSize,
getNextFocusableComponent,
getPreferredSize,
getRegisteredKeyStrokes,
getRootPane,
getSize,
getToolTipLocation,
getToolTipText,
getToolTipText,
getTopLevelAncestor,
getVisibleRect,
getWidth,
getX,
getY,
grabFocus,
hasFocus,
isDoubleBuffered,
isFocusCycleRoot,
isFocusTraversable,
isLightweightComponent,
isManagingFocus,
isOpaque,
isOptimizedDrawingEnabled,
isPaintingTile,
isRequestFocusEnabled,
isValidateRoot,
paint,
paintBorder,
paintChildren,
paintComponent,
paintImmediately,
paintImmediately,
print,
printAll,
processComponentKeyEvent,
processFocusEvent,
processKeyEvent,
processMouseMotionEvent,
putClientProperty,
registerKeyboardAction,
registerKeyboardAction,
removeAncestorListener,
removeNotify,
removePropertyChangeListener,
removePropertyChangeListener,
removeVetoableChangeListener,
repaint,
repaint,
requestDefaultFocus,
requestFocus,
resetKeyboardActions,
reshape,
revalidate,
scrollRectToVisible,
setAlignmentX,
setAlignmentY,
setAutoscrolls,
setBackground,
setBorder,
setDebugGraphicsOptions,
setDoubleBuffered,
setEnabled,
setFont,
setForeground,
setMaximumSize,
setMinimumSize,
setNextFocusableComponent,
setOpaque,
setPreferredSize,
setRequestFocusEnabled,
setToolTipText,
setUI,
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,
setCursor,
setLayout,
validate,
validateTree |
| Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
bounds,
checkImage,
checkImage,
coalesceEvents,
contains,
createImage,
createImage,
disable,
disableEvents,
dispatchEvent,
enable,
enable,
enableEvents,
enableInputMethods,
getBackground,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont,
getFontMetrics,
getForeground,
getInputContext,
getInputMethodRequests,
getLocale,
getLocation,
getLocationOnScreen,
getName,
getParent,
getPeer,
getSize,
getToolkit,
getTreeLock,
gotFocus,
handleEvent,
hide,
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,
processInputMethodEvent,
processMouseEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
repaint,
repaint,
repaint,
resize,
resize,
setBounds,
setBounds,
setComponentOrientation,
setDropTarget,
setLocale,
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 |
| Constructor Detail |
public ProSearchComponent()
public ProSearchComponent(java.util.ResourceBundle bundle)
| Method Detail |
public void setResourceBundle(java.util.ResourceBundle bundle)
public java.util.ResourceBundle getResourceBundle()
public static java.lang.String getString(java.lang.String key)
public void registerForMoreFewerEvents(MoreFewerEventListener listener)
listener - The listener for "More" and "Fewer" events.public void setMaximumCriteria(int i)
i - The number count.getMaximumCriteria()public int getMaximumCriteria()
setMaximumCriteria()public void setSelectiveSearchComboSize(java.awt.Dimension d)
d - The dimension that needs to be setpublic void setDataForSelectiveSearchCombo(java.util.Vector v)
v - Vector which contains Objects which needs to be listed in the Combo box.public void setDataForSelectiveSearchCombo(javax.swing.tree.TreeModel model)
model - TreeModel that is to be set for the ProTreeCombo.public void setSearchImpl(SearchInterface impl)
impl - The class which has provided an implementation for the SearchInterface.public SearchInterface getSearchImpl()
public void setAllButtonsEnabled(boolean enable)
public void showResult(javax.swing.JComponent comp)
comp - The component that needs to be displayed.
NOTE : This is possible only if the "resultDisplayEnabled" option is set. It is NOT
set by default. Use the setResultDisplayEnabled(true) to turn this option ON.public void setStatusPanelVisible(boolean b)
b - Whether or not status panel should be visible.public void setResultDisplayEnabled(boolean b)
b - Whether or not the result display should be enabled.public void setMatchOptionEnabled(boolean b)
b - Whether or not the RadioButtons are required.isMatchOptionEnabled()public boolean isStatusPanelVisible()
public boolean isResultDisplayEnabled()
public boolean isMatchOptionEnabled()
setMatchOptionEnabled()public void setStatus(java.lang.String str)
str - The text that is to be set in the Status panel.public java.lang.String getStatus()
setStatus()public void setStatusBackground(java.awt.Color c)
c - Background color for the Status Panel.getStatusBackground()public java.awt.Color getStatusBackground()
setStatusBackground()public void setStatusForeground(java.awt.Color c)
c - Foreground color for the Status Panel.getStatusForeground()public java.awt.Color getStatusForeground()
setStatusForeground()public void addComponentToStatusPanel(javax.swing.JComponent component)
component - The component to be added in the status panel.removeComponentFromStatusPanel()public void removeComponentFromStatusPanel(javax.swing.JComponent component)
component - The component to be removed from the status panel.addComponentToStatusPanel()public int getProgressBarBubbleShape()
setProgressBarBubbleShape()public void setProgressBarBubbleShape(int shape)
shape - The bubble shape of the progress bar.getProgressBarBubbleShape()public void setBubbleActive(boolean b)
b - Whether the bubble should be set to movement or stopped from movement.public boolean isBubbleActive()
setBubbleActive()public void setBubbleDelay(int speed)
speed - The speed that is to be set for the bubble.public void setProgressBarVisible(boolean b)
b - Whether or not the progress bar has to be visible.isProgressBarVisible()public boolean isProgressBarVisible()
public void setBubbleVisible(boolean b)
b - whether the bubble is visible or not.isBubbleVisible()public boolean isBubbleVisible()
setBubbleVisible()public static void centerWindow(java.awt.Component com)
com - The component (container) to be centered.
public void updateSearchButton(java.lang.String str,
java.lang.String strArg)
str - a String value to represent the name of the button.strArg - a String value to represent the ActionCommand of the button.public ProMoreFewerComponent getProMoreFewerComponent()
ProMoreFewerComponent class as a
handle for the user to get the required values from the used
ProMoreFewerComponent.ProMoreFewerComponent value of the
current instance used in ProSearchComponentpublic void removeShowResultComponent()
|
Bean Builder | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||