public WorkspaceFrame(Workspace workspace) { this.workspace = workspace; menuActions = new HashSet<ProtegeAction>(); createUI(); restoreMetrics(); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { if (OSUtils.isOSX()){ ProtegeAppleApplication.getInstance().setEditorKit(null); } saveMetrics(); removeWindowListener(this); } public void windowActivated(WindowEvent event) { if (OSUtils.isOSX()){ ProtegeAppleApplication.getInstance().setEditorKit(WorkspaceFrame.this.workspace.getEditorKit()); } } }); }
public WorkspaceFrame(Workspace workspace) { this.workspace = workspace; menuActions = new HashSet<>(); createUI(); restoreMetrics(); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { if (OSUtils.isOSX()){ ProtegeAppleApplication.getInstance().setEditorKit(null); } saveMetrics(); removeWindowListener(this); } public void windowActivated(WindowEvent event) { if (OSUtils.isOSX()){ ProtegeAppleApplication.getInstance().setEditorKit(WorkspaceFrame.this.workspace.getEditorKit()); } workspace.handleActivated(); } }); }
public WorkspaceFrame(Workspace workspace) { this.workspace = workspace; menuActions = new HashSet<ProtegeAction>(); createUI(); restoreMetrics(); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { if (OSUtils.isOSX()){ ProtegeAppleApplication.getInstance().setEditorKit(null); } saveMetrics(); removeWindowListener(this); } public void windowActivated(WindowEvent event) { if (OSUtils.isOSX()){ ProtegeAppleApplication.getInstance().setEditorKit(WorkspaceFrame.this.workspace.getEditorKit()); } } }); }
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); } }
public void ancestorAdded(AncestorEvent event) { // add a listener for when the window gets activated ProtegeManager.getInstance().getFrame(workspace).addWindowListener(new WindowAdapter() { public void windowActivated(WindowEvent event) { handleWindowActivated(); } }); workspace.removeAncestorListener(this); }
/** * 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); } }
/** * 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); } }
public void ancestorAdded(AncestorEvent event) { // add a listener for when the window gets activated ProtegeManager.getInstance().getFrame(workspace).addWindowListener(new WindowAdapter() { public void windowActivated(WindowEvent event) { handleWindowActivated(); } }); workspace.removeAncestorListener(this); }
public void ancestorAdded(AncestorEvent event) { // add a listener for when the window gets activated ProtegeManager.getInstance().getFrame(workspace).addWindowListener(new WindowAdapter() { public void windowActivated(WindowEvent event) { handleWindowActivated(); } }); workspace.removeAncestorListener(this); }
public void ancestorAdded(AncestorEvent event) { // add a listener for when the window gets activated ProtegeManager.getInstance().getFrame(workspace).addWindowListener(new WindowAdapter() { public void windowActivated(WindowEvent event) { handleWindowActivated(); } }); workspace.removeAncestorListener(this); }