/** * Creates the instance of the SupportChatWorkspace. */ private Workspace() { final MainWindow mainWindow = SparkManager.getMainWindow(); // Add MainWindow listener mainWindow.addMainWindowListener(new MainWindowListener() { public void shutdown() { final ChatContainer container = SparkManager.getChatManager().getChatContainer(); // Close all Chats. for (ChatRoom chatRoom : container.getChatRooms()) { // Leave ChatRoom container.leaveChatRoom(chatRoom); } conferences.shutdown(); gatewayPlugin.shutdown(); bookmarkPlugin.shutdown(); broadcastPlugin.shutdown(); } public void mainWindowActivated() { } public void mainWindowDeactivated() { } }); // Initialize workspace pane, defaulting the tabs to the bottom. boolean top = Default.getBoolean(Default.TABS_PLACEMENT_TOP); workspacePane = UIComponentRegistry.createWorkspaceTabPanel(top ? JTabbedPane.TOP : JTabbedPane.BOTTOM); workspacePane.setBorder(BorderFactory.createEmptyBorder()); // Add Panels. cardLayout = new CardLayout(); cardPanel = new JPanel(cardLayout); cardPanel.setOpaque(false); cardPanel.add(WORKSPACE_PANE, this); statusBox = UIComponentRegistry.createStatusBar(); // Build default workspace this.setLayout(new GridBagLayout()); add(workspacePane, new GridBagConstraints(0, 9, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); add(statusBox, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); this.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("F12"), "showDebugger"); this.getActionMap().put("showDebugger", new AbstractAction("showDebugger") { private static final long serialVersionUID = 4066886679016416923L; public void actionPerformed(ActionEvent evt) { EnhancedDebuggerWindow window = EnhancedDebuggerWindow.getInstance(); window.setVisible(true); } }); // Set background setBackground(new Color(235, 239, 254)); }