NewHandlerDialog nhd = new NewHandlerDialog(monitor, NEW_HANDLER, true);
nhd.init();
nhd.setVisible(true);
if (nhd.returnBool) {
//
DocTypeHandler dh = new DocTypeHandler(nhd.extField.getText(), nhd.descField.getText(), nhd.appField.getText());
monitor.handlerList.add(dh);
setList();
}
} // end for adding a handler
else if (s.equals(REMOVE)) {
int chosen = handlerList.getSelectedIndex();
if (chosen != -1) {
removeItemAt(chosen);
monitor.handlerList.remove(chosen);
setList();
}
} // end for adding a handler
else if (s.equals(EDIT)) {
int chosen = handlerList.getSelectedIndex();
if (chosen != -1) {
//
NewHandlerDialog nhd = new NewHandlerDialog(monitor, EDIT_HANDLER, true);
// set the values of the selected item
nhd.init();
nhd.setDTH(monitor.handlerList.get(chosen));
nhd.setVisible(true);
if (nhd.returnBool) {
DocTypeHandler dh = monitor.handlerList.get(chosen);
dh = new DocTypeHandler(nhd.extField.getText(), nhd.descField.getText(), nhd.appField.getText());
monitor.handlerList.set(chosen, dh);
setList();
}
} // end for item chosen
} // end for editing a handler