|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
semorg.gui.util.ExtensibleSearchControl
public class ExtensibleSearchControl
Provides a search control widget which can apply several conditions to the filter of a list window. This list of conditions can by expanded by the user to apply more and more conditions to the list window.
Field Summary | |
---|---|
private static String[] |
booleanComparators
Comparator constants which can be applied to boolean values. |
private org.eclipse.swt.widgets.Combo[] |
columnCombos
The combo fields containing the names of the columns which are used for the filtering. |
private Vector<DBColumn> |
columns
Columns on which the conditions get applied. |
private org.eclipse.swt.widgets.Combo[] |
comparatorCombos
The combo fields containing the applicable comparators. |
private org.eclipse.swt.widgets.Combo[] |
conjunctionCombos
The conjunction combos. |
private static String[] |
conjunctions
Conjunctions constants whose values depend on the selected language. |
private static String[] |
dateComparators
Comparator constants which can be applied to dates. |
private org.eclipse.swt.widgets.ToolItem[] |
extenders
The buttons which extends the filter.. |
private int |
filterExtensionCounter
The number of the applied conditions. |
private org.eclipse.swt.widgets.Composite[] |
filterExtensions
The filter extensions of the filter control. |
private org.eclipse.swt.widgets.Text[] |
filterTexts
The text fields of the filter control. |
private static String[] |
floatComparators
Comparator constants which can be applied to floar numbers. |
private static String[] |
intComparators
Comparator constants which can be applied to integers. |
private static String[] |
stringComparators
Comparator constants which can be applied to strings. |
private static String[] |
timeComparators
Comparator constants which can be applied to times. |
private static String[] |
timestampComparators
Comparator constants which can be applied to timestamps. |
private org.eclipse.swt.widgets.Composite |
window
The window containing the filter control. |
Fields inherited from class org.eclipse.swt.widgets.Control |
---|
handle |
Constructor Summary | |
---|---|
ExtensibleSearchControl(org.eclipse.swt.widgets.Composite parent,
int numberExtensions)
Instantiates a new extensible search control. |
Method Summary | |
---|---|
void |
addExtensionListener(org.eclipse.swt.events.SelectionListener arg0)
Adds the extension listener. |
void |
addModifyListener(org.eclipse.swt.events.ModifyListener arg0)
Adds the modify listener. |
private org.eclipse.swt.widgets.Composite |
createFilterExtension(int number)
Creates a filter extension, i.e. it creates widgets in the array conjunctionCombos , columnCombos ,
comparatorCombos and filterTexts at the specified
position. |
private String[] |
getComparatorString(String publicColumnName)
Firstly this function resolves the DBColumn instance for the
given public name and then returns the correct class of comparators
depending on the type of the DBColumn . |
Vector<DBConstraint> |
getConstraints()
Returns the constraints which are entered into the filter control by the user. |
private DBColumn |
getDBColumn(String publicColumnName)
Returns a DBColumn for a given public name. |
void |
setColumns(Vector<DBColumn> columns)
Inserts the given columns into the filter controls. |
void |
setData(String key,
String value)
Sets a pair of key and value to this control needed for testing with ATOSj. |
Methods inherited from class org.eclipse.swt.widgets.Composite |
---|
changed, checkSubclass, computeSize, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList |
Methods inherited from class org.eclipse.swt.widgets.Scrollable |
---|
computeTrim, getClientArea, getHorizontalBar, getVerticalBar |
Methods inherited from class org.eclipse.swt.widgets.Control |
---|
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update |
Methods inherited from class org.eclipse.swt.widgets.Widget |
---|
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final String[] conjunctions
private static final String[] stringComparators
private static final String[] intComparators
private static final String[] floatComparators
private static final String[] dateComparators
private static final String[] timestampComparators
private static final String[] timeComparators
private static final String[] booleanComparators
private Vector<DBColumn> columns
private int filterExtensionCounter
private final org.eclipse.swt.widgets.Composite[] filterExtensions
private final org.eclipse.swt.widgets.ToolItem[] extenders
private final org.eclipse.swt.widgets.Combo[] conjunctionCombos
private final org.eclipse.swt.widgets.Combo[] columnCombos
private final org.eclipse.swt.widgets.Combo[] comparatorCombos
private final org.eclipse.swt.widgets.Text[] filterTexts
private org.eclipse.swt.widgets.Composite window
Constructor Detail |
---|
public ExtensibleSearchControl(org.eclipse.swt.widgets.Composite parent, int numberExtensions)
parent
- the parent compositenumberExtensions
- the number of extensionsMethod Detail |
---|
private org.eclipse.swt.widgets.Composite createFilterExtension(int number)
conjunctionCombos
, columnCombos
,
comparatorCombos
and filterTexts
at the specified
position.
number
- the index of the extension to create.
public void addExtensionListener(org.eclipse.swt.events.SelectionListener arg0)
arg0
- the SelectionListener
to add.public void addModifyListener(org.eclipse.swt.events.ModifyListener arg0)
arg0
- the ModifyListener
to add.public Vector<DBConstraint> getConstraints() throws Exception
DBConstraint
instances.
DBConstraint
instances according to the
conditions of the filter control.
Exception
- if the parsing of dates, times, timestamps, integers or
float numbers fails for some reason.public void setColumns(Vector<DBColumn> columns)
columns
- vector of DBColumn
instances which should be
inserted into the filterprivate String[] getComparatorString(String publicColumnName)
DBColumn
instance for the
given public name and then returns the correct class of comparators
depending on the type of the DBColumn
.
publicColumnName
- the public name of the column
DBColumn
instance.private DBColumn getDBColumn(String publicColumnName)
DBColumn
for a given public name.
publicColumnName
- the public name of the column.
DBColumn
instance corresponding to the given public name.public void setData(String key, String value)
key
- the key (type) of the value setvalue
- the value set to the control
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |