use of org.apache.sling.reqanalyzer.impl.gui.MainFrame in project sling by apache.
the class RequestAnalyzerWebConsole method showWindow.
private synchronized void showWindow() throws ServletException, IOException {
if (this.frame == null) {
final File toAnalyze = this.getLogFileCopy();
final Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
MainFrame frame = new MainFrame(toAnalyze, Integer.MAX_VALUE, screenSize);
// exit the application if the main frame is closed
frame.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
// remove the tmp file we showed
if (toAnalyze.exists()) {
toAnalyze.delete();
}
// clear the window reference
RequestAnalyzerWebConsole.this.frame = null;
}
});
this.frame = frame;
}
// make sure the window is visible, try to bring to the front
this.frame.setVisible(true);
this.frame.toFront();
}
use of org.apache.sling.reqanalyzer.impl.gui.MainFrame in project sling by apache.
the class RequestAnalyzerWebConsole method dispose.
void dispose() {
if (this.frame != null) {
MainFrame frame = this.frame;
this.frame = null;
AWTEvent e = new WindowEvent(frame, WindowEvent.WINDOW_CLOSING);
Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(e);
}
}
Aggregations