Search in sources :

Example 26 with JBCheckBox

use of com.intellij.ui.components.JBCheckBox in project netbeans-mmd-plugin by raydac.

the class KeyShortCutEditPanel method initComponents.

@SuppressWarnings("unchecked")
private void initComponents() {
    scrollPaneTable = new JBScrollPane();
    tableKeyShortcuts = new JBTable();
    mainPanel = new JBPanel();
    labelKeyCode = new JBLabel();
    checkBoxALT = new JBCheckBox();
    checkBoxCTRL = new JBCheckBox();
    checkBoxSHIFT = new JBCheckBox();
    checkBoxMeta = new JBCheckBox();
    textFieldKeyCode = new JBTextField();
    buttonEditKeyCode = new JToggleButton();
    setLayout(new java.awt.BorderLayout());
    // NOI18N
    scrollPaneTable.setBorder(javax.swing.BorderFactory.createTitledBorder(BUNDLE.getString("KeyShortCutEditPanel.ScrollPaneBorderTitle")));
    tableKeyShortcuts.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
    tableKeyShortcuts.addMouseListener(new java.awt.event.MouseAdapter() {

        public void mouseClicked(java.awt.event.MouseEvent evt) {
            tableKeyShortcutsMouseClicked(evt);
        }
    });
    scrollPaneTable.setViewportView(tableKeyShortcuts);
    add(scrollPaneTable, java.awt.BorderLayout.CENTER);
    // NOI18N
    labelKeyCode.setText(BUNDLE.getString("KeyShortCutEditPanel.labelKeyCode.text"));
    // NOI18N
    checkBoxALT.setText(BUNDLE.getString("KeyShortCutEditPanel.checkBoxALT.text"));
    // NOI18N
    checkBoxCTRL.setText(BUNDLE.getString("KeyShortCutEditPanel.checkBoxCTRL.text"));
    // NOI18N
    checkBoxSHIFT.setText(BUNDLE.getString("KeyShortCutEditPanel.checkBoxSHIFT.text"));
    // NOI18N
    checkBoxMeta.setText(BUNDLE.getString("KeyShortCutEditPanel.checkBoxMeta.text"));
    textFieldKeyCode.addFocusListener(new java.awt.event.FocusAdapter() {

        public void focusLost(java.awt.event.FocusEvent evt) {
            textFieldKeyCodeFocusLost(evt);
        }
    });
    textFieldKeyCode.addKeyListener(new java.awt.event.KeyAdapter() {

        public void keyTyped(java.awt.event.KeyEvent evt) {
            textFieldKeyCodeKeyTyped(evt);
        }

        public void keyPressed(java.awt.event.KeyEvent evt) {
            textFieldKeyCodeKeyPressed(evt);
        }
    });
    // NOI18N
    buttonEditKeyCode.setText(BUNDLE.getString("KeyShortCutEditPanel.buttonEditKeyCode.text"));
    buttonEditKeyCode.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            buttonEditKeyCodeActionPerformed(evt);
        }
    });
    javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
    mainPanel.setLayout(mainPanelLayout);
    mainPanelLayout.setHorizontalGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup().addContainerGap(44, Short.MAX_VALUE).addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false).addGroup(mainPanelLayout.createSequentialGroup().addComponent(labelKeyCode).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(textFieldKeyCode)).addGroup(mainPanelLayout.createSequentialGroup().addComponent(checkBoxALT).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(checkBoxCTRL).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(checkBoxSHIFT).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(checkBoxMeta))).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(buttonEditKeyCode).addContainerGap()));
    mainPanelLayout.setVerticalGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(mainPanelLayout.createSequentialGroup().addContainerGap().addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING).addComponent(buttonEditKeyCode, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE).addGroup(javax.swing.GroupLayout.Alignment.LEADING, mainPanelLayout.createSequentialGroup().addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(labelKeyCode).addComponent(textFieldKeyCode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(checkBoxALT).addComponent(checkBoxCTRL).addComponent(checkBoxSHIFT).addComponent(checkBoxMeta)))).addContainerGap(44, Short.MAX_VALUE)));
    add(mainPanel, java.awt.BorderLayout.PAGE_END);
}
Also used : ActionListener(java.awt.event.ActionListener) JBTextField(com.intellij.ui.components.JBTextField) JBTable(com.intellij.ui.table.JBTable) KeyEvent(java.awt.event.KeyEvent) ActionEvent(java.awt.event.ActionEvent) JBPanel(com.intellij.ui.components.JBPanel) JBCheckBox(com.intellij.ui.components.JBCheckBox) JToggleButton(javax.swing.JToggleButton) JBLabel(com.intellij.ui.components.JBLabel) JBScrollPane(com.intellij.ui.components.JBScrollPane)

Example 27 with JBCheckBox

use of com.intellij.ui.components.JBCheckBox in project sonarlint-intellij by SonarSource.

the class SonarLintProjectBindPanel method create.

public JPanel create(Project project) {
    this.project = project;
    rootPanel = new JPanel(new BorderLayout());
    bindEnable = new JBCheckBox("Enable binding to remote SonarQube server", true);
    bindEnable.addItemListener(new BindItemListener());
    createBindPanel();
    rootPanel.add(bindEnable, BorderLayout.NORTH);
    rootPanel.add(bindPanel, BorderLayout.CENTER);
    return rootPanel;
}
Also used : JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) JBCheckBox(com.intellij.ui.components.JBCheckBox)

Example 28 with JBCheckBox

use of com.intellij.ui.components.JBCheckBox in project intellij-leiningen-plugin by derkork.

the class LeiningenSettings method createComponent.

public JComponent createComponent() {
    JPanel outerPanel = new JPanel(new BorderLayout());
    JPanel leinPanel = new JPanel(new FormLayout("80dlu, fill:80dlu:grow, 20dlu, 80dlu", "p,p,p"));
    CellConstraints c = new CellConstraints();
    int row = 1;
    leinPanel.add(new JBLabel("Leiningen executable:"), c.xy(1, row));
    this.leinBinSelectorField = new TextFieldWithBrowseButton();
    leinBinSelectorField.addBrowseFolderListener("Select the Leiningen executable", "'lein' on Linux/MacOS, 'lein.bat' on Windows. ", null, new FileChooserDescriptor(true, false, false, false, false, false));
    leinPanel.add(leinBinSelectorField, c.xy(2, row));
    row++;
    leinPanel.add(new JBLabel("Leiningen Home:"), c.xy(1, row));
    this.leinHomeSelectorField = new TextFieldWithBrowseButton();
    leinHomeSelectorField.addBrowseFolderListener("Select the Leiningen home directory", "usually at $USER_HOME/.lein", null, new FileChooserDescriptor(false, true, false, false, false, false));
    leinPanel.add(leinHomeSelectorField, c.xy(2, row));
    this.overrideLeinHome = new JBCheckBox();
    leinPanel.add(overrideLeinHome, c.xy(3, row));
    leinPanel.add(new JBLabel("Override"), c.xy(4, row));
    row++;
    leinPanel.add(new JBLabel("Leiningen Jar:"), c.xy(1, row));
    this.leinJarSelectorField = new TextFieldWithBrowseButton();
    leinJarSelectorField.addBrowseFolderListener("Select the Leiningen Jar", "usually at $USER_HOME/.lein/self-installs/leinigen-VERSION-standalone.jar", null, new FileChooserDescriptor(true, false, true, true, false, false));
    leinPanel.add(leinJarSelectorField, c.xy(2, row));
    this.overrideLeinJar = new JBCheckBox();
    leinPanel.add(overrideLeinJar, c.xy(3, row));
    leinPanel.add(new JBLabel("Override"), c.xy(4, row));
    outerPanel.add(leinPanel, BorderLayout.NORTH);
    myWatcher = new UserActivityWatcher();
    myWatcher.register(outerPanel);
    myWatcher.addUserActivityListener(new UserActivityListener() {

        public void stateChanged() {
            changed = true;
            leinJarSelectorField.setEnabled(overrideLeinJar.isSelected());
            leinHomeSelectorField.setEnabled(overrideLeinHome.isSelected());
        }
    });
    return outerPanel;
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) TextFieldWithBrowseButton(com.intellij.openapi.ui.TextFieldWithBrowseButton) JBLabel(com.intellij.ui.components.JBLabel) FileChooserDescriptor(com.intellij.openapi.fileChooser.FileChooserDescriptor) UserActivityWatcher(com.intellij.ui.UserActivityWatcher) UserActivityListener(com.intellij.ui.UserActivityListener) CellConstraints(com.jgoodies.forms.layout.CellConstraints) JBCheckBox(com.intellij.ui.components.JBCheckBox)

Aggregations

JBCheckBox (com.intellij.ui.components.JBCheckBox)28 JBLabel (com.intellij.ui.components.JBLabel)10 Nullable (org.jetbrains.annotations.Nullable)5 ComboBox (com.intellij.openapi.ui.ComboBox)4 JBTextField (com.intellij.ui.components.JBTextField)4 GridBag (com.intellij.util.ui.GridBag)4 NotNull (org.jetbrains.annotations.NotNull)4 TextFieldWithBrowseButton (com.intellij.openapi.ui.TextFieldWithBrowseButton)3 ActionEvent (java.awt.event.ActionEvent)3 ProjectSelector (com.google.cloud.tools.intellij.project.ProjectSelector)2 ZenCodingFilter (com.intellij.codeInsight.template.emmet.filters.ZenCodingFilter)2 FileChooserDescriptor (com.intellij.openapi.fileChooser.FileChooserDescriptor)2 ActionListener (java.awt.event.ActionListener)2 ItemEvent (java.awt.event.ItemEvent)2 ItemListener (java.awt.event.ItemListener)2 PhoneGapTargets (com.github.masahirosuzuka.PhoneGapIntelliJPlugin.commandLine.PhoneGapTargets)1 Option (com.intellij.codeInsight.hints.Option)1 EnvironmentVariablesTextFieldWithBrowseButton (com.intellij.execution.configuration.EnvironmentVariablesTextFieldWithBrowseButton)1 FacetEditorValidator (com.intellij.facet.ui.FacetEditorValidator)1 FacetValidatorsManager (com.intellij.facet.ui.FacetValidatorsManager)1