Package org.waveprotocol.wave.model.document.AnnotationBehaviour

Examples of org.waveprotocol.wave.model.document.AnnotationBehaviour.DefaultAnnotationBehaviour


    painterRegistry.registerBoundaryFunction(BOUNDARY_KEYS, boundaryFunc);
  }

  private static void registerBehaviour(AnnotationRegistry registry, String prefix) {
    registry.registerBehaviour(prefix,
        new DefaultAnnotationBehaviour(AnnotationFamily.CONTENT) {
      @Override
      public BiasDirection getBias(final StringMap<Object> left, final StringMap<Object> right,
          CursorDirection cursor) {
        final Box<BiasDirection> ret = Box.create(BiasDirection.NEITHER);
        KEYS.each(new Proc() {
View Full Code Here


     *   - style-like (no bias change, inherits inside)
     *   - link-like (bias away, with priority overriding containers).
     *   - spell-like (metadata, never inherits)
     */
    AnnotationRegistry registry = root.createExtension();
    registry.registerBehaviour(STYLE_KEY, new DefaultAnnotationBehaviour(AnnotationFamily.CONTENT));
    registry.registerBehaviour(LINK_KEY, new AnnotationBehaviour() {
      public BiasDirection getBias(StringMap<Object> left, StringMap<Object> right,
          CursorDirection cursor) {
        assert left.containsKey(LINK_KEY) && right.containsKey(LINK_KEY);
        return left.get(LINK_KEY) == null ? BiasDirection.LEFT : BiasDirection.RIGHT; // away
View Full Code Here

     * Create a registry that has two types of behaviours:
     *   - style-like (no bias change, inherits inside)
     *   - link-like (bias away, with priority overriding containers).
     */
    REGISTRY = AnnotationRegistryImpl.ROOT;
    REGISTRY.registerBehaviour(STYLE_KEY, new DefaultAnnotationBehaviour(AnnotationFamily.CONTENT));
    REGISTRY.registerBehaviour(LINK_KEY, new AnnotationBehaviour() {
      public BiasDirection getBias(StringMap<Object> left, StringMap<Object> right,
          CursorDirection cursor) {
        assert left.containsKey(LINK_KEY) && right.containsKey(LINK_KEY);
        return left.get(LINK_KEY) == null ? BiasDirection.LEFT : BiasDirection.RIGHT; // away
View Full Code Here

  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

  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

  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

  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

    painterRegistry.registerBoundaryFunction(BOUNDARY_KEYS, boundaryFunc);
  }

  private static void registerBehaviour(AnnotationRegistry registry, String prefix) {
    registry.registerBehaviour(prefix,
        new DefaultAnnotationBehaviour(AnnotationFamily.CONTENT) {
      @Override
      public BiasDirection getBias(final StringMap<Object> left, final StringMap<Object> right,
          CursorDirection cursor) {
        final Box<BiasDirection> ret = Box.create(BiasDirection.NEITHER);
        KEYS.each(new Proc() {
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.model.document.AnnotationBehaviour.DefaultAnnotationBehaviour

Copyright © 2018 www.massapicom. 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.