com.intellij.ui.ComboboxSpeedSearch Java Examples
The following examples show how to use
com.intellij.ui.ComboboxSpeedSearch.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SelectFileTemplateDialog.java From PackageTemplates with Apache License 2.0 | 6 votes |
@NotNull private ComboBox getSelector() { ArrayList<TemplateForSearch> listTemplateForSearch = FileTemplateHelper.getTemplates( project, cbAddInternal.isSelected(), cbAddJ2EE.isSelected(), ptWrapper.getPackageTemplate().getFileTemplateSource() ); ComboBox comboBox = new ComboBox(listTemplateForSearch.toArray()); comboBox.setRenderer(new ListCellRendererWrapper<TemplateForSearch>() { @Override public void customize(JList list, TemplateForSearch template, int index, boolean selected, boolean hasFocus) { if (template != null) { setIcon(FileTemplateUtil.getIcon(template.getTemplate())); setText(template.getTemplate().getName()); } } }); new ComboboxSpeedSearch(comboBox); return comboBox; }
Example #2
Source File: DataSourceSelector.java From intellij-xquery with Apache License 2.0 | 6 votes |
public DataSourceSelector(JComboBox dataSourceList) { this.dataSourceList = dataSourceList; new ComboboxSpeedSearch(this.dataSourceList) { protected String getElementText(Object element) { if (element instanceof XQueryDataSourceConfiguration) { return ((XQueryDataSourceConfiguration) element).NAME; } else if (element == null) { return NO_DATA_SOURCE; } return super.getElementText(element); } }; this.dataSourceList.setModel(dataSourcesModel); this.dataSourceList.setRenderer(new ListCellRendererWrapper() { @Override public void customize(final JList list, final Object value, final int index, final boolean selected, final boolean hasFocus) { if (value instanceof XQueryDataSourceConfiguration) { final XQueryDataSourceConfiguration dataSourceConfiguration = (XQueryDataSourceConfiguration) value; setText(dataSourceConfiguration.NAME); } else if (value == null) { setText(NO_DATA_SOURCE); } } }); }
Example #3
Source File: ConfigurationModuleSelector.java From intellij-xquery with Apache License 2.0 | 6 votes |
public ConfigurationModuleSelector(final Project project, final JComboBox<Module> modulesList, final String noModule) { myProject = project; myModulesList = modulesList; new ComboboxSpeedSearch(modulesList) { protected String getElementText(Object element) { if (element instanceof Module) { return ((Module) element).getName(); } else if (element == null) { return noModule; } return super.getElementText(element); } }; myModulesList.setModel(new SortedComboBoxModel<>(ModulesAlphaComparator.INSTANCE)); myModulesList.setRenderer(new ModuleListCellRenderer(noModule)); }
Example #4
Source File: ModulesComboBox.java From consulo with Apache License 2.0 | 6 votes |
private ModulesComboBox(final SortedComboBoxModel<Module> model) { super(model); myModel = model; new ComboboxSpeedSearch(this){ @Override protected String getElementText(Object element) { if (element instanceof Module) { return ((Module)element).getName(); } else if (element == null) { return ""; } return super.getElementText(element); } }; setRenderer(new ModuleListCellRenderer()); }
Example #5
Source File: ModuleDescriptionsComboBox.java From consulo with Apache License 2.0 | 6 votes |
public ModuleDescriptionsComboBox() { myModel = new SortedComboBoxModel<>(Comparator.comparing(description -> description != null ? description.getName() : "", String.CASE_INSENSITIVE_ORDER)); setModel(myModel); new ComboboxSpeedSearch(this) { @Override protected String getElementText(Object element) { if (element instanceof ModuleDescription) { return ((ModuleDescription)element).getName(); } else { return ""; } } }; setRenderer(new ModuleDescriptionListCellRenderer()); }
Example #6
Source File: TemplateKindCombo.java From consulo with Apache License 2.0 | 6 votes |
public TemplateKindCombo() { getComboBox().setRenderer(new ColoredListCellRenderer() { @Override protected void customizeCellRenderer(@Nonnull JList list, Object value, int index, boolean selected, boolean hasFocus) { if (value instanceof Trinity) { append((String)((Trinity)value).first); setIcon((Image)((Trinity)value).second); } } }); new ComboboxSpeedSearch(getComboBox()) { @Override protected String getElementText(Object element) { if (element instanceof Trinity) { return (String)((Trinity)element).first; } return null; } }; setButtonListener(null); }
Example #7
Source File: VariableDialog.java From intellij-xquery with Apache License 2.0 | 5 votes |
public VariableDialog() { panel.setName(DIALOG_PANEL); name.getComponent().setName(NAME); namespace.getComponent().setName(NAMESPACE); value.getComponent().setRows(7); value.getComponent().setColumns(50); value.getComponent().setName(VALUE); type.getComponent().setModel(typesModel); populateTypesList(); new ComboboxSpeedSearch(type.getComponent()); }
Example #8
Source File: DetailsTabForm.java From consulo with Apache License 2.0 | 5 votes |
public DetailsTabForm(@Nullable Action analyzeAction, boolean internalMode) { myCommentsArea.setTitle(DiagnosticBundle.message("error.dialog.comment.prompt")); myCommentsArea.setLabelPosition(BorderLayout.NORTH); myDetailsPane.setBackground(UIUtil.getTextFieldBackground()); myDetailsPane.setPreferredSize(new Dimension(IdeErrorsDialog.COMPONENTS_WIDTH, internalMode ? 500 : 205)); myDetailsHolder.setBorder(IdeBorderFactory.createBorder()); if (analyzeAction != null) { myAnalyzeStacktraceButton.setAction(analyzeAction); } else { myAnalyzeStacktraceButton.setVisible(false); } myAssigneeComboBox.setRenderer(new DeveloperRenderer(myAssigneeComboBox.getRenderer())); myAssigneeComboBox.setPrototypeDisplayValue(new Developer(0, "Here Goes Some Very Long String")); myAssigneeComboBox.addActionListener(new ActionListenerProxy(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { myAssigneeId = getAssigneeId(); } })); new ComboboxSpeedSearch(myAssigneeComboBox) { @Override protected String getElementText(Object element) { return element == null ? "" : ((Developer) element).getSearchableText(); } }; }