Java Reference
In-Depth Information
then retrieves the names of the corresponding persisted mining
objects. The handlerUpdateTableContent code is shown here:
1. private void handlerUpdateTableContent() {
2.
NamedObject lNamedObject getSelectedNamedObjectType();
3.
String[] lMiningObjects getMiningObjects(lNamedObject);
4.
if (lNamedObject NamedObject.task) {
5.
mDisplayObjectsTable.setModel(
6.
new TaskTableModel(
7.
mDmeConn,
8.
lMiningObjects,
9.
getSelectedNamedObjectType()));
10.
} else {
11.
mDisplayObjectsTable.setModel(
12.
new MiningObjectsTableModel(
13.
mDmeConn,
14.
lMiningObjects,
15.
getSelectedNamedObjectType()));
16.
}
17. }
This code fills the TableModel associated with the Java Swing
graphical table used to display these objects. The graphical table
used to display named objects has three columns to display their
name, description, and creation date. The table used to display tasks
has two more columns to display task duration and status, and thus,
these columns have a specific TableModel . A TableModel is the object
underlying the graphical component that holds the values accessed
by row and column indices. The TableModel also provides the graphi-
cal component for the number of rows and columns to be displayed.
The code of getMiningObjects is detailed in 13.2.3.
13.2.3
Retrieving the List of Saved Objects
Retrieving the list of object names for a given named object class is
shown below.
1. private String[] getMiningObjects(NamedObject iNameObject) {
2.
Collection lMiningObjects null;
3.
try {
4.
lMiningObjects mDmeConn.getObjectNames(iNameObject);
5.
} catch (JDMException lException) {
6.
throw new UnexpectedJDMException(lException);
 
Search WWH ::




Custom Search