Java 类com.intellij.ui.ListUtil 实例源码

项目:intellij-ce-playground    文件:BranchesPanel.java   
private JBList createList(RefGroup group) {
  JBList list = new JBList(createListModel(group));
  list.setCellRenderer(myCellRenderer);
  ListUtil.installAutoSelectOnMouseMove(list);
  list.setSelectedIndex(0);
  list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

  jumpOnMouseClick(list);
  jumpOnEnter(list);

  return list;
}
项目:intellij-ce-playground    文件:ReferencePopupComponent.java   
private JBList createList(RefGroup group) {
  JBList list = new JBList(createListModel(group));
  list.setCellRenderer(myCellRenderer);
  ListUtil.installAutoSelectOnMouseMove(list);
  list.setSelectedIndex(0);
  list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

  jumpOnMouseClick(list);
  jumpOnEnter(list);

  return list;
}
项目:intellij-ce-playground    文件:RecentProjectPanel.java   
@Override
public void mouseReleased(MouseEvent e) {
  final Point point = e.getPoint();
  final MyList list = MyList.this;
  final int index = list.locationToIndex(point);
  if (index != -1) {
    if (getCloseIconRect(index).contains(point)) {
      e.consume();
      final Object element = getModel().getElementAt(index);
      removeRecentProjectElement(element);
      ListUtil.removeSelectedItems(MyList.this);
    }
  }
}
项目:intellij-ce-playground    文件:DeleteBookmarkAction.java   
@Override
public void actionPerformed(AnActionEvent e) {
  List<Bookmark> bookmarks = BookmarksAction.getSelectedBookmarks(myList);
  ListUtil.removeSelectedItems(myList);

  for (Bookmark bookmark : bookmarks) {
    BookmarkManager.getInstance(myProject).removeBookmark(bookmark);
  }
}
项目:intellij-ce-playground    文件:PythonPathEditor.java   
@Override
protected void doRemoveItems(int[] idxs, JList list) {
  List<Pair<VirtualFile, Integer>> removed = Lists.newArrayList();
  for (int i : idxs) {
    removed.add(Pair.create((VirtualFile)getListModel().get(i), i));
  }
  ListUtil.removeIndices(list, myPathListModel.remove(removed));
  list.updateUI();
  setModified(true);
}
项目:intellij-ce-playground    文件:AntClasspathEditorPanel.java   
public Form() {
  myClasspathList.setCellRenderer(new AntUIUtil.ClasspathRenderer());

  myUpdatables.add(ListUtil.addRemoveListener(myRemoveButton, myClasspathList));
  myUpdatables.add(ListUtil.addMoveUpListener(myMoveUpButton, myClasspathList));
  myUpdatables.add(ListUtil.addMoveDownListener(myMoveDownButton, myClasspathList));
}
项目:tools-idea    文件:DeleteBookmarkAction.java   
@Override
public void actionPerformed(AnActionEvent e) {
  List<Bookmark> bookmarks = BookmarksAction.getSelectedBookmarks(myList);
  ListUtil.removeSelectedItems(myList);

  for (Bookmark bookmark : bookmarks) {
    BookmarkManager.getInstance(myProject).removeBookmark(bookmark);
  }
}
项目:tools-idea    文件:AntClasspathEditorPanel.java   
public Form() {
  myClasspathList.setCellRenderer(new AntUIUtil.ClasspathRenderer());

  myUpdatables.add(ListUtil.addRemoveListener(myRemoveButton, myClasspathList));
  myUpdatables.add(ListUtil.addMoveUpListener(myMoveUpButton, myClasspathList));
  myUpdatables.add(ListUtil.addMoveDownListener(myMoveDownButton, myClasspathList));
}
项目:consulo-apache-ant    文件:AntClasspathEditorPanel.java   
public Form() {
  myClasspathList.setCellRenderer(new AntUIUtil.ClasspathRenderer());

  myUpdatables.add(ListUtil.addRemoveListener(myRemoveButton, myClasspathList));
  myUpdatables.add(ListUtil.addMoveUpListener(myMoveUpButton, myClasspathList));
  myUpdatables.add(ListUtil.addMoveDownListener(myMoveDownButton, myClasspathList));
}
项目:consulo    文件:PopupChooserBuilder.java   
private MyListWrapper(final JList list) {
  super(UIUtil.isUnderAquaLookAndFeel() ? 0 : -1);
  list.setVisibleRowCount(15);
  setViewportView(list);

  if (myAutoselectOnMouseMove) {
    ListUtil.installAutoSelectOnMouseMove(list);
  }

  ScrollingUtil.installActions(list);

  setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
  myList = list;
}
项目:consulo    文件:RecentProjectPanel.java   
@Override
public void mouseReleased(MouseEvent e) {
  final Point point = e.getPoint();
  final MyList list = MyList.this;
  final int index = list.locationToIndex(point);
  if (index != -1) {
    if (getCloseIconRect(index).contains(point)) {
      e.consume();
      final Object element = getModel().getElementAt(index);
      removeRecentProjectElement(element);
      ListUtil.removeSelectedItems(MyList.this);
    }
  }
}
项目:consulo    文件:DeleteBookmarkAction.java   
@Override
public void actionPerformed(AnActionEvent e) {
  List<Bookmark> bookmarks = BookmarksAction.getSelectedBookmarks(myList);
  ListUtil.removeSelectedItems(myList);

  for (Bookmark bookmark : bookmarks) {
    BookmarkManager.getInstance(myProject).removeBookmark(bookmark);
  }
}
项目:intellij-ce-playground    文件:HintUpdateSupply.java   
private static boolean isSelectedByMouse(@NotNull JComponent c) {
  return Boolean.TRUE.equals(c.getClientProperty(ListUtil.SELECTED_BY_MOUSE_EVENT));
}
项目:intellij-ce-playground    文件:JBMovePanel.java   
@Override
public void actionPerformed(AnActionEvent e) {
  ListUtil.moveSelectedItemsUp(myRightList); 
}
项目:intellij-ce-playground    文件:JBMovePanel.java   
@Override
public void actionPerformed(AnActionEvent e) {
  ListUtil.moveSelectedItemsDown(myRightList);
}
项目:intellij-ce-playground    文件:MoveBookmarkDownAction.java   
@Override
public void actionPerformed(AnActionEvent e) {
  ListUtil.moveSelectedItemsDown(myList);
  BookmarkManager.getInstance(myProject).moveBookmarkDown(BookmarksAction.getSelectedBookmarks(myList).get(0));
}
项目:intellij-ce-playground    文件:MoveBookmarkUpAction.java   
@Override
public void actionPerformed(AnActionEvent e) {
  ListUtil.moveSelectedItemsUp(myList);
  BookmarkManager.getInstance(myProject).moveBookmarkUp(BookmarksAction.getSelectedBookmarks(myList).get(0));
}
项目:intellij-ce-playground    文件:AntClasspathEditorPanel.java   
public void enableButtons(boolean enable) {
  for (Iterator<ListUtil.Updatable> iterator = myUpdatables.iterator(); iterator.hasNext();) {
    ListUtil.Updatable updatable = iterator.next();
    updatable.enable(enable);
  }
}
项目:tools-idea    文件:JBMovePanel.java   
@Override
public void actionPerformed(AnActionEvent e) {
  ListUtil.moveSelectedItemsUp(myRightList); 
}
项目:tools-idea    文件:JBMovePanel.java   
@Override
public void actionPerformed(AnActionEvent e) {
  ListUtil.moveSelectedItemsDown(myRightList);
}
项目:tools-idea    文件:MoveBookmarkDownAction.java   
@Override
public void actionPerformed(AnActionEvent e) {
  ListUtil.moveSelectedItemsDown(myList);
  BookmarkManager.getInstance(myProject).moveBookmarkDown(BookmarksAction.getSelectedBookmarks(myList).get(0));
}
项目:tools-idea    文件:MoveBookmarkUpAction.java   
@Override
public void actionPerformed(AnActionEvent e) {
  ListUtil.moveSelectedItemsUp(myList);
  BookmarkManager.getInstance(myProject).moveBookmarkUp(BookmarksAction.getSelectedBookmarks(myList).get(0));
}
项目:tools-idea    文件:AntClasspathEditorPanel.java   
public void enableButtons(boolean enable) {
  for (Iterator<ListUtil.Updatable> iterator = myUpdatables.iterator(); iterator.hasNext();) {
    ListUtil.Updatable updatable = iterator.next();
    updatable.enable(enable);
  }
}
项目:consulo-apache-ant    文件:AntClasspathEditorPanel.java   
public void enableButtons(boolean enable) {
  for (Iterator<ListUtil.Updatable> iterator = myUpdatables.iterator(); iterator.hasNext();) {
    ListUtil.Updatable updatable = iterator.next();
    updatable.enable(enable);
  }
}
项目:consulo    文件:HintUpdateSupply.java   
private static boolean isSelectedByMouse(@Nonnull JComponent c) {
  return Boolean.TRUE.equals(c.getClientProperty(ListUtil.SELECTED_BY_MOUSE_EVENT));
}
项目:consulo    文件:JBMovePanel.java   
@Override
public void actionPerformed(AnActionEvent e) {
  ListUtil.moveSelectedItemsUp(myRightList); 
}
项目:consulo    文件:JBMovePanel.java   
@Override
public void actionPerformed(AnActionEvent e) {
  ListUtil.moveSelectedItemsDown(myRightList);
}
项目:consulo    文件:MoveBookmarkDownAction.java   
@Override
public void actionPerformed(AnActionEvent e) {
  ListUtil.moveSelectedItemsDown(myList);
  BookmarkManager.getInstance(myProject).moveBookmarkDown(BookmarksAction.getSelectedBookmarks(myList).get(0));
}
项目:consulo    文件:MoveBookmarkUpAction.java   
@Override
public void actionPerformed(AnActionEvent e) {
  ListUtil.moveSelectedItemsUp(myList);
  BookmarkManager.getInstance(myProject).moveBookmarkUp(BookmarksAction.getSelectedBookmarks(myList).get(0));
}