Examples of PainterRegistry


Examples of org.waveprotocol.wave.client.editor.content.PainterRegistry

   * @param augmenter paint function with wave link handling logic
   */
  @SuppressWarnings("deprecation")
  public static void register(Registries registries,
      LinkAttributeAugmenter augmenter) {
    PainterRegistry painterRegistry = registries.getPaintRegistry();
    LinkAnnotationHandler handler =
        new LinkAnnotationHandler(painterRegistry.getPainter());

    AnnotationRegistry annotationRegistry = registries.getAnnotationHandlerRegistry();
    annotationRegistry.registerHandler(AnnotationConstants.LINK_PREFIX, handler);
    // Don't register behaviour on the link/auto key, since an external agent
    // puts it there resulting in surprising behaviour mid-typing (e.g. if
    // the text is bold, the bold will suddenly get ended because of the link)
    registerBehaviour(annotationRegistry, AnnotationConstants.LINK_PREFIX);
    registerBehaviour(annotationRegistry, AnnotationConstants.LINK_MANUAL);
    registerBehaviour(annotationRegistry, AnnotationConstants.LINK_WAVE);

    painterRegistry.registerPaintFunction(KEYS, new RenderFunc(augmenter));
    painterRegistry.registerBoundaryFunction(BOUNDARY_KEYS, boundaryFunc);
  }
View Full Code Here

Examples of org.waveprotocol.wave.client.editor.content.PainterRegistry

  FakeTimerService timerService = new FakeTimerService();

  public TestDocumentContext<Node, Element, Text> createAnnotationContext() {

    final AnnotationPainter painter = new AnnotationPainter(timerService);
    final PainterRegistry painterRegistry =
        new PainterRegistryImpl("l:p", "l:b", painter);
    painterRegistry.registerPaintFunction(rangeKeys, new PaintFunction() {
      @Override
      public Map<String, String> apply(Map<String, Object> from, boolean isEditing) {
        Map<String, String> ret = new HashMap<String, String>();
        for (Map.Entry<String, Object> entry : from.entrySet()) {
          ret.put(entry.getKey(), (String) entry.getValue());
        }
        return ret;
      }
    });
    boundaryKeys.each(new Proc() {
      @Override
      public void apply(String key) {
        final String k = key;
        painterRegistry.registerBoundaryFunction(boundaryKeys, new BoundaryFunction() {
          @Override
          public <N, E extends N, T extends N> E apply(LocalDocument<N, E, T> localDoc, E parent,
              N nodeAfter, Map<String, Object> before, Map<String, Object> after,
              boolean isEditing) {
            Point.checkRelationship(localDoc, parent, nodeAfter, "Test boundary function");
View Full Code Here

Examples of org.waveprotocol.wave.client.editor.content.PainterRegistry

    return editor;
  }

  private static void registerHandlers(Registries registries) {
    AnnotationRegistry annotationRegistry = registries.getAnnotationHandlerRegistry();
    PainterRegistry paintRegistry = registries.getPaintRegistry();
    ElementHandlerRegistry elementHandlerRegistry = registries.getElementHandlerRegistry();

    LineContainers.setTopLevelContainerTagname(Blips.BODY_TAGNAME);
    LineRendering.registerContainer(Blips.BODY_TAGNAME, elementHandlerRegistry);
    TestInlineDoodad.register(elementHandlerRegistry);
View Full Code Here

Examples of org.waveprotocol.wave.client.editor.content.PainterRegistry

   *
   * @param registries registry to register on
   * @return the new handler
   */
  public static void register(Registries registries) {
    PainterRegistry painterRegistry = registries.getPaintRegistry();
    TitleAnnotationHandler handler = new TitleAnnotationHandler(painterRegistry.getPainter());
    registries.getAnnotationHandlerRegistry().registerHandler(PREFIX, handler);
    registries.getAnnotationHandlerRegistry().registerBehaviour(PREFIX,
        new DefaultAnnotationBehaviour(AnnotationFamily.CONTENT));
    painterRegistry.registerPaintFunction(KEYS, renderFunc);
  }
View Full Code Here

Examples of org.waveprotocol.wave.client.editor.content.PainterRegistry

   *
   * @param registries registry to register on
   * @return the new handler
   */
  public static void register(Registries registries) {
    PainterRegistry painterRegistry = registries.getPaintRegistry();
    StyleAnnotationHandler handler = new StyleAnnotationHandler(painterRegistry.getPainter());
    registries.getAnnotationHandlerRegistry().registerHandler(AnnotationConstants.STYLE_PREFIX, handler);
    registries.getAnnotationHandlerRegistry().registerBehaviour(AnnotationConstants.STYLE_PREFIX,
        new DefaultAnnotationBehaviour(AnnotationFamily.CONTENT));
    painterRegistry.registerPaintFunction(AnnotationConstants.STYLE_KEYS, renderFunc);
  }
View Full Code Here

Examples of org.waveprotocol.wave.client.editor.content.PainterRegistry

    return editor;
  }

  private static void registerHandlers(Registries registries) {
    AnnotationRegistry annotationRegistry = registries.getAnnotationHandlerRegistry();
    PainterRegistry paintRegistry = registries.getPaintRegistry();
    ElementHandlerRegistry elementHandlerRegistry = registries.getElementHandlerRegistry();

    ImageThumbnail.register(elementHandlerRegistry,
        new FakeAttachmentsManager(), null);
View Full Code Here

Examples of org.waveprotocol.wave.client.editor.content.PainterRegistry

   *
   * @param registries registry to register on
   * @return the new handler
   */
  public static void register(Registries registries) {
    PainterRegistry painterRegistry = registries.getPaintRegistry();
    StyleAnnotationHandler handler = new StyleAnnotationHandler(painterRegistry.getPainter());
    registries.getAnnotationHandlerRegistry().registerHandler(PREFIX, handler);
    registries.getAnnotationHandlerRegistry().registerBehaviour(PREFIX,
        new DefaultAnnotationBehaviour(AnnotationFamily.CONTENT));
    painterRegistry.registerPaintFunction(KEYS, renderFunc);
  }
View Full Code Here

Examples of org.waveprotocol.wave.client.editor.content.PainterRegistry

   *
   * @param registries registry to register on
   * @return the new handler
   */
  public static void register(Registries registries) {
    PainterRegistry painterRegistry = registries.getPaintRegistry();
    TitleAnnotationHandler handler = new TitleAnnotationHandler(painterRegistry.getPainter());
    registries.getAnnotationHandlerRegistry().registerHandler(PREFIX, handler);
    registries.getAnnotationHandlerRegistry().registerBehaviour(PREFIX,
        new DefaultAnnotationBehaviour(AnnotationFamily.CONTENT));
    painterRegistry.registerPaintFunction(KEYS, renderFunc);
  }
View Full Code Here

Examples of org.waveprotocol.wave.client.editor.content.PainterRegistry

   * @param augmenter paint function with wave link handling logic
   */
  @SuppressWarnings("deprecation")
  public static void register(Registries registries,
      LinkAttributeAugmenter augmenter) {
    PainterRegistry painterRegistry = registries.getPaintRegistry();
    LinkAnnotationHandler handler =
        new LinkAnnotationHandler(painterRegistry.getPainter());

    AnnotationRegistry annotationRegistry = registries.getAnnotationHandlerRegistry();
    annotationRegistry.registerHandler(PREFIX, handler);
    // Don't register behaviour on the link/auto key, since an external agent
    // puts it there resulting in surprising behaviour mid-typing (e.g. if
    // the text is bold, the bold will suddenly get ended because of the link)
    registerBehaviour(annotationRegistry, KEY);
    registerBehaviour(annotationRegistry, MANUAL_KEY);
    registerBehaviour(annotationRegistry, WAVE_KEY);

    painterRegistry.registerPaintFunction(KEYS, new RenderFunc(augmenter));
    painterRegistry.registerBoundaryFunction(BOUNDARY_KEYS, boundaryFunc);
  }
View Full Code Here

Examples of org.waveprotocol.wave.client.editor.content.PainterRegistry

    return editor;
  }

  private static void registerHandlers(Registries registries) {
    AnnotationRegistry annotationRegistry = registries.getAnnotationHandlerRegistry();
    PainterRegistry paintRegistry = registries.getPaintRegistry();
    ElementHandlerRegistry elementHandlerRegistry = registries.getElementHandlerRegistry();

    ImageThumbnail.register(elementHandlerRegistry,
        new FakeAttachmentsManager(), null);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.