public void addWorkspace(final Workspace workspace) { if (!workspaceFrameMap.containsKey(workspace)) { // Add the workspace final WorkspaceFrame frame = new WorkspaceFrame(workspace); frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { if (doClose(workspace)){ // Remove the listener frame.removeWindowListener(this); frame.dispose(); } } }); workspaceFrameMap.put(workspace, frame); frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); frame.setVisible(true); } }
/** * Adds an open workspace to the manager which causes the workspace to be shown. * The manager will handle the closing of the workspace. * @param workspace The workspace to tbe added. */ public void addWorkspace(final Workspace workspace) { if (!workspaceFrameMap.containsKey(workspace)) { // Add the workspace final WorkspaceFrame frame = new WorkspaceFrame(workspace); frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { if (doClose(workspace)) { // Remove the listener frame.removeWindowListener(this); frame.dispose(); } } }); workspaceFrameMap.put(workspace, frame); frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); frame.setVisible(true); } }
/** * Adds an open workspace to the manager which causes the workspace to be shown. * The manager will handle the closing of the workspace. * @param workspace The workspace to tbe added. */ public void addWorkspace(final Workspace workspace) { if (!workspaceFrameMap.containsKey(workspace)) { // Add the workspace final WorkspaceFrame frame = new WorkspaceFrame(workspace); frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { if (doClose(workspace)) { // Remove the listener frame.removeWindowListener(this); frame.dispose(); } } }); workspaceFrameMap.put(workspace, frame); frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); frame.setVisible(true); } }