Search in sources :

Example 66 with JBLabel

use of com.intellij.ui.components.JBLabel in project intellij-community by JetBrains.

the class GitRejectedPushUpdateDialog method createCenterPanel.

@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;
}
Also used : JBLabel(com.intellij.ui.components.JBLabel)

Example 67 with JBLabel

use of com.intellij.ui.components.JBLabel in project intellij-community by JetBrains.

the class GitCompareBranchesLogPanel method layoutCommitListPanel.

private JPanel layoutCommitListPanel(@NotNull String currentBranch, boolean forward) {
    String desc = makeDescription(currentBranch, forward);
    JPanel bth = new JPanel(new BorderLayout());
    JBLabel descriptionLabel = new JBLabel(desc, UIUtil.ComponentStyle.SMALL);
    descriptionLabel.setBorder(JBUI.Borders.emptyBottom(5));
    bth.add(descriptionLabel, BorderLayout.NORTH);
    bth.add(forward ? myHeadToBranchListPanel : myBranchToHeadListPanel);
    return bth;
}
Also used : JBLabel(com.intellij.ui.components.JBLabel)

Example 68 with JBLabel

use of com.intellij.ui.components.JBLabel in project intellij-community by JetBrains.

the class MavenEnvironmentForm method createUIComponents.

private void createUIComponents() {
    mavenHomeField = new TextFieldWithHistory();
    mavenHomeField.setHistorySize(-1);
    final ArrayList<String> foundMavenHomes = new ArrayList<>();
    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<>(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, "");
}
Also used : JBLabel(com.intellij.ui.components.JBLabel) TextFieldWithHistory(com.intellij.ui.TextFieldWithHistory) ComponentWithBrowseButton(com.intellij.openapi.ui.ComponentWithBrowseButton) ArrayList(java.util.ArrayList) File(java.io.File)

Example 69 with JBLabel

use of com.intellij.ui.components.JBLabel in project intellij-community by JetBrains.

the class GitCrlfDialog method createCenterPanel.

@Override
protected JComponent createCenterPanel() {
    JLabel description = new JBLabel("<html>You are about to commit CRLF line separators to the Git repository.<br/>" + "It is recommended to set core.autocrlf Git attribute to <code>" + RECOMMENDED_VALUE + "</code> to avoid line separator issues.</html>");
    JLabel additionalDescription = new JBLabel("<html>Fix and Commit: <code>git config --global core.autocrlf " + RECOMMENDED_VALUE + "</code> will be called,<br/>" + "Commit as Is: the config value won't be set.</html>", UIUtil.ComponentStyle.SMALL);
    JLabel readMore = LinkLabel.create("Read more", () -> BrowserUtil.browse("https://help.github.com/articles/dealing-with-line-endings"));
    JLabel icon = new JLabel(UIUtil.getWarningIcon(), SwingConstants.LEFT);
    myDontWarn = new JBCheckBox("Don't warn again");
    myDontWarn.setMnemonic('w');
    JPanel rootPanel = new JPanel(new GridBagLayout());
    GridBag g = new GridBag().setDefaultInsets(new Insets(0, 6, DEFAULT_VGAP, DEFAULT_HGAP)).setDefaultAnchor(GridBagConstraints.LINE_START).setDefaultFill(GridBagConstraints.HORIZONTAL);
    rootPanel.add(icon, g.nextLine().next().coverColumn(4));
    rootPanel.add(description, g.next());
    rootPanel.add(readMore, g.nextLine().next().next());
    rootPanel.add(additionalDescription, g.nextLine().next().next().pady(DEFAULT_HGAP));
    rootPanel.add(myDontWarn, g.nextLine().next().next().insets(0, 0, 0, 0));
    return rootPanel;
}
Also used : JBLabel(com.intellij.ui.components.JBLabel) GridBag(com.intellij.util.ui.GridBag) JBCheckBox(com.intellij.ui.components.JBCheckBox)

Example 70 with JBLabel

use of com.intellij.ui.components.JBLabel in project intellij-community by JetBrains.

the class IdeaGradleProjectSettingsControlBuilder method addGradleChooserComponents.

@Override
public IdeaGradleProjectSettingsControlBuilder addGradleChooserComponents(PaintAwarePanel content, int indentLevel) {
    ButtonGroup buttonGroup = new ButtonGroup();
    if (!dropUseWrapperButton) {
        myUseWrapperButton = new JBRadioButton(GradleBundle.message("gradle.settings.text.use.default_wrapper.configured"));
        myUseWrapperButton.addActionListener(myActionListener);
        buttonGroup.add(myUseWrapperButton);
        content.add(myUseWrapperButton, ExternalSystemUiUtil.getFillLineConstraints(indentLevel));
    }
    if (!dropCustomizableWrapperButton) {
        myUseWrapperWithVerificationButton = new JBRadioButton(GradleBundle.message("gradle.settings.text.use.customizable_wrapper"));
        myUseWrapperWithVerificationButton.addActionListener(myActionListener);
        myUseWrapperVerificationLabel = new JBLabel(GradleBundle.message("gradle.settings.text.wrapper.customization.compatibility"));
        myUseWrapperVerificationLabel.setFont(UIUtil.getLabelFont(UIUtil.FontSize.MINI));
        myUseWrapperVerificationLabel.setIcon(UIUtil.getBalloonInformationIcon());
        buttonGroup.add(myUseWrapperWithVerificationButton);
        content.add(myUseWrapperWithVerificationButton, ExternalSystemUiUtil.getLabelConstraints(indentLevel));
        content.add(myUseWrapperVerificationLabel, ExternalSystemUiUtil.getFillLineConstraints(indentLevel));
    }
    if (!dropUseLocalDistributionButton) {
        myUseLocalDistributionButton = new JBRadioButton(GradleBundle.message("gradle.settings.text.use.local.distribution"));
        myUseLocalDistributionButton.addActionListener(myActionListener);
        buttonGroup.add(myUseLocalDistributionButton);
        content.add(myUseLocalDistributionButton, ExternalSystemUiUtil.getFillLineConstraints(indentLevel));
    }
    if (!dropUseBundledDistributionButton) {
        myUseBundledDistributionButton = new JBRadioButton(GradleBundle.message("gradle.settings.text.use.bundled.distribution", GradleVersion.current().getVersion()));
        myUseBundledDistributionButton.addActionListener(myActionListener);
        buttonGroup.add(myUseBundledDistributionButton);
        //content.add(Box.createGlue(), ExternalSystemUiUtil.getFillLineConstraints(indentLevel));
        content.add(myUseBundledDistributionButton, ExternalSystemUiUtil.getFillLineConstraints(indentLevel));
    }
    return this;
}
Also used : JBLabel(com.intellij.ui.components.JBLabel) JBRadioButton(com.intellij.ui.components.JBRadioButton)

Aggregations

JBLabel (com.intellij.ui.components.JBLabel)98 Nullable (org.jetbrains.annotations.Nullable)23 NotNull (org.jetbrains.annotations.NotNull)11 JBCheckBox (com.intellij.ui.components.JBCheckBox)10 FileChooserDescriptor (com.intellij.openapi.fileChooser.FileChooserDescriptor)9 VirtualFile (com.intellij.openapi.vfs.VirtualFile)8 ComboBox (com.intellij.openapi.ui.ComboBox)7 VerticalFlowLayout (com.intellij.openapi.ui.VerticalFlowLayout)7 GridBag (com.intellij.util.ui.GridBag)7 List (java.util.List)7 JBList (com.intellij.ui.components.JBList)6 JBTable (com.intellij.ui.table.JBTable)6 JBTextField (com.intellij.ui.components.JBTextField)5 DocumentEvent (javax.swing.event.DocumentEvent)5 DumbAwareAction (com.intellij.openapi.project.DumbAwareAction)4 Project (com.intellij.openapi.project.Project)4 TextFieldWithBrowseButton (com.intellij.openapi.ui.TextFieldWithBrowseButton)4 StringUtil (com.intellij.openapi.util.text.StringUtil)4 java.awt (java.awt)4 ArrayList (java.util.ArrayList)4