當前位置: 首頁>>代碼示例>>Java>>正文


Java JBLabel.setLabelFor方法代碼示例

本文整理匯總了Java中com.intellij.ui.components.JBLabel.setLabelFor方法的典型用法代碼示例。如果您正苦於以下問題:Java JBLabel.setLabelFor方法的具體用法?Java JBLabel.setLabelFor怎麽用?Java JBLabel.setLabelFor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.ui.components.JBLabel的用法示例。


在下文中一共展示了JBLabel.setLabelFor方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createDestinationRootPanel

import com.intellij.ui.components.JBLabel; //導入方法依賴的package包/類
@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;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:JavaExtractSuperBaseDialog.java

示例2: getComponent

import com.intellij.ui.components.JBLabel; //導入方法依賴的package包/類
@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;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:27,代碼來源:DeviceConfiguratorPanel.java

示例3: createCustomPanel

import com.intellij.ui.components.JBLabel; //導入方法依賴的package包/類
@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();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:20,代碼來源:TrelloRepositoryEditor.java

示例4: createNorthPanel

import com.intellij.ui.components.JBLabel; //導入方法依賴的package包/類
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;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:27,代碼來源:GitCompareBranchesLogPanel.java

示例5: createCustomPanel

import com.intellij.ui.components.JBLabel; //導入方法依賴的package包/類
@Nullable
@Override
protected JComponent createCustomPanel() {
  myProjectLabel = new JBLabel("Project:", SwingConstants.RIGHT);
  myProjectComboBox = new ComboBox(300);
  myProjectComboBox.setRenderer(new TaskUiUtil.SimpleComboBoxRenderer("Set server URL and token first"));
  myProjectLabel.setLabelFor(myProjectComboBox);
  return new FormBuilder().addLabeledComponent(myProjectLabel, myProjectComboBox).getPanel();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:10,代碼來源:GitlabRepositoryEditor.java

示例6: createNorthPanel

import com.intellij.ui.components.JBLabel; //導入方法依賴的package包/類
@Override
protected JComponent createNorthPanel() {
  JBLabel descriptionLabel = new JBLabel(XmlStringUtil.wrapInHtml(makeDescription()));

    final JComboBox repositorySelector = new JComboBox(ArrayUtil.toObjectArray(myRepositories, GitRepository.class));
  repositorySelector.setRenderer(new GitRepositoryComboboxListCellRenderer(repositorySelector));
  repositorySelector.setSelectedItem(myInitialRepository);
  repositorySelector.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      List<GitCommit> commits = myCommits.get((GitRepository)repositorySelector.getSelectedItem());
      myCommitListWithDiffPanel.setCommits(new ArrayList<GitCommit>(commits));
    }
  });

  JPanel repoSelectorPanel = new JPanel(new BorderLayout());
  JBLabel label = new JBLabel("Repository: ");
  label.setLabelFor(repoSelectorPanel);
  repoSelectorPanel.add(label, BorderLayout.WEST);
  repoSelectorPanel.add(repositorySelector);

  if (myRepositories.size() < 2) {
    repoSelectorPanel.setVisible(false);
  }

  JPanel northPanel = new JPanel(new BorderLayout());
  northPanel.add(descriptionLabel);
  northPanel.add(repoSelectorPanel, BorderLayout.SOUTH);
  return northPanel;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:31,代碼來源:GitBranchIsNotFullyMergedDialog.java

示例7: createCenterPanel

import com.intellij.ui.components.JBLabel; //導入方法依賴的package包/類
@Override
@NotNull
protected JComponent createCenterPanel() {

  JPanel contentPanel = new JPanel(new GridBagLayout());
  GridBag g = new GridBag()
    .setDefaultInsets(new Insets(0, 0, DEFAULT_VGAP, DEFAULT_HGAP))
    .setDefaultAnchor(GridBagConstraints.LINE_START)
    .setDefaultFill(GridBagConstraints.HORIZONTAL);

  JLabel icon = new JLabel(UIUtil.getQuestionIcon(), SwingConstants.LEFT);
  myBookmarkName = new JBTextField(13);
  myBookmarkName.getDocument().addDocumentListener(new DocumentAdapter() {
    @Override
    public void textChanged(DocumentEvent e) {
      validateFields();
    }
  });

  JBLabel bookmarkLabel = new JBLabel("Bookmark name:");
  bookmarkLabel.setLabelFor(myBookmarkName);

  myActiveCheckbox = new JBCheckBox("Inactive", false);

  contentPanel.add(icon, g.nextLine().next().coverColumn(3).pady(DEFAULT_HGAP));
  contentPanel.add(bookmarkLabel, g.next().fillCellNone().insets(new Insets(0, 6, DEFAULT_VGAP, DEFAULT_HGAP)));
  contentPanel.add(myBookmarkName, g.next().coverLine().setDefaultWeightX(1));
  contentPanel.add(myActiveCheckbox, g.nextLine().next().next().coverLine(2));
  return contentPanel;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:31,代碼來源:HgBookmarkDialog.java

示例8: createCenterPanel

import com.intellij.ui.components.JBLabel; //導入方法依賴的package包/類
@Override
protected JComponent createCenterPanel() {

  JLabel icon = new JLabel(UIUtil.getWarningIcon(), SwingConstants.LEFT);
  JLabel description = new JLabel(getMessageText());

  myNameTextField = new JTextField(20);
  JBLabel nameLabel = new JBLabel("Name: ");
  nameLabel.setDisplayedMnemonic('n');
  nameLabel.setLabelFor(myNameTextField);

  myEmailTextField = new JTextField(20);
  JBLabel emailLabel = new JBLabel("E-mail: ");
  emailLabel.setDisplayedMnemonic('e');
  emailLabel.setLabelFor(myEmailTextField);

  if (myProposedValues != null) {
    myNameTextField.setText(myProposedValues.getFirst());
    myEmailTextField.setText(myProposedValues.getSecond());
  }
  else {
    myNameTextField.setText(SystemProperties.getUserName());
  }

  myGlobalCheckbox = new JBCheckBox("Set properties globally", true);
  myGlobalCheckbox.setMnemonic('g');

  JPanel rootPanel = new JPanel(new GridBagLayout());
  GridBag g = new GridBag()
    .setDefaultInsets(new Insets(0, 0, DEFAULT_VGAP, DEFAULT_HGAP))
    .setDefaultAnchor(GridBagConstraints.LINE_START)
    .setDefaultFill(GridBagConstraints.HORIZONTAL);

  rootPanel.add(description, g.nextLine().next().coverLine(3).pady(DEFAULT_HGAP));
  rootPanel.add(icon, g.nextLine().next().coverColumn(3));
  rootPanel.add(nameLabel, g.next().fillCellNone().insets(new Insets(0, 6, DEFAULT_VGAP, DEFAULT_HGAP)));
  rootPanel.add(myNameTextField, g.next());
  rootPanel.add(emailLabel, g.nextLine().next().next().fillCellNone().insets(new Insets(0, 6, DEFAULT_VGAP, DEFAULT_HGAP)));
  rootPanel.add(myEmailTextField, g.next());
  rootPanel.add(myGlobalCheckbox, g.nextLine().next().next().coverLine(2));

  return rootPanel;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:44,代碼來源:GitUserNameNotDefinedDialog.java


注:本文中的com.intellij.ui.components.JBLabel.setLabelFor方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。