use of com.intellij.openapi.ui.ComboBox in project intellij-community by JetBrains.
the class StringConcatenationArgumentToLogCallInspection method createOptionsPanel.
@Nullable
@Override
public JComponent createOptionsPanel() {
final ComboBox comboBox = new ComboBox(new Object[] { InspectionGadgetsBundle.message("all.levels.option"), InspectionGadgetsBundle.message("warn.level.and.lower.option"), InspectionGadgetsBundle.message("info.level.and.lower.option"), InspectionGadgetsBundle.message("debug.level.and.lower.option"), InspectionGadgetsBundle.message("trace.level.option") });
comboBox.setSelectedIndex(warnLevel);
comboBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
warnLevel = comboBox.getSelectedIndex();
}
});
final JPanel panel = new JPanel(new BorderLayout());
panel.add(FormBuilder.createFormBuilder().addLabeledComponent(InspectionGadgetsBundle.message("warn.on.label"), comboBox).getPanel(), BorderLayout.NORTH);
return panel;
}
use of com.intellij.openapi.ui.ComboBox in project intellij-community by JetBrains.
the class TagPanel method createUIComponents.
private void createUIComponents() {
myLocalName = new LanguageTextField(RegExpLanguage.INSTANCE, myProject, myOrigInjection.getTagName());
myNamespace = new ComboBox(200);
}
use of com.intellij.openapi.ui.ComboBox in project intellij-community by JetBrains.
the class XmlAttributePanel method createUIComponents.
private void createUIComponents() {
myLanguagePanel = new LanguagePanel(myProject, myOrigInjection);
myTagPanel = new TagPanel(myProject, myOrigInjection);
myAdvancedPanel = new AdvancedXmlPanel(myProject, myOrigInjection);
myLocalName = new LanguageTextField(RegExpLanguage.INSTANCE, myProject, myOrigInjection.getAttributeName());
myNamespace = new ComboBox(200);
}
use of com.intellij.openapi.ui.ComboBox in project intellij-community by JetBrains.
the class AntHectorConfigurable method createComponent.
public JComponent createComponent() {
final JPanel panel = new JPanel(new GridBagLayout());
panel.setBorder(IdeBorderFactory.createTitledBorder("File Context", false));
myCombo = new ComboBox();
myCombo.putClientProperty(CONTEXTS_COMBO_KEY, Boolean.TRUE);
panel.add(new JLabel("Included into:"), new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, JBUI.insets(5, 0), 0, 0));
panel.add(myCombo, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, JBUI.insets(5, 5, 5, 0), 0, 0));
final PsiManager psiManager = PsiManager.getInstance(myProject);
final FileBasedIndex fbi = FileBasedIndex.getInstance();
final Collection<VirtualFile> antFiles = fbi.getContainingFiles(AntImportsIndex.INDEX_NAME, AntImportsIndex.ANT_FILES_WITH_IMPORTS_KEY, myFileFilter);
for (VirtualFile file : antFiles) {
final PsiFile psiFile = psiManager.findFile(file);
if (!(psiFile instanceof XmlFile)) {
continue;
}
final XmlFile xmlFile = (XmlFile) psiFile;
if (!xmlFile.equals(myFile) && AntDomFileDescription.isAntFile(xmlFile)) {
final String path = PathUtil.getLocalPath(file);
final XmlFile previous = myPathToFileMap.put(path, xmlFile);
assert previous == null;
}
}
final List<String> paths = new ArrayList<>(myPathToFileMap.keySet());
Collections.sort(paths, (o1, o2) -> o1.compareTo(o2));
myCombo.addItem(NONE);
for (String path : paths) {
myCombo.addItem(path);
}
final AntConfigurationBase antConfig = AntConfigurationBase.getInstance(myProject);
final XmlFile currentContext = antConfig.getContextFile(myFile);
if (currentContext != null) {
final VirtualFile vFile = currentContext.getVirtualFile();
assert vFile != null;
final String path = PathUtil.getLocalPath(vFile);
if (!FileUtil.pathsEqual(path, myLocalPath)) {
myOriginalContext = path;
}
}
myCombo.setSelectedItem(myOriginalContext);
return panel;
}
use of com.intellij.openapi.ui.ComboBox in project android by JetBrains.
the class ConfigureDeviceOptionsStep method createUIComponents.
private void createUIComponents() {
myNavigationControlsCombo = new ComboBox(new EnumComboBoxModel<>(Navigation.class)) {
@Override
public ListCellRenderer getRenderer() {
return new ColoredListCellRenderer() {
@Override
protected void customizeCellRenderer(@NotNull JList list, Object value, int index, boolean selected, boolean hasFocus) {
append(((Navigation) value).getShortDisplayValue());
}
};
}
};
myHardwareSkinHelpLabel = new HyperlinkLabel("How do I create a custom hardware skin?");
myHardwareSkinHelpLabel.setHyperlinkTarget(AvdWizardUtils.CREATE_SKIN_HELP_LINK);
myCustomSkinPath = new SkinChooser(null, false);
myDeviceDefinitionPreview = new DeviceDefinitionPreview(getModel().getDeviceData());
}
Aggregations