* start and kill nodes
*/
public void updateWidgetDropDown() {
List<NodeWidget> widgetList = current.getGenerator().getWidgets();
OozieDiagramController controller = current.getController();
if (widgetDropDown == null) {
widgetDropDown = new ArrayList<NodeWidget>();
}
else {
widgetDropDown.clear();
}
if (widgetList != null) {
for (NodeWidget w : widgetList) {
if (!(w instanceof KillNodeWidget) && !(w instanceof StartNodeWidget) && w != current) {
widgetDropDown.add(w);
}
}
}
// if okVal listbox doesn't exist, return
if (okVal != null) {
okVal.clear();
}
else {
return;
}
// insert empty option on top
okVal.addItem("");
for (int i = 0; i < widgetDropDown.size(); i++) {
NodeWidget w = widgetDropDown.get(i);
okVal.addItem(prettyItemString(w));
// option selected when this node widget is connected to the
// widget in a design panel
List<NodeWidget> neigh = controller.getCurrentNeighbor(current);
if (neigh != null && neigh.size() > 0 && w == neigh.get(0))
okVal.setSelectedIndex(i + 1);
}
// remove previous handler, otherwise, end up having multiple handlers