use of com.intellij.ui.components.JBLabel in project intellij-community by JetBrains.
the class GitBranchIsNotFullyMergedDialog method createNorthPanel.
@Override
protected JComponent createNorthPanel() {
JBLabel descriptionLabel = new JBLabel(makeDescription(myInitialRepository));
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) {
GitRepository selectedRepo = (GitRepository) repositorySelector.getSelectedItem();
descriptionLabel.setText(makeDescription(selectedRepo));
myCommitListWithDiffPanel.setCommits(myCommits.get(selectedRepo));
}
});
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;
}
use of com.intellij.ui.components.JBLabel in project intellij-community by JetBrains.
the class GitSmartOperationDialog method createNorthPanel.
@Override
protected JComponent createNorthPanel() {
JBLabel description = new JBLabel("<html>Your local changes to the following files would be overwritten by " + myOperationTitle + ".<br/>" + ApplicationNamesInfo.getInstance().getFullProductName() + " can stash the changes, " + myOperationTitle + " and unstash them after that.</html>");
description.setBorder(IdeBorderFactory.createEmptyBorder(0, 0, 10, 0));
return description;
}
use of com.intellij.ui.components.JBLabel in project intellij-community by JetBrains.
the class GitCompareBranchesLogPanel method createNorthPanel.
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;
}
use of com.intellij.ui.components.JBLabel in project intellij-community by JetBrains.
the class GithubRepositoryEditor method createCustomPanel.
@Nullable
@Override
protected JComponent createCustomPanel() {
myHostLabel = new JBLabel("Host:", SwingConstants.RIGHT);
JPanel myHostPanel = new JPanel(new BorderLayout(5, 0));
myHostPanel.add(myURLText, BorderLayout.CENTER);
myHostPanel.add(myShareUrlCheckBox, BorderLayout.EAST);
myRepositoryLabel = new JBLabel("Repository:", SwingConstants.RIGHT);
myRepoAuthor = new MyTextField("Repository Owner");
myRepoName = new MyTextField("Repository Name");
myRepoAuthor.setPreferredSize("SomelongNickname");
myRepoName.setPreferredSize("SomelongReponame-with-suffixes");
JPanel myRepoPanel = new JPanel(new GridBagLayout());
GridBag bag = new GridBag().setDefaultWeightX(1).setDefaultFill(GridBagConstraints.HORIZONTAL);
myRepoPanel.add(myRepoAuthor, bag.nextLine().next());
myRepoPanel.add(new JLabel("/"), bag.next().fillCellNone().insets(0, 5, 0, 5).weightx(0));
myRepoPanel.add(myRepoName, bag.next());
myTokenLabel = new JBLabel("API Token:", SwingConstants.RIGHT);
myToken = new MyTextField("OAuth2 token");
myTokenButton = new JButton("Create API token");
myTokenButton.addActionListener(e -> {
generateToken();
doApply();
});
JPanel myTokenPanel = new JPanel();
myTokenPanel.setLayout(new BorderLayout(5, 5));
myTokenPanel.add(myToken, BorderLayout.CENTER);
myTokenPanel.add(myTokenButton, BorderLayout.EAST);
myShowNotAssignedIssues = new JBCheckBox("Include issues not assigned to me");
installListener(myRepoAuthor);
installListener(myRepoName);
installListener(myToken);
installListener(myShowNotAssignedIssues);
return FormBuilder.createFormBuilder().setAlignLabelOnRight(true).addLabeledComponent(myHostLabel, myHostPanel).addLabeledComponent(myRepositoryLabel, myRepoPanel).addLabeledComponent(myTokenLabel, myTokenPanel).addComponentToRightColumn(myShowNotAssignedIssues).getPanel();
}
use of com.intellij.ui.components.JBLabel in project intellij-community by JetBrains.
the class IdeaGradleProjectSettingsControlBuilder method addGradleHomeComponents.
@Override
public IdeaGradleProjectSettingsControlBuilder addGradleHomeComponents(PaintAwarePanel content, int indentLevel) {
if (dropGradleHomePathComponents)
return this;
myGradleHomeLabel = new JBLabel(GradleBundle.message("gradle.settings.text.home.path"));
myGradleHomePathField = new TextFieldWithBrowseButton();
myGradleHomePathField.addBrowseFolderListener("", GradleBundle.message("gradle.settings.text.home.path"), null, GradleUtil.getGradleHomeFileChooserDescriptor(), TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
myGradleHomePathField.getTextField().getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
myGradleHomePathField.getTextField().setForeground(LocationSettingType.EXPLICIT_CORRECT.getColor());
}
@Override
public void removeUpdate(DocumentEvent e) {
myGradleHomePathField.getTextField().setForeground(LocationSettingType.EXPLICIT_CORRECT.getColor());
}
@Override
public void changedUpdate(DocumentEvent e) {
}
});
content.add(myGradleHomeLabel, ExternalSystemUiUtil.getLabelConstraints(indentLevel));
content.add(myGradleHomePathField, ExternalSystemUiUtil.getFillLineConstraints(0));
return this;
}
Aggregations