• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ComboboxSpeedSearch类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.intellij.ui.ComboboxSpeedSearch的典型用法代码示例。如果您正苦于以下问题:Java ComboboxSpeedSearch类的具体用法?Java ComboboxSpeedSearch怎么用?Java ComboboxSpeedSearch使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ComboboxSpeedSearch类属于com.intellij.ui包,在下文中一共展示了ComboboxSpeedSearch类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getSelector

import com.intellij.ui.ComboboxSpeedSearch; //导入依赖的package包/类
@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;
}
 
开发者ID:CeH9,项目名称:PackageTemplates,代码行数:24,代码来源:SelectFileTemplateDialog.java


示例2: ConfigurationModuleSelector

import com.intellij.ui.ComboboxSpeedSearch; //导入依赖的package包/类
/**
 * @deprecated use {@link #ConfigurationModuleSelector(Project, ModulesComboBox, String)} instead
 */
public ConfigurationModuleSelector(final Project project, final JComboBox 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<Module>(ModulesAlphaComparator.INSTANCE));
  myModulesList.setRenderer(new ModuleListCellRenderer(noModule));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:ConfigurationModuleSelector.java


示例3: setupModulesCombobox

import com.intellij.ui.ComboboxSpeedSearch; //导入依赖的package包/类
private void setupModulesCombobox(PackagingElementResolvingContext context) {
  final Module[] modules = context.getModulesProvider().getModules().clone();
  Arrays.sort(modules, ModulesAlphaComparator.INSTANCE);
  if (modules.length > 1) {
    myModuleComboBox.addItem(null);
  }
  for (Module module : modules) {
    myModuleComboBox.addItem(module);
  }
  myModuleComboBox.setRenderer(new ModuleListRenderer(myModuleComboBox));
  new ComboboxSpeedSearch(myModuleComboBox) {
    @Override
    protected String getElementText(Object element) {
      return element instanceof Module ? ((Module)element).getName() : "";
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:JarArtifactFromModulesDialog.java


示例4: DetailsTabForm

import com.intellij.ui.ComboboxSpeedSearch; //导入依赖的package包/类
public DetailsTabForm(@Nullable Action analyzeAction, boolean internalMode) {
  myCommentsArea.setTitle(DiagnosticBundle.message("error.dialog.comment.prompt"));
  myDetailsPane.setBackground(UIUtil.getTextFieldBackground());
  myDetailsHolder.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();
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:DetailsTabForm.java


示例5: ModulesComboBox

import com.intellij.ui.ComboboxSpeedSearch; //导入依赖的package包/类
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());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:ModulesComboBox.java


示例6: TemplateKindCombo

import com.intellij.ui.ComboboxSpeedSearch; //导入依赖的package包/类
public TemplateKindCombo() {
  //noinspection unchecked
  getComboBox().setRenderer(new ListCellRendererWrapper() {
    @Override
    public void customize(final JList list, final Object value, final int index, final boolean selected, final boolean cellHasFocus) {
      if (value instanceof Trinity) {
        setText((String)((Trinity)value).first);
        setIcon ((Icon)((Trinity)value).second);
      }
    }
  });

  new ComboboxSpeedSearch(getComboBox()) {
    @Override
    protected String getElementText(Object element) {
      if (element instanceof Trinity) {
        return (String)((Trinity)element).first;
      }
      return null;
    }
  }.setComparator(new SpeedSearchComparator(true));
  setButtonListener(null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:TemplateKindCombo.java


示例7: DetailsTabForm

import com.intellij.ui.ComboboxSpeedSearch; //导入依赖的package包/类
public DetailsTabForm(@Nullable Action analyzeAction, boolean internalMode) {
  myCommentsArea.setTitle(DiagnosticBundle.message("error.dialog.comment.prompt"));
  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();
    }
  };
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:27,代码来源:DetailsTabForm.java


示例8: TemplateKindCombo

import com.intellij.ui.ComboboxSpeedSearch; //导入依赖的package包/类
public TemplateKindCombo() {
  getComboBox().setRenderer(new ListCellRendererWrapper() {
    @Override
    public void customize(final JList list, final Object value, final int index, final boolean selected, final boolean cellHasFocus) {
      if (value instanceof Trinity) {
        setText((String)((Trinity)value).first);
        setIcon ((Icon)((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);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:23,代码来源:TemplateKindCombo.java


示例9: DataSourceSelector

import com.intellij.ui.ComboboxSpeedSearch; //导入依赖的package包/类
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);
            }
        }
    });
}
 
开发者ID:ligasgr,项目名称:intellij-xquery,代码行数:27,代码来源:DataSourceSelector.java


示例10: ConfigurationModuleSelector

import com.intellij.ui.ComboboxSpeedSearch; //导入依赖的package包/类
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));
}
 
开发者ID:ligasgr,项目名称:intellij-xquery,代码行数:17,代码来源:ConfigurationModuleSelector.java


示例11: createCombo

import com.intellij.ui.ComboboxSpeedSearch; //导入依赖的package包/类
private JComboBox createCombo(List<Language> languages) {
  JComboBox jComboBox = new ComboBox(new CollectionComboBoxModel(languages));
  jComboBox.setRenderer(new ListCellRendererWrapper<Language>() {
    @Override
    public void customize(JList list, Language lang, int index, boolean selected, boolean hasFocus) {
      if (lang != null) {
        setText(lang.getDisplayName());
        LanguageFileType associatedLanguage = lang.getAssociatedFileType();
        if (associatedLanguage != null) setIcon(associatedLanguage.getIcon());
      }
    }
  });
  new ComboboxSpeedSearch(jComboBox) {
    @Override
    protected String getElementText(Object element) {
      return element instanceof Language ? ((Language) element).getDisplayName() : null;
    }
  };
  Language previous = myProject != null ? myProject.getUserData(SCRATCH_LANGUAGE) : null;
  if (previous != null) {
    jComboBox.setSelectedItem(previous);
  }

  return jComboBox;
}
 
开发者ID:ignatov,项目名称:intellij-scratch,代码行数:26,代码来源:NewScratchFileAction.java


示例12: ModuleDescriptionsComboBox

import com.intellij.ui.ComboboxSpeedSearch; //导入依赖的package包/类
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());
}
 
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:ModuleDescriptionsComboBox.java


示例13: ConfigurationModuleSelector

import com.intellij.ui.ComboboxSpeedSearch; //导入依赖的package包/类
/**
 * @deprecated use {@link #ConfigurationModuleSelector(Project, ModulesComboBox, String)} instead
 */
public ConfigurationModuleSelector(final Project project, final JComboBox<Module> modulesList, final String noModule)
{
	myProject = project;
	myModulesList = modulesList;
	myModulesDescriptionsComboBox = null;
	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));
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:27,代码来源:ConfigurationModuleSelector.java


示例14: setupModulesCombobox

import com.intellij.ui.ComboboxSpeedSearch; //导入依赖的package包/类
private void setupModulesCombobox(PackagingElementResolvingContext context)
{
	final Module[] modules = context.getModulesProvider().getModules().clone();
	Arrays.sort(modules, ModulesAlphaComparator.INSTANCE);
	if(modules.length > 1)
	{
		myModuleComboBox.addItem(null);
	}
	for(Module module : modules)
	{
		myModuleComboBox.addItem(module);
	}
	myModuleComboBox.setRenderer(new ModuleListRenderer(myModuleComboBox));
	new ComboboxSpeedSearch(myModuleComboBox)
	{
		@Override
		protected String getElementText(Object element)
		{
			return element instanceof Module ? ((Module) element).getName() : "";
		}
	};
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:23,代码来源:JarArtifactFromModulesDialog.java


示例15: subInit

import com.intellij.ui.ComboboxSpeedSearch; //导入依赖的package包/类
@Override
protected void subInit() {
    super.subInit();

    this.myMessageTextField = new EditorTextField("");
    this.myKindUpDownHint      = new JLabel();
    this.myKindUpDownHint.setIcon(PlatformIcons.UP_DOWN_ARROWS);
    this.myKindUpDownHint.setToolTipText(PhpBundle.message("actions.new.php.base.arrows.kind.tooltip"));


    this.myKindComboBox = new ComboBox<String>();
    this.myKindComboBox.setMinimumAndPreferredWidth(400);
    this.myKindComboBox.setRenderer(new ListCellRendererWrapper<Trinity>() {
        public void customize(JList list, Trinity value, int index, boolean selected, boolean hasFocus) {
            this.setText((String)value.first);
            this.setIcon((Icon)value.second);
        }
    });
    ComboboxSpeedSearch var10001 = new ComboboxSpeedSearch(this.myKindComboBox) {
        protected String getElementText(Object element) {
            return (String)((Trinity)element).first;
        }
    };
    KeyboardShortcut up = new KeyboardShortcut(KeyStroke.getKeyStroke(38, 0), (KeyStroke)null);
    KeyboardShortcut down = new KeyboardShortcut(KeyStroke.getKeyStroke(40, 0), (KeyStroke)null);
    AnAction kindArrow = PhpNewFileDialog.getCbArrowAction(this.myKindComboBox);
    kindArrow.registerCustomShortcutSet(new CustomShortcutSet(new Shortcut[]{up, down}), this.myNameTextField);
    List<Trinity> exceptionTypes = this.getExceptionTypes();

    for(Trinity type : exceptionTypes) {
        this.myKindComboBox.addItem(type);
    }
}
 
开发者ID:aurimasniekis,项目名称:idea-php-class-templates,代码行数:34,代码来源:PhpNewExceptionClassDialog.java


示例16: AttributesPanel

import com.intellij.ui.ComboboxSpeedSearch; //导入依赖的package包/类
public AttributesPanel() {
  myBackButton.setIcon(AllIcons.Actions.Back);
  myBackButton.setBorder(BORDER);

  myPaletteScrollPane.setVisible(false);
  myAdvancedFilterCheckBox.setVisible(false);
  myAttrGroupCombo.setVisible(false);

  new ComboboxSpeedSearch(myThemeCombo);

  myBackButton.setToolTipText("Back to the theme");

  myAttributesTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  myAttributesTable.setTableHeader(null);

  // TODO: TableSpeedSearch does not really support filtered tables since it incorrectly uses the model to calculate the number
  // of available cells. Fix this.
  new TableSpeedSearch(myAttributesTable) {
    @Override
    protected int getElementCount() {
      return myComponent.getRowCount() * myComponent.getColumnCount();
    }
  };

  mySubStyleLabel.setVisible(false);
  mySubStyleLabel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

  myPalette.setShowCheckeredBackground(true);

  // Stop the combo box long items from blocking the right panel from being able to be made small.
  myThemeCombo.setMinimumSize(new Dimension(10, myThemeCombo.getMinimumSize().height));
  myThemeCombo.setPreferredSize(new Dimension(10, myThemeCombo.getPreferredSize().height));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:34,代码来源:AttributesPanel.java


示例17: ConfigurationModuleSelector

import com.intellij.ui.ComboboxSpeedSearch; //导入依赖的package包/类
public ConfigurationModuleSelector(final Project project, final JComboBox modulesList, String noModule) {
  myNoModule = 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 myNoModule;
      }
      return super.getElementText(element);
    }
  };
  myModulesList.setModel(myModules);
  myModulesList.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 Module) {
        final Module module = (Module)value;
        setIcon(ModuleType.get(module).getIcon());
        setText(module.getName());
      }
      else if (value == null) {
        setText(myNoModule);
      }
    }
  });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:30,代码来源:ConfigurationModuleSelector.java


示例18: ModulesCombobox

import com.intellij.ui.ComboboxSpeedSearch; //导入依赖的package包/类
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 ListCellRendererWrapper<Module>() {
    @Override
    public void customize(JList list, Module value, int index, boolean selected, boolean hasFocus) {
      if (value != null) {
        setText(value.getName());
        setIcon(ModuleType.get(value).getIcon());
      }
      else {
        setText("[none]");
      }
    }
  });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:28,代码来源:ModulesCombobox.java


示例19: VariableDialog

import com.intellij.ui.ComboboxSpeedSearch; //导入依赖的package包/类
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());
}
 
开发者ID:ligasgr,项目名称:intellij-xquery,代码行数:12,代码来源:VariableDialog.java


示例20: DetailsTabForm

import com.intellij.ui.ComboboxSpeedSearch; //导入依赖的package包/类
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();
    }
  };
}
 
开发者ID:consulo,项目名称:consulo,代码行数:28,代码来源:DetailsTabForm.java



注:本文中的com.intellij.ui.ComboboxSpeedSearch类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BulkDeleteResponse类代码示例发布时间:2022-05-23
下一篇:
Java ServerPipelineHook类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap