Search in sources :

Example 71 with JBLabel

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

the class RedmineRepositoryEditor method createCustomPanel.

@Nullable
@Override
protected JComponent createCustomPanel() {
    myProjectLabel = new JBLabel("Project:", SwingConstants.RIGHT);
    myProjectCombo = new ComboBox(300);
    //myProjectCombo.setRenderer(new TaskUiUtil.SimpleComboBoxRenderer("Set URL and password/token first"));
    myProjectCombo.setRenderer(new ListCellRendererWrapper<RedmineProjectItem>() {

        @Override
        public void customize(JList list, RedmineProjectItem value, int index, boolean selected, boolean hasFocus) {
            if (value == null) {
                setText("Set URL and password/token first");
            } else {
                if (myProjectCombo.isPopupVisible()) {
                    //if (value.myLevel == 0 && value.myProject != RedmineRepository.UNSPECIFIED_PROJECT) {
                    //setFont(UIUtil.getListFont().deriveFont(Font.BOLD));
                    //}
                    setText(StringUtil.repeat("   ", value.myLevel) + value.myProject.getName());
                } else {
                    // Do not indent selected project
                    setText(value.myProject.getName());
                }
            }
        }
    });
    myAPIKeyLabel = new JBLabel("API Token:", SwingConstants.RIGHT);
    myAPIKey = new JPasswordField();
    myAllAssigneesCheckBox = new JBCheckBox("Include issues not assigned to me");
    return FormBuilder.createFormBuilder().addLabeledComponent(myAPIKeyLabel, myAPIKey).addLabeledComponent(myProjectLabel, myProjectCombo).addComponentToRightColumn(myAllAssigneesCheckBox).getPanel();
}
Also used : JBLabel(com.intellij.ui.components.JBLabel) ComboBox(com.intellij.openapi.ui.ComboBox) JBCheckBox(com.intellij.ui.components.JBCheckBox) Nullable(org.jetbrains.annotations.Nullable)

Example 72 with JBLabel

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

the class TracRepositoryEditor method createCustomPanel.

@Nullable
@Override
protected JComponent createCustomPanel() {
    mySearchLabel = new JBLabel("Search:", SwingConstants.RIGHT);
    myDefaultSearch = new JTextField();
    installListener(myDefaultSearch);
    return FormBuilder.createFormBuilder().addLabeledComponent(mySearchLabel, myDefaultSearch).getPanel();
}
Also used : JBLabel(com.intellij.ui.components.JBLabel) Nullable(org.jetbrains.annotations.Nullable)

Example 73 with JBLabel

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

the class GenericRepositoryEditor method createCustomPanel.

@Nullable
@Override
protected JComponent createCustomPanel() {
    myField2Variable = new IdentityHashMap<>();
    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();
}
Also used : FormBuilder(com.intellij.util.ui.FormBuilder) JBLabel(com.intellij.ui.components.JBLabel) Nullable(org.jetbrains.annotations.Nullable)

Example 74 with JBLabel

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

the class GenericRepositoryEditor method setAnchor.

@Override
public void setAnchor(@Nullable JComponent anchor) {
    super.setAnchor(anchor);
    List<JBLabel> labels = UIUtil.findComponentsOfType(myCustomPanel, JBLabel.class);
    for (JBLabel label : labels) {
        label.setAnchor(anchor);
    }
}
Also used : JBLabel(com.intellij.ui.components.JBLabel)

Example 75 with JBLabel

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

the class LighthouseRepositoryEditor method createCustomPanel.

@Nullable
@Override
protected JComponent createCustomPanel() {
    myProjectIDLabel = new JBLabel("Project ID:", SwingConstants.RIGHT);
    myProjectId = new JTextField();
    installListener(myProjectId);
    myAPIKeyLabel = new JBLabel("API Token:", SwingConstants.RIGHT);
    myAPIKey = new JTextField();
    installListener(myAPIKey);
    return FormBuilder.createFormBuilder().addLabeledComponent(myProjectIDLabel, myProjectId).addLabeledComponent(myAPIKeyLabel, myAPIKey).getPanel();
}
Also used : JBLabel(com.intellij.ui.components.JBLabel) Nullable(org.jetbrains.annotations.Nullable)

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