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); } });
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); } });
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); } });
private void addMenuItem(JMenu thisMenuItem, final WorkspaceTabPlugin plugin) { final TabbedWorkspace workspace = (TabbedWorkspace) getWorkspace(); JCheckBoxMenuItem item = new JCheckBoxMenuItem(new AbstractAction(plugin.getLabel()) { private static final long serialVersionUID = 2331248705801798457L; 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); } } }); item.setSelected(workspace.containsTab(plugin.getId())); thisMenuItem.add(item); }
public WorkspaceTab addTabForPlugin(WorkspaceTabPlugin plugin) { WorkspaceTab tab = null; try { tab = plugin.newInstance(); addTab(tab); } catch (Throwable e) { if (tab != null) { String msg = "An error occurred when creating the " + plugin.getLabel() + " tab."; tab.setLayout(new BorderLayout()); tab.add(ComponentFactory.createExceptionComponent(msg, e, null)); } LOGGER.warn(e); } return tab; }
private void addMenuItem(JMenu thisMenuItem, final WorkspaceTabPlugin plugin) { final TabbedWorkspace workspace = (TabbedWorkspace) getWorkspace(); JCheckBoxMenuItem item = new JCheckBoxMenuItem(new AbstractAction(plugin.getLabel()) { private static final long serialVersionUID = 2331248705801798457L; 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); } } }); item.setSelected(workspace.containsTab(plugin.getId())); thisMenuItem.add(item); }
public WorkspaceTab addTabForPlugin(WorkspaceTabPlugin plugin) { WorkspaceTab tab = null; try { tab = plugin.newInstance(); addTab(tab); } catch (Throwable e) { if (tab != null) { String msg = "An error occurred when creating the " + plugin.getLabel() + " tab."; tab.setLayout(new BorderLayout()); tab.add(ComponentFactory.createExceptionComponent(msg, e, null)); } LOGGER.warn(e); } return tab; }
public void setup(WorkspaceTabPlugin plugin) { this.id = plugin.getId(); this.label = plugin.getLabel(); this.icon = plugin.getIcon(); this.workspace = plugin.getWorkspace(); this.defaultViewConfigurationFile = plugin.getDefaultViewConfigFile(); }
private void addMenuItem(JMenu thisMenuItem, final WorkspaceTabPlugin plugin) { final TabbedWorkspace workspace = (TabbedWorkspace) getWorkspace(); JCheckBoxMenuItem item = new JCheckBoxMenuItem(new AbstractAction(plugin.getLabel()) { private static final long serialVersionUID = 2331248705801798457L; 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); } } }); item.setSelected(workspace.containsTab(plugin.getId())); thisMenuItem.add(item); }
public void setup(WorkspaceTabPlugin plugin) { this.id = plugin.getId(); this.label = plugin.getLabel(); this.icon = plugin.getIcon(); this.workspace = plugin.getWorkspace(); this.defaultViewConfigurationFile = plugin.getDefaultViewConfigFile(); }
public void setup(WorkspaceTabPlugin plugin) { this.id = plugin.getId(); this.label = plugin.getLabel(); this.icon = plugin.getIcon(); this.workspace = plugin.getWorkspace(); this.defaultViewConfigurationFile = plugin.getDefaultViewConfigFile(); }
public WorkspaceTab addTabForPlugin(WorkspaceTabPlugin plugin) { WorkspaceTab tab = null; try { tab = plugin.newInstance(); addTab(tab); } catch (Throwable e) { if (tab != null) { String msg = "An error occurred when creating the " + plugin.getLabel() + " tab."; tab.setLayout(new BorderLayout()); tab.add(ComponentFactory.createExceptionComponent(msg, e, null)); } logger.error("An error occurred when attempting to instantiate a tab plugin. " + "Tab plugin Id: {}. Error details: {}", plugin.getId(), e); } return tab; }