本文整理汇总了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;
}
示例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);
}
示例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());
}
示例4: select
import com.intellij.ui.ScrollingUtil; //导入方法依赖的package包/类
public void select(T item) {
if (item != null) {
ScrollingUtil.selectItem(myList, item);
}
else {
ScrollingUtil.ensureSelectionExists(myList);
}
}
示例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());
}
示例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();
}
示例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);
}
示例8: ensureSelectionExist
import com.intellij.ui.ScrollingUtil; //导入方法依赖的package包/类
protected void ensureSelectionExist() {
ScrollingUtil.ensureSelectionExists(myList);
}