@Override
public void run(final String text) {
final String hostName = host.getName();
final String command = "MakeKernelPanic";
guiData.startProgressIndicator(hostName, host.getDistString(command));
host.execCommand(new ExecCommandConfig().commandString(command));
guiData.stopProgressIndicator(hostName, host.getDistString(command));
}
});
submenu.add(panicMenuItem);
/* reboot */
final MyMenuItem rebootMenuItem = menuFactory.createMenuItem(
Tools.getString("HostBrowser.MakeKernelReboot") + host.getName(),
null,
new AccessMode(AccessMode.GOD, AccessMode.NORMAL),
new AccessMode(AccessMode.ADMIN, AccessMode.NORMAL))
.enablePredicate(new EnablePredicate() {
@Override
public String check() {
if (!host.isConnected()) {
return Host.NOT_CONNECTED_MENU_TOOLTIP_TEXT;
}
return null;
}
})
.addAction(new MenuAction() {
@Override
public void run(final String text) {
final String hostName = host.getName();
final String command = "MakeKernelReboot";
guiData.startProgressIndicator(hostName, host.getDistString(command));
host.execCommand(new ExecCommandConfig().commandString(command));
guiData.stopProgressIndicator(hostName, host.getDistString(command));
}
});
submenu.add(rebootMenuItem);
}