|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--javax.swing.JPanel
|
+--com.ca.commons.cbutil.CBPanel
|
+--com.ca.directory.jxplorer.search.BuildFilterPanel
Creates a scrollable panel that can add and remove rows that are used to build raw filters. Each row consists of an attribute combo box ('sn'), a function combo box ('Equal To'), and text field that the user can enter the filter value. If there are more than one row, an And/Or combo is added to the second row and and And/Or labels to all rows there after. The And/Or labels always show the value of the And/Or combo box.
This idea behind this class is that a user can build simple raw filters (e.g. (&(cn=f*)(sn=f*)) with only one function ('|' or '&').
This panel is controlled by the SearchGUI class. I.e. the SearchGUI class tells this class to add or remove a row or to edit or load a certain filter. It also feeds back to the SearchGUI the values of it's components when required.
| Nested Class Summary |
| Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
| Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
| Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary |
| Fields inherited from class com.ca.commons.cbutil.CBPanel |
c, xpos, ypos |
| 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 | |
BuildFilterPanel(JXplorer jx)
Constructor that sets up the Build tab with a not check box, and the first row e.g an attribute combo, a function combo and a text field. |
|
| Method Summary | |
protected void |
addFilterRow()
Addes a row or line to the Join tab. |
protected void |
checkForSpecialEditor(java.lang.String attrName,
javax.swing.JTextField field)
Takes an attribute name and checks its syntax against that of the GeneralizedTime syntax (~121.1.24). |
protected boolean |
displayFilter(java.lang.String filter)
Attempts to display a filter usually after someone has selected to load a filter via the load dialog or via the edit button in the search dialog. |
protected java.lang.String |
getAttributeComboValue(java.lang.String filter)
Returns the attribute value that is being search for. |
protected java.lang.String[] |
getAttributes()
Gets a list of attributes that are available in the schema which can be used for searching. |
protected java.lang.String |
getFilter()
Constructs the filter by adding filter parts to a string buffer for each row in the filter constructor. |
protected java.lang.String |
getFilterFieldText(java.lang.String filter)
Returns the value that is being search for. |
protected java.lang.String |
getFunctionPart(int i)
Constructs the body ('(cn=w*)') of the filter by reading the attribute type selected (i.e. |
protected int |
getFunctionPosition(java.lang.String filter)
Determines what the function of the filter is for example if it is a ~= or (!) |
protected int |
getOccurrences(java.lang.String string,
java.lang.String substring)
Counts the number of times a substring occurs within a string. |
protected boolean |
isFilterValid()
Checks if the filter is valid. |
protected void |
removeFilterRow()
Removes lines (rows) from the filter constructor. |
protected java.lang.String |
replace(java.lang.String string,
java.lang.String oldString,
java.lang.String newString)
Takes a string and replaces any occurances of a given string with another given string. |
protected java.lang.String |
trimFilter(java.lang.String filter)
Trims a string by two places at the beginning of the string and one place at the end of the string. |
| Methods inherited from class com.ca.commons.cbutil.CBPanel |
add, add, add, addGreedyWide, addGreedyWide, addLine, addLines, addln, addWide, makeHeavy, makeHigh, makeLight, makeWide, newLine, toString |
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
| Methods inherited from class java.awt.Container |
add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public BuildFilterPanel(JXplorer jx)
jx - JXplorer, used to get the search broker.| Method Detail |
protected boolean displayFilter(java.lang.String filter)
filter - the actual raw filter to be displayed e.g. '(!(|(!(sn=r*))(sn=e*)))'.
protected java.lang.String getAttributeComboValue(java.lang.String filter)
filter - the search filter that the value (or text) is to be extracted from (e.g '(cn=Bob)').
protected java.lang.String getFilterFieldText(java.lang.String filter)
filter - the search filter that the value (or text) is to be extracted from (e.g '(cn=Bob)').
protected int getFunctionPosition(java.lang.String filter)
filter - the filter that we are to determine the function of.
protected int getOccurrences(java.lang.String string,
java.lang.String substring)
string - the string that is getting checked for the occurence of a substring.substring - the substring that is being checked for.
protected java.lang.String trimFilter(java.lang.String filter)
filter - the string (e.g. (&(cn=f*)(sn=f*))) to trim.
protected void addFilterRow()
protected void checkForSpecialEditor(java.lang.String attrName,
javax.swing.JTextField field)
attrName - the attribute name - usually from the combo box in the Search dialog (Build
tab).field - the text field where the text will be set after the time dialog is closed.protected void removeFilterRow()
protected java.lang.String[] getAttributes()
protected boolean isFilterValid()
protected java.lang.String getFilter()
protected java.lang.String getFunctionPart(int i)
i - the row number that is being processed.
protected java.lang.String replace(java.lang.String string,
java.lang.String oldString,
java.lang.String newString)
string - the string that contains the text to be replaced.oldString - the text to be replaced.newString - the text to take the place of the old text.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||