/** * Produce a string representation of the Editor hierarchy being controlled by * {@code driver}. */ public static String toString(EditorDriver<?> driver) { StringBuilder sb = new StringBuilder(); driver.accept(new EditorHierarchyPrinter(sb)); return sb.toString(); }
public static DelegateMap of(EditorDriver<?> driver, KeyMethod key) { final DelegateMap toReturn = new DelegateMap(key); driver.accept(new EditorVisitor() { @Override public <T> void endVisit(EditorContext<T> ctx) { toReturn.put(ctx.getAbsolutePath(), ctx.getEditor()); @SuppressWarnings("unchecked") AbstractEditorDelegate<T, ?> delegate = (AbstractEditorDelegate<T, ?>) ctx.getEditorDelegate(); if (delegate != null) { toReturn.put(delegate.getObject(), delegate); } } }); return toReturn; }
/** * Produce a string representation of the Editor hierarchy being controlled by * {@code driver}. */ public static String toString(EditorDriver<?> driver) { StringBuilder sb = new StringBuilder(); driver.accept(new EditorHierarchyPrinter(sb)); return sb.toString(); }
/** * Produce a string representation of the Editor hierarchy being controlled by * {@code driver}. */ public static String toString(EditorDriver<?> driver) { StringBuilder sb = new StringBuilder(); driver.accept(new EditorHierarchyPrinter(sb)); return sb.toString(); }
public static DelegateMap of(EditorDriver<?> driver, KeyMethod key) { final DelegateMap toReturn = new DelegateMap(key); driver.accept(new EditorVisitor() { @Override public <T> void endVisit(EditorContext<T> ctx) { toReturn.put(ctx.getAbsolutePath(), ctx.getEditor()); @SuppressWarnings("unchecked") AbstractEditorDelegate<T, ?> delegate = (AbstractEditorDelegate<T, ?>) ctx.getEditorDelegate(); if (delegate != null) { toReturn.put(delegate.getObject(), delegate); } } }); return toReturn; }
public static DelegateMap of(EditorDriver<?> driver, KeyMethod key) { final DelegateMap toReturn = new DelegateMap(key); driver.accept(new EditorVisitor() { @Override public <T> void endVisit(EditorContext<T> ctx) { toReturn.put(ctx.getAbsolutePath(), ctx.getEditor()); @SuppressWarnings("unchecked") AbstractEditorDelegate<T, ?> delegate = (AbstractEditorDelegate<T, ?>) ctx.getEditorDelegate(); if (delegate != null) { toReturn.put(delegate.getObject(), delegate); } } }); return toReturn; }