Java 类com.intellij.util.containers.InternalIterator 实例源码

项目:intellij-ce-playground    文件:UserRenderersConfigurable.java   
@Override
public void reset(@NotNull NodeRendererSettings settings) {
  myRendererChooser.removeAllElements();
  final RendererConfiguration rendererConfiguration = settings.getCustomRenderers();
  final ArrayList<NodeRenderer> elementsToSelect = new ArrayList<NodeRenderer>(1);
  rendererConfiguration.iterateRenderers(new InternalIterator<NodeRenderer>() {
    @Override
    public boolean visit(final NodeRenderer renderer) {
      final NodeRenderer clonedRenderer = (NodeRenderer)renderer.clone();
      myRendererChooser.addElement(clonedRenderer, clonedRenderer.isEnabled());
      if (elementsToSelect.size() == 0) {
        elementsToSelect.add(clonedRenderer);
      }
      return true;
    }
  });
  myRendererChooser.selectElements(elementsToSelect);
  updateCurrentRenderer(elementsToSelect);
  myRendererDataConfigurable.reset();
}
项目:intellij-ce-playground    文件:NodeRendererSettings.java   
public List<NodeRenderer> getAllRenderers() {
  // the order is important as the renderers are applied according to it
  final List<NodeRenderer> allRenderers = new ArrayList<NodeRenderer>();

  // user defined renderers must come first
  myCustomRenderers.iterateRenderers(new InternalIterator<NodeRenderer>() {
    public boolean visit(final NodeRenderer renderer) {
      allRenderers.add(renderer);
      return true;
    }
  });

  // plugins registered renderers come after that
  allRenderers.addAll(myPluginRenderers);
  Collections.addAll(allRenderers, NodeRenderer.EP_NAME.getExtensions());

  // now all predefined stuff
  allRenderers.add(myHexRenderer);
  allRenderers.add(myPrimitiveRenderer);
  Collections.addAll(allRenderers, myAlternateCollectionRenderers);
  allRenderers.add(myToStringRenderer);
  allRenderers.add(myArrayRenderer);
  allRenderers.add(myClassRenderer);
  return allRenderers;
}
项目:tools-idea    文件:UserRenderersConfigurable.java   
public void reset() {
  myRendererChooser.removeAllElements();
  final RendererConfiguration rendererConfiguration = NodeRendererSettings.getInstance().getCustomRenderers();
  final ArrayList<NodeRenderer> elementsToSelect = new ArrayList<NodeRenderer>(1);
  rendererConfiguration.iterateRenderers(new InternalIterator<NodeRenderer>() {
    public boolean visit(final NodeRenderer renderer) {
      final NodeRenderer clonedRenderer = (NodeRenderer)renderer.clone();
      myRendererChooser.addElement(clonedRenderer, clonedRenderer.isEnabled());
      if (elementsToSelect.size() == 0) {
        elementsToSelect.add(clonedRenderer);
      }
      return true;
    }
  });
  myRendererChooser.selectElements(elementsToSelect);
  updateCurrentRenderer(elementsToSelect);
  myRendererDataConfigurable.reset();
}
项目:tools-idea    文件:NodeRendererSettings.java   
public List<NodeRenderer> getAllRenderers() {
  // the order is important as the renderers are applied according to it
  final List<NodeRenderer> allRenderers = new ArrayList<NodeRenderer>();
  allRenderers.add(myHexRenderer);
  allRenderers.add(myPrimitiveRenderer);
  allRenderers.addAll(myPluginRenderers);
  myCustomRenderers.iterateRenderers(new InternalIterator<NodeRenderer>() {
    public boolean visit(final NodeRenderer renderer) {
      allRenderers.add(renderer);
      return true;
    }
  });
  for (NodeRenderer myAlternateCollectionRenderer : myAlternateCollectionRenderers) {
    allRenderers.add(myAlternateCollectionRenderer);
  }
  allRenderers.add(myColorRenderer);
  allRenderers.add(myToStringRenderer);
  allRenderers.add(myArrayRenderer);
  allRenderers.add(myClassRenderer);
  return allRenderers;
}
项目:consulo-java    文件:UserRenderersConfigurable.java   
@Override
public void reset(@NotNull NodeRendererSettings settings)
{
    myRendererChooser.removeAllElements();
    final RendererConfiguration rendererConfiguration = settings.getCustomRenderers();
    final ArrayList<NodeRenderer> elementsToSelect = new ArrayList<NodeRenderer>(1);
    rendererConfiguration.iterateRenderers(new InternalIterator<NodeRenderer>()
    {
        @Override
        public boolean visit(final NodeRenderer renderer)
        {
            final NodeRenderer clonedRenderer = (NodeRenderer) renderer.clone();
            myRendererChooser.addElement(clonedRenderer, clonedRenderer.isEnabled());
            if(elementsToSelect.size() == 0)
            {
                elementsToSelect.add(clonedRenderer);
            }
            return true;
        }
    });
    myRendererChooser.selectElements(elementsToSelect);
    updateCurrentRenderer(elementsToSelect);
    myRendererDataConfigurable.reset();
}
项目:intellij-ce-playground    文件:RendererConfiguration.java   
public void iterateRenderers(InternalIterator<NodeRenderer> iterator) {
  for (final NodeRenderer renderer : myRepresentationNodes) {
    final boolean shouldContinue = iterator.visit(renderer);
    if (!shouldContinue) {
      break;
    }
  }
}
项目:tools-idea    文件:RendererConfiguration.java   
public void iterateRenderers(InternalIterator<NodeRenderer> iterator) {
  for (final NodeRenderer renderer : myRepresentationNodes) {
    final boolean shouldContinue = iterator.visit(renderer);
    if (!shouldContinue) {
      break;
    }
  }
}
项目:consulo-java    文件:RendererConfiguration.java   
public void iterateRenderers(InternalIterator<NodeRenderer> iterator)
{
    for(final NodeRenderer renderer : myRepresentationNodes)
    {
        final boolean shouldContinue = iterator.visit(renderer);
        if(!shouldContinue)
        {
            break;
        }
    }
}