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


Java JBPanel类代码示例

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


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

示例1: createLicenseInfoTab

import com.intellij.ui.components.JBPanel; //导入依赖的package包/类
private JPanel createLicenseInfoTab(boolean supported) {
    ActionToolbar toolbar = ComponentUtils.createActionToolbar(licensesComponentsTree);
    licenseFilterMenu = new LicenseFilterMenu(project);
    FilterButton licensesFilterButton = new FilterButton(licenseFilterMenu, "License", "Select licenses to show");
    licensesFilterButton.setAlignmentX(Component.LEFT_ALIGNMENT);
    SimpleToolWindowPanel filterPanel = new SimpleToolWindowPanel(false);
    filterPanel.setToolbar(toolbar.getComponent());
    filterPanel.setContent(licensesFilterButton);

    JPanel licenseTab = new JBPanel(new BorderLayout());
    licensesCentralVerticalSplit = new OnePixelSplitter(false, 0.3f);
    licensesCentralVerticalSplit.setFirstComponent(createLicensesComponentsTreeView());
    licensesCentralVerticalSplit.setSecondComponent(createLicenseDetailsView(supported));
    licenseTab.add(filterPanel, BorderLayout.NORTH);
    licenseTab.add(licensesCentralVerticalSplit, BorderLayout.CENTER);
    return licenseTab;
}
 
开发者ID:JFrogDev,项目名称:jfrog-idea-plugin,代码行数:18,代码来源:XrayToolWindow.java

示例2: createIssuesComponentsTreeView

import com.intellij.ui.components.JBPanel; //导入依赖的package包/类
private JComponent createIssuesComponentsTreeView() {
    issuesCount = new JBLabel("Issues (0) ");

    JPanel componentsTreePanel = new JBPanel(new BorderLayout()).withBackground(UIUtil.getTableBackground());
    JLabel componentsTreeTitle = new JBLabel(" Components Tree");
    componentsTreeTitle.setFont(componentsTreeTitle.getFont().deriveFont(TITLE_FONT_SIZE));
    componentsTreePanel.add(componentsTreeTitle, BorderLayout.LINE_START);
    componentsTreePanel.add(issuesCount, BorderLayout.LINE_END);

    issuesCountPanel = new JBPanel().withBackground(UIUtil.getTableBackground());
    issuesCountPanel.setLayout(new BoxLayout(issuesCountPanel, BoxLayout.Y_AXIS));
    issuesComponentsTree.setCellRenderer(new IssuesTreeCellRenderer());
    issuesComponentsTree.expandRow(0);
    issuesComponentsTree.setRootVisible(false);
    issuesTreeExpansionListener = new IssuesTreeExpansionListener(issuesComponentsTree, issuesCountPanel, issuesCountPanels);

    JBPanel treePanel = new JBPanel(new BorderLayout()).withBackground(UIUtil.getTableBackground());
    TreeSpeedSearch treeSpeedSearch = new TreeSpeedSearch(issuesComponentsTree);
    treePanel.add(treeSpeedSearch.getComponent(), BorderLayout.WEST);
    treePanel.add(issuesCountPanel, BorderLayout.CENTER);
    JScrollPane treeScrollPane = ScrollPaneFactory.createScrollPane(treePanel);
    treeScrollPane.getVerticalScrollBar().setUnitIncrement(SCROLL_BAR_SCROLLING_UNITS);
    return new TitledPane(JSplitPane.VERTICAL_SPLIT, TITLE_LABEL_SIZE, componentsTreePanel, treeScrollPane);
}
 
开发者ID:JFrogDev,项目名称:jfrog-idea-plugin,代码行数:25,代码来源:XrayToolWindow.java

示例3: createLicensesComponentsTreeView

import com.intellij.ui.components.JBPanel; //导入依赖的package包/类
private JComponent createLicensesComponentsTreeView() {
    JPanel componentsTreePanel = new JBPanel(new BorderLayout());
    componentsTreePanel.setBackground(UIUtil.getTableBackground());
    JLabel componentsTreeTitle = new JBLabel(" Components Tree");
    componentsTreeTitle.setFont(componentsTreeTitle.getFont().deriveFont(TITLE_FONT_SIZE));
    componentsTreePanel.add(componentsTreeTitle, BorderLayout.WEST);

    licensesComponentsTree.expandRow(0);
    licensesComponentsTree.setRootVisible(false);
    licensesComponentsTree.setCellRenderer(new LicensesTreeCellRenderer());
    TreeSpeedSearch treeSpeedSearch = new TreeSpeedSearch(licensesComponentsTree);
    JScrollPane treeScrollPane = ScrollPaneFactory.createScrollPane(treeSpeedSearch.getComponent());
    treeScrollPane.getVerticalScrollBar().setUnitIncrement(SCROLL_BAR_SCROLLING_UNITS);
    return new TitledPane(JSplitPane.VERTICAL_SPLIT, TITLE_LABEL_SIZE, componentsTreePanel, treeScrollPane);

}
 
开发者ID:JFrogDev,项目名称:jfrog-idea-plugin,代码行数:17,代码来源:XrayToolWindow.java

示例4: ToolWindowPanel

import com.intellij.ui.components.JBPanel; //导入依赖的package包/类
public ToolWindowPanel(Project project) {
    super(false);

    this.project = project;

    mainContent = new JBPanel(new BorderLayout());
    mainContent.setAutoscrolls(true);
    setContent(mainContent);

    this.rootNode = new DefaultMutableTreeNode(getDefaultRootNode());

    createRepositoryTree();
    createActionToolBar();
    createStatusLine();
    createExecutionCounter();

    configureActions();

    loadRepositories();
}
 
开发者ID:testIT-LivingDoc,项目名称:livingdoc-intellij,代码行数:21,代码来源:ToolWindowPanel.java

示例5: createNavigationSplitter

import com.intellij.ui.components.JBPanel; //导入依赖的package包/类
@NotNull
public static JBSplitter createNavigationSplitter(@Nullable JComponent leftPanelContents, @Nullable JComponent rightPanelContents) {
  JBPanel navigationPanel = new JBPanel(new BorderLayout());
  navigationPanel.setBackground(JBColor.background());
  if (leftPanelContents != null) {
    navigationPanel.add(leftPanelContents, BorderLayout.CENTER);
  }

  JBPanel contextInformationPanel = new JBPanel(new BorderLayout());
  contextInformationPanel.setBackground(JBColor.background());
  if (rightPanelContents != null) {
    contextInformationPanel.add(rightPanelContents, BorderLayout.CENTER);
  }

  JBSplitter navigationSplitter = new JBSplitter(false);
  navigationSplitter.setFirstComponent(navigationPanel);
  navigationSplitter.setSecondComponent(contextInformationPanel);
  navigationSplitter.setDividerWidth(DIVIDER_WIDTH);

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

示例6: createCenterPanel

import com.intellij.ui.components.JBPanel; //导入依赖的package包/类
@Nullable
@Override
protected JComponent createCenterPanel() {
  JPanel iconPanel = new JBPanel(new BorderLayout());
  iconPanel.add(new JBLabel(AllIcons.General.WarningDialog), BorderLayout.NORTH);

  myMessage = new JEditorPane();
  myMessage.setEditorKit(UIUtil.getHTMLEditorKit());
  myMessage.setEditable(false);
  myMessage.setPreferredSize(JBUI.size(500, 100));
  myMessage.setBorder(BorderFactory.createLineBorder(Gray._200));
  String text = "<div style='margin:5px;'>" + IdeaDecompilerBundle.message("legal.notice.text") + "</div>";
  myMessage.setText(text);

  JPanel panel = new JBPanel(new BorderLayout(10, 0));
  panel.add(iconPanel, BorderLayout.WEST);
  panel.add(myMessage, BorderLayout.CENTER);
  return panel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:IdeaDecompiler.java

示例7: buildForOne

import com.intellij.ui.components.JBPanel; //导入依赖的package包/类
private void buildForOne(JBPanel panel, final FilePath root) {
  final GridBagConstraints c = new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTHWEST,
          GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 0, 0);
  c.fill = GridBagConstraints.HORIZONTAL;
  c.gridwidth = 2;
  final JBLabel comp = new JBLabel("Please select remote URL:");
  comp.setFont(comp.getFont().deriveFont(Font.BOLD));
  panel.add(comp, c);
  final JBTextField value = new JBTextField();
  value.setColumns(100);
  final String preset = myCheckoutURLs.get(root.getIOFile());
  if (preset != null) {
    value.setText(preset);
  }
  myFields.put(root.getIOFile(), value);
  ++ c.gridy;
  panel.add(value, c);
  addWarning(panel, c);
}
 
开发者ID:irengrig,项目名称:fossil4idea,代码行数:20,代码来源:FossilUpdateConfigurable.java

示例8: createTab

import com.intellij.ui.components.JBPanel; //导入依赖的package包/类
public Component createTab(String text) {
    JPanel panel = new JBPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
    JLabel label = JBLabelDecorator.createJBLabelDecorator(text);
    label.setOpaque(false);
    panel.add(label);
    TabButton btn = new TabButton();
    panel.add(btn);
    panel.setBackground(Color.black);
    panel.setOpaque(false);
    UIUtil.setNotOpaqueRecursively(panel);
    return panel;
}
 
开发者ID:Jamling,项目名称:SmartQQ4IntelliJ,代码行数:13,代码来源:ClosableTabHost.java

示例9: createUnsupportedView

import com.intellij.ui.components.JBPanel; //导入依赖的package包/类
private JPanel createUnsupportedView() {
    JLabel label = new JBLabel();
    label.setText("Unsupported project type, currently only Maven, Gradle and npm projects are supported.");

    JBPanel panel = new JBPanel(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    c.fill = GridBagConstraints.BOTH;
    c.anchor = GridBagConstraints.CENTER;
    panel.add(label, c);
    panel.setBackground(UIUtil.getTableBackground());
    return panel;
}
 
开发者ID:JFrogDev,项目名称:jfrog-idea-plugin,代码行数:13,代码来源:XrayToolWindow.java

示例10: createComponentsDetailsView

import com.intellij.ui.components.JBPanel; //导入依赖的package包/类
private JComponent createComponentsDetailsView(boolean supported) {
    if (!GlobalSettings.getInstance().isCredentialsSet()) {
        return createNoCredentialsView();
    }
    if (!supported) {
        return createUnsupportedView();
    }
    JLabel title = new JBLabel(" Component Details");
    title.setFont(title.getFont().deriveFont(TITLE_FONT_SIZE));

    issuesDetailsPanel = new JBPanel(new BorderLayout()).withBackground(UIUtil.getTableBackground());
    issuesDetailsPanel.add(ComponentUtils.createDisabledTextLabel("Select component or issue for more details"), BorderLayout.CENTER);
    issuesDetailsScroll = ScrollPaneFactory.createScrollPane(issuesDetailsPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    return new TitledPane(JSplitPane.VERTICAL_SPLIT, TITLE_LABEL_SIZE, title, issuesDetailsScroll);
}
 
开发者ID:JFrogDev,项目名称:jfrog-idea-plugin,代码行数:16,代码来源:XrayToolWindow.java

示例11: createLicenseDetailsView

import com.intellij.ui.components.JBPanel; //导入依赖的package包/类
private JComponent createLicenseDetailsView(boolean supported) {
    if (!GlobalSettings.getInstance().isCredentialsSet()) {
        return createNoCredentialsView();
    }
    if (!supported) {
        return createUnsupportedView();
    }
    JLabel title = new JBLabel(" Details");
    title.setFont(title.getFont().deriveFont(TITLE_FONT_SIZE));

    licensesDetailsPanel = new JBPanel(new BorderLayout()).withBackground(UIUtil.getTableBackground());
    licensesDetailsPanel.add(ComponentUtils.createDisabledTextLabel("Select component or issue for more details"), BorderLayout.CENTER);
    licensesDetailsScroll = ScrollPaneFactory.createScrollPane(licensesDetailsPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    return new TitledPane(JSplitPane.VERTICAL_SPLIT, TITLE_LABEL_SIZE, title, licensesDetailsScroll);
}
 
开发者ID:JFrogDev,项目名称:jfrog-idea-plugin,代码行数:16,代码来源:XrayToolWindow.java

示例12: createNoCredentialsView

import com.intellij.ui.components.JBPanel; //导入依赖的package包/类
private JComponent createNoCredentialsView() {
    HyperlinkLabel link = new HyperlinkLabel();
    link.setHyperlinkText("To start using the JFrog Plugin, please ", "configure", " your JFrog Xray details.");
    link.addHyperlinkListener(e -> ShowSettingsUtil.getInstance().showSettingsDialog(project, XrayGlobalConfiguration.class));

    JBPanel panel = new JBPanel(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    c.fill = GridBagConstraints.BOTH;
    c.anchor = GridBagConstraints.CENTER;
    panel.add(link, c);
    panel.setBackground(UIUtil.getTableBackground());
    return panel;
}
 
开发者ID:JFrogDev,项目名称:jfrog-idea-plugin,代码行数:14,代码来源:XrayToolWindow.java

示例13: createCommonGridPanel

import com.intellij.ui.components.JBPanel; //导入依赖的package包/类
private static JPanel createCommonGridPanel(JPanel panel, ScanTreeNode node) {
    if (node == null || node.getGeneralInfo() == null) {
        replaceAndUpdateUI(panel, createDisabledTextLabel("Component information is not available"),
                BorderLayout.CENTER);
        return null;
    }
    JPanel gridPanel = new JBPanel(new GridBagLayout());
    gridPanel.setBackground(UIUtil.getTableBackground());
    String pkgType = StringUtils.capitalize(node.getGeneralInfo().pkgType);
    if (StringUtils.isBlank(pkgType)) {
        // No package type
        addJtext(gridPanel, 0, "Group:", node.getGeneralInfo().getGroupId());
        addJtext(gridPanel, 1, "Artifact:", node.getGeneralInfo().getArtifactId());
        addJtext(gridPanel, 2, "Version:", node.getGeneralInfo().getVersion());
    } else if (pkgType.equals("Npm")) {
        // Npm
        addJtext(gridPanel, 0, "Package:", node.getGeneralInfo().getGroupId());
        addJtext(gridPanel, 1, "Version:", node.getGeneralInfo().getVersion());
        addJtext(gridPanel, 2, "Type:", pkgType);
    } else {
        // Maven/Gradle
        addJtext(gridPanel, 0, "Group:", node.getGeneralInfo().getGroupId());
        addJtext(gridPanel, 1, "Artifact:", node.getGeneralInfo().getArtifactId());
        addJtext(gridPanel, 2, "Version:", node.getGeneralInfo().getVersion());
        addJtext(gridPanel, 3, "Type:", StringUtils.capitalize(node.getGeneralInfo().pkgType));
    }
    addLicenses(gridPanel, node.getLicenses());
    return gridPanel;
}
 
开发者ID:JFrogDev,项目名称:jfrog-idea-plugin,代码行数:30,代码来源:DetailsViewFactory.java

示例14: addLicenses

import com.intellij.ui.components.JBPanel; //导入依赖的package包/类
private static void addLicenses(JPanel panel, Set<License> licenses) {
    if (licenses == null) {
        return;
    }
    JPanel licensesPanel = new JBPanel(new HorizontalLayout(1));
    licensesPanel.setBackground(UIUtil.getTableBackground());
    for (License license : licenses) {
        if (CollectionUtils.isEmpty(license.moreInfoUrl)) {
            licensesPanel.add(createJTextArea(createLicenseString(license), false));
            continue;
        }
        HyperlinkLabel hyperlinkLabel = new HyperlinkLabel(createLicenseString(license));
        hyperlinkLabel.setBackground(UIUtil.getTableBackground());
        hyperlinkLabel.setHyperlinkTarget(license.moreInfoUrl.get(0));
        licensesPanel.add(hyperlinkLabel);
    }

    JBLabel headerLabel = new JBLabel("Licenses:");
    headerLabel.setBackground(UIUtil.getTableBackground());
    headerLabel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));

    GridBagConstraints c = new GridBagConstraints();
    c.fill = GridBagConstraints.HORIZONTAL;
    c.anchor = GridBagConstraints.NORTHWEST;
    c.ipadx = 20;
    c.ipady = 3;

    c.gridy = 4;
    panel.add(headerLabel, c);

    c.gridx = 1;
    c.weightx = 0.9;
    panel.add(licensesPanel, c);
}
 
开发者ID:JFrogDev,项目名称:jfrog-idea-plugin,代码行数:35,代码来源:DetailsViewFactory.java

示例15: createIssueCountLabel

import com.intellij.ui.components.JBPanel; //导入依赖的package包/类
public static JPanel createIssueCountLabel(int issueCount, int rowHeight) {
    JPanel issueCountPanel = new JBPanel(new BorderLayout()).withBackground(UIUtil.getTableBackground());
    JLabel issueCountLabel = new JBLabel();
    issueCountPanel.add(issueCountLabel, BorderLayout.EAST);
    setIssueCountPanel(issueCount, issueCountPanel);

    issueCountLabel.setAlignmentX(Component.RIGHT_ALIGNMENT);
    issueCountLabel.setMinimumSize(new JBDimension(issueCountLabel.getMinimumSize().width, rowHeight));
    issueCountLabel.setMaximumSize(new JBDimension(issueCountLabel.getMaximumSize().width, rowHeight));

    issueCountPanel.setMinimumSize(new JBDimension(issueCountPanel.getMinimumSize().width, rowHeight));
    issueCountPanel.setMaximumSize(new JBDimension(issueCountPanel.getMaximumSize().width, rowHeight));
    return issueCountPanel;
}
 
开发者ID:JFrogDev,项目名称:jfrog-idea-plugin,代码行数:15,代码来源:ComponentUtils.java


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