Ejemplo n.º 1
0
 public String addTab(String tabTitle, Bean<Configuration> configuration) {
   Tab tab =
       new Tab(
           this,
           redrawThread,
           ConfigurationManager.getGlobalConfiguration().getEditorFont(),
           configuration);
   for (UserInterfaceListener listener : listeners) {
     if (listener.getPanelPaintDeviceListener() != null) {
       tab.addPanelPaintDeviceListener(listener.getPanelPaintDeviceListener());
     }
   }
   String uniqueTitle = tabbedPane.addTab(tab, tabTitle);
   currentTab().layout(configuration.getDataObject().isVerticallySplit() ? 1 : 0);
   enableComponents();
   return uniqueTitle;
 }
Ejemplo n.º 2
0
 public void help(String title, String path, boolean navigation) {
   for (int i = 0; i < tabbedPane.getTabCount(); i++) {
     if (!(tabbedPane.getComponentAt(i) instanceof Tab)) {
       if (tabbedPane.getTitleAt(i).equals(title)
           || tabbedPane.getTitleAt(i).startsWith(title + "-")) {
         tabbedPane.setSelectedIndex(i);
         return;
       }
     }
   }
   JComponent help;
   if (navigation) {
     help = new AdvancedHelpPanel(getClass().getResource(path), this);
   } else {
     help = new JScrollPane(new HelpPanel(getClass().getResource(path), this).getPane());
   }
   tabbedPane.addTab(help, title, Icons.getIcon("help"));
 }