|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.swing.visuals.tableview.EditController
public class EditController
Interface for implementing controllers to edit models for tables.
When specifying a column when using the method on the EditController, use the actual column name from the model and not the column label to avoid conflicts between the two.
Field Summary | |
---|---|
protected java.lang.String[] |
editableColumns
|
protected boolean |
editEnabled
|
protected int |
insertMode
|
Fields inherited from interface com.sas.table.EditControllerInterface |
---|
DEFAULT_INDEX, EXTEND, INSERT |
Constructor Summary | |
---|---|
EditController()
Default constructor |
Method Summary | |
---|---|
java.lang.String[] |
getEditableColumns()
Returns the columns in which editing is allowed. |
int |
getInsertMode()
Returns the insert mode for the controller. |
boolean |
isEditableColumn(java.lang.String columnName)
Returns a boolean indicating whether the column is allowed to be edited. |
boolean |
isEditEnabled()
Returns whether editing has been enabled for the TableView. |
void |
setEditableColumns(java.lang.String[] columnNames)
Sets the columns in which editing is allowed. |
void |
setEditEnabled(boolean edit)
Enables or disables editing on the TableView. |
void |
setInsertMode(int mode)
Sets the insert mode for the controller. |
Field Detail |
---|
protected boolean editEnabled
protected int insertMode
protected java.lang.String[] editableColumns
Constructor Detail |
---|
public EditController()
Method Detail |
---|
public void setEditEnabled(boolean edit)
setEditEnabled
in interface com.sas.table.EditControllerInterface
edit
- whether to enable editing on the TableViewpublic boolean isEditEnabled()
isEditEnabled
in interface com.sas.table.EditControllerInterface
public java.lang.String[] getEditableColumns()
getEditableColumns
in interface com.sas.table.EditControllerInterface
public void setEditableColumns(java.lang.String[] columnNames)
When specifying a column when using the method on the EditController, use the actual column name from the model and not the column label to avoid conflicts between the two.
setEditableColumns
in interface com.sas.table.EditControllerInterface
columnNames
- An array of column names in which editing is allowed.public boolean isEditableColumn(java.lang.String columnName)
When specifying a column when using the method on the EditController, use the actual column name from the model and not the column label to avoid conflicts between the two.
isEditableColumn
in interface com.sas.table.EditControllerInterface
columnName
- The name of the column to query about whether it is
allowed to be edited.
public int getInsertMode()
Returns the insert mode for the controller. Valid values are EditControllerInterface.INSERT and EditControllerInterface.EXTEND. If mode is EditControllerInterface.INSERT, then the controller will allow rows to be inserted before each row in the table. If mode is EditControllerInterface.EXTEND, then the controller will allow rows to be inserted at the default location (usually the end, this is model specific) of the table.
If the model is a javax.swing.table.DefaultTableModel then either mode is available. Otherwise, if the model implements com.sas.table.InsertRowInterface, then the table will follow the following rules. If InsertRowInterface.isRowInsertionAllowed() is false, then inserting will be disabled. If true, then the InsertRowInterface.isExtendOnly() method is checked. If isExtendOnly() returns true, then then EXTEND mode is available and the INSERT mode is not available. If isExtendOnly() returns false then both modes, INSERT and EXTEND, are both available. If a mode is selected but not available on the model, then the actions for that mode will be disabled.
The default value for insertMode is (INSERT | EXTEND). So both mode are available by default.
getInsertMode
in interface com.sas.table.EditControllerInterface
public void setInsertMode(int mode)
Sets the insert mode for the controller. Valid values are EditControllerInterface.INSERT and EditControllerInterface.EXTEND. If mode is EditControllerInterface.INSERT, then the controller allows a new row to be inserted before each row in the table. If mode is EditControllerInterface.EXTEND, then the controller allow a new row to be inserted at the default location (usually the end, this is model specific) of the table.
If the model is a javax.swing.table.DefaultTableModel then either mode is available. Otherwise, if the model implements com.sas.table.InsertRowInterface, then the table will follow the following rules. If InsertRowInterface.isRowInsertionAllowed() is false, then inserting will be disabled. If true, then the InsertRowInterface.isExtendOnly() method is checked. If isExtendOnly() returns true, then then EXTEND mode is available and the INSERT mode is not available. If isExtendOnly() returns false then both modes, INSERT and EXTEND, are both available. If a mode is selected but not available on the model, then the actions for that mode will be disabled.
The default value for insertMode is (INSERT | EXTEND). So both mode are available by default.
setInsertMode
in interface com.sas.table.EditControllerInterface
mode
- the type of inserting to allow on the controller
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |