public void actionPerformed(AdminAction action, ActionEvent ae) {
try {
String name = action._name;
boolean textModeChanged = false;
// System.out.println("AdminUI actionPerformed: " + name);
Management management = _management;
if (name.startsWith("REFRESH")) {
int interval = 0;
if (name.startsWith("REFRESH_")) {
interval = Integer.parseInt(name.substring("REFRESH_".length()));
}
scheduleRefresh(interval);
} else if ("EXIT".equals(name)) {
setManagement(null);
close();
} else if ("CONNECT".equals(name)) {
connectDialog(_rmiHost);
} else if ("DISCONNECT".equals(name)) {
disconnect();
} else if ("ABOUT".equals(name)) {
if (_splashWindow == null) {
_splashWindow = new SplashWindow(_frame);
_splashWindow.display();
}
} else if ("HELP".equals(name)) {
showHelp(ae);
} else if ("SSUSP".equals(name)) {
boolean state = ((AbstractButton) ae.getSource()).isSelected();
if (management != null && management.isInitialized()) {
if (state) {
int confirm = JOptionPane.showConfirmDialog(_frame, getProperty("ssusp.confirm"));
if (confirm != JOptionPane.YES_OPTION) {
state = false;
}
}
management.setShutdownSuspended(state);
scheduleRefresh(-1);
} else {
((AbstractButton) ae.getSource()).setSelected(false);
}
} else if ("USUSP".equals(name)) {
boolean state = ((AbstractButton) ae.getSource()).isSelected();
if (management != null && management.isInitialized()) {
if (state) {
int confirm = JOptionPane.showConfirmDialog(_frame, getProperty("ususp.confirm"));
if (confirm != JOptionPane.YES_OPTION) {
state = false;
}
}
management.setUpdateSuspended(state);
scheduleRefresh(-1);
} else {
((AbstractButton) ae.getSource()).setSelected(false);
}
} else if ("AONLY".equals(name)) {
boolean state = ((AbstractButton) ae.getSource()).isSelected();
if (management != null && management.isInitialized()) {
if (state) {
int confirm = JOptionPane.showConfirmDialog(_frame, getProperty("aonly.confirm"));
if (confirm != JOptionPane.YES_OPTION) {
state = false;
}
}
management.setAppendOnly(state);
scheduleRefresh(-1);
} else {
((AbstractButton) ae.getSource()).setSelected(false);
}
} else if ("JCOPY".equals(name)) {
boolean state = ((AbstractButton) ae.getSource()).isSelected();
if (management != null && management.isInitialized()) {
if (state) {
int confirm = JOptionPane.showConfirmDialog(_frame, getProperty("jcopy.confirm"));
if (confirm != JOptionPane.YES_OPTION) {
state = false;
}
}
management.setJournalCopyingFast(state);
scheduleRefresh(-1);
} else {
((AbstractButton) ae.getSource()).setSelected(false);
}
} else if ("FLUSH".equals(name)) {
if (management != null && management.isInitialized()) {
management.flushAndForce();
}
// } else if ("SHUTDOWN".equals(name)) {
// if (management != null && management.isInitialized()) {
// int confirm = JOptionPane.showConfirmDialog(_frame,
// getProperty("shutdown.confirm"));