Search in sources :

Example 6 with JBLabel

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

the class TrelloRepositoryEditor method createCustomPanel.

@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();
}
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 7 with JBLabel

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

the class YouTrackRepositoryEditor method createCustomPanel.

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

Example 8 with JBLabel

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

the class CreateCondaEnvDialog method layoutPanel.

protected void layoutPanel(final List<Sdk> allSdks) {
    final GridBagConstraints c = new GridBagConstraints();
    c.fill = GridBagConstraints.HORIZONTAL;
    c.insets = new Insets(2, 2, 2, 2);
    c.gridx = 0;
    c.gridy = 0;
    c.weightx = 0.0;
    myMainPanel.add(new JBLabel(PyBundle.message("sdk.create.venv.dialog.label.name")), c);
    c.gridx = 1;
    c.gridy = 0;
    c.gridwidth = 2;
    c.weightx = 1.0;
    myMainPanel.add(myName, c);
    c.gridx = 0;
    c.gridy = 1;
    c.gridwidth = 1;
    c.weightx = 0.0;
    myMainPanel.add(new JBLabel(PyBundle.message("sdk.create.venv.dialog.label.location")), c);
    c.gridx = 1;
    c.gridy = 1;
    c.gridwidth = 2;
    c.weightx = 1.0;
    myMainPanel.add(myDestination, c);
    c.gridx = 0;
    c.gridy = 2;
    c.gridwidth = 1;
    c.weightx = 0.0;
    myMainPanel.add(new JBLabel(PyBundle.message("sdk.create.venv.conda.dialog.label.python.version")), c);
    c.gridx = 1;
    c.gridy = 2;
    mySdkCombo = new ComboBox();
    c.insets = new Insets(2, 2, 2, 2);
    c.weightx = 1.0;
    myMainPanel.add(mySdkCombo, c);
    c.gridx = 0;
    c.gridy = 3;
    c.gridwidth = 3;
    myMainPanel.add(myMakeAvailableToAllProjectsCheckbox, c);
}
Also used : JBLabel(com.intellij.ui.components.JBLabel) ComboBox(com.intellij.openapi.ui.ComboBox)

Example 9 with JBLabel

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

the class CreateVirtualEnvDialog method layoutPanel.

protected void layoutPanel(final List<Sdk> allSdks) {
    final GridBagConstraints c = new GridBagConstraints();
    c.fill = GridBagConstraints.HORIZONTAL;
    c.insets = new Insets(2, 2, 2, 2);
    c.gridx = 0;
    c.gridy = 0;
    c.weightx = 0.0;
    myMainPanel.add(new JBLabel(PyBundle.message("sdk.create.venv.dialog.label.name")), c);
    c.gridx = 1;
    c.gridy = 0;
    c.gridwidth = 2;
    c.weightx = 1.0;
    myMainPanel.add(myName, c);
    c.gridx = 0;
    c.gridy = 1;
    c.gridwidth = 1;
    c.weightx = 0.0;
    myMainPanel.add(new JBLabel(PyBundle.message("sdk.create.venv.dialog.label.location")), c);
    c.gridx = 1;
    c.gridy = 1;
    c.gridwidth = 2;
    c.weightx = 1.0;
    myMainPanel.add(myDestination, c);
    c.gridx = 0;
    c.gridy = 2;
    c.gridwidth = 1;
    c.weightx = 0.0;
    myMainPanel.add(new JBLabel(PyBundle.message("sdk.create.venv.dialog.label.base.interpreter")), c);
    c.gridx = 1;
    c.gridy = 2;
    mySdkCombo = new ComboBox();
    c.insets = new Insets(2, 2, 2, 2);
    c.weightx = 1.0;
    myMainPanel.add(mySdkCombo, c);
    c.gridx = 2;
    c.gridy = 2;
    c.insets = new Insets(0, 0, 2, 2);
    c.weightx = 0.0;
    FixedSizeButton button = new FixedSizeButton();
    button.setPreferredSize(myDestination.getButton().getPreferredSize());
    myMainPanel.add(button, c);
    c.gridx = 0;
    c.gridy = 3;
    c.gridwidth = 3;
    c.insets = new Insets(2, 2, 2, 2);
    mySitePackagesCheckBox = new JBCheckBox(PyBundle.message("sdk.create.venv.dialog.label.inherit.global.site.packages"));
    myMainPanel.add(mySitePackagesCheckBox, c);
    c.gridx = 0;
    c.gridy = 4;
    myMainPanel.add(myMakeAvailableToAllProjectsCheckbox, c);
    button.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            final PythonSdkType sdkType = PythonSdkType.getInstance();
            final FileChooserDescriptor descriptor = sdkType.getHomeChooserDescriptor();
            String suggestedPath = sdkType.suggestHomePath();
            VirtualFile suggestedDir = suggestedPath == null ? null : LocalFileSystem.getInstance().findFileByPath(FileUtil.toSystemIndependentName(suggestedPath));
            final NullableConsumer<Sdk> consumer = sdk -> {
                if (sdk == null)
                    return;
                if (!allSdks.contains(sdk)) {
                    allSdks.add(sdk);
                }
                updateSdkList(allSdks, sdk);
            };
            FileChooser.chooseFiles(descriptor, myProject, suggestedDir, new FileChooser.FileChooserConsumer() {

                @Override
                public void consume(List<VirtualFile> selectedFiles) {
                    String path = selectedFiles.get(0).getPath();
                    if (sdkType.isValidSdkHome(path)) {
                        path = FileUtil.toSystemDependentName(path);
                        Sdk newSdk = null;
                        for (Sdk sdk : allSdks) {
                            if (path.equals(sdk.getHomePath())) {
                                newSdk = sdk;
                            }
                        }
                        if (newSdk == null) {
                            newSdk = new PyDetectedSdk(path);
                        }
                        consumer.consume(newSdk);
                    }
                }

                @Override
                public void cancelled() {
                }
            });
        }
    });
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) ComboBox(com.intellij.openapi.ui.ComboBox) ActionEvent(java.awt.event.ActionEvent) FileChooserDescriptor(com.intellij.openapi.fileChooser.FileChooserDescriptor) JBCheckBox(com.intellij.ui.components.JBCheckBox) ActionListener(java.awt.event.ActionListener) JBLabel(com.intellij.ui.components.JBLabel) ArrayList(java.util.ArrayList) List(java.util.List) Sdk(com.intellij.openapi.projectRoots.Sdk) NullableConsumer(com.intellij.util.NullableConsumer) FixedSizeButton(com.intellij.openapi.ui.FixedSizeButton)

Example 10 with JBLabel

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

the class IpnbHeadingPanel method createViewPanel.

@Override
protected JBLabel createViewPanel() {
    final JBLabel label = new JBLabel(renderCellText());
    label.setBackground(IpnbEditorUtil.getBackground());
    label.setOpaque(true);
    return label;
}
Also used : JBLabel(com.intellij.ui.components.JBLabel)

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