当前位置: 首页>>代码示例>>Java>>正文


Java JBTabbedPane类代码示例

本文整理汇总了Java中com.intellij.ui.components.JBTabbedPane的典型用法代码示例。如果您正苦于以下问题:Java JBTabbedPane类的具体用法?Java JBTabbedPane怎么用?Java JBTabbedPane使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


JBTabbedPane类属于com.intellij.ui.components包,在下文中一共展示了JBTabbedPane类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: CodeMakerConfiguration

import com.intellij.ui.components.JBTabbedPane; //导入依赖的package包/类
public CodeMakerConfiguration(CodeMakerSettings settings) {
    tabbedPane = new JBTabbedPane();
    editPaneMap = new HashMap<>();
    addTemplateButton.addActionListener(e -> {
        TemplateEditPane editPane = new TemplateEditPane(settings, "", this);
        String title = "Untitled";
        tabbedPane.addTab(title, editPane.getTemplateEdit());
        tabbedPane.setSelectedIndex(tabbedPane.getTabCount() - 1);
        editPaneMap.put(title, editPane);
    });
    resetTabPane(settings);
    GridConstraints constraints = new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST,
        GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
        GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(300, 300), null, 0, true);
    mainPane.add(tabbedPane, constraints);
}
 
开发者ID:zeng198821,项目名称:CodeGenerate,代码行数:17,代码来源:CodeMakerConfiguration.java

示例2: setUp

import com.intellij.ui.components.JBTabbedPane; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
  super.setUp();
  myNestedFormLoader = new MyNestedFormLoader();

  final String swingPath = PathUtil.getJarPathForClass(AbstractButton.class);

  java.util.List<URL> cp = new ArrayList<URL>();
  appendPath(cp, JBTabbedPane.class);
  appendPath(cp, TIntObjectHashMap.class);
  appendPath(cp, UIUtil.class);
  appendPath(cp, SystemInfoRt.class);
  appendPath(cp, ApplicationManager.class);
  appendPath(cp, PathManager.getResourceRoot(this.getClass(), "/messages/UIBundle.properties"));
  appendPath(cp, PathManager.getResourceRoot(this.getClass(), "/RuntimeBundle.properties"));
  appendPath(cp, GridLayoutManager.class); // forms_rt
  appendPath(cp, DataProvider.class);
  myClassFinder = new MyClassFinder(
    new URL[] {new File(swingPath).toURI().toURL()},
    cp.toArray(new URL[cp.size()])
  );
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:AsmCodeGeneratorTest.java

示例3: getComponentArea

import com.intellij.ui.components.JBTabbedPane; //导入依赖的package包/类
@Nullable
private Area getComponentArea(final JComponent surfaceComponent, final JComponent lightComponent) {
  if (!lightComponent.isShowing()) return null;

  final Point panelPoint = SwingUtilities.convertPoint(lightComponent, new Point(0, 0), surfaceComponent);
  final int x = panelPoint.x;
  final int y = panelPoint.y;

  Insets insetsToIgnore = lightComponent.getInsets();
  final boolean isWithBorder = Boolean.TRUE.equals(lightComponent.getClientProperty(SearchUtil.HIGHLIGHT_WITH_BORDER));
  final boolean isLabelFromTabbedPane = Boolean.TRUE.equals(lightComponent.getClientProperty(JBTabbedPane.LABEL_FROM_TABBED_PANE));

  if ((insetsToIgnore == null || (UIUtil.isUnderAquaLookAndFeel() && lightComponent instanceof JButton)) || isWithBorder) {
    insetsToIgnore = EMPTY_INSETS;
  }

  int hInset = isWithBorder ? 7 : isLabelFromTabbedPane ? 20 : 7;
  int vInset = isWithBorder ? 1 : isLabelFromTabbedPane ? 10 : 5;
  final Area area = new Area(new RoundRectangle2D.Double(x - hInset + insetsToIgnore.left,
                                                         y - vInset + insetsToIgnore.top,
                                                         lightComponent.getWidth() + hInset * 2 - insetsToIgnore.right - insetsToIgnore.left,
                                                         lightComponent.getHeight() + vInset * 2 - insetsToIgnore.top - insetsToIgnore.bottom,
                                                         6, 6));
  return area;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:26,代码来源:GlassPanel.java

示例4: setUp

import com.intellij.ui.components.JBTabbedPane; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
  super.setUp();
  myNestedFormLoader = new MyNestedFormLoader();

  final String swingPath = PathUtil.getJarPathForClass(AbstractButton.class);

  java.util.List<URL> cp = new ArrayList<URL>();
  appendPath(cp, JBTabbedPane.class);
  appendPath(cp, TIntObjectHashMap.class);
  appendPath(cp, UIUtil.class);
  appendPath(cp, SystemInfoRt.class);
  appendPath(cp, ApplicationManager.class);
  appendPath(cp, PathManager.getResourceRoot(this.getClass(), "/messages/UIBundle.properties"));
  appendPath(cp, PathManager.getResourceRoot(this.getClass(), "/RuntimeBundle.properties"));
  appendPath(cp, GridLayoutManager.class); // forms_rt
  myClassFinder = new MyClassFinder(
    new URL[] {new File(swingPath).toURI().toURL()},
    cp.toArray(new URL[cp.size()])
  );
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:22,代码来源:AsmCodeGeneratorTest.java

示例5: createParseTreeAndProfileTabbedPanel

import com.intellij.ui.components.JBTabbedPane; //导入依赖的package包/类
public JTabbedPane createParseTreeAndProfileTabbedPanel() {
	JBTabbedPane tabbedPane = new JBTabbedPane();

	LOG.info("createParseTreePanel" + " " + project.getName());
	Pair<UberTreeViewer, JPanel> pair = createParseTreePanel();
	treeViewer = pair.a;
	tabbedPane.addTab("Parse tree", pair.b);

	jTreeViewer = new JTreeViewer(null, this);
	tabbedPane.addTab("Hierarchy", jTreeViewer);

	profilerPanel = new ProfilerPanel(project, this);
	tabbedPane.addTab("Profiler", profilerPanel.$$$getRootComponent$$$());

	return tabbedPane;
}
 
开发者ID:antlr,项目名称:intellij-plugin-v4,代码行数:17,代码来源:PreviewPanel.java

示例6: init

import com.intellij.ui.components.JBTabbedPane; //导入依赖的package包/类
private void init(IdeaContext ideaContext, List<Table> tables){
    setLayout(new BorderLayout());
    JBTabbedPane tabbedPane = new JBTabbedPane();

    for (Table table: tables) {
        TablePanel tablePanel = new TablePanel(table);
        tabbedPane.add(tablePanel.getRootComponent(), table.getTableName());
        panels.add(tablePanel);
    }

    List<CodeRoot> codeRoots =  SETTING_MANAGER.getTemplates().getRoots();
    SelectGroupPanel selectGroupPanel = new SelectGroupPanel(codeRoots, ideaContext.getProject());
    JPanel groupPanel = selectGroupPanel.getGroupsPanel();
    JButton genBtn = selectGroupPanel.getGenerator();
    groupPathMap = selectGroupPanel.getGroupPathMap();
    genBtn.addActionListener( it -> {
        List<String> selectGroups = new ArrayList<>();
        this.getAllJCheckBoxValue(groupPanel, selectGroups);

        if(!selectGroups.isEmpty()) {
            List<CodeContext> contexts = new ArrayList<>();

            for (TablePanel panel: panels) {
                String modelName = panel.getModelTextField().getText().trim();
                String tableName = panel.getTableTextField().getText().trim();
                String comment = panel.getCommentTextField().getText().trim();
                // 组装数据
                CodeContext context = new CodeContext(modelName, tableName, comment, panel.getFields());
                contexts.add(context);
            }
            generator(ideaContext, selectGroups, contexts);
            dispose();
        }
    });

    add(tabbedPane, BorderLayout.CENTER);
    selectGroupPanel.getRootPanel().setBorder(BorderFactory.createEmptyBorder(0, 15, 10, 15));
    add(selectGroupPanel.getRootPanel(), BorderLayout.SOUTH);
}
 
开发者ID:hykes,项目名称:CodeGen,代码行数:40,代码来源:ColumnEditorFrame.java

示例7: createOptionsPanel

import com.intellij.ui.components.JBTabbedPane; //导入依赖的package包/类
@Override
public JComponent createOptionsPanel() {
  JTabbedPane tabs = new JBTabbedPane(SwingConstants.TOP);
  tabs.add("Entry points", new OptionsPanel());
  tabs.add("On the fly editor settings", myLocalInspectionBase.createOptionsPanel());
  return tabs;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:UnusedDeclarationInspection.java

示例8: doCreateComponent

import com.intellij.ui.components.JBTabbedPane; //导入依赖的package包/类
private JComponent doCreateComponent() {
  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();

  JTabbedPane tabs = new JBTabbedPane();
  for (int i = 0; i < editors.size(); i++) {
    Pair<String, SettingsEditor<T>> pair = editors.get(i);
    JPanel panel = new JPanel(new BorderLayout());
    panel.add(pair.getSecond().getComponent(), BorderLayout.CENTER);
    tabs.add(pair.getFirst(), panel);
  }

  return tabs;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:GroupSettingsBuilder.java

示例9: getComponentArea

import com.intellij.ui.components.JBTabbedPane; //导入依赖的package包/类
@Nullable
private Area getComponentArea(final JComponent surfaceComponent, final JComponent lightComponent, int offset) {
  if (!lightComponent.isShowing()) return null;

  final Point panelPoint = SwingUtilities.convertPoint(lightComponent, new Point(0, 0), surfaceComponent);
  final int x = panelPoint.x;
  final int y = panelPoint.y;

  Insets insetsToIgnore = lightComponent.getInsets();
  final boolean isWithBorder = Boolean.TRUE.equals(lightComponent.getClientProperty(SearchUtil.HIGHLIGHT_WITH_BORDER));
  final boolean isLabelFromTabbedPane = Boolean.TRUE.equals(lightComponent.getClientProperty(JBTabbedPane.LABEL_FROM_TABBED_PANE));

  if ((insetsToIgnore == null || (UIUtil.isUnderAquaLookAndFeel() && lightComponent instanceof JButton)) || isWithBorder) {
    insetsToIgnore = EMPTY_INSETS;
  }

  int hInset = getComponentHInset(isWithBorder, isLabelFromTabbedPane);
  int vInset = getComponentVInset(isWithBorder, isLabelFromTabbedPane);
  hInset += offset;
  vInset += offset;
  int xCoord = x - hInset + insetsToIgnore.left;
  int yCoord = y - vInset + insetsToIgnore.top;
  int width = lightComponent.getWidth() + hInset * 2 - insetsToIgnore.right - insetsToIgnore.left;
  int height = lightComponent.getHeight() + vInset * 2 - insetsToIgnore.top - insetsToIgnore.bottom;
  return new Area(new RoundRectangle2D.Double(xCoord,
                                              yCoord,
                                              width,
                                              height,
                                              Math.min(height, 30), Math.min(height, 30)));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:GlassPanel.java

示例10: createComponent

import com.intellij.ui.components.JBTabbedPane; //导入依赖的package包/类
public JComponent createComponent() {
  tabbedPane = new JBTabbedPane();
  for (Configurable configurable : configurables) {
    JComponent component = configurable.createComponent();
    tabbedPane.add(configurable.getDisplayName(), component);
  }
  return tabbedPane;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:CompositeConfigurable.java

示例11: createCenterPanel

import com.intellij.ui.components.JBTabbedPane; //导入依赖的package包/类
protected JComponent createCenterPanel() {
  myTabbedPane = new JBTabbedPane();
  myTabbedPane.add(myUserTab.createComponent(), SvnBundle.message("dialog.edit.http.proxies.settings.tab.edit.user.file.title"));
  myTabbedPane.add(mySystemTab.createComponent(), SvnBundle.message("dialog.edit.http.proxies.settings.tab.edit.system.file.title"));
  myPanel.add(myTabbedPane, BorderLayout.NORTH);
  return myPanel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:SvnConfigureProxiesDialog.java

示例12: createToolWindowContent

import com.intellij.ui.components.JBTabbedPane; //导入依赖的package包/类
public void createToolWindowContent(final Project project, final ToolWindow toolWindow) {
    // Plugin is now placed into a Tabbed Pane to add additional views to it
    JBTabbedPane master = new JBTabbedPane(SwingConstants.BOTTOM);
    SlingPluginExplorer explorer = new SlingPluginExplorer(project);
    LOGGER.debug("CTWC: Explorer: '" + explorer + "'");
    master.insertTab("Plugin", null, explorer, "Plugin Windows", 0);

    WebContentFXPanel info = new WebContentFXPanel();
    master.insertTab("Info", null, info, "Plugin Info", 1);

    final AemdcPanel aemdcPanel = ComponentProvider.getComponent(project, AemdcPanel.class);
    LOGGER.debug("AEMDC Panel found: '{}'", aemdcPanel);
    aemdcPanel.setContainer(master);

    final ContentManager contentManager = toolWindow.getContentManager();
    final Content content = contentManager.getFactory().createContent(master, null, false);
    contentManager.addContent(content);
    Disposer.register(project, explorer);

    final ToolWindowManagerAdapter listener = new ToolWindowManagerAdapter() {
        boolean wasVisible = false;

        @Override
        public void stateChanged() {
            if (toolWindow.isDisposed()) {
                return;
            }
            boolean visible = toolWindow.isVisible();
            // If the Plugin became visible then we let the AEMDC Panel know to recrate the JFX Panel
            // to avoid the double buffering
            if(!wasVisible && visible) {
                aemdcPanel.reset();
            }
            wasVisible = visible;
        }
    };
    final ToolWindowManagerEx manager = ToolWindowManagerEx.getInstanceEx(project);
    manager.addToolWindowManagerListener(listener, project);
}
 
开发者ID:headwirecom,项目名称:aem-ide-tooling-4-intellij,代码行数:40,代码来源:SlingPluginToolWindowFactory.java

示例13: installPreviewPanel

import com.intellij.ui.components.JBTabbedPane; //导入依赖的package包/类
@Override
protected void installPreviewPanel(final JPanel previewPanel) {
  if (getSettingsType() != LanguageCodeStyleSettingsProvider.SettingsType.LANGUAGE_SPECIFIC) {
    tabbedPane = new JBTabbedPane();
    tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
    Language[] langs = LanguageCodeStyleSettingsProvider.getLanguagesWithSharedPreview();
    if (langs.length == 0) return;
    for (Language lang : langs) {
      tabbedPane.addTab(getTabName(lang), createDummy());
    }
    tabbedPane.setComponentAt(0, getEditor().getComponent());
    myLangSelectionIndex = 0;
    if (myLanguage == null) {
      setPanelLanguage(langs[0]);
    }
    else {
      updatePreview(true);
    }
    tabbedPane.addChangeListener(new ChangeListener() {
      @Override
      public void stateChanged(ChangeEvent e) {
        onTabSelection((JTabbedPane)e.getSource());
      }
    });
    previewPanel.add(tabbedPane, BorderLayout.CENTER);
    previewPanel.addAncestorListener(new AncestorListenerAdapter() {
      @Override
      public void ancestorAdded(AncestorEvent event) {
        selectCurrentLanguageTab();
      }
    });
  }
  else {
    // If settings are language-specific
    previewPanel.add(getEditor().getComponent(), BorderLayout.CENTER);
    updatePreview(true);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:39,代码来源:MultilanguageCodeStyleAbstractPanel.java

示例14: createOptionsPanel

import com.intellij.ui.components.JBTabbedPane; //导入依赖的package包/类
@Override
public JComponent createOptionsPanel()
{
	JTabbedPane tabs = new JBTabbedPane(SwingConstants.TOP);
	tabs.add("Entry points", new OptionsPanel());
	tabs.add("On the fly editor settings", myLocalInspectionBase.createOptionsPanel());
	return tabs;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:9,代码来源:UnusedDeclarationInspection.java

示例15: TabbedRefreshablePanel

import com.intellij.ui.components.JBTabbedPane; //导入依赖的package包/类
public TabbedRefreshablePanel() {
  myPanels = new ArrayList<RefreshablePanel>();
  myPane = new JBTabbedPane();
  myPanel = new JPanel(new BorderLayout());
  myPanel.add(myPane, BorderLayout.CENTER);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:TabbedRefreshablePanel.java


注:本文中的com.intellij.ui.components.JBTabbedPane类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。