public CustomWorkspaceTabsManager getCustomTabsManager() { return new CustomWorkspaceTabsManager(); }
/** * Gets a custom tab plugin for a custom tab. * @param name The name/id of the custom tab. * @param workspace The workspace pertaining to the tab * @return A WorkspaceTabPlugin that can be used to create a custom tab. */ public final WorkspaceTabPlugin getPluginForTabName(final String name, final TabbedWorkspace workspace) { if(!customTabs.contains(name)) { customTabs.add(name); save(); } return createPlugin(name, workspace); }
/** * Gets the plugins that define the custom tabs. (For what it's worth, * these plugins are created on the fly - they are not defined in any * plugin.xml file. * @param workspace The workspace that the tab plugins pertain to. * @return A list of custom tab plugins */ public List<WorkspaceTabPlugin> getCustomTabPlugins(TabbedWorkspace workspace) { List<WorkspaceTabPlugin> tabPlugins = new ArrayList<>(); for(String tab : customTabs) { tabPlugins.add(getPluginForTabName(tab, workspace)); } return tabPlugins; }
public List<WorkspaceTabPlugin> getOrderedPlugins() { WorkspaceTabPluginLoader loader = new WorkspaceTabPluginLoader(this); List<WorkspaceTabPlugin> plugins = new ArrayList<WorkspaceTabPlugin>(loader.getPlugins()); CustomWorkspaceTabsManager customTabsManager = getCustomTabsManager(); plugins.addAll(customTabsManager.getCustomTabPlugins(this)); Collections.sort(plugins, new Comparator<WorkspaceTabPlugin>() { public int compare(WorkspaceTabPlugin o1, WorkspaceTabPlugin o2) { return o1.getIndex().compareTo(o2.getIndex()); } }); return plugins; }
private void updateEnabledStatus() { TabbedWorkspace workspace = (TabbedWorkspace) getWorkspace(); setEnabled(!workspace.getCustomTabsManager().getCustomTabs().isEmpty()); }
/** * Deletes a previously added custom tab * @param id The name/id of the custom tab to be deleted. */ public void deleteCustomTab(String id) { customTabs.remove(id); save(); }
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 List<WorkspaceTabPlugin> getOrderedPlugins() { WorkspaceTabPluginLoader loader = new WorkspaceTabPluginLoader(this); List<WorkspaceTabPlugin> plugins = new ArrayList<WorkspaceTabPlugin>(loader.getPlugins()); CustomWorkspaceTabsManager customTabsManager = getCustomTabsManager(); plugins.addAll(customTabsManager.getCustomTabPlugins(this)); Collections.sort(plugins, new Comparator<WorkspaceTabPlugin>() { public int compare(WorkspaceTabPlugin o1, WorkspaceTabPlugin o2) { return o1.getIndex().compareTo(o2.getIndex()); } }); return plugins; }
private void updateEnabledStatus() { TabbedWorkspace workspace = (TabbedWorkspace) getWorkspace(); setEnabled(!workspace.getCustomTabsManager().getCustomTabs().isEmpty()); }
/** * Deletes a previously added custom tab * @param id The name/id of the custom tab to be deleted. */ public void deleteCustomTab(String id) { customTabs.remove(id); save(); }
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); } } }
/** * Gets a custom tab plugin for a custom tab. * @param name The name/id of the custom tab. * @param workspace The workspace pertaining to the tab * @return A WorkspaceTabPlugin that can be used to create a custom tab. */ public final WorkspaceTabPlugin getPluginForTabName(final String name, final TabbedWorkspace workspace) { if(!customTabs.contains(name)) { customTabs.add(name); save(); } return createPlugin(name, workspace); }
/** * Gets the plugins that define the custom tabs. (For what it's worth, * these plugins are created on the fly - they are not defined in any * plugin.xml file. * @param workspace The workspace that the tab plugins pertain to. * @return A list of custom tab plugins */ public List<WorkspaceTabPlugin> getCustomTabPlugins(TabbedWorkspace workspace) { List<WorkspaceTabPlugin> tabPlugins = new ArrayList<WorkspaceTabPlugin>(); for(String tab : customTabs) { tabPlugins.add(getPluginForTabName(tab, workspace)); } return tabPlugins; }
public List<WorkspaceTabPlugin> getOrderedPlugins() { WorkspaceTabPluginLoader loader = new WorkspaceTabPluginLoader(this); List<WorkspaceTabPlugin> plugins = new ArrayList<>(loader.getPlugins()); CustomWorkspaceTabsManager customTabsManager = getCustomTabsManager(); plugins.addAll(customTabsManager.getCustomTabPlugins(this)); Collections.sort(plugins, (o1, o2) -> o1.getIndex().compareTo(o2.getIndex())); return plugins; }
private void updateEnabledStatus() { TabbedWorkspace workspace = (TabbedWorkspace) getWorkspace(); setEnabled(!workspace.getCustomTabsManager().getCustomTabs().isEmpty()); }
/** * Deletes a previously added custom tab * @param id The name/id of the custom tab to be deleted. */ public void deleteCustomTab(String id) { customTabs.remove(id); save(); }
public CustomWorkspaceTabsManager getCustomTabsManager() { return new CustomWorkspaceTabsManager(); }
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); } } }
/** * Gets a custom tab plugin for a custom tab. * @param name The name/id of the custom tab. * @param workspace The workspace pertaining to the tab * @return A WorkspaceTabPlugin that can be used to create a custom tab. */ public final WorkspaceTabPlugin getPluginForTabName(final String name, final TabbedWorkspace workspace) { if(!customTabs.contains(name)) { customTabs.add(name); save(); } return createPlugin(name, workspace); }
/** * Gets the plugins that define the custom tabs. (For what it's worth, * these plugins are created on the fly - they are not defined in any * plugin.xml file. * @param workspace The workspace that the tab plugins pertain to. * @return A list of custom tab plugins */ public List<WorkspaceTabPlugin> getCustomTabPlugins(TabbedWorkspace workspace) { List<WorkspaceTabPlugin> tabPlugins = new ArrayList<WorkspaceTabPlugin>(); for(String tab : customTabs) { tabPlugins.add(getPluginForTabName(tab, workspace)); } return tabPlugins; }