Java Reference
In-Depth Information
19.
setDatasetSettingsEnabled(false);
20.
throw new UnexpectedJDMException(lException);
21.
}
22.}
The call to
setDatasetSettingsEnabled
at line 4 enables the buttons
Check, Stats,
and
Build Model
because the connection has just been
established with the DME. In line 5,
getSupportedFunctions
returns the
list of supported functions. Each mining function is then processed to
enable its associated pane (sometimes called a
tab
in other environ-
ments) corresponding to the proper build settings. Once this is done,
we also validate the default URI through the call of
handlerCheck-
DataSet
.
13.3.2
Getting the Metadata
When the user hits
RETURN
after changing the
Physical Dataset
URI text
field, or when clicking on the
Check
button when creating the connec-
tion, the
handlerCheckDataSet
operation is performed as shown here:
1. private void handlerCheckDataSet() {
2.
try {
3.
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
4.
createDatasetAndImportMetaData(mPhysicalDataset.getText());
String[] lAttributesNames
getAttributeNames();
5.
6.
// Comment the following line if you want the natural order
7.
Arrays.sort(lAttributesNames);
8.
populateCombos(lAttributesNames);
9.
} catch (UnexpectedJDMException lException) {
10.
JOptionPane.showMessageDialog(this, "Exception Occured: "
lException.getMessage());
11.
12.
} finally {
13.
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
14.
}
15.}
At line 3, we set the cursor to a shape indicating that the user must
wait because the metadata retrieval may take a while, for example,
when the connection to a database must be initialized. The cursor is
reset to its original shape at line 13.
Once the metadata has been populated, the list of attributes can
be retrieved from the
PhysicalDataSet.
This list is used to update a
Search WWH ::
Custom Search