@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(); }
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; }
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(); }
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; }
@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(); }
public void iterateRenderers(InternalIterator<NodeRenderer> iterator) { for (final NodeRenderer renderer : myRepresentationNodes) { final boolean shouldContinue = iterator.visit(renderer); if (!shouldContinue) { break; } } }
public void iterateRenderers(InternalIterator<NodeRenderer> iterator) { for(final NodeRenderer renderer : myRepresentationNodes) { final boolean shouldContinue = iterator.visit(renderer); if(!shouldContinue) { break; } } }