|
|||||||||
| Home >> All >> org >> scopemvc >> view >> [ swing overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.scopemvc.view.swing
Class STable

java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JTable
org.scopemvc.view.swing.STable
- All Implemented Interfaces:
- javax.accessibility.Accessible, javax.swing.event.CellEditorListener, java.util.EventListener, java.awt.image.ImageObserver, javax.swing.event.ListSelectionListener, ListSelectionParent, java.awt.MenuContainer, java.awt.event.MouseListener, Refreshable, javax.swing.Scrollable, java.io.Serializable, javax.swing.event.TableColumnModelListener, javax.swing.event.TableModelListener, org.scopemvc.core.View
- public class STable
- extends javax.swing.JTable
- implements org.scopemvc.core.View, Refreshable, java.awt.event.MouseListener, ListSelectionParent
- extends javax.swing.JTable
A JTable bound to a list property of a model. The table shows a list
of rows from the bound property (see setSelector(org.scopemvc.core.Selector) 55 ). If the rows
are model objects, the properties shown for each column are set
using setColumnSelectors(org.scopemvc.core.Selector[]) 55 . See also setColumnNames(java.lang.String[]) 55 .
STable uses STableModel and so the contents can be sorted using setSorted(boolean) 55 or setSorted(Comparator) 55 .
STable uses a standard (non-bound) Swing ListSelectionModel
unless a selection Selector is set using setSelectionSelector(org.scopemvc.core.Selector) 55
or setSelectionSelectorString(java.lang.String) 55 in which case a bound
SListSelectionModel is used. This allows both single-selection
and an as-yet-limited multiselection (contiguous only) using a HashSet
property to hold the selected objects. See SListSelectionModel,
which is used by STable to maintain bound selections.
- Version:
- $Revision: 1.17 $ $Date: 2002/05/23 17:05:24 $
| Nested Class Summary | |
(package private) static class |
STable.BooleanEditor
|
(package private) static class |
STable.BooleanRenderer
|
| Nested classes inherited from class javax.swing.JTable |
javax.swing.JTable.AccessibleJTable |
| 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 | |
private java.lang.String |
doubleClickControlID
Control to issue on double click. |
protected java.util.HashMap |
editors
|
private static org.apache.commons.logging.Log |
LOG
|
protected java.util.HashMap |
renderers
|
private java.lang.String |
selectionControlID
Control to issue on selection change. |
private ValidationHelper |
validationHelper
Helper to manage validation state. |
| 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.Container |
|
| 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 | |
STable()
|
|
| Method Summary | |
protected javax.swing.table.TableModel |
createDefaultDataModel()
STables create their own STableModel by default. |
protected void |
createDefaultEditors()
Create the default editors for this table. |
protected void |
createDefaultRenderers()
Sets default Scope table cell renderers. |
javax.swing.JToolTip |
createToolTip()
Return the toolTip property of this component, creating it and
setting it if it is currently null. |
java.lang.Object |
findElementAt(int inIndex)
|
int |
findIndexFor(java.lang.Object inValue)
|
java.lang.Object |
getBoundModel()
|
java.lang.String |
getChangeSelectionControlID()
Get the Control ID for the Control that will be issued when the selection is changed. |
org.scopemvc.core.Controller |
getController()
Don't assign a direct Controller to List, instead delegate to the containing SwingView that has a parent Controller. |
javax.swing.table.TableCellEditor |
getDefaultEditor(java.lang.Class columnClass)
Get the default editor for editing values of the given type (String, Boolean and so on). |
javax.swing.table.TableCellRenderer |
getDefaultRenderer(java.lang.Class columnClass)
Get the default renderer for rendering the given data type. |
java.lang.String |
getDoubleClickControlID()
Get the Control ID for the Control that will be issued when the List is double-clicked. |
void |
issueChangeSelectionControl()
|
void |
issueControl(org.scopemvc.core.Control inControl)
Don't assign a direct Controller to List, instead delegate to the containing SwingView that has a parent Controller. |
void |
mouseClicked(java.awt.event.MouseEvent e)
This method is called when the mouse is clicked (pressed and released in short succession) on a component. |
void |
mouseEntered(java.awt.event.MouseEvent e)
This method is called when the mouse enters a component. |
void |
mouseExited(java.awt.event.MouseEvent e)
This method is called when the mouse exits a component. |
void |
mousePressed(java.awt.event.MouseEvent e)
This method is called when the mouse is pressed over a component. |
void |
mouseReleased(java.awt.event.MouseEvent e)
This method is called when the mouse is released over a component. |
void |
refresh()
Update the widget with the current state of the bound model. |
void |
refreshSelection()
|
void |
setBoundModel(java.lang.Object inModel)
|
void |
setChangeSelectionControlID(java.lang.String inControlID)
Set the Control ID for the Control that will be issued when the selection is changed. |
void |
setColumnNames(java.lang.String[] inNames)
Set up the column names. |
void |
setColumnSelectors(org.scopemvc.core.Selector[] inSelectors)
Set up the column selectors. |
void |
setColumnSelectorStrings(java.lang.String[] inSelectorStrings)
Set up the column selectors. |
void |
setController(org.scopemvc.core.Controller inController)
Don't assign a direct Controller to List, instead delegate to the containing SwingView that has a parent Controller. |
void |
setDoubleClickControlID(java.lang.String inControlID)
Set the Control ID for the Control that will be issued when the List is double-clicked. |
void |
setSelectionSelector(org.scopemvc.core.Selector inSelector)
Set the Selector for the list selection: this property will be bound to the list's single selection. |
void |
setSelectionSelectorString(java.lang.String inSelectorString)
Set the Selector for the list selection: this property will be bound to the list's single selection. |
void |
setSelector(org.scopemvc.core.Selector inSelector)
Set the Selector for the table data. |
void |
setSelectorString(java.lang.String inSelectorString)
Set the Selector for the table data. |
void |
validationFailed(java.lang.Exception inException)
|
void |
validationSuccess()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.scopemvc.view.swing.ListSelectionParent |
setEnabled |
| Field Detail |
LOG
private static final org.apache.commons.logging.Log LOG
validationHelper
private ValidationHelper validationHelper
- Helper to manage validation state.
selectionControlID
private java.lang.String selectionControlID
- Control to issue on selection change.
doubleClickControlID
private java.lang.String doubleClickControlID
- Control to issue on double click.
editors
protected java.util.HashMap editors
renderers
protected java.util.HashMap renderers
| Constructor Detail |
STable
public STable()
| Method Detail |
createDefaultDataModel
protected javax.swing.table.TableModel createDefaultDataModel()
- STables create their own STableModel by default.
getBoundModel
public final java.lang.Object getBoundModel()
- Specified by:
getBoundModelin interfaceorg.scopemvc.core.View
setBoundModel
public final void setBoundModel(java.lang.Object inModel)
- Specified by:
setBoundModelin interfaceorg.scopemvc.core.View
setSelector
public final void setSelector(org.scopemvc.core.Selector inSelector)
- Set the Selector for the table data. Should be a java.util.List
or an Object[] or have a "size" property and properties accessible
by an IntIndexedSelector.
setSelectorString
public final void setSelectorString(java.lang.String inSelectorString)
- Set the Selector for the table data. Should be a java.util.List
or an Object[] or have a "size" property and properties accessible
by an IntIndexedSelector.
setColumnSelectors
public void setColumnSelectors(org.scopemvc.core.Selector[] inSelectors)
- Set up the column selectors.
setColumnSelectorStrings
public void setColumnSelectorStrings(java.lang.String[] inSelectorStrings)
- Set up the column selectors.
setColumnNames
public void setColumnNames(java.lang.String[] inNames)
- Set up the column names.
setSelectionSelector
public final void setSelectionSelector(org.scopemvc.core.Selector inSelector)
- Set the Selector for the list selection: this property will be
bound to the list's single selection.
setSelectionSelectorString
public final void setSelectionSelectorString(java.lang.String inSelectorString)
- Set the Selector for the list selection: this property will be
bound to the list's single selection.
refresh
public void refresh()
- Description copied from interface:
Refreshable - Update the widget with the current state of the bound model.
Probably something like this:
Object propertyValue = boundModel.getPropertyValue(); boolean propertyReadOnly = boundModel.getPropertyReadOnly(); updateFromProperty(propertyValue, propertyReadOnly);- Specified by:
refreshin interfaceRefreshable
refreshSelection
public void refreshSelection()
findIndexFor
public int findIndexFor(java.lang.Object inValue)
- Specified by:
findIndexForin interfaceListSelectionParent
findElementAt
public java.lang.Object findElementAt(int inIndex)
- Specified by:
findElementAtin interfaceListSelectionParent
validationFailed
public void validationFailed(java.lang.Exception inException)
- Specified by:
validationFailedin interfaceListSelectionParent
validationSuccess
public void validationSuccess()
- Specified by:
validationSuccessin interfaceListSelectionParent
createToolTip
public javax.swing.JToolTip createToolTip()
- Description copied from class:
javax.swing.JComponent - Return the
toolTipproperty of this component, creating it and setting it if it is currentlynull. This method can be overridden in subclasses which wish to control the exact form of tooltip created.
issueChangeSelectionControl
public void issueChangeSelectionControl()
- Specified by:
issueChangeSelectionControlin interfaceListSelectionParent
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent e)
- Description copied from interface:
java.awt.event.MouseListener - This method is called when the mouse is clicked (pressed and released
in short succession) on a component.
- Specified by:
mouseClickedin interfacejava.awt.event.MouseListener
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
- Description copied from interface:
java.awt.event.MouseListener - This method is called when the mouse is pressed over a component.
- Specified by:
mousePressedin interfacejava.awt.event.MouseListener
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
- Description copied from interface:
java.awt.event.MouseListener - This method is called when the mouse is released over a component.
- Specified by:
mouseReleasedin interfacejava.awt.event.MouseListener
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent e)
- Description copied from interface:
java.awt.event.MouseListener - This method is called when the mouse enters a component.
- Specified by:
mouseEnteredin interfacejava.awt.event.MouseListener
mouseExited
public void mouseExited(java.awt.event.MouseEvent e)
- Description copied from interface:
java.awt.event.MouseListener - This method is called when the mouse exits a component.
- Specified by:
mouseExitedin interfacejava.awt.event.MouseListener
getChangeSelectionControlID
public java.lang.String getChangeSelectionControlID()
- Get the Control ID for the Control that will be issued when
the selection is changed.
setChangeSelectionControlID
public final void setChangeSelectionControlID(java.lang.String inControlID)
- Set the Control ID for the Control that will be issued when
the selection is changed. If null no Control will be issued.
getDoubleClickControlID
public java.lang.String getDoubleClickControlID()
- Get the Control ID for the Control that will be issued when
the List is double-clicked.
setDoubleClickControlID
public final void setDoubleClickControlID(java.lang.String inControlID)
- Set the Control ID for the Control that will be issued when
the List is double-clicked. If null no Control will be issued.
setController
public void setController(org.scopemvc.core.Controller inController)
- Don't assign a direct Controller to List, instead delegate
to the containing SwingView that has a parent Controller.
- Specified by:
setControllerin interfaceorg.scopemvc.core.View
getController
public org.scopemvc.core.Controller getController()
- Don't assign a direct Controller to List, instead delegate
to the containing SwingView that has a parent Controller.
- Specified by:
getControllerin interfaceorg.scopemvc.core.View
issueControl
public void issueControl(org.scopemvc.core.Control inControl)
- Don't assign a direct Controller to List, instead delegate
to the containing SwingView that has a parent Controller.
- Specified by:
issueControlin interfaceorg.scopemvc.core.View
getDefaultEditor
public javax.swing.table.TableCellEditor getDefaultEditor(java.lang.Class columnClass)
- Description copied from class:
javax.swing.JTable - Get the default editor for editing values of the given type
(String, Boolean and so on).
getDefaultRenderer
public javax.swing.table.TableCellRenderer getDefaultRenderer(java.lang.Class columnClass)
- Description copied from class:
javax.swing.JTable - Get the default renderer for rendering the given data type.
createDefaultRenderers
protected void createDefaultRenderers()
- Sets default Scope table cell renderers. They
use Scope's StringConverters.
createDefaultEditors
protected void createDefaultEditors()
- Description copied from class:
javax.swing.JTable - Create the default editors for this table. The default method creates
the editor for Booleans.
Other fields are edited as strings at the moment.
|
|||||||||
| Home >> All >> org >> scopemvc >> view >> [ swing overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC