Java 类com.intellij.util.treeWithCheckedNodes.SelectionManager 实例源码

项目:intellij-ce-playground    文件:VcsStructureChooser.java   
public VcsStructureChooser(@NotNull Project project,
                           String title,
                           Collection<VirtualFile> initialSelection,
                           @NotNull List<VirtualFile> initialRoots) {
  super(project, true);
  setTitle(title);
  myProject = project;
  myInitialRoots = initialRoots;
  mySelectionManager = new SelectionManager(MAX_FOLDERS, 500, MyNodeConverter.getInstance());

  init();

  mySelectionManager.setSelection(initialSelection);

  checkEmpty();
}
项目:consulo    文件:VcsStructureChooser.java   
public VcsStructureChooser(@Nonnull Project project,
                           @Nonnull String title,
                           @Nonnull Collection<VirtualFile> initialSelection,
                           @Nonnull List<VirtualFile> roots) {
  super(project, true);
  setTitle(title);
  myProject = project;
  myRoots = roots;
  mySelectionManager = new SelectionManager(MAX_FOLDERS, 500, MyNodeConverter.getInstance());
  myModulesSet = calculateModules(roots);

  init();

  mySelectionManager.setSelection(initialSelection);

  checkEmpty();
}
项目:tools-idea    文件:VcsStructureChooser.java   
public VcsStructureChooser(final AbstractVcs vcs,
                           final String title,
                           final Collection<VirtualFile> initialSelection,
                           List<VirtualFile> initialRoots) {
  super(vcs.getProject(), true);
  myInitialRoots = initialRoots;
  setTitle(title);
  myVcs = vcs;
  mySelectionManager = new SelectionManager(MAX_FOLDERS, 500, MyNodeConvertor.getInstance());
  init();
  mySelectionManager.setSelection(initialSelection);
  checkEmptyness();
}
项目:intellij-ce-playground    文件:VcsStructureChooser.java   
private MyCheckboxTreeCellRenderer(final SelectionManager selectionManager,
                                   Map<VirtualFile, String> modulesSet,
                                   final Project project,
                                   final JTree tree,
                                   final Collection<VirtualFile> roots) {
  super(new BorderLayout());
  mySelectionManager = selectionManager;
  myModulesSet = modulesSet;
  myRoots = roots;
  setBackground(tree.getBackground());
  myColoredRenderer = new ColoredTreeCellRenderer() {
    @Override
    public void customizeCellRenderer(JTree tree,
                                      Object value,
                                      boolean selected,
                                      boolean expanded,
                                      boolean leaf,
                                      int row,
                                      boolean hasFocus) {
      append(value.toString());
    }
  };
  myFictive = new JBList();
  myFictive.setBackground(tree.getBackground());
  myFictive.setSelectionBackground(UIUtil.getListSelectionBackground());
  myFictive.setSelectionForeground(UIUtil.getListSelectionForeground());

  myTextRenderer = new WithModulesListCellRenderer(project, myModulesSet) {
    @Override
    protected void putParentPath(Object value, FilePath path, FilePath self) {
      if (myRoots.contains(self.getVirtualFile())) {
        super.putParentPath(value, path, self);
      }
    }
  };
  myTextRenderer.setBackground(tree.getBackground());

  myCheckbox = new JCheckBox();
  myCheckbox.setBackground(tree.getBackground());
  myEmpty = new JLabel("");

  add(myCheckbox, BorderLayout.WEST);
  add(myTextRenderer, BorderLayout.CENTER);
  myCheckbox.setVisible(true);
}
项目:tools-idea    文件:VcsStructureChooser.java   
private MyCheckboxTreeCellRenderer(final SelectionManager selectionManager, Map<VirtualFile, String> modulesSet, final Project project,
                                   final JTree tree, final Collection<VirtualFile> roots) {
  super(new BorderLayout());
  mySelectionManager = selectionManager;
  myModulesSet = modulesSet;
  myRoots = roots;
  setBackground(tree.getBackground());
  myColoredRenderer = new ColoredTreeCellRenderer() {
    @Override
    public void customizeCellRenderer(JTree tree,
                                      Object value,
                                      boolean selected,
                                      boolean expanded,
                                      boolean leaf,
                                      int row,
                                      boolean hasFocus) {
      append(value.toString());
    }
  };
  myFictive = new JBList();
  myFictive.setBackground(tree.getBackground());
  myFictive.setSelectionBackground(UIUtil.getListSelectionBackground());
  myFictive.setSelectionForeground(UIUtil.getListSelectionForeground());

  myTextRenderer = new WithModulesListCellRenderer(project, myModulesSet) {
    @Override
    protected void putParentPath(Object value, FilePath path, FilePath self) {
      if (myRoots.contains(self.getVirtualFile())) {
        super.putParentPath(value, path, self);
      }
    }
  };
  myTextRenderer.setBackground(tree.getBackground());

  myCheckbox = new JCheckBox();
  myCheckbox.setBackground(tree.getBackground());
  myEmpty = new JLabel("");

  add(myCheckbox, BorderLayout.WEST);
  add(myTextRenderer, BorderLayout.CENTER);
  myCheckbox.setVisible(true);
}
项目:consulo    文件:VcsStructureChooser.java   
private MyCheckboxTreeCellRenderer(@Nonnull SelectionManager selectionManager,
                                   @Nonnull Map<VirtualFile, String> modulesSet,
                                   @Nonnull Project project,
                                   @Nonnull JTree tree,
                                   @Nonnull Collection<VirtualFile> roots) {
  super(new BorderLayout());
  mySelectionManager = selectionManager;
  myModulesSet = modulesSet;
  myRoots = roots;
  setBackground(tree.getBackground());
  myColoredRenderer = new ColoredTreeCellRenderer() {
    @Override
    public void customizeCellRenderer(@Nonnull JTree tree,
                                      Object value,
                                      boolean selected,
                                      boolean expanded,
                                      boolean leaf,
                                      int row,
                                      boolean hasFocus) {
      append(value.toString());
    }
  };
  myFictive = new JBList();
  myFictive.setBackground(tree.getBackground());
  myFictive.setSelectionBackground(UIUtil.getListSelectionBackground());
  myFictive.setSelectionForeground(UIUtil.getListSelectionForeground());

  myTextRenderer = new WithModulesListCellRenderer(project, myModulesSet) {
    @Override
    protected void putParentPath(Object value, FilePath path, FilePath self) {
      if (myRoots.contains(self.getVirtualFile())) {
        super.putParentPath(value, path, self);
      }
    }
  };
  myTextRenderer.setBackground(tree.getBackground());

  myCheckbox = new JCheckBox();
  myCheckbox.setBackground(tree.getBackground());
  myEmpty = new JLabel("");

  add(myCheckbox, BorderLayout.WEST);
  add(myTextRenderer, BorderLayout.CENTER);
  myCheckbox.setVisible(true);
}