当前位置: 首页>>代码示例>>Java>>正文


Java ScrollingUtil.ensureSelectionExists方法代码示例

本文整理汇总了Java中com.intellij.ui.ScrollingUtil.ensureSelectionExists方法的典型用法代码示例。如果您正苦于以下问题:Java ScrollingUtil.ensureSelectionExists方法的具体用法?Java ScrollingUtil.ensureSelectionExists怎么用?Java ScrollingUtil.ensureSelectionExists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.ui.ScrollingUtil的用法示例。


在下文中一共展示了ScrollingUtil.ensureSelectionExists方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: showDialog

import com.intellij.ui.ScrollingUtil; //导入方法依赖的package包/类
private static Sdk showDialog(final Project project, String title, final Component parent, Sdk jdkToSelect) {
  final JdkChooserPanel jdkChooserPanel = new JdkChooserPanel(project);
  jdkChooserPanel.fillList(null, null);
  final MyDialog dialog = jdkChooserPanel.new MyDialog(parent);
  if (title != null) {
    dialog.setTitle(title);
  }
  if (jdkToSelect != null) {
    jdkChooserPanel.selectJdk(jdkToSelect);
  }
  else {
    ScrollingUtil.ensureSelectionExists(jdkChooserPanel.myList);
  }
  new DoubleClickListener() {
    @Override
    protected boolean onDoubleClick(MouseEvent e) {
      dialog.clickDefaultButton();
      return true;
    }
  }.installOn(jdkChooserPanel.myList);
  return dialog.showAndGet() ? jdkChooserPanel.getChosenJdk() : null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:JdkChooserPanel.java

示例2: GroupList

import com.intellij.ui.ScrollingUtil; //导入方法依赖的package包/类
public GroupList(PsiClass[] classes)
{
    super(new BorderLayout());
    SortedListModel<String> model = new SortedListModel<String>(new Comparator<String>()
    {
        public int compare(String s1, String s2) {
            return s1.compareTo(s2);
        }
    });
    list = new JBList(model);
    Set<String> groups = TestNGUtil.getAnnotationValues("groups", classes);
  String[] array = ArrayUtil.toStringArray(groups);
    Arrays.sort(array);
    model.addAll(array);
    add(ScrollPaneFactory.createScrollPane(list));
    list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    ScrollingUtil.ensureSelectionExists(list);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:GroupList.java

示例3: setItems

import com.intellij.ui.ScrollingUtil; //导入方法依赖的package包/类
public void setItems(Collection<T> items) {
  DefaultListModel model = myForm.getListModel();
  model.removeAllElements();
  for (T item : items) {
    model.addElement(item);
  }
  ScrollingUtil.ensureSelectionExists(getList());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:AnActionListEditor.java

示例4: select

import com.intellij.ui.ScrollingUtil; //导入方法依赖的package包/类
public void select(T item) {
  if (item != null) {
    ScrollingUtil.selectItem(myList, item);
  }
  else {
    ScrollingUtil.ensureSelectionExists(myList);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:AnActionListEditor.java

示例5: loadValues

import com.intellij.ui.ScrollingUtil; //导入方法依赖的package包/类
public void loadValues(AbstractProperty.AbstractPropertyContainer container) {
  DefaultListModel model = getModel();
  model.clear();
  Iterator iterator = getProperty().getIterator(container);
  while (iterator.hasNext()) {
    Object item = iterator.next();
    model.addElement(item);
  }
  ScrollingUtil.ensureSelectionExists(getList());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:UIPropertyBinding.java

示例6: MethodListDlg

import com.intellij.ui.ScrollingUtil; //导入方法依赖的package包/类
public MethodListDlg(final PsiClass psiClass, final Condition<PsiMethod> filter, final JComponent parent)
{
	super(parent, false);
	myClass = psiClass;
	createList(psiClass.getAllMethods(), filter);
	myWholePanel.add(ScrollPaneFactory.createScrollPane(myList));
	myList.setCellRenderer(new ColoredListCellRenderer()
	{
		protected void customizeCellRenderer(@NotNull final JList list, final Object value, final int index, final boolean selected, final boolean hasFocus)
		{
			final PsiMethod psiMethod = (PsiMethod) value;
			append(PsiFormatUtil.formatMethod(psiMethod, PsiSubstitutor.EMPTY, PsiFormatUtil.SHOW_NAME, 0), StructureNodeRenderer.applyDeprecation(psiMethod, SimpleTextAttributes
					.REGULAR_ATTRIBUTES));
			final PsiClass containingClass = psiMethod.getContainingClass();
			if(!myClass.equals(containingClass))
			{
				append(" (" + containingClass.getQualifiedName() + ")", StructureNodeRenderer.applyDeprecation(containingClass, SimpleTextAttributes.GRAY_ATTRIBUTES));
			}
		}
	});
	myList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
	new DoubleClickListener()
	{
		@Override
		protected boolean onDoubleClick(MouseEvent e)
		{
			MethodListDlg.this.close(OK_EXIT_CODE);
			return true;
		}
	}.installOn(myList);

	ScrollingUtil.ensureSelectionExists(myList);
	TreeUIHelper.getInstance().installListSpeedSearch(myList);
	setTitle(ExecutionBundle.message("choose.test.method.dialog.title"));
	init();
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:37,代码来源:MethodListDlg.java

示例7: addExecutorComponent

import com.intellij.ui.ScrollingUtil; //导入方法依赖的package包/类
public void addExecutorComponent(Executor executor, JComponent component) {
  myRunnerPanel.add(component, executor.getId());
  myListModel.addElement(executor);
  ScrollingUtil.ensureSelectionExists(myRunnersList);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:ConfigurationSettingsEditor.java

示例8: ensureSelectionExist

import com.intellij.ui.ScrollingUtil; //导入方法依赖的package包/类
protected void ensureSelectionExist() {
  ScrollingUtil.ensureSelectionExists(myList);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:AbstractListBuilder.java


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