Example usage for com.intellij.openapi.ui ComboBox ComboBox

List of usage examples for com.intellij.openapi.ui ComboBox ComboBox

Introduction

In this page you can find the example usage for com.intellij.openapi.ui ComboBox ComboBox.

Prototype

public ComboBox(E @NotNull [] items) 

Source Link

Usage

From source file:org.twodividedbyzero.idea.findbugs.gui.settings.MinRankPane.java

License:Open Source License

MinRankPane(final int indent) {
    super(new FlowLayout(FlowLayout.LEFT, 0, 0));
    label = new JLabel(ResourcesLoader.getString("minRank.text"));
    label.setToolTipText(ResourcesLoader.getString("minRank.description"));
    label.setPreferredSize(new JBDimension(indent, label.getPreferredSize().height));

    final DefaultComboBoxModel model = new DefaultComboBoxModel();
    for (int minRank = BugRanker.VISIBLE_RANK_MIN; minRank <= BugRanker.VISIBLE_RANK_MAX; minRank++) {
        final BugRankCategory category = BugRankCategory.getRank(minRank);
        model.addElement(new Item(minRank, minRank + " - " + category));
    }/*from  w  w  w  .j  ava2s. c  om*/
    comboBox = new ComboBox(model);

    add(label);
    add(comboBox);
}

From source file:settings.SettingConfigurable.java

License:Apache License

@Nullable
@Override//from   w w  w  .  j  a  v  a 2s .  com
public JComponent createComponent() {
    if (settingPanel == null) {
        settingPanel = new JPanel(new VerticalLayout(18));

        // header UI
        Container container = new Container();
        container.setLayout(new BorderLayout());

        currentEngine = TranslationEngineType
                .fromName(PropertiesComponent.getInstance().getValue(StorageDataKey.SettingLanguageEngine));
        TranslationEngineType[] items = TranslationEngineType.getLanguageEngineArray();
        languageEngineBox = new ComboBox(items);
        languageEngineBox.setEnabled(true);
        languageEngineBox.setSelectedItem(currentEngine);
        languageEngineBox.addActionListener(this);

        container.add(new JLabel("Language engine: "), BorderLayout.WEST);
        container.add(languageEngineBox, BorderLayout.CENTER);

        settingPanel.add(container);

        initContentContainer();
        initAndAddFilterContainer();
    }
    return settingPanel;
}

From source file:ui.AddFilterRuleDialog.java

License:Apache License

protected JComponent doCreateCenterPanel() {
    JPanel panel = new JPanel(new BorderLayout(5, 0));

    FilterRule.FilterRuleType[] types = FilterRule.FilterRuleType.values();

    ruleType = new ComboBox(types);
    ruleType.setEnabled(true);//from w w  w  . j a v  a  2 s  . c o  m
    ruleType.setSelectedIndex(0);

    panel.add(ruleType, BorderLayout.WEST);

    filterName = new JTextField(20);
    PromptSupport.setPrompt("Set the string name here", filterName);
    panel.add(filterName, BorderLayout.CENTER);

    return panel;
}