stageCombo.setEditable(false);
stageCombo.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Stage stage = (Stage) stageCombo.getSelectedItem();
Integer intStage = stageId.get(stage);
mainPanel.setSelectedIndex(intStage);
}
});
addButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Stage stage = (Stage) stageCombo.getSelectedItem();
if (controller != null) {
controller.addHookCommand(stage);
}
}
});
deleteButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Collection<HookTableView> collection = hookMap.values();
for (HookTableView table : collection) {
table.deleteSelectedRows();
if (table.isEmpty()) {
Stage stage = table.getHookId();
int stageIndex = stageId.get(stage);
mainPanel.setEnabledAt(stageIndex, false);
}
}
}