Search in sources :

Example 21 with JBLabel

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

the class FormBuilder method addTooltip.

public FormBuilder addTooltip(final String text) {
    final JBLabel label = new JBLabel(text, UIUtil.ComponentStyle.SMALL, UIUtil.FontColor.BRIGHTER);
    label.setBorder(new EmptyBorder(0, 10, 0, 0));
    return addComponentToRightColumn(label, 1);
}
Also used : JBLabel(com.intellij.ui.components.JBLabel) EmptyBorder(javax.swing.border.EmptyBorder)

Example 22 with JBLabel

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

the class AbstractPopup method setWarning.

public void setWarning(@NotNull String text) {
    JBLabel label = new JBLabel(text, UIUtil.getBalloonWarningIcon(), SwingConstants.CENTER);
    label.setOpaque(true);
    Color color = HintUtil.getInformationColor();
    label.setBackground(color);
    label.setBorder(BorderFactory.createLineBorder(color, 3));
    myHeaderPanel.add(label, BorderLayout.SOUTH);
}
Also used : JBLabel(com.intellij.ui.components.JBLabel)

Example 23 with JBLabel

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

the class XLightBreakpointPropertiesPanel method loadProperties.

public void loadProperties() {
    mySubPanels.forEach(XBreakpointPropertiesSubPanel::loadProperties);
    if (myConditionComboBox != null) {
        XExpression condition = myBreakpoint.getConditionExpressionInt();
        myConditionComboBox.setExpression(condition);
        boolean hideCheckbox = !myShowAllOptions && condition == null;
        myConditionEnabledCheckbox.setSelected(hideCheckbox || (myBreakpoint.isConditionEnabled() && condition != null));
        myConditionEnabledPanel.removeAll();
        if (hideCheckbox) {
            JBLabel label = new JBLabel(XDebuggerBundle.message("xbreakpoints.condition.checkbox"));
            label.setBorder(JBUI.Borders.empty(0, 4));
            label.setLabelFor(myConditionComboBox.getComboBox());
            myConditionEnabledPanel.add(label);
        } else {
            myConditionEnabledPanel.add(myConditionEnabledCheckbox);
        }
        onCheckboxChanged();
    }
    for (XBreakpointCustomPropertiesPanel customPanel : myCustomPanels) {
        customPanel.loadFrom(myBreakpoint);
    }
    myEnabledCheckbox.setSelected(myBreakpoint.isEnabled());
    myBreakpointNameLabel.setText(XBreakpointUtil.getShortText(myBreakpoint));
}
Also used : JBLabel(com.intellij.ui.components.JBLabel) XBreakpointCustomPropertiesPanel(com.intellij.xdebugger.breakpoints.ui.XBreakpointCustomPropertiesPanel) XExpression(com.intellij.xdebugger.XExpression)

Example 24 with JBLabel

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

the class DetailsPanel method rebuildCommitPanels.

private void rebuildCommitPanels(int[] selection) {
    myEmptyText.setText("");
    int selectionLength = selection.length;
    // for each commit besides the first there are two components: Separator and CommitPanel
    int existingCount = (myMainContentPanel.getComponentCount() + 1) / 2;
    int requiredCount = Math.min(selectionLength, MAX_ROWS);
    for (int i = existingCount; i < requiredCount; i++) {
        if (i > 0) {
            myMainContentPanel.add(new SeparatorComponent(0, OnePixelDivider.BACKGROUND, null));
        }
        myMainContentPanel.add(new CommitPanel(myLogData, myColorManager));
    }
    // clear superfluous items
    while (myMainContentPanel.getComponentCount() > 2 * requiredCount - 1) {
        myMainContentPanel.remove(myMainContentPanel.getComponentCount() - 1);
    }
    if (selectionLength > MAX_ROWS) {
        myMainContentPanel.add(new SeparatorComponent(0, OnePixelDivider.BACKGROUND, null));
        JBLabel label = new JBLabel("(showing " + MAX_ROWS + " of " + selectionLength + " selected commits)");
        label.setFont(VcsHistoryUtil.getCommitDetailsFont());
        label.setBorder(CommitPanel.getDetailsBorder());
        myMainContentPanel.add(label);
    }
    mySelection = Ints.asList(Arrays.copyOf(selection, requiredCount));
    repaint();
}
Also used : SeparatorComponent(com.intellij.ui.SeparatorComponent) JBLabel(com.intellij.ui.components.JBLabel)

Example 25 with JBLabel

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

the class ReferencesPanel method createLabel.

@NotNull
protected JBLabel createLabel(@NotNull String text, @Nullable Icon icon) {
    JBLabel label = new JBLabel(text, icon, SwingConstants.LEFT);
    label.setFont(getLabelsFont());
    label.setIconTextGap(0);
    label.setHorizontalAlignment(SwingConstants.LEFT);
    return label;
}
Also used : JBLabel(com.intellij.ui.components.JBLabel) NotNull(org.jetbrains.annotations.NotNull)

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