コード例 #1
0
 public int addTab(
     String s,
     JComponent component,
     boolean selectTab,
     boolean replaceContent,
     boolean lockable,
     boolean addDefaultToolbar,
     ActionGroup toolbarActions,
     String helpId) {
   int existing = getComponentNumNamed(s);
   ContentManager contentManager = getContentManager();
   if (existing != -1) {
     Content existingContent = contentManager.getContent(existing);
     if (!replaceContent) {
       contentManager.setSelectedContent(existingContent);
       return existing;
     }
     //            if (!existingContent.isPinned()) {
     //                getContentManager().removeContent(existingContent);
     //                existingContent.release();
     //            }
   }
   CommitLogWindowComponent newComponent =
       new CommitLogWindowComponent(
           component, addDefaultToolbar, toolbarActions, contentManager, helpId);
   Content content =
       ContentFactory.SERVICE
           .getInstance()
           .createContent(newComponent.getShownComponent(), s, lockable);
   newComponent.setContent(content);
   contentManager.addContent(content);
   return getComponentAt(contentManager.getContentCount() - 1, selectTab);
 }
コード例 #2
0
 private Content createNewContent(
     final ContentManager contentManager,
     final RunContentDescriptor descriptor,
     Executor executor) {
   final String processDisplayName = descriptor.getDisplayName();
   final Content content =
       ContentFactory.SERVICE
           .getInstance()
           .createContent(descriptor.getComponent(), processDisplayName, true);
   content.putUserData(DESCRIPTOR_KEY, descriptor);
   content.putUserData(ToolWindow.SHOW_CONTENT_ICON, Boolean.TRUE);
   contentManager.addContent(content);
   new CloseListener(content, executor);
   return content;
 }