* Runtime.getRuntime().halt(0); return; } showState(newState); } });
*/
ti.setImageAutoSize(true);
final JPopupMenu popup = new JPopupMenu();
_exitItem.setAction(new AbstractAction("Exit", createImageIcon("/resources/exit.png"))
{
public void actionPerformed(ActionEvent e)
{
popup.setVisible(false);
stop = true;
synchronized (tray)
{
tray.remove(ti);
}
}
});
_stopItem.setAction(new AbstractAction("Stop", createImageIcon("/resources/stop.png"))
{
public void actionPerformed(ActionEvent e)
{
executor.execute(new Runnable()
{
public void run()
{
if (_process != null)
try
{
_process.stop();
}
catch (Throwable ex)
{
ex.printStackTrace();
}
}
});
popup.setVisible(false);
}
});
_closeItem.setAction(new AbstractAction("Close Popup", createImageIcon("/resources/close.png"))
{
public void actionPerformed(ActionEvent e)
{
popup.setVisible(false);
}
});
_startItem.setAction(new AbstractAction("Start", createImageIcon("/resources/start.png"))
{
public void actionPerformed(ActionEvent e)
{
if (_process != null)
try
{
_process.start();
}
catch (Throwable ex)
{
ex.printStackTrace();
}
popup.setVisible(false);
}
});
_restartItem.setAction(new AbstractAction("Restart", createImageIcon("/resources/restart.png"))
{
public void actionPerformed(ActionEvent e)
{
if (_process != null)
try
{
_process.restart();
}
catch (Throwable ex)
{
ex.printStackTrace();
}
popup.setVisible(false);
}
});
_consoleItem.setAction(new AbstractAction("Console", createImageIcon("/resources/console.png"))
{
public void actionPerformed(ActionEvent e)
{
if (_process != null)
openConsole();
popup.setVisible(false);
}
});
_threadDumpItem.setAction(new AbstractAction("Thread Dump", createImageIcon("/resources/lightning.png"))
{
public void actionPerformed(ActionEvent e)
{
if (_process != null)
try
{
_process.threadDump();
}
catch (Throwable ex)
{
ex.printStackTrace();
}
popup.setVisible(false);
}
});
_stopTimerItem.setAction(new AbstractAction("Stop Timer/Condition", createImageIcon("/resources/clock_stop.png"))
{
public void actionPerformed(ActionEvent e)
{
if (_process != null)
{
try
{
_process.stopTimerCondition();
if (_console != null)
{
_console.setTimer(_process.isTimerActive());
_console.setCondition(_process.isConditionActive());
}
}
catch (Throwable ex)
{
ex.printStackTrace();
}
}
popup.setVisible(false);
}
});
_exitWrapperItem.setAction(new AbstractAction("Stop Wrapper", createImageIcon("/resources/exitWrapper.png"))
{
public void actionPerformed(ActionEvent e)
{
executor.execute(new Runnable()
{
public void run()
{
if (_process != null)
try
{
_process.stopWrapper();
}
catch (Throwable ex)
{
ex.printStackTrace();
}
}
});
popup.setVisible(false);
}
});
_threadDumpWrapperItem.setAction(new AbstractAction("TDump Wrapper", createImageIcon("/resources/lightning.png"))
{
public void actionPerformed(ActionEvent e)
{
if (_process != null)
try
{
_process.wrapperThreadDump();
}
catch (Throwable ex)
{
ex.printStackTrace();
}
popup.setVisible(false);
}
});
_closeConsoleItem.setAction(new AbstractAction("Close Console")
{
public void actionPerformed(ActionEvent e)
{
closeConsole();
popup.setVisible(false);
}
});
_startServiceItem.setAction(new AbstractAction("Start Service", createImageIcon("/resources/startService.png"))
{
public void actionPerformed(ActionEvent e)
{
if (_process == null)
{
try
{
WrappedService w = new WrappedService();
w.init();
w.start();
}
catch (Throwable ex)
{
ex.printStackTrace();
}
}
popup.setVisible(false);
}
});
_responseItem.setAction(new AbstractAction("Response", createImageIcon("/resources/Help16.gif"))
{
public void actionPerformed(ActionEvent e)
{
if (_process != null && _inquireMessage != null)
{