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; }
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; }
public static WorkspaceTab handleCreateNewTab(TabbedWorkspace workspace) { final String name = JOptionPane.showInputDialog(workspace, "Please enter a name for the new tab"); if (name != null) { CustomWorkspaceTabsManager customTabsManager = workspace.getCustomTabsManager(); WorkspaceTab tab = workspace.addTabForPlugin(customTabsManager.getPluginForTabName(name, workspace)); workspace.setSelectedTab(tab); return tab; } return null; } }
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()); }
public static WorkspaceTab handleCreateNewTab(TabbedWorkspace workspace) { final String name = JOptionPane.showInputDialog(workspace, "Please enter a name for the new tab"); if (name != null) { CustomWorkspaceTabsManager customTabsManager = workspace.getCustomTabsManager(); WorkspaceTab tab = workspace.addTabForPlugin(customTabsManager.getPluginForTabName(name, workspace)); workspace.setSelectedTab(tab); return tab; } return null; } }
public static WorkspaceTab handleCreateNewTab(TabbedWorkspace workspace) { final String name = JOptionPane.showInputDialog(workspace, "Please enter a name for the new tab"); if (name != null) { CustomWorkspaceTabsManager customTabsManager = workspace.getCustomTabsManager(); WorkspaceTab tab = workspace.addTabForPlugin(customTabsManager.getPluginForTabName(name, workspace)); workspace.setSelectedTab(tab); return tab; } return null; } }
private void updateEnabledStatus() { TabbedWorkspace workspace = (TabbedWorkspace) getWorkspace(); setEnabled(!workspace.getCustomTabsManager().getCustomTabs().isEmpty()); }
private void updateEnabledStatus() { TabbedWorkspace workspace = (TabbedWorkspace) getWorkspace(); setEnabled(!workspace.getCustomTabsManager().getCustomTabs().isEmpty()); }
public LoadedTabsSelector(TabbedWorkspace workspace) { super(new BorderLayout()); CustomWorkspaceTabsManager customTabsManager = workspace.getCustomTabsManager(); table = new CheckTable<>("Custom tabs"); table.setDefaultRenderer(new DefaultTableCellRenderer(){ /** * */ private static final long serialVersionUID = -7161202195746696063L; public Component getTableCellRendererComponent(JTable jTable, Object o, boolean b, boolean b1, int i, int i1) { if (o instanceof WorkspaceTabPlugin){ o = ((WorkspaceTabPlugin)o).getLabel(); } return super.getTableCellRendererComponent(jTable, o, b, b1, i, i1); } }); table.getModel().setData(customTabsManager.getCustomTabPlugins(workspace), false); add(new JScrollPane(table), BorderLayout.CENTER); }
public LoadedTabsSelector(TabbedWorkspace workspace) { super(new BorderLayout()); CustomWorkspaceTabsManager customTabsManager = workspace.getCustomTabsManager(); table = new CheckTable<WorkspaceTabPlugin>("Custom tabs"); table.setDefaultRenderer(new DefaultTableCellRenderer(){ /** * */ private static final long serialVersionUID = -7161202195746696063L; public Component getTableCellRendererComponent(JTable jTable, Object o, boolean b, boolean b1, int i, int i1) { if (o instanceof WorkspaceTabPlugin){ o = ((WorkspaceTabPlugin)o).getLabel(); } return super.getTableCellRendererComponent(jTable, o, b, b1, i, i1); } }); table.getModel().setData(customTabsManager.getCustomTabPlugins(workspace), false); add(new JScrollPane(table), BorderLayout.CENTER); }
public LoadedTabsSelector(TabbedWorkspace workspace) { super(new BorderLayout()); CustomWorkspaceTabsManager customTabsManager = workspace.getCustomTabsManager(); table = new CheckTable<WorkspaceTabPlugin>("Custom tabs"); table.setDefaultRenderer(new DefaultTableCellRenderer(){ /** * */ private static final long serialVersionUID = -7161202195746696063L; public Component getTableCellRendererComponent(JTable jTable, Object o, boolean b, boolean b1, int i, int i1) { if (o instanceof WorkspaceTabPlugin){ o = ((WorkspaceTabPlugin)o).getLabel(); } return super.getTableCellRendererComponent(jTable, o, b, b1, i, i1); } }); table.getModel().setData(customTabsManager.getCustomTabPlugins(workspace), false); add(new JScrollPane(table), BorderLayout.CENTER); }
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); } } }