|
Rational Developer for Power Systems Software V8.0 |
|||||||||
| 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.JTable
com.ibm.etools.iseries.ui.JFormattedTable
public class JFormattedTable
JFormattedTable extends javax.swing.JTable and implements com.ibm.etools.iseries.ui.JFormattedComponent.
It allows you to easily access and manipulate AS/400 database data when you use DefaultTableModel
as the TableModel and populate the data through ListManager bean.
JFormattedTable supports editcode, editword, formatting, and verification capabilities for AS/400 data
based on each table column. To allow for these capabilities, you should use JFormattedTableColumn inside JFormattedTable and
specify the column's cellEditor and cellRenderer as one of the following JFormatted cell editors or renderers:
JFormattedTextFieldCellEditor, JFormattedComboBoxCellEditor, or JFormattedLabelCellRenderer.
The default value of JFormattedTable's autoCreateColumnsFromModel property is true. If you create a
JFormattedTable with a table model, you can let JFormattedTable automatically create table columns, then
customize these columns.
For example:
String[] columnNames = {"ItemNo", "Model"}; // column names
String[][] items = { {"00001", "2000AB1"}, {"00002", "2000AB2"}};// table data
DefaultTableModel myModel = new DefaultTableModel(items, columnNames);
JFormattedTable itemTable=new JFormattedTable(myModel);
JFormattedTableColumn itemNoColumn;
try {
itemNoColumn = (JFormattedTableColumn)itemTable.getColumn("ItemNo");
itemNoColumn.setCellEditable(false); // set itemNoColumn as read only
} catch (Exception e){
itemNoColumn = null;
}
If you create a default JFormattedTable and add table columns to the JFormattedTable, you need to set
the autoCreateColumnsFromModel property as false.
JFormattedTable myTable=new JFormattedTable();
myTable.setAutoCreateColumnsFromModel(false);
JFormattedTableColumn myColumn = new JFormattedTableColumn();
myColumn.setIdentifier("model");
myColumn.setHeaderValue("Model");
myTable.addColumn(myColumn);
JFormattedComponent,
JTable,
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JTable |
|---|
JTable.AccessibleJTable, JTable.DropLocation, JTable.PrintMode |
| 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.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static String |
Copyright
|
| 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 com.ibm.etools.iseries.ui.JFormattedComponent |
|---|
copyright |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
JFormattedTable()
Creates a new JFormattedTable. |
|
JFormattedTable(FieldModel fm)
Creates a new JFormattedTable with the specified field model. |
|
JFormattedTable(int numRows,
int numColumns)
Creates a new JFormattedTable with the numRows and numColumns of empty cells. |
|
JFormattedTable(int numRows,
int numColumns,
FieldModel fm)
Creates a new JFormattedTable with the specified field model, number of rows and columns. |
|
JFormattedTable(Object[][] rowData,
Object[] columnNames)
Creates a new JFormattedTable with the specified data and column names. |
|
JFormattedTable(Object[][] rowData,
Object[] columnNames,
FieldModel fm)
Creates a new JFormattedTable with the specified data, column names and field model. |
|
JFormattedTable(TableModel dm)
Creates new JFormattedTable with the specified TableModel. |
|
JFormattedTable(TableModel dm,
FieldModel fm)
Creates a new JFormattedTable with the specified TableModel and FieldModel. |
|
JFormattedTable(TableModel dm,
TableColumnModel cm)
Creates a new JFormattedTable with the specified TableModel and TableColumnModel. |
|
JFormattedTable(TableModel dm,
TableColumnModel cm,
ListSelectionModel sm)
Creates a new JFormattedTable with the specified TableModel,TableColumnModel and ListSelectionModel. |
|
JFormattedTable(Vector rowData,
Vector columnNames)
Creates a new JFormattedTable with the specified data and column names. |
|
JFormattedTable(Vector rowData,
Vector columnNames,
FieldModel fm)
Creates a new JFormattedTable with the specified data, column names and field model. |
|
| Method Summary | |
|---|---|
static String |
Copyright()
Copyright notice. |
void |
createDefaultColumnsFromModel()
Creates default table columns from table model. |
FieldModel |
getFieldModel()
Gets the default field model. |
boolean |
isCellEditable(int row,
int column)
Returns true if the cell at row and column is editable. |
boolean |
isSelectionEmpty()
Returns true if nothing is selected. |
void |
setFieldModel(FieldModel fm)
Sets the default field model of the JFormattedTable. |
void |
setVisibleRowCount(int rows)
Sets how many rows to make visible at once. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String Copyright
| Constructor Detail |
|---|
public JFormattedTable()
public JFormattedTable(Object[][] rowData,
Object[] columnNames)
rowData - The data for the table.columnNames - The names of each column.
public JFormattedTable(Object[][] rowData,
Object[] columnNames,
FieldModel fm)
rowData - The data for the table.columnNames - The names of each column.fm - The default field model for formatting and validating.
public JFormattedTable(int numRows,
int numColumns)
numRows - The number of rows.numColumns - The number of columns.
public JFormattedTable(int numRows,
int numColumns,
FieldModel fm)
numRows - The number of rows.numColumns - The number of columns.fm - The default field model for formatting and validating.public JFormattedTable(FieldModel fm)
fm - The default field model for formatting and validating.
public JFormattedTable(Vector rowData,
Vector columnNames)
rowData - The data of the table.columnNames - The names of each column.
public JFormattedTable(Vector rowData,
Vector columnNames,
FieldModel fm)
rowData - The data of the table.columnNames - The names of each column.fm - The default field model for formatting and validating.public JFormattedTable(TableModel dm)
dm - the data model for the table.
public JFormattedTable(TableModel dm,
FieldModel fm)
dm - The data model of the table.fm - The default field model for formatting and validating.
public JFormattedTable(TableModel dm,
TableColumnModel cm)
dm - The data model for the table.cm - The column model for the table.
public JFormattedTable(TableModel dm,
TableColumnModel cm,
ListSelectionModel sm)
dm - The data model for the table.cm - The column model for the table.sm - The row selection model for the table.| Method Detail |
|---|
public static String Copyright()
public void createDefaultColumnsFromModel()
createDefaultColumnsFromModel in class JTableJFormattedTableColumn,
JTable.createDefaultColumnsFromModel()public FieldModel getFieldModel()
getFieldModel in interface JFormattedComponent
public boolean isCellEditable(int row,
int column)
isCellEditable in class JTablerow - The row number of the cell.column - The column number of the cell.JFormattedTableColumn,
JTable.isCellEditable(int, int)public boolean isSelectionEmpty()
public void setFieldModel(FieldModel fm)
setFieldModel in interface JFormattedComponentfm - The default field model for formatting and validating.JFormattedComponent.getFieldModel()public void setVisibleRowCount(int rows)
rows - The preferred number of rows to display without using a scrollbar.
|
Rational Developer for Power Systems Software V8.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||