Search in sources :

Example 1 with MainWindowListener

use of org.jivesoftware.MainWindowListener in project Spark by igniterealtime.

the class LayoutPlugin method initialize.

public void initialize() {
    final MainWindow mainWindow = SparkManager.getMainWindow();
    SparkManager.getMainWindow().addMainWindowListener(new MainWindowListener() {

        public void shutdown() {
            LayoutSettingsManager.getLayoutSettings().setMainWindowBounds(mainWindow.getBounds());
            if (mainWindow.isDocked()) {
                LayoutSettingsManager.getLayoutSettings().setSplitPaneDividerLocation(mainWindow.getSplitPane().getDividerLocation());
            } else {
                LayoutSettingsManager.getLayoutSettings().setSplitPaneDividerLocation(-1);
            }
            LayoutSettingsManager.saveLayoutSettings();
        }

        public void mainWindowActivated() {
        }

        public void mainWindowDeactivated() {
        }
    });
}
Also used : MainWindow(org.jivesoftware.MainWindow) MainWindowListener(org.jivesoftware.MainWindowListener)

Aggregations

MainWindow (org.jivesoftware.MainWindow)1 MainWindowListener (org.jivesoftware.MainWindowListener)1