Java 类com.intellij.ui.speedSearch.ElementFilter 实例源码

项目:intellij-ce-playground    文件:FilteringTreeBuilder.java   
public FilteringTreeBuilder(Tree tree,
                            ElementFilter filter,
                            AbstractTreeStructure structure,
                            @Nullable Comparator<NodeDescriptor> comparator) {
  super(tree,
        (DefaultTreeModel)tree.getModel(),
        structure instanceof FilteringTreeStructure ? structure
                                                    : new FilteringTreeStructure(filter, structure),
        comparator);

  myTree = tree;
  initRootNode();

  if (filter instanceof ElementFilter.Active) {
    ((ElementFilter.Active)filter).addListener(new ElementFilter.Listener() {
      @Override
      public ActionCallback update(final Object preferredSelection, final boolean adjustSelection, final boolean now) {
        return refilter(preferredSelection, adjustSelection, now);
      }
    }, this);
  }

  myTree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() {
    @Override
    public void valueChanged(TreeSelectionEvent e) {
      TreePath newPath = e.getNewLeadSelectionPath();
      if (newPath != null) {
        Object element = getElementFor(newPath.getLastPathComponent());
        if (element != null) {
          myLastSuccessfulSelect = element;
        }
      }
    }
  });
}
项目:intellij-ce-playground    文件:FilteringTreeStructure.java   
public FilteringTreeStructure(@NotNull ElementFilter filter, @NotNull AbstractTreeStructure originalStructure, boolean initNow) {
  //noinspection unchecked
  myFilter = filter;
  myBaseStructure = originalStructure;
  myRoot = new FilteringNode(null, myBaseStructure.getRootElement());
  if (initNow) {
    rebuild();
  }
}
项目:intellij-ce-playground    文件:ListPopupModel.java   
public ListPopupModel(ElementFilter filter, SpeedSearch speedSearch, ListPopupStep step) {
  myFilter = filter;
  myStep = step;
  mySpeedSearch = speedSearch;
  myOriginalList = new ArrayList<Object>(step.getValues());
  rebuildLists();
}
项目:tools-idea    文件:FilteringTreeBuilder.java   
public FilteringTreeBuilder(Tree tree,
                            ElementFilter filter,
                            AbstractTreeStructure structure,
                            @Nullable Comparator<NodeDescriptor> comparator) {
  super(tree,
        (DefaultTreeModel)tree.getModel(),
        structure instanceof FilteringTreeStructure ? structure
                                                    : new FilteringTreeStructure(filter, structure),
        comparator);

  myTree = tree;
  initRootNode();

  if (filter instanceof ElementFilter.Active) {
    ((ElementFilter.Active)filter).addListener(new ElementFilter.Listener() {
      public ActionCallback update(final Object preferredSelection, final boolean adjustSelection, final boolean now) {
        return refilter(preferredSelection, adjustSelection, now);
      }
    }, this);
  }

  myTree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() {
    public void valueChanged(TreeSelectionEvent e) {
      TreePath newPath = e.getNewLeadSelectionPath();
      if (newPath != null) {
        Object element = getElementFor(newPath.getLastPathComponent());
        if (element != null) {
          myLastSuccessfulSelect = element;
        }
      }
    }
  });
}
项目:tools-idea    文件:FilteringTreeStructure.java   
public FilteringTreeStructure(@NotNull ElementFilter filter, @NotNull AbstractTreeStructure originalStructure, boolean initNow) {
  //noinspection unchecked
  myFilter = filter;
  myBaseStructure = originalStructure;
  myRoot = new FilteringNode(null, myBaseStructure.getRootElement());
  if (initNow) {
    rebuild();
  }
}
项目:tools-idea    文件:ListPopupModel.java   
public ListPopupModel(ElementFilter filter, SpeedSearch speedSearch, ListPopupStep step) {
  myFilter = filter;
  myStep = step;
  mySpeedSearch = speedSearch;
  myOriginalList = new ArrayList<Object>(step.getValues());
  rebuildLists();
}
项目:consulo    文件:FilteringTreeBuilder.java   
public FilteringTreeBuilder(Tree tree, ElementFilter filter, AbstractTreeStructure structure, @Nullable Comparator<NodeDescriptor> comparator) {
  super(tree, (DefaultTreeModel)tree.getModel(), structure instanceof FilteringTreeStructure ? structure : new FilteringTreeStructure(filter, structure),
        comparator);

  myTree = tree;
  initRootNode();

  if (filter instanceof ElementFilter.Active) {
    ((ElementFilter.Active)filter).addListener(new ElementFilter.Listener() {
      @Override
      public ActionCallback update(final Object preferredSelection, final boolean adjustSelection, final boolean now) {
        return refilter(preferredSelection, adjustSelection, now);
      }
    }, this);
  }

  myTree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() {
    @Override
    public void valueChanged(TreeSelectionEvent e) {
      TreePath newPath = e.getNewLeadSelectionPath();
      if (newPath != null) {
        Object element = getElementFor(newPath.getLastPathComponent());
        if (element != null) {
          myLastSuccessfulSelect = element;
        }
      }
    }
  });
}
项目:consulo    文件:FilteringTreeStructure.java   
public FilteringTreeStructure(@Nonnull ElementFilter filter, @Nonnull AbstractTreeStructure originalStructure, boolean initNow) {
  //noinspection unchecked
  myFilter = filter;
  myBaseStructure = originalStructure;
  myRoot = new FilteringNode(null, myBaseStructure.getRootElement());
  if (initNow) {
    rebuild();
  }
}
项目:consulo    文件:ListPopupModel.java   
public ListPopupModel(ElementFilter filter, SpeedSearch speedSearch, ListPopupStep step) {
  myFilter = filter;
  myStep = step;
  mySpeedSearch = speedSearch;
  myOriginalList = new ArrayList<>(step.getValues());
  rebuildLists();
}
项目:intellij-ce-playground    文件:FilteringTreeStructure.java   
public FilteringTreeStructure(@NotNull ElementFilter filter, @NotNull AbstractTreeStructure originalStructure) {
  this(filter, originalStructure, true);
}
项目:intellij-ce-playground    文件:OptionsEditorContext.java   
public OptionsEditorContext(ElementFilter.Active filter) {
  myFilter = filter;
}
项目:intellij-ce-playground    文件:OptionsEditorContext.java   
@NotNull
ElementFilter<Configurable> getFilter() {
  return myFilter;
}
项目:tools-idea    文件:FilteringTreeStructure.java   
public FilteringTreeStructure(@NotNull ElementFilter filter, @NotNull AbstractTreeStructure originalStructure) {
  this(filter, originalStructure, true);
}
项目:tools-idea    文件:OptionsEditorContext.java   
public OptionsEditorContext(ElementFilter.Active filter) {
  myFilter = filter;
}
项目:tools-idea    文件:OptionsEditorContext.java   
@NotNull
ElementFilter<Configurable> getFilter() {
  return myFilter;
}
项目:consulo    文件:FilteringTreeStructure.java   
public FilteringTreeStructure(@Nonnull ElementFilter filter, @Nonnull AbstractTreeStructure originalStructure) {
  this(filter, originalStructure, true);
}
项目:consulo    文件:OptionsEditorContext.java   
public OptionsEditorContext(ElementFilter.Active filter) {
  myFilter = filter;
}
项目:consulo    文件:OptionsEditorContext.java   
@Nonnull
ElementFilter<Configurable> getFilter() {
  return myFilter;
}