Java Code Examples for com.intellij.ui.SortedComboBoxModel#add()

The following examples show how to use com.intellij.ui.SortedComboBoxModel#add() . 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: ConfigurationModuleSelector.java    From intellij-xquery with Apache License 2.0 5 votes vote down vote up
private void setModules(final Collection<Module> modules) {
    if (myModulesList instanceof ModulesComboBox) {
        ((ModulesComboBox) myModulesList).setModules(modules);
    } else {
        SortedComboBoxModel<Module> model = (SortedComboBoxModel<Module>) myModulesList.getModel();
        model.setAll(modules);
        model.add(null);
    }
}
 
Example 2
Source File: DefaultFileExtensionsPanel.java    From intellij-xquery with Apache License 2.0 4 votes vote down vote up
private void populateExtensionsList(SortedComboBoxModel<String> model, Object defaultItem, List<String> allItems) {
    for (String type : allItems) {
        model.add(type);
    }
    model.setSelectedItem(defaultItem);
}
 
Example 3
Source File: ProjectSettingsForm.java    From EclipseCodeFormatter with Apache License 2.0 4 votes vote down vote up
private void refreshProfilesModel(SortedComboBoxModel profilesModel) {
	profilesModel.setAll(GlobalSettings.getInstance().getSettingsList());
	Settings projectSpecificProfile = ProjectSettings.getInstance(project).getState().getProjectSpecificProfile();
	profilesModel.add(projectSpecificProfile);
}
 
Example 4
Source File: ConfigFileLocator.java    From EclipseCodeFormatter with Apache License 2.0 4 votes vote down vote up
private void valid(String valid_config, ProjectSettingsForm projectSettingsForm, SortedComboBoxModel profilesModel, JComboBox comboBox) {
	profilesModel.add(valid_config);
	comboBox.setEnabled(false);
	comboBox.setBorder(projectSettingsForm.normalBorder);
}
 
Example 5
Source File: ConfigFileLocator.java    From EclipseCodeFormatter with Apache License 2.0 4 votes vote down vote up
private void invalid(String text, SortedComboBoxModel profilesModel, JComboBox comboBox) {
	profilesModel.add(text);
	comboBox.setEnabled(false);
	comboBox.setBorder(ProjectSettingsForm.ERROR_BORDER);
}