|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.citra.table.search.AbstractSearchPanel
com.citra.table.search.SearchTablePanel
public class SearchTablePanel
SearchTablePanel is a panel through which search model events are constructed and propagated to SearchModelListeners.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected JComboBox |
fieldBox
a combobox that contains the columns that we are able to search. |
Fields inherited from class com.citra.table.search.AbstractSearchPanel |
---|
closeButton, findLabel, foundBackgroundColor, foundForegroundColor, highLight, nextButton, notFound, notFoundBackgroundColor, notFoundForegroundColor, prevButton, searchModel |
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 | |
---|---|
SearchTablePanel(String[] fields)
Constructs a SearchTablePanel with fields as the fields that we are able to search. |
|
SearchTablePanel(String[] fields,
Class[] classes)
Constructs a SearchTablePanel with fields as the fields that we are able to search
and classes as the corresponding classes of each field. |
|
SearchTablePanel(TableModel tableModel)
Constructs a SearchTablePanel by quering tableModel for the fields
and their corresponding classes. |
Method Summary | |
---|---|
protected void |
createDefaultSeekers()
Creates default VisualSeeker for objects, strings, numbers and boolean values. |
VisualSeeker |
getDefaultSeeker(Class columnClass)
Returns the visual seeker to use for the class defined by columnClass. |
VisualSeeker |
getDefaultSeeker(int field)
Returns the visual seeker to use for the value at field . |
JComboBox |
getFieldBox()
Returns a combobox that contains the fields that we are able to search. |
protected TableSearch |
getTableSearchForSeeker(VisualSeeker seeker)
Returns a TableSearch for the seeker passed as argument. |
void |
highLight()
Searches the whole table in an arbitrary direction. |
protected void |
initComponents()
Initializes the components that will be added to the panel. |
protected void |
makePanel()
Initializes the panel. |
void |
next()
Searches in the forward direction. |
void |
previous()
Searches in the backward direction. |
void |
setCurrentSeeker(VisualSeeker seeker)
Assignes a visual seeker to the panel. |
void |
setDefaultSeeker(Class columnClass,
VisualSeeker seeker)
Sets the default visual seeker for columnClass. |
void |
setTable(JTable table)
Assigns a table to the SearchTablePanel. |
void |
update(TableModel model)
Updates the SearchTablePanel by querying model and recreating the
fields that we are able to search. |
void |
updateUI()
Resets the UI property with a value from the current look and feel. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected JComboBox fieldBox
Constructor Detail |
---|
public SearchTablePanel(String[] fields)
fields
as the fields that we are able to search.
The corresponing filter for each field is initialized to a StringFilter.
fields
- the fields, which usually are the columns of a table.public SearchTablePanel(String[] fields, Class[] classes)
fields
as the fields that we are able to search
and classes
as the corresponding classes of each field.
An IllegalArgumentException is thrown if fields
and classes
are not of the same length.
fields
- the fields, which ususally are the columns of a table.classes
- the associated classes to fields.public SearchTablePanel(TableModel tableModel)
tableModel
for the fields
and their corresponding classes. The search columns and classes are constructed by calling
the getColumnName and getColumnClass methods of TableModel respectively. Therefore,
these methods should not return null.
tableModel
- the tablemodel to queryMethod Detail |
---|
protected void createDefaultSeekers()
public VisualSeeker getDefaultSeeker(int field)
field
.
This method returns null by default. Override it in order to return your own visual seeker object.
field
- the field index to which a visual seeker is associated.
field
public VisualSeeker getDefaultSeeker(Class columnClass)
columnClass
- the class to which a visual seeker is associated.
public JComboBox getFieldBox()
protected TableSearch getTableSearchForSeeker(VisualSeeker seeker)
seeker
- the visual seeker for which we want a TableSearch returned
public void highLight()
highLight
in class AbstractSearchPanel
protected void initComponents()
initComponents
in class AbstractSearchPanel
protected void makePanel()
makePanel
in class AbstractSearchPanel
public void next()
next
in class AbstractSearchPanel
public void previous()
previous
in class AbstractSearchPanel
public void setCurrentSeeker(VisualSeeker seeker)
seeker
- the visual seeker to assignpublic void setDefaultSeeker(Class columnClass, VisualSeeker seeker)
columnClass
- the Class with which a visual seeker we want to associateseeker
- the visual seeker to assignpublic void setTable(JTable table)
table
- the table to assignpublic void update(TableModel model)
model
and recreating the
fields that we are able to search.
model
- the TableModel to querypublic void updateUI()
updateUI
in class JPanel
JComponent.updateUI()
|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |