shutdownReceiverButtonAction.setEnabled(false);
restartReceiverButtonAction =
new AbstractAction() {
public void actionPerformed(ActionEvent e) {
Receiver selectedReceiver = getCurrentlySelectedReceiver();
if(selectedReceiver == null){
return;
}
selectedReceiver.shutdown();
selectedReceiver.activateOptions();
}
};
restartReceiverButtonAction.putValue(
Action.SHORT_DESCRIPTION,
"Restarts the selected Receiver");
restartReceiverButtonAction.putValue(Action.NAME, "Restart");
restartReceiverButtonAction.putValue(
Action.SMALL_ICON, new ImageIcon(ChainsawIcons.ICON_RESTART));
restartReceiverButtonAction.putValue(
Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_R));
restartReceiverButtonAction.setEnabled(false);
showReceiverHelpAction =
new AbstractAction("Help") {
public void actionPerformed(ActionEvent e) {
Receiver receiver = getCurrentlySelectedReceiver();
if (receiver != null) {
HelpManager.getInstance().showHelpForClass(receiver.getClass());
}
}
};
showReceiverHelpAction.putValue(
Action.SMALL_ICON, new ImageIcon(ChainsawIcons.HELP));
showReceiverHelpAction.putValue(
Action.SHORT_DESCRIPTION, "Displays the JavaDoc page for this Plugin");
startAllAction =
new AbstractAction(
"(Re)start All Receivers", new ImageIcon(ChainsawIcons.ICON_RESTART_ALL)) {
public void actionPerformed(ActionEvent e) {
if (
JOptionPane.showConfirmDialog(
null,
"This will cause any active Receiver to stop, and disconnect. Is this ok?",
"Confirm", JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) {
new Thread(
new Runnable() {
public void run() {
Collection allReceivers =
pluginRegistry.getPlugins(Receiver.class);
for (Iterator iter = allReceivers.iterator();
iter.hasNext();) {
Receiver item = (Receiver) iter.next();
item.shutdown();
item.activateOptions();
}
updateReceiverTreeInDispatchThread();
MessageCenter.getInstance().getLogger().info(
"All Receivers have been (re)started");