public void actionPerformed(ActionEvent e) { try { if (!workspace.containsTab(plugin.getId())) { WorkspaceTab tab = plugin.newInstance(); workspace.addTab(tab); } else { WorkspaceTab tab = workspace.getWorkspaceTab(plugin.getId()); workspace.removeTab(tab); tab.dispose(); } } catch (Exception ex) { logger.error("An error occurred whilst adding a menu item. Details: {}", ex); } } });
public void actionPerformed(ActionEvent e) { try { if (!workspace.containsTab(plugin.getId())) { WorkspaceTab tab = plugin.newInstance(); workspace.addTab(tab); } else { WorkspaceTab tab = workspace.getWorkspaceTab(plugin.getId()); workspace.removeTab(tab); tab.dispose(); } } catch (Exception ex) { LOGGER.error("Exception caught (re)building tab menu", ex); } } });
public void actionPerformed(ActionEvent e) { try { if (!workspace.containsTab(plugin.getId())) { WorkspaceTab tab = plugin.newInstance(); workspace.addTab(tab); } else { WorkspaceTab tab = workspace.getWorkspaceTab(plugin.getId()); workspace.removeTab(tab); tab.dispose(); } } catch (Exception ex) { LOGGER.error("Exception caught (re)building tab menu", ex); } } });
public void actionPerformed(ActionEvent event) { TabbedWorkspace workspace = (TabbedWorkspace) getWorkspace(); LoadedTabsSelector selector = new LoadedTabsSelector(workspace); int ret = JOptionPaneEx.showConfirmDialog(workspace, "Delete Tabs", selector, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, selector); if (ret == JOptionPane.OK_OPTION){ for (WorkspaceTabPlugin tabPlugin : selector.getSelectedTabs()){ final String id = tabPlugin.getId(); if (workspace.containsTab(id)) { // make sure we remove it from the workspace if it is currently active WorkspaceTab tab = workspace.getWorkspaceTab(id); workspace.removeTab(tab); try { tab.dispose(); } catch (Exception e) { throw new RuntimeException(e); } } workspace.getCustomTabsManager().deleteCustomTab(id); } } }
public void actionPerformed(ActionEvent event) { TabbedWorkspace workspace = (TabbedWorkspace) getWorkspace(); LoadedTabsSelector selector = new LoadedTabsSelector(workspace); int ret = JOptionPaneEx.showConfirmDialog(workspace, "Delete Tabs", selector, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, selector); if (ret == JOptionPane.OK_OPTION){ for (WorkspaceTabPlugin tabPlugin : selector.getSelectedTabs()){ final String id = tabPlugin.getId(); if (workspace.containsTab(id)) { // make sure we remove it from the workspace if it is currently active WorkspaceTab tab = workspace.getWorkspaceTab(id); workspace.removeTab(tab); try { tab.dispose(); } catch (Exception e) { throw new RuntimeException(e); } } workspace.getCustomTabsManager().deleteCustomTab(id); } } }
public void actionPerformed(ActionEvent event) { TabbedWorkspace workspace = (TabbedWorkspace) getWorkspace(); LoadedTabsSelector selector = new LoadedTabsSelector(workspace); int ret = JOptionPaneEx.showConfirmDialog(workspace, "Delete Tabs", selector, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, selector); if (ret == JOptionPane.OK_OPTION){ for (WorkspaceTabPlugin tabPlugin : selector.getSelectedTabs()){ final String id = tabPlugin.getId(); if (workspace.containsTab(id)) { // make sure we remove it from the workspace if it is currently active WorkspaceTab tab = workspace.getWorkspaceTab(id); workspace.removeTab(tab); try { tab.dispose(); } catch (Exception e) { throw new RuntimeException(e); } } workspace.getCustomTabsManager().deleteCustomTab(id); } } }