Java 类com.intellij.ui.TabbedPaneWrapper 实例源码

项目:intellij-ce-playground    文件:ArtifactPropertiesEditors.java   
public void addTabs(TabbedPaneWrapper tabbedPane) {
  List<String> sortedTabs = new ArrayList<String>(myMainPanels.keySet());
  Collections.sort(sortedTabs, new Comparator<String>() {
    @Override
    public int compare(String o1, String o2) {
      int i1 = STANDARD_TABS_ORDER.indexOf(o1);
      if (i1 == -1) i1 = STANDARD_TABS_ORDER.size();
      int i2 = STANDARD_TABS_ORDER.indexOf(o2);
      if (i2 == -1) i2 = STANDARD_TABS_ORDER.size();
      if (i1 != i2) {
        return i1 - i2;
      }
      return o1.compareTo(o2);
    }
  });
  for (String tab : sortedTabs) {
    tabbedPane.addTab(tab, myMainPanels.get(tab));
  }
}
项目:intellij-ce-playground    文件:TabbedModuleEditor.java   
@Override
protected JComponent createCenterPanel() {
  myTabbedPane = new TabbedPaneWrapper(this);

  for (ModuleConfigurationEditor editor : myEditors) {
    myTabbedPane.addTab(editor.getDisplayName(), editor.createComponent());
    editor.reset();
  }
  restoreSelectedEditor();

  myTabbedPane.addChangeListener(new javax.swing.event.ChangeListener() {
    @Override
    public void stateChanged(ChangeEvent e) {
      saveSelectedEditor();
      if (myHistory != null) {
        myHistory.pushQueryPlace();
      }
    }
  });
  return myTabbedPane.getComponent();
}
项目:intellij-ce-playground    文件:EditorComposite.java   
@NotNull
private TabbedPaneWrapper.AsJBTabs createTabbedPaneWrapper(FileEditor[] editors) {
  PrevNextActionsDescriptor descriptor = new PrevNextActionsDescriptor(IdeActions.ACTION_NEXT_EDITOR_TAB, IdeActions.ACTION_PREVIOUS_EDITOR_TAB);
  final TabbedPaneWrapper.AsJBTabs wrapper = new TabbedPaneWrapper.AsJBTabs(myFileEditorManager.getProject(), SwingConstants.BOTTOM, descriptor, this);
  wrapper.getTabs().getPresentation().setPaintBorder(0, 0, 0, 0).setTabSidePaintBorder(1).setGhostsAlwaysVisible(true).setUiDecorator(new UiDecorator() {
    @Override
    @NotNull
    public UiDecoration getDecoration() {
      return new UiDecoration(null, new Insets(0, 8, 0, 8));
    }
  });
  wrapper.getTabs().getComponent().setBorder(new EmptyBorder(0, 0, 1, 0));

  boolean firstEditor = true;
  for (FileEditor editor : editors) {
    JComponent component = firstEditor && myComponent != null ? (JComponent)myComponent.getComponent(0) : createEditorComponent(editor);
    wrapper.addTab(getDisplayName(editor), component);
    firstEditor = false;
  }
  wrapper.addChangeListener(new MyChangeListener());

  return wrapper;
}
项目:tools-idea    文件:ArtifactPropertiesEditors.java   
public void addTabs(TabbedPaneWrapper tabbedPane) {
  List<String> sortedTabs = new ArrayList<String>(myMainPanels.keySet());
  Collections.sort(sortedTabs, new Comparator<String>() {
    @Override
    public int compare(String o1, String o2) {
      int i1 = STANDARD_TABS_ORDER.indexOf(o1);
      if (i1 == -1) i1 = STANDARD_TABS_ORDER.size();
      int i2 = STANDARD_TABS_ORDER.indexOf(o2);
      if (i2 == -1) i2 = STANDARD_TABS_ORDER.size();
      if (i1 != i2) {
        return i1 - i2;
      }
      return o1.compareTo(o2);
    }
  });
  for (String tab : sortedTabs) {
    tabbedPane.addTab(tab, myMainPanels.get(tab));
  }
}
项目:tools-idea    文件:TabbedModuleEditor.java   
@Override
protected JComponent createCenterPanel() {
  myTabbedPane = new TabbedPaneWrapper(this);

  for (ModuleConfigurationEditor editor : myEditors) {
    myTabbedPane.addTab(editor.getDisplayName(), editor.createComponent());
    editor.reset();
  }
  restoreSelectedEditor();

  myTabbedPane.addChangeListener(new javax.swing.event.ChangeListener() {
    @Override
    public void stateChanged(ChangeEvent e) {
      saveSelectedEditor();
      if (myHistory != null) {
        myHistory.pushQueryPlace();
      }
    }
  });
  return myTabbedPane.getComponent();
}
项目:consulo-apache-ant    文件:BuildFilePropertiesPanel.java   
private Form(@NotNull final Project project)
{
    myTabs = new Tab[]{
            new PropertiesTab(),
            new ExecutionTab(GlobalAntConfiguration.getInstance(), project),
            new AdditionalClasspathTab(),
            new FiltersTab()
    };

    myHeapSizeLabel.setLabelFor(myXmx);
    myWrapper = new TabbedPaneWrapper(this);
    myTabsPlace.setLayout(new BorderLayout());
    myTabsPlace.add(myWrapper.getComponent(), BorderLayout.CENTER);

    myBinding.bindBoolean(myRunInBackground, AntBuildFileImpl.RUN_IN_BACKGROUND);
    myBinding.bindBoolean(myCloseOnNoError, AntBuildFileImpl.CLOSE_ON_NO_ERRORS);
    myBinding.bindInt(myXmx, AntBuildFileImpl.MAX_HEAP_SIZE);
    myBinding.bindInt(myXss, AntBuildFileImpl.MAX_STACK_SIZE);

    for(Tab tab : myTabs)
    {
        myWrapper.addTab(tab.getDisplayName(), tab.getComponent());
    }
}
项目:consulo    文件:EditorComposite.java   
@Nonnull
private TabbedPaneWrapper.AsJBTabs createTabbedPaneWrapper(FileEditor[] editors) {
  PrevNextActionsDescriptor descriptor = new PrevNextActionsDescriptor(IdeActions.ACTION_NEXT_EDITOR_TAB, IdeActions.ACTION_PREVIOUS_EDITOR_TAB);
  final TabbedPaneWrapper.AsJBTabs wrapper = new TabbedPaneWrapper.AsJBTabs(myFileEditorManager.getProject(), SwingConstants.BOTTOM, descriptor, this);
  wrapper.getTabs().getPresentation().setPaintBorder(0, 0, 0, 0).setTabSidePaintBorder(1).setGhostsAlwaysVisible(true).setUiDecorator(
          () -> new UiDecorator.UiDecoration(null, new Insets(0, 8, 0, 8)));
  wrapper.getTabs().getComponent().setBorder(new EmptyBorder(0, 0, 1, 0));

  boolean firstEditor = true;
  for (FileEditor editor : editors) {
    JComponent component = firstEditor && myComponent != null ? (JComponent)myComponent.getComponent(0) : createEditorComponent(editor);
    wrapper.addTab(getDisplayName(editor), component);
    firstEditor = false;
  }
  wrapper.addChangeListener(new MyChangeListener());

  return wrapper;
}
项目:consulo    文件:SdkEditor.java   
@Nonnull
@Override
protected JComponent createCenterComponent() {
  myTabbedPane = new TabbedPaneWrapper(myDisposable);
  for (OrderRootType type : OrderRootType.getAllTypes()) {
    if (showTabForType(type)) {
      final OrderRootTypeUIFactory factory = OrderRootTypeUIFactory.FACTORY.getByKey(type);
      if(factory == null) {
        continue;
      }

      SdkPathEditor pathEditor = getPathEditor(type);

      myTabbedPane.addTab(pathEditor.getDisplayName(), pathEditor.createComponent());
    }
  }

  myTabbedPane.addChangeListener(new ChangeListener() {
    @Override
    public void stateChanged(final ChangeEvent e) {
      myHistory.pushQueryPlace();
    }
  });
  return myTabbedPane.getComponent();
}
项目:consulo    文件:ArtifactPropertiesEditors.java   
public void addTabs(TabbedPaneWrapper tabbedPane) {
  List<String> sortedTabs = new ArrayList<String>(myMainPanels.keySet());
  Collections.sort(sortedTabs, new Comparator<String>() {
    @Override
    public int compare(String o1, String o2) {
      int i1 = STANDARD_TABS_ORDER.indexOf(o1);
      if (i1 == -1) i1 = STANDARD_TABS_ORDER.size();
      int i2 = STANDARD_TABS_ORDER.indexOf(o2);
      if (i2 == -1) i2 = STANDARD_TABS_ORDER.size();
      if (i1 != i2) {
        return i1 - i2;
      }
      return o1.compareTo(o2);
    }
  });
  for (String tab : sortedTabs) {
    tabbedPane.addTab(tab, myMainPanels.get(tab));
  }
}
项目:consulo    文件:TabbedModuleEditor.java   
@Override
protected JComponent createCenterPanel() {
  myTabbedPane = new TabbedPaneWrapper(this);

  for (ModuleConfigurationEditor editor : myEditors) {
    myTabbedPane.addTab(editor.getDisplayName(), editor.createComponent());
    editor.reset();
  }
  restoreSelectedEditor();

  myTabbedPane.addChangeListener(new javax.swing.event.ChangeListener() {
    @Override
    public void stateChanged(ChangeEvent e) {
      saveSelectedEditor();
      if (myHistory != null) {
        myHistory.pushQueryPlace();
      }
    }
  });
  return myTabbedPane.getComponent();
}
项目:intellij-ce-playground    文件:SdkEditor.java   
private void createMainPanel(){
  myMainPanel = new JPanel(new GridBagLayout());

  myTabbedPane = new TabbedPaneWrapper(myDisposable);
  for (OrderRootType type : OrderRootType.getAllTypes()) {
    if (mySdk == null || showTabForType(type)) {
      final SdkPathEditor pathEditor = OrderRootTypeUIFactory.FACTORY.getByKey(type).createPathEditor(mySdk);
      if (pathEditor != null) {
        pathEditor.setAddBaseDir(mySdk.getHomeDirectory());
        myTabbedPane.addTab(pathEditor.getDisplayName(), pathEditor.createComponent());
        myPathEditors.put(type, pathEditor);
      }
    }
  }

  myTabbedPane.addChangeListener(new ChangeListener() {
    @Override
    public void stateChanged(final ChangeEvent e) {
      myHistory.pushQueryPlace();
    }
  });

  myHomeComponent = createHomeComponent();
  myHomeComponent.getTextField().setEditable(false);

  myHomeFieldLabel = new JLabel(getHomeFieldLabelValue());
  final int leftInset = Registry.is("ide.new.project.settings") ? 10 : 0;
  final int rightInset = Registry.is("ide.new.project.settings") ? 10 : 0;
  myMainPanel.add(myHomeFieldLabel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, leftInset, 2, 2), 0, 0));
  myMainPanel.add(myHomeComponent, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(2, 2, 2, rightInset), 0, 0));

  myAdditionalDataPanel = new JPanel(new BorderLayout());
  myMainPanel.add(myAdditionalDataPanel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, leftInset, 0, rightInset), 0, 0));

  myMainPanel.add(myTabbedPane.getComponent(), new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 0, 0, 0), 0, 0));
}
项目:intellij-ce-playground    文件:ArtifactPropertiesEditors.java   
public void removeTabs(TabbedPaneWrapper tabbedPane) {
  for (String tabName : myMainPanels.keySet()) {
    for (int i = 0; i < tabbedPane.getTabCount(); i++) {
      if (tabName.equals(tabbedPane.getTitleAt(i))) {
        tabbedPane.removeTabAt(i);
        break;
      }
    }
  }
}
项目:intellij-ce-playground    文件:FacetEditorImpl.java   
@Override
public JComponent createComponent() {
  final JComponent editorComponent;
  if (myEditorTabs.length > 1) {
    final TabbedPaneWrapper tabbedPane = new TabbedPaneWrapper(myDisposable);
    for (FacetEditorTab editorTab : myEditorTabs) {
      JComponent c = editorTab.createComponent();
      UIUtil.addInsets(c, UIUtil.PANEL_SMALL_INSETS);
      tabbedPane.addTab(editorTab.getDisplayName(), c);
    }
    tabbedPane.addChangeListener(new ChangeListener() {
      @Override
      public void stateChanged(@NotNull ChangeEvent e) {
        myEditorTabs[mySelectedTabIndex].onTabLeaving();
        mySelectedTabIndex = tabbedPane.getSelectedIndex();
        onTabSelected(myEditorTabs[mySelectedTabIndex]);
      }
    });
    editorComponent = tabbedPane.getComponent();
    myTabbedPane = tabbedPane;
  }
  else if (myEditorTabs.length == 1) {
    editorComponent = myEditorTabs[0].createComponent();
    UIUtil.addInsets(editorComponent, new Insets(0, 5, 0, 0));
  }
  else {
    editorComponent = new JPanel();
  }

  final JComponent errorComponent = myErrorPanel.getComponent();
  UIUtil.addInsets(errorComponent, new Insets(0, 5, 5, 0));

  final JPanel panel = new JPanel(new BorderLayout());
  panel.add(BorderLayout.CENTER, editorComponent);
  panel.add(BorderLayout.SOUTH, errorComponent);
  return panel;
}
项目:intellij-ce-playground    文件:FacetEditorImpl.java   
public void setSelectedTabName(final String tabName) {
  getComponent();
  final TabbedPaneWrapper tabbedPane = myTabbedPane;
  if (tabbedPane == null) return;
  for (int i = 0; i < tabbedPane.getTabCount(); i++) {
    if (tabName.equals(tabbedPane.getTitleAt(i))) {
      tabbedPane.setSelectedIndex(i);
      return;
    }
  }
}
项目:intellij-ce-playground    文件:FacetTypeEditor.java   
public JComponent createComponent() {
  MultipleFacetSettingsEditor allFacetsEditor = createAllFacetsEditor();
  if (myAllFacetsEditor != null) {
    myAllFacetsEditor.disposeUIResources();
  }
  myAllFacetsEditor = allFacetsEditor;

  myCurrentConfigurables = new ArrayList<Configurable>();
  if (myDefaultSettingsConfigurable != null) {
    myCurrentConfigurables.add(myDefaultSettingsConfigurable);
  }

  if (myAllFacetsEditor != null) {
    myCurrentConfigurables.add(new AllFacetsConfigurable(myAllFacetsEditor));
  }

  if (myCurrentConfigurables.isEmpty()) {
    return new JPanel();
  }
  if (myCurrentConfigurables.size() == 1) {
    return myCurrentConfigurables.get(0).createComponent();
  }

  myTabbedPane = new TabbedPaneWrapper(myDisposable);
  for (Configurable configurable : myCurrentConfigurables) {
    myTabbedPane.addTab(configurable.getDisplayName(), configurable.createComponent());
  }
  return myTabbedPane.getComponent();
}
项目:intellij-ce-playground    文件:InfoAndProgressPanel.java   
@NotNull
private static Component getAnchor(@NotNull JRootPane pane) {
  Component tabWrapper = UIUtil.findComponentOfType(pane, TabbedPaneWrapper.TabWrapper.class);
  if (tabWrapper != null) return tabWrapper;
  Component splitters = UIUtil.findComponentOfType(pane, EditorsSplitters.class);
  if (splitters != null) return splitters;
  FileEditorManagerEx ex = FileEditorManagerEx.getInstanceEx(ProjectUtil.guessCurrentProject(pane));
  return ex == null ? pane : ex.getSplitters();
}
项目:intellij-ce-playground    文件:TabbedConfigurable.java   
@Override
public JComponent createComponent() {
  myTabbedPane = new TabbedPaneWrapper(myParent);
  createConfigurableTabs();
  final JComponent component = myTabbedPane.getComponent();
  component.setPreferredSize(JBUI.size(500, 400));
  return component;
}
项目:intellij-ce-playground    文件:PrintDialog.java   
@Override
protected JComponent createCenterPanel() {
  TabbedPaneWrapper tabbedPaneWrapper = new TabbedPaneWrapper(myDisposable);
  tabbedPaneWrapper.addTab(CodeEditorBundle.message("print.settings.tab"), createPrintSettingsPanel());
  tabbedPaneWrapper.addTab(CodeEditorBundle.message("print.header.footer.tab"), createHeaderAndFooterPanel());
  tabbedPaneWrapper.addTab(CodeEditorBundle.message("print.advanced.tab"), createAdvancedPanel());
  return tabbedPaneWrapper.getComponent();
}
项目:intellij-ce-playground    文件:DirectoryChooser.java   
public DirectoryChooser(@NotNull Project project, @NotNull DirectoryChooserView view){
  super(project, true);
  myView = view;
  final PropertiesComponent propertiesComponent = PropertiesComponent.getInstance();
  myFilterExisting = propertiesComponent.isTrueValue(FILTER_NON_EXISTING);
  myTabbedPaneWrapper = new TabbedPaneWrapper(getDisposable());
  myChooseByNamePanel = new ChooseByNamePanel(project, new GotoClassModel2(project){
    @NotNull
    @Override
    public String[] getNames(boolean checkBoxState) {
      return super.getNames(false);
    }
  }, "", false, null) {
    @Override
    protected void showTextFieldPanel() {
    }

    @Override
    protected void close(boolean isOk) {
      super.close(isOk);
      if (isOk) {
        final List<Object> elements = getChosenElements();
        if (elements != null && elements.size() > 0) {
          myActionListener.elementChosen(elements.get(0));
        }
        doOKAction();
      }
      else {
        doCancelAction();
      }
    }
  };
  Disposer.register(myDisposable, myChooseByNamePanel);
  init();
}
项目:intellij-ce-playground    文件:MavenArtifactSearchDialog.java   
private void initComponents(Project project, String initialText, boolean classMode) {
  myTabbedPane = new TabbedPaneWrapper(project);

  MavenArtifactSearchPanel.Listener listener = new MavenArtifactSearchPanel.Listener() {
    public void itemSelected() {
      clickDefaultButton();
    }

    public void canSelectStateChanged(MavenArtifactSearchPanel from, boolean canSelect) {
      myOkButtonStates.put(from, canSelect);
      updateOkButtonState();
    }
  };

  myArtifactsPanel = new MavenArtifactSearchPanel(project, !classMode ? initialText : "", false, listener, this, myManagedDependenciesMap);
  myClassesPanel = new MavenArtifactSearchPanel(project, classMode ? initialText : "", true, listener, this, myManagedDependenciesMap);

  myTabbedPane.addTab("Search for artifact", myArtifactsPanel);
  myTabbedPane.addTab("Search for class", myClassesPanel);
  myTabbedPane.setSelectedIndex(classMode ? 1 : 0);

  myTabbedPane.getComponent().setPreferredSize(JBUI.size(900, 600));

  myTabbedPane.addChangeListener(new ChangeListener() {
    public void stateChanged(ChangeEvent e) {
      updateOkButtonState();
    }
  });

  updateOkButtonState();
}
项目:tools-idea    文件:SdkEditor.java   
private void createMainPanel(){
  myMainPanel = new JPanel(new GridBagLayout());

  myTabbedPane = new TabbedPaneWrapper(myDisposable);
  for (OrderRootType type : OrderRootType.getAllTypes()) {
    if (mySdk == null || showTabForType(type)) {
      final SdkPathEditor pathEditor = OrderRootTypeUIFactory.FACTORY.getByKey(type).createPathEditor(mySdk);
      if (pathEditor != null) {
        pathEditor.setAddBaseDir(mySdk.getHomeDirectory());
        myTabbedPane.addTab(pathEditor.getDisplayName(), pathEditor.createComponent());
        myPathEditors.put(type, pathEditor);
      }
    }
  }

  myTabbedPane.addChangeListener(new ChangeListener() {
    @Override
    public void stateChanged(final ChangeEvent e) {
      myHistory.pushQueryPlace();
    }
  });

  myHomeComponent = createHomeComponent();
  myHomeComponent.getTextField().setEditable(false);

  myHomeFieldLabel = new JLabel(getHomeFieldLabelValue());
  myMainPanel.add(myHomeFieldLabel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 0, 2, 2), 0, 0));
  myMainPanel.add(myHomeComponent, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(2, 2, 2, 0), 0, 0));

  myAdditionalDataPanel = new JPanel(new BorderLayout());
  myMainPanel.add(myAdditionalDataPanel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 0, 0, 0), 0, 0));

  myMainPanel.add(myTabbedPane.getComponent(), new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 0, 0, 0), 0, 0));
}
项目:tools-idea    文件:ArtifactPropertiesEditors.java   
public void removeTabs(TabbedPaneWrapper tabbedPane) {
  for (String tabName : myMainPanels.keySet()) {
    for (int i = 0; i < tabbedPane.getTabCount(); i++) {
      if (tabName.equals(tabbedPane.getTitleAt(i))) {
        tabbedPane.removeTabAt(i);
        break;
      }
    }
  }
}
项目:tools-idea    文件:FacetEditorImpl.java   
public JComponent createComponent() {
  final JComponent editorComponent;
  if (myEditorTabs.length > 1) {
    final TabbedPaneWrapper tabbedPane = new TabbedPaneWrapper(myDisposable);
    for (FacetEditorTab editorTab : myEditorTabs) {
      JComponent c = editorTab.createComponent();
      if (c != null) {
        UIUtil.addInsets(c, UIUtil.PANEL_SMALL_INSETS);
      }
      tabbedPane.addTab(editorTab.getDisplayName(), c);
    }
    tabbedPane.addChangeListener(new ChangeListener() {
      public void stateChanged(ChangeEvent e) {
        myEditorTabs[mySelectedTabIndex].onTabLeaving();
        mySelectedTabIndex = tabbedPane.getSelectedIndex();
        onTabSelected(myEditorTabs[mySelectedTabIndex]);
      }
    });
    editorComponent = tabbedPane.getComponent();
    myTabbedPane = tabbedPane;
  }
  else if (myEditorTabs.length == 1) {
    editorComponent = myEditorTabs[0].createComponent();
  }
  else {
    editorComponent = new JPanel();
  }
  final JPanel panel = new JPanel(new BorderLayout());
  panel.add(BorderLayout.CENTER, editorComponent);
  panel.add(BorderLayout.SOUTH, myErrorPanel.getComponent());

  return panel;
}
项目:tools-idea    文件:FacetEditorImpl.java   
public void setSelectedTabName(final String tabName) {
  getComponent();
  final TabbedPaneWrapper tabbedPane = myTabbedPane;
  if (tabbedPane == null) return;
  for (int i = 0; i < tabbedPane.getTabCount(); i++) {
    if (tabName.equals(tabbedPane.getTitleAt(i))) {
      tabbedPane.setSelectedIndex(i);
      return;
    }
  }
}
项目:tools-idea    文件:FacetTypeEditor.java   
public JComponent createComponent() {
  MultipleFacetSettingsEditor allFacetsEditor = createAllFacetsEditor();
  if (myAllFacetsEditor != null) {
    myAllFacetsEditor.disposeUIResources();
  }
  myAllFacetsEditor = allFacetsEditor;

  myCurrentConfigurables = new ArrayList<Configurable>();
  if (myDefaultSettingsConfigurable != null) {
    myCurrentConfigurables.add(myDefaultSettingsConfigurable);
  }

  if (myAllFacetsEditor != null) {
    myCurrentConfigurables.add(new AllFacetsConfigurable(myAllFacetsEditor));
  }

  if (myCurrentConfigurables.isEmpty()) {
    return new JPanel();
  }
  if (myCurrentConfigurables.size() == 1) {
    return myCurrentConfigurables.get(0).createComponent();
  }

  myTabbedPane = new TabbedPaneWrapper(myDisposable);
  for (Configurable configurable : myCurrentConfigurables) {
    myTabbedPane.addTab(configurable.getDisplayName(), configurable.createComponent());
  }
  return myTabbedPane.getComponent();
}
项目:tools-idea    文件:TabbedConfigurable.java   
public JComponent createComponent() {
  myTabbedPane = new TabbedPaneWrapper(myParent);
  createConfigurableTabs();
  final JComponent component = myTabbedPane.getComponent();
  component.setPreferredSize(new Dimension(500, 400));
  return component;
}
项目:tools-idea    文件:PrintDialog.java   
@Override
protected JComponent createCenterPanel() {
  TabbedPaneWrapper tabbedPaneWrapper = new TabbedPaneWrapper(myDisposable);
  tabbedPaneWrapper.addTab(CodeEditorBundle.message("print.settings.tab"), createPrintSettingsPanel());
  tabbedPaneWrapper.addTab(CodeEditorBundle.message("print.header.footer.tab"), createHeaderAndFooterPanel());
  tabbedPaneWrapper.addTab(CodeEditorBundle.message("print.advanced.tab"), createAdvancedPanel());
  return tabbedPaneWrapper.getComponent();
}
项目:tools-idea    文件:DirectoryChooser.java   
public DirectoryChooser(@NotNull Project project, @NotNull DirectoryChooserView view){
  super(project, true);
  myView = view;
  final PropertiesComponent propertiesComponent = PropertiesComponent.getInstance();
  myFilterExisting = propertiesComponent.isValueSet(FILTER_NON_EXISTING) && propertiesComponent.isTrueValue(FILTER_NON_EXISTING);
  myTabbedPaneWrapper = new TabbedPaneWrapper(getDisposable());
  myChooseByNamePanel = new ChooseByNamePanel(project, new GotoClassModel2(project){
    @NotNull
    @Override
    public String[] getNames(boolean checkBoxState) {
      return super.getNames(false);
    }
  }, "", false, null) {
    @Override
    protected void showTextFieldPanel() {
    }

    @Override
    protected void close(boolean isOk) {
      super.close(isOk);
      if (isOk) {
        final List<Object> elements = getChosenElements();
        if (elements != null && elements.size() > 0) {
          myActionListener.elementChosen(elements.get(0));
        }
        doOKAction();
      }
      else {
        doCancelAction();
      }
    }
  };
  Disposer.register(myDisposable, myChooseByNamePanel);
  init();
}
项目:tools-idea    文件:MavenArtifactSearchDialog.java   
private void initComponents(Project project, String initialText, boolean classMode) {
  myTabbedPane = new TabbedPaneWrapper(project);

  MavenArtifactSearchPanel.Listener listener = new MavenArtifactSearchPanel.Listener() {
    public void itemSelected() {
      clickDefaultButton();
    }

    public void canSelectStateChanged(MavenArtifactSearchPanel from, boolean canSelect) {
      myOkButtonStates.put(from, canSelect);
      updateOkButtonState();
    }
  };

  myArtifactsPanel = new MavenArtifactSearchPanel(project, !classMode ? initialText : "", false, listener, this, myManagedDependenciesMap);
  myClassesPanel = new MavenArtifactSearchPanel(project, classMode ? initialText : "", true, listener, this, myManagedDependenciesMap);

  myTabbedPane.addTab("Search for artifact", myArtifactsPanel);
  myTabbedPane.addTab("Search for class", myClassesPanel);
  myTabbedPane.setSelectedIndex(classMode ? 1 : 0);

  myTabbedPane.getComponent().setPreferredSize(new Dimension(900, 600));

  myTabbedPane.addChangeListener(new ChangeListener() {
    public void stateChanged(ChangeEvent e) {
      updateOkButtonState();
    }
  });

  updateOkButtonState();
}
项目:consulo    文件:InfoAndProgressPanel.java   
@Nonnull
private static Component getAnchor(@Nonnull JRootPane pane) {
  Component tabWrapper = UIUtil.findComponentOfType(pane, TabbedPaneWrapper.TabWrapper.class);
  if (tabWrapper != null && tabWrapper.isShowing()) return tabWrapper;
  DesktopEditorsSplitters splitters = UIUtil.findComponentOfType(pane, DesktopEditorsSplitters.class);
  if (splitters != null) {
    return splitters.isShowing() ? splitters : pane;
  }
  FileEditorManagerEx ex = FileEditorManagerEx.getInstanceEx(ProjectUtil.guessCurrentProject(pane));
  if (ex == null) return pane;
  splitters = (DesktopEditorsSplitters)ex.getSplitters();
  return splitters.isShowing() ? splitters : pane;
}
项目:consulo    文件:GroupSettingsBuilder.java   
@Nonnull
private JComponent doCreateComponent(@Nonnull Disposable disposable) {
  List<Pair<String,SettingsEditor<T>>> editors = myGroup.getEditors();
  if (editors.size() == 0) return new JPanel();
  if (editors.size() == 1) return editors.get(0).getSecond().getComponent();

  TabbedPaneWrapper tabbedPaneWrapper = new TabbedPaneWrapper(disposable);
  for (Pair<String, SettingsEditor<T>> pair : editors) {
    JPanel panel = new JPanel(new BorderLayout());
    panel.add(pair.getSecond().getComponent(), BorderLayout.CENTER);
    tabbedPaneWrapper.addTab(pair.getFirst(), panel);
  }
  return tabbedPaneWrapper.getComponent();
}
项目:consulo    文件:TabbedConfigurable.java   
@Override
public JComponent createComponent() {
  myTabbedPane = new TabbedPaneWrapper(myParent);
  createConfigurableTabs();
  final JComponent component = myTabbedPane.getComponent();
  component.setPreferredSize(new Dimension(500, 400));
  return component;
}
项目:consulo    文件:ArtifactPropertiesEditors.java   
public void removeTabs(TabbedPaneWrapper tabbedPane) {
  for (String tabName : myMainPanels.keySet()) {
    for (int i = 0; i < tabbedPane.getTabCount(); i++) {
      if (tabName.equals(tabbedPane.getTitleAt(i))) {
        tabbedPane.removeTabAt(i);
        break;
      }
    }
  }
}
项目:consulo    文件:PrintDialog.java   
@Override
protected JComponent createCenterPanel() {
  TabbedPaneWrapper tabbedPaneWrapper = new TabbedPaneWrapper(myDisposable);
  tabbedPaneWrapper.addTab(CodeEditorBundle.message("print.settings.tab"), createPrintSettingsPanel());
  tabbedPaneWrapper.addTab(CodeEditorBundle.message("print.header.footer.tab"), createHeaderAndFooterPanel());
  tabbedPaneWrapper.addTab(CodeEditorBundle.message("print.advanced.tab"), createAdvancedPanel());
  return tabbedPaneWrapper.getComponent();
}
项目:consulo    文件:DirectoryChooser.java   
public DirectoryChooser(@Nonnull Project project, @Nonnull DirectoryChooserView view){
  super(project, true);
  myView = view;
  final PropertiesComponent propertiesComponent = PropertiesComponent.getInstance();
  myFilterExisting = propertiesComponent.isValueSet(FILTER_NON_EXISTING) && propertiesComponent.isTrueValue(FILTER_NON_EXISTING);
  myTabbedPaneWrapper = new TabbedPaneWrapper(getDisposable());
  myChooseByNamePanel = new ChooseByNamePanel(project, new GotoClassModel2(project){
    @Nonnull
    @Override
    public String[] getNames(boolean checkBoxState) {
      return super.getNames(false);
    }
  }, "", false, null) {
    @Override
    protected void showTextFieldPanel() {
    }

    @Override
    protected void close(boolean isOk) {
      super.close(isOk);
      if (isOk) {
        final List<Object> elements = getChosenElements();
        if (elements != null && elements.size() > 0) {
          myActionListener.elementChosen(elements.get(0));
        }
        doOKAction();
      }
      else {
        doCancelAction();
      }
    }
  };
  Disposer.register(myDisposable, myChooseByNamePanel);
  init();
}
项目:intellij-ce-playground    文件:HeaderlessTabbedPane.java   
public HeaderlessTabbedPane(Disposable disposable) {
  super(new BorderLayout());
  myTabbedPane = new TabbedPaneWrapper(disposable);
  add(myTabbedPane.getComponent(), BorderLayout.CENTER);
}
项目:intellij-ce-playground    文件:AbstractTreeClassChooserDialog.java   
protected TabbedPaneWrapper getTabbedPane() {
  return myTabbedPane;
}
项目:intellij-ce-playground    文件:ShowJavadocAction.java   
public void actionPerformed(final AnActionEvent e) {
  final PropertyInspectorTable inspector = PropertyInspectorTable.DATA_KEY.getData(e.getDataContext());
  final IntrospectedProperty introspectedProperty = inspector.getSelectedIntrospectedProperty();
  final PsiClass aClass = inspector.getComponentClass();

  final PsiMethod getter = PropertyUtil.findPropertyGetter(aClass, introspectedProperty.getName(), false, true);
  LOG.assertTrue(getter != null);

  final PsiMethod setter = PropertyUtil.findPropertySetter(aClass, introspectedProperty.getName(), false, true);
  LOG.assertTrue(setter != null);

  final DocumentationManager documentationManager = DocumentationManager.getInstance(aClass.getProject());

  final DocumentationComponent component1 = new DocumentationComponent(documentationManager);
  final DocumentationComponent component2 = new DocumentationComponent(documentationManager);

  final Disposable disposable = Disposer.newDisposable();
  final TabbedPaneWrapper tabbedPane = new TabbedPaneWrapper(disposable);

  tabbedPane.addTab(UIDesignerBundle.message("tab.getter"), component1);
  tabbedPane.addTab(UIDesignerBundle.message("tab.setter"), component2);

  documentationManager.fetchDocInfo(getter, component1);
  documentationManager.queueFetchDocInfo(setter, component2).doWhenProcessed(new Runnable() {
    public void run() {
      final JBPopup hint =
        JBPopupFactory.getInstance().createComponentPopupBuilder(tabbedPane.getComponent(), component1)
          .setDimensionServiceKey(aClass.getProject(), DocumentationManager.JAVADOC_LOCATION_AND_SIZE, false)
          .setResizable(true)
          .setMovable(true)
          .setRequestFocus(true)
          .setTitle(UIDesignerBundle.message("property.javadoc.title", introspectedProperty.getName()))
          .createPopup();
      component1.setHint(hint);
      component2.setHint(hint);
      Disposer.register(hint, component1);
      Disposer.register(hint, component2);
      Disposer.register(hint, disposable);
      hint.show(new RelativePoint(inspector, new Point(0,0)));
      //component1.requestFocus();
    }
  });
}
项目:tools-idea    文件:HeaderlessTabbedPane.java   
public HeaderlessTabbedPane(Disposable disposable) {
  super(new BorderLayout());
  myTabbedPane = new TabbedPaneWrapper(disposable);
  add(myTabbedPane.getComponent(), BorderLayout.CENTER);
}
项目:tools-idea    文件:AbstractTreeClassChooserDialog.java   
protected TabbedPaneWrapper getTabbedPane() {
  return myTabbedPane;
}