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 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 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; }
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); } } });