Java 类com.intellij.ui.components.JBLabel 实例源码

项目:ijphab    文件:PhabricatorRepositoryEditor.java   
@Nullable
@Override
protected JComponent createCustomPanel() {
  myIconProjectsLabel = new JBLabel("Icon Projects:", SwingConstants.RIGHT);
  myIconProjects = TextFieldWithAutoCompletion.create(
    myProject,
    Collections.emptyList(),
    true,
    myRepository.getIconProjects()
  );
  JBLabel descLabel = new JBLabel();
  descLabel.setCopyable(true);
  descLabel.setText("Only one icon is shown for each task. " +
                    "This icon is extracted from the projects the task belongs to.<br>" +
                    "You can specify the projects whose icons will be used first. " +
                    "Separate multiple projects with commas.");
  descLabel.setComponentStyle(UIUtil.ComponentStyle.SMALL);
  return FormBuilder.createFormBuilder()
    .addLabeledComponent(myIconProjectsLabel, myIconProjects)
    .addComponentToRightColumn(descLabel)
    .getPanel();
}
项目:jfrog-idea-plugin    文件:XrayToolWindow.java   
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);
}
项目:jfrog-idea-plugin    文件:XrayToolWindow.java   
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);

}
项目:jfrog-idea-plugin    文件:DetailsViewFactory.java   
private static void addJtext(JPanel panel, int place, String header, String text) {
    JLabel headerLabel = new JBLabel(header);
    headerLabel.setOpaque(true);
    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 = place;
    panel.add(headerLabel, c);

    c.gridx = 1;
    c.weightx = 0.9;
    panel.add(createJTextArea(text, true), c);
}
项目:jfrog-idea-plugin    文件:FilterButton.java   
private void initUi(String myName, String toolTip) {
    myNameLabel = new JBLabel(myName);
    myNameLabel.setIcon(AllIcons.General.Filter);
    JLabel arrow = new JBLabel(AllIcons.Ide.Statusbar_arrows);
    setToolTipText(toolTip);
    setDefaultForeground();
    setFocusable(true);
    setBorder(createUnfocusedBorder());

    setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
    add(myNameLabel);
    add(Box.createHorizontalStrut(GAP_BEFORE_ARROW));
    add(arrow);

    revalidate();
    repaint();
    showPopupMenuOnClick();
    indicateHovering();
    indicateFocusing();
}
项目:hybris-integration-intellij-idea-plugin    文件:HybrisApplicationSettingsForm.java   
private void createUIComponents() {
    impexLabel = new JBLabel();
    impexLabel.setBorder(IdeBorderFactory.createTitledBorder(HybrisI18NBundleUtils.message(
        "hybris.import.settings.impex.title"), false));
    hybrisRemoteControlLabel = new JBLabel();
    hybrisRemoteControlLabel.setBorder(IdeBorderFactory.createTitledBorder(HybrisI18NBundleUtils.message(
        "hybris.import.settings.tools.remote.title"), false));
    projectImportLabel = new JBLabel();
    projectImportLabel.setBorder(IdeBorderFactory.createTitledBorder(HybrisI18NBundleUtils.message(
        "hybris.import.settings.project.title")));
    junkListPanel = new JunkListPanel("hybris.import.settings.junk.directory.name", new ArrayList<String>());
    junkDirectoriesPanel = junkListPanel;

    projectTreeViewSettingsLabel = new JBLabel();
    projectTreeViewSettingsLabel.setBorder(IdeBorderFactory.createTitledBorder(HybrisI18NBundleUtils.message(
        "hybris.project.view.tree.settings")));
}
项目:intellij-nette-tester    文件:TesterConfigurableForm.java   
private void createUIComponents() {
    defaultExtensionLabel = new JBLabel(TesterBundle.message("settings.defaultExtension"));
    defaultExtensionCombobox = new ComboBox<>(new String[]{"phpt", "php"});

    bootstrapFileLabel = new JBLabel(TesterBundle.message("settings.bootstrapFile"));
    bootstrapFileField = new TextFieldWithBrowseButton();
    bootstrapFileField.addBrowseFolderListener(null, null, project, FileChooserDescriptorFactory.createSingleFileDescriptor("php"));

    namespaceMappingTable = new NamespaceMappingTable(project);
    namespaceMappingPanel = ToolbarDecorator.createDecorator(namespaceMappingTable.getTableView(), new ElementProducer<TesterNamespaceMapping>() {
        @Override
        public TesterNamespaceMapping createElement() {
            return new TesterNamespaceMapping();
        }

        @Override
        public boolean canCreateElement() {
            return true;
        }
    }).createPanel();

    namespaceMappingPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, JBColor.LIGHT_GRAY), TesterBundle.message("settings.namespaceMappings.title")));
}
项目:intellij-nette-tester    文件:TesterTestEnvironmentSettingsEditor.java   
private void createUIComponents() {
    phpInterpreter = new PhpInterpreterComboBox(project, null);
    phpInterpreter.setModel(PhpInterpretersManagerImpl.getInstance(project).getInterpreters(), null);
    phpInterpreter.setNoItemText("<default project interpreter>");

    interpreterOptions = new PhpConfigurationOptionsComponent();

    phpIniPath = new TextFieldWithBrowseButton();
    phpIniPath.addBrowseFolderListener(null, null, project, FileChooserDescriptorFactory.createSingleFileDescriptor("ini"));

    useSystemPhpIniCheckbox = new JBCheckBox(TesterBundle.message("runConfiguration.editor.testEnv.useSystemPhpIni"));

    interpreterLabel = new JBLabel(TesterBundle.message("runConfiguration.editor.testEnv.interpreter"));
    interpreterOptionsLabel = new JBLabel(TesterBundle.message("runConfiguration.editor.testEnv.interpreterOptions"));
    pathToPhpIniLabel = new JBLabel(TesterBundle.message("runConfiguration.editor.testEnv.phpIni"));
}
项目:intellij-nette-tester    文件:TesterSettingsEditor.java   
private void createUIComponents() {
    testScope = new TextFieldWithBrowseButton();
    testScope.addBrowseFolderListener(null, null, project, FileChooserDescriptorFactory.createSingleFileOrFolderDescriptor());

    testerExecutable = new TextFieldWithBrowseButton();
    testerExecutable.addBrowseFolderListener(null, null, project, FileChooserDescriptorFactory.createSingleFileOrFolderDescriptor());

    testerOptions = new RawCommandLineEditor();
    testerOptions.setDialogCaption("Options");

    userSetupScript = new TextFieldWithBrowseButton();
    userSetupScript.addBrowseFolderListener(null, null, project, FileChooserDescriptorFactory.createSingleFileDescriptor("php"));

    testScopeLabel = new JBLabel(TesterBundle.message("runConfiguration.editor.tester.testScope"));
    testerExecutableLabel = new JBLabel(TesterBundle.message("runConfiguration.editor.tester.testerExecutable"));
    testerOptionsLabel = new JBLabel(TesterBundle.message("runConfiguration.editor.tester.testerOptions"));
    setupScriptLabel = new JBLabel(TesterBundle.message("runConfiguration.editor.tester.setupScript"));
}
项目:intellij-nette-tester    文件:TesterNewTestCaseDialog.java   
private void createUIComponents() {
    testTargetTextField = new EditorTextField("", getProject(), FileTypes.PLAIN_TEXT);
    namespaceComboBox = new PhpNamespaceComboBox(getProject(), "", getDisposable());
    directoryComboBox = new PhpPsrDirectoryComboBox(getProject()) {
        @Override
        public void init(@NotNull VirtualFile baseDir, @NotNull String namespace) {
            super.init(baseDir, namespace);
            ProjectFileIndex index = ProjectRootManager.getInstance(TesterNewTestCaseDialog.this.getProject()).getFileIndex();
            this.setDirectoriesFilter(index::isInTestSourceContent);

            this.updateDirectories(TesterNewTestCaseDialog.this.getNamespace());
        }
    };

    classToTestLabel = new JBLabel(TesterBundle.message("dialog.newTestCase.label.classToTest"));
    testClassLabel = new JBLabel(TesterBundle.message("dialog.newTestCase.label.testClass"));
    namespaceLabel = new JBLabel(TesterBundle.message("dialog.newTestCase.label.namespace"));
    fileNameLabel = new JBLabel(TesterBundle.message("dialog.newTestCase.label.fileName"));
    directoryLabel = new JBLabel(TesterBundle.message("dialog.newTestCase.label.directory"));

    testTargetCompletionHint = new JBLabel(UIUtil.ComponentStyle.MINI);
    namespaceCompletionHint = new JBLabel(UIUtil.ComponentStyle.MINI);
    directoryCompletionHint = new JBLabel(UIUtil.ComponentStyle.MINI);
}
项目:PackageTemplates    文件:ScriptDialog.java   
private void createViews() {
    etfName = new EditorTextField(Localizer.get("ExampleName"));
    btnTry = new JButton(Localizer.get("TryIt"));
    jlResult = new JBLabel(Localizer.get("ResultWillBeHere"));

    etfName.setAlignmentX(Component.CENTER_ALIGNMENT);
    etfName.setAlignmentY(Component.CENTER_ALIGNMENT);
    btnTry.setAlignmentX(Component.CENTER_ALIGNMENT);
    btnTry.setAlignmentY(Component.CENTER_ALIGNMENT);
    jlResult.setAlignmentX(Component.CENTER_ALIGNMENT);
    jlResult.setAlignmentY(Component.CENTER_ALIGNMENT);

    btnTry.addMouseListener(new ClickListener() {
        @Override
        public void mouseClicked(MouseEvent e) {
            jlResult.setText(ScriptExecutor.runScript(etfCode.getText(), etfName.getText()));
        }
    });
}
项目:PackageTemplates    文件:SelectPackageTemplateDialog.java   
private void buildFavouritesUI() {
    resetFavourites();
    createFavouriteRadioButtons();

    if (!listButtons.isEmpty()) {
        cbCompactNames = new JCheckBox(Localizer.get("label.CompactNames"), isCompactNames);
        cbCompactNames.addItemListener(e -> {
            isCompactNames = e.getStateChange() == ItemEvent.SELECTED;
            buildFavouritesUI();
        });

        favouritesPanel.add(new SeparatorComponent(), new CC().growX().spanX().wrap());
        favouritesPanel.add(new JBLabel(Localizer.get("label.Favourites")), new CC().growX().spanX().pushX().wrap().alignX("center"));
        favouritesPanel.add(cbCompactNames, new CC().spanX().wrap().gapY("0", "10pt"));

        for (JBRadioButton radioButton : listButtons) {
            favouritesPanel.add(radioButton, new CC().growX().spanX().wrap());
        }

        listButtons.get(0).doClick();
    } else {
        rbFromPath.doClick();
    }
}
项目:stylint-plugin    文件:PackagesNotificationPanel.java   
private static void doShowError(String title, String description, DialogBuilder builder) {
    builder.setTitle(title);
    final JTextArea textArea = new JTextArea();
    textArea.setEditable(false);
    textArea.setText(description);
    textArea.setWrapStyleWord(false);
    textArea.setLineWrap(true);
    final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(textArea);
    scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    final JPanel panel = new JPanel(new BorderLayout(10, 0));
    panel.setPreferredSize(new Dimension(600, 400));
    panel.add(scrollPane, BorderLayout.CENTER);
    panel.add(new JBLabel("Details:", Messages.getErrorIcon(), SwingConstants.LEFT), BorderLayout.NORTH);
    builder.setCenterPanel(panel);
    builder.setButtonsAlignment(SwingConstants.CENTER);
    builder.addOkAction();
    builder.show();
}
项目:intellij-ce-playground    文件:RestoreReferencesDialog.java   
@Override
protected JComponent createCenterPanel() {
  final JPanel panel = new JPanel(new BorderLayout(UIUtil.DEFAULT_HGAP, UIUtil.DEFAULT_VGAP));
  myList = new JBList(myNamedElements);
  myList.setCellRenderer(new FQNameCellRenderer());
  panel.add(ScrollPaneFactory.createScrollPane(myList), BorderLayout.CENTER);

  panel.add(new JBLabel(myContainsClassesOnly ?
                        CodeInsightBundle.message("dialog.paste.on.import.text") :
                        CodeInsightBundle.message("dialog.paste.on.import.text2"), SMALL, BRIGHTER), BorderLayout.NORTH);

  final JPanel buttonPanel = new JPanel(new VerticalFlowLayout());
  final JButton okButton = new JButton(CommonBundle.getOkButtonText());
  getRootPane().setDefaultButton(okButton);
  buttonPanel.add(okButton);
  final JButton cancelButton = new JButton(CommonBundle.getCancelButtonText());
  buttonPanel.add(cancelButton);

  panel.setPreferredSize(JBUI.size(500, 400));

  return panel;
}
项目:intellij-ce-playground    文件:JavaExtractSuperBaseDialog.java   
@Override
protected JPanel createDestinationRootPanel() {
  final List<VirtualFile> sourceRoots = JavaProjectRootsUtil.getSuitableDestinationSourceRoots(myProject);
  if (sourceRoots.size() <= 1) return super.createDestinationRootPanel();
  final JPanel panel = new JPanel(new BorderLayout());
  panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
  final JBLabel label = new JBLabel(RefactoringBundle.message("target.destination.folder"));
  panel.add(label, BorderLayout.NORTH);
  label.setLabelFor(myDestinationFolderComboBox);
  myDestinationFolderComboBox.setData(myProject, myTargetDirectory, new Pass<String>() {
    @Override
    public void pass(String s) {
    }
  }, ((PackageNameReferenceEditorCombo)myPackageNameField).getChildComponent());
  panel.add(myDestinationFolderComboBox, BorderLayout.CENTER);
  return panel;
}
项目:intellij-ce-playground    文件:GitCompareBranchesLogPanel.java   
private JComponent createNorthPanel() {
  final JComboBox repoSelector = new JComboBox(ArrayUtil.toObjectArray(myCompareInfo.getRepositories(), GitRepository.class));
  repoSelector.setRenderer(new GitRepositoryComboboxListCellRenderer(repoSelector));
  repoSelector.setSelectedItem(myInitialRepo);

  repoSelector.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      GitRepository selectedRepo = (GitRepository)repoSelector.getSelectedItem();
      myHeadToBranchListPanel.setCommits(getHeadToBranchCommits(selectedRepo));
      myBranchToHeadListPanel.setCommits(getBranchToHeadCommits(selectedRepo));
    }
  });

  JPanel repoSelectorPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
  JBLabel label = new JBLabel("Repository: ");
  label.setLabelFor(repoSelectorPanel);
  label.setDisplayedMnemonic(KeyEvent.VK_R);
  repoSelectorPanel.add(label);
  repoSelectorPanel.add(repoSelector);

  if (myCompareInfo.getRepositories().size() < 2) {
    repoSelectorPanel.setVisible(false);
  }
  return repoSelectorPanel;
}
项目:intellij-ce-playground    文件:DiffPanelImpl.java   
static JComponent createComponentForTitle(@Nullable String title,
                                          @Nullable final LineSeparator sep1,
                                          @Nullable final LineSeparator sep2,
                                          boolean left) {
  if (sep1 != null && sep2 != null && !sep1.equals(sep2)) {
    LineSeparator separator = left ? sep1 : sep2;
    JPanel bottomPanel = new JPanel(new BorderLayout());
    JLabel sepLabel = new JLabel(separator.name());
    sepLabel.setForeground(separator.equals(LineSeparator.CRLF) ? JBColor.RED : PlatformColors.BLUE);
    bottomPanel.add(sepLabel, left ? BorderLayout.EAST : BorderLayout.WEST);

    JPanel panel = new JPanel(new BorderLayout());
    panel.add(new JLabel(title == null ? "" : title));
    panel.add(bottomPanel, BorderLayout.SOUTH);
    return panel;
  }
  else {
    return new JBLabel(title == null ? "" : title);
  }
}
项目:intellij-ce-playground    文件:IpnbImagePanel.java   
@Override
protected JComponent createViewPanel() {
  final String png = myCell.getBase64String();

  final JBLabel label = new JBLabel();
  if (!StringUtil.isEmptyOrSpaces(png)) {
    try {
      byte[] btDataFile = new BASE64Decoder().decodeBuffer(png);
      BufferedImage image = ImageIO.read(new ByteArrayInputStream(btDataFile));
      label.setIcon(new ImageIcon(image));
    }
    catch (IOException e) {
      LOG.error("Couldn't parse image. " + e.getMessage());
    }
  }

  label.setBackground(IpnbEditorUtil.getBackground());
  label.setOpaque(true);

  return label;
}
项目:intellij-ce-playground    文件:PyConfigureInterpretersLinkPanel.java   
public PyConfigureInterpretersLinkPanel(final JPanel parentPanel) {
  super(new BorderLayout());
  myConfigureLabel = new JBLabel("<html><a href=\"#\">Configure Interpreters");
  myConfigureLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
  new ClickListener() {
    @Override
    public boolean onClick(@NotNull MouseEvent e, int clickCount) {
      if (clickCount == 1) {
        Settings settings = Settings.KEY.getData(DataManager.getInstance().getDataContext(parentPanel));
        if (settings != null) {
          settings.select(settings.find(PyActiveSdkModuleConfigurable.class.getName()));
          return true;
        }
      }
      return false;
    }
  }.installOn(myConfigureLabel);

  add(myConfigureLabel, BorderLayout.CENTER);
}
项目:intellij-ce-playground    文件:DeviceConfiguratorPanel.java   
@Override
JComponent getComponent() {
  myComboBox.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      applyEditors();
    }
  });

  myComboBox.setRenderer(new ListCellRendererWrapper() {
    @Override
    public void customize(JList list, Object value, int index, boolean selected, boolean hasFocus) {
      if (value instanceof ResourceEnum) {
        setText(((ResourceEnum)value).getShortDisplayValue());
      }
    }
  });

  final JPanel panel = new JPanel(new VerticalFlowLayout());
  final JBLabel label = new JBLabel(getCaption());
  label.setLabelFor(myComboBox);
  myComboBox.setModel(createModel());
  panel.add(label);
  panel.add(myComboBox);
  return panel;
}
项目:intellij-ce-playground    文件:ProGuardConfigFilesPanel.java   
public ProGuardConfigFilesPanel() {
  super(new BorderLayout());
  myModel = new CollectionListModel<String>();
  myList = new JBList(myModel);

  final ToolbarDecorator decorator = ToolbarDecorator.createDecorator(myList).
    setAddAction(new AnActionButtonRunnable() {
    @Override
    public void run(AnActionButton button) {
      final String path = chooseFile();

      if (path != null) {
        myModel.add(path);
      }
    }
  });
  JPanel tablePanel = decorator.setPreferredSize(new Dimension(-1, 120)).createPanel();
  tablePanel.setMinimumSize(new Dimension(-1, 120));
  add(tablePanel, BorderLayout.CENTER);
  final JBLabel label = new JBLabel("Config file paths:");
  label.setBorder(IdeBorderFactory.createEmptyBorder(0, 0, 5, 0));
  add(label, BorderLayout.NORTH);
}
项目:intellij-ce-playground    文件:ExternalDependencyEntityUi.java   
MyComponent() {
  super(new GridBagLayout());
  setBackground(GradleEditorUiConstants.BACKGROUND_COLOR);
  editorVersion.setBackground(GradleEditorUiConstants.BACKGROUND_COLOR);
  editorVersion.setEditable(true);
  GridBag constraints = new GridBag().anchor(GridBagConstraints.WEST);
  add(mySimpleScope, constraints);
  add(myRefScope, constraints);
  add(new JBLabel(" "), constraints); // Separate scope from group
  add(mySimpleGroup, constraints);
  add(myRefGroup, constraints);
  add(new JBLabel(":"), constraints);
  add(mySimpleArtifact, constraints);
  add(myRefArtifact, constraints);
  add(new JBLabel(":"), constraints);
  add(mySimpleVersion, constraints);
  add(myRefVersion, constraints);
  add(editorVersion, constraints);
}
项目:intellij-ce-playground    文件:ConfigureDeviceOptionsStep.java   
private void createUIComponents() {
  myNavigationControlsCombo = new ComboBox(new EnumComboBoxModel<Navigation>(Navigation.class)) {
    @Override
    public ListCellRenderer getRenderer() {
      return new ColoredListCellRenderer() {
        @Override
        protected void customizeCellRenderer(JList list, Object value, int index, boolean selected, boolean hasFocus) {
          append(((Navigation)value).getShortDisplayValue());
        }
      };
    }
  };

  myHelpAndErrorLabel = new JBLabel();
  myHelpAndErrorLabel.setBackground(JBColor.background());
  myHelpAndErrorLabel.setForeground(JBColor.foreground());
  myHelpAndErrorLabel.setOpaque(true);
  myHardwareSkinHelpLabel = new HyperlinkLabel("How do I create a custom hardware skin?");
  myHardwareSkinHelpLabel.setHyperlinkTarget(AvdWizardConstants.CREATE_SKIN_HELP_LINK);
  myCustomSkinPath = new SkinChooser(getProject());
}
项目:intellij-ce-playground    文件:SystemImagePreview.java   
public SystemImagePreview(@Nullable Disposable disposable) {
  myDisposable = disposable;
  myRootPanel.setLayout(new CardLayout());
  myReleaseName.setFont(AvdWizardConstants.TITLE_FONT);
  myApiLevel.setFont(AvdWizardConstants.TITLE_FONT);
  myAndroidVersion.setFont(AvdWizardConstants.TITLE_FONT);
  myVendor.setFont(AvdWizardConstants.TITLE_FONT);
  myDocumentationLink.setOpaque(false);
  myAbi.setFont(AvdWizardConstants.TITLE_FONT);
  myRootPanel.add(myMainPanel, MAIN_CONTENT);
  JPanel nonePanel = new JPanel(new BorderLayout());
  JBLabel noneLabel = new JBLabel(NO_SYSTEM_IMAGE_SELECTED);
  noneLabel.setHorizontalAlignment(JBLabel.CENTER);
  nonePanel.add(noneLabel, BorderLayout.CENTER);
  nonePanel.setBackground(JBColor.WHITE);
  myRootPanel.add(nonePanel, NO_IMAGE_CONTENT);
  myMainPanel.setBackground(JBColor.WHITE);
  mySeparator.setForeground(JBColor.BLACK);

  myDocumentationLink.addHyperlinkListener(myApiLevelListener);
  myDocumentationLink.setHtmlText("See the <a>API level distribution chart</a>");
}
项目:intellij-ce-playground    文件:FrameBufferController.java   
private void setIcons(final long closedAtomId, @NotNull final ImageIcon image, @NotNull final BufferType bufferType) {
  ApplicationManager.getApplication().invokeLater(new Runnable() {
    @Override
    public void run() {
      if (myCurrentFetchAtomId.get() == closedAtomId) {
        int index = bufferType.ordinal();
        myLoadingPanels[index].add(new JBLabel(image));
        if (myLoadingPanels[index].isLoading()) {
          myLoadingPanels[index].stopLoading();
        }

        myBufferScrollPanes[index].repaint();
      }
    }
  });
}
项目:intellij-ce-playground    文件:ChooseGradleHomeDialogFixture.java   
@NotNull
public static ChooseGradleHomeDialogFixture find(@NotNull final Robot robot) {
  DialogFixture found = findDialog(new GenericTypeMatcher<Dialog>(Dialog.class) {
    @Override
    protected boolean isMatching(@NotNull Dialog dialog) {
      if (!dialog.isVisible() || !dialog.isShowing()) {
        return false;
      }
      ComponentFinder finder = robot.finder();
      finder.find(dialog, new ComponentMatcher() {
        @Override
        public boolean matches(Component c) {
          if (c instanceof JBLabel) {
            return "Gradle home:".equals(((JBLabel)c).getText());
          }
          return false;
        }
      });
      finder.findByType(dialog, TextFieldWithBrowseButton.class);
      return true;
    }
  }).withTimeout(LONG_TIMEOUT.duration()).using(robot);
  return new ChooseGradleHomeDialogFixture(robot, found.target());
}
项目:intellij-ce-playground    文件:ConfigureAndroidProjectStepFixture.java   
@NotNull
public ConfigureAndroidProjectStepFixture enterPackageName(@NotNull String text) {
  LabelWithEditLink link = robot().finder().findByType(target(), LabelWithEditLink.class);

  JBLabel editLabel = robot().finder().find(link, new GenericTypeMatcher<JBLabel>(JBLabel.class) {
    @Override
    protected boolean isMatching(@NotNull JBLabel label) {
      return "<html><a>Edit</a></html>".equals(label.getText());
    }
  });
  robot().click(editLabel);

  final JTextField textField = robot().finder().findByType(link, JTextField.class);
  pause(new Condition("'Package name' field is visible") {
    @Override
    public boolean test() {
      return textField.isShowing();
    }
  });
  replaceText(textField, text);

  // click "Done"
  robot().click(editLabel);
  return this;
}
项目:intellij-ce-playground    文件:IdeaDecompiler.java   
@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;
}
项目:intellij-ce-playground    文件:GenericRepositoryEditor.java   
@Nullable
@Override
protected JComponent createCustomPanel() {
  myField2Variable = new IdentityHashMap<JTextField, TemplateVariable>();
  FormBuilder builder = FormBuilder.createFormBuilder();
  for (final TemplateVariable variable : myRepository.getTemplateVariables()) {
    if (variable.isShownOnFirstTab()) {
      JTextField field = variable.isHidden() ? new JPasswordField(variable.getValue()) : new JTextField(variable.getValue());
      myField2Variable.put(field, variable);
      installListener(field);
      JBLabel label = new JBLabel(prettifyVariableName(variable.getName()) + ":", SwingConstants.RIGHT);
      label.setAnchor(getAnchor());
      builder.addLabeledComponent(label, field);
    }
  }
  return builder.getPanel();
}
项目:intellij-ce-playground    文件:TrelloRepositoryEditor.java   
@Nullable
@Override
protected JComponent createCustomPanel() {
  myBoardComboBox = new ComboBox(300);
  myBoardLabel = new JBLabel("Board:", SwingConstants.RIGHT);
  myBoardLabel.setLabelFor(myBoardComboBox);

  myListComboBox = new ComboBox(300);
  myListLabel = new JBLabel("List:", SwingConstants.RIGHT);
  myListLabel.setLabelFor(myListComboBox);

  myAllCardsCheckBox = new JBCheckBox("Include cards not assigned to me");

  return FormBuilder.createFormBuilder()
    .addLabeledComponent(myBoardLabel, myBoardComboBox)
    .addLabeledComponent(myListLabel, myListComboBox)
    .addComponentToRightColumn(myAllCardsCheckBox)
    .getPanel();
}
项目:intellij-ce-playground    文件:MavenEnvironmentForm.java   
private void createUIComponents() {
  mavenHomeField = new TextFieldWithHistory();
  mavenHomeField.setHistorySize(-1);
  final ArrayList<String> foundMavenHomes = new ArrayList<String>();
  foundMavenHomes.add(MavenServerManager.BUNDLED_MAVEN_2);
  foundMavenHomes.add(MavenServerManager.BUNDLED_MAVEN_3);
  final File mavenHomeDirectory = MavenUtil.resolveMavenHomeDirectory(null);
  if (mavenHomeDirectory != null) {
    foundMavenHomes.add(FileUtil.toSystemIndependentName(mavenHomeDirectory.getPath()));
  }
  mavenHomeField.setHistory(foundMavenHomes);
  mavenHomeComponent = LabeledComponent.create(
    new ComponentWithBrowseButton<TextFieldWithHistory>(mavenHomeField, null), "Maven &amp;home directory");

  final JBLabel versionLabel = new JBLabel();
  versionLabel.setOpaque(true);
  versionLabel.setVerticalAlignment(SwingConstants.TOP);
  versionLabel.setVerticalTextPosition(SwingConstants.TOP);
  mavenVersionLabelComponent = LabeledComponent.create(versionLabel, "");
}
项目:intellij-ce-playground    文件:GitRejectedPushUpdateDialog.java   
@Override
protected JComponent createCenterPanel() {
  JBLabel desc = new JBLabel(wrapInHtml(makeDescription()));

  JPanel options = new JPanel(new BorderLayout());
  if (!myRebaseOverMergeProblemDetected) {
    options.add(myAutoUpdateInFuture, BorderLayout.SOUTH);
  }

  if (!GitUtil.justOneGitRepository(myProject)) {
    options.add(myUpdateAllRoots);
  }

  final int GAP = 15;
  JPanel rootPanel = new JPanel(new BorderLayout(GAP, GAP));
  rootPanel.add(desc);
  rootPanel.add(options, BorderLayout.SOUTH);
  JLabel iconLabel = new JLabel(myRebaseOverMergeProblemDetected ? UIUtil.getWarningIcon() : UIUtil.getQuestionIcon());
  rootPanel.add(iconLabel, BorderLayout.WEST);

  return rootPanel;
}
项目:intellij    文件:OpenBlazeWorkspaceFileAction.java   
OpenBlazeWorkspaceFileActionDialog(
    Project project, WorkspacePathResolver workspacePathResolver) {
  super(project, /* canBeParent */ false, IdeModalityType.PROJECT);
  this.project = project;

  component = new JPanel(new GridBagLayout());
  FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFileDescriptor();
  fileTextField =
      WorkspaceFileTextField.create(
          workspacePathResolver, descriptor, PATH_FIELD_WIDTH, myDisposable);

  component.add(new JBLabel("Path:"));
  component.add(fileTextField.getField(), UiUtil.getFillLineConstraints(0));

  UiUtil.fillBottom(component);
  init();
}
项目:jfrog-idea-plugin    文件:XrayToolWindow.java   
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;
}
项目:jfrog-idea-plugin    文件:XrayToolWindow.java   
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);
}
项目:jfrog-idea-plugin    文件:XrayToolWindow.java   
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);
}
项目:jfrog-idea-plugin    文件:XrayToolWindow.java   
private JComponent createComponentsIssueDetailView() {
    issuesTable = new IssuesTable();
    JScrollPane tableScroll = ScrollPaneFactory.createScrollPane(issuesTable, SideBorder.ALL);
    tableScroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    JLabel title = new JBLabel(" Component Issues Details");
    title.setFont(title.getFont().deriveFont(TITLE_FONT_SIZE));
    return new TitledPane(JSplitPane.VERTICAL_SPLIT, TITLE_LABEL_SIZE, title, tableScroll);
}
项目:jfrog-idea-plugin    文件:DetailsViewFactory.java   
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);
}
项目:jfrog-idea-plugin    文件:ComponentUtils.java   
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;
}
项目:educational-plugin    文件:EduCoursesPanel.java   
private static JLabel createTagLabel(String tagText) {
  Border emptyBorder = JBUI.Borders.empty(3, 5);
  JBLabel label = new JBLabel(tagText);
  label.setOpaque(true);
  label.setBorder(emptyBorder);
  label.setBackground(new JBColor(COLOR, COLOR));
  return label;
}