Package org.waveprotocol.wave.client.editor

Examples of org.waveprotocol.wave.client.editor.NodeMutationHandler


    ElementHandlerRegistry elementRegistry = registries.getElementHandlerRegistry();

    // bootstrapping for new nodes
    if (oldLevel == null) {
      NodeMutationHandler mutationHandler = elementRegistry.getMutationHandler(e);
      if (mutationHandler instanceof PermanentMutationHandler) {
        e.setNodeMutationHandler(mutationHandler);
      }
      oldLevel = Level.SHELVED;
    }

    boolean notRendered = (e.getRenderer() == AgentAdapter.noRenderer);
    assert notRendered == (oldLevel == Level.SHELVED) : "oldLevel: " + oldLevel + " notRendered:"+notRendered;
    boolean shouldBeRendered = level.isAtLeast(Level.RENDERED);

    // Increasing level
    switch (oldLevel) {
      case SHELVED: // -> RENDERED
        if (level.isAtMost(Level.SHELVED)) break;

        setupRenderer(e, true);
        if (e == fullRawSubstrate.getDocumentElement()) {
          initRootElementRendering(true);
        }
        e.setNodeMutationHandler(elementRegistry.getMutationHandler(e));

      case RENDERED: // -> INTERACTIVE
        if (level.isAtMost(Level.RENDERED)) break;

        e.setNodeEventHandler(elementRegistry.getEventHandler(e));
        maybeSetupGwtWidget(e);

      case INTERACTIVE: // -> EDITING
        if (level.isAtMost(Level.INTERACTIVE)) break;

        maybeSetupModeNotifications(e);
        break;
    }

    // Decreasing level
    switch (oldLevel) {
      case EDITING: // -> INTERACTIVE
        if (level.isAtLeast(Level.EDITING)) break;
        // No need to cleanup mode notifications

      case INTERACTIVE: // -> RENDERED
        if (level.isAtLeast(Level.INTERACTIVE)) break;

        maybeSetupGwtWidget(e);
        e.setNodeEventHandler(null);

      case RENDERED: // -> SHELVED
        if (level.isAtLeast(Level.RENDERED)) break;

        NodeMutationHandler mutationHandler = elementRegistry.getMutationHandler(e);
        if (mutationHandler instanceof PermanentMutationHandler) {
          e.setNodeMutationHandler(mutationHandler);
        } else {
          e.setNodeMutationHandler(null);
        }
View Full Code Here


    ElementHandlerRegistry elementRegistry = registries.getElementHandlerRegistry();

    // bootstrapping for new nodes
    if (oldLevel == null) {
      NodeMutationHandler mutationHandler = elementRegistry.getMutationHandler(e);
      if (mutationHandler instanceof PermanentMutationHandler) {
        e.setNodeMutationHandler(mutationHandler);
      }
      oldLevel = Level.SHELVED;
    }

    boolean notRendered = (e.getRenderer() == AgentAdapter.noRenderer);
    assert notRendered == (oldLevel == Level.SHELVED) : "oldLevel: " + oldLevel + " notRendered:"+notRendered;
    boolean shouldBeRendered = level.isAtLeast(Level.RENDERED);

    // Increasing level
    switch (oldLevel) {
      case SHELVED: // -> RENDERED
        if (level.isAtMost(Level.SHELVED)) break;

        setupRenderer(e, true);
        if (e == fullRawSubstrate.getDocumentElement()) {
          initRootElementRendering(true);
        }
        e.setNodeMutationHandler(elementRegistry.getMutationHandler(e));

      case RENDERED: // -> INTERACTIVE
        if (level.isAtMost(Level.RENDERED)) break;

        e.setNodeEventHandler(elementRegistry.getEventHandler(e));
        maybeSetupGwtWidget(e);

      case INTERACTIVE: // -> EDITING
        if (level.isAtMost(Level.INTERACTIVE)) break;

        maybeSetupModeNotifications(e);
        break;
    }

    // Decreasing level
    switch (oldLevel) {
      case EDITING: // -> INTERACTIVE
        if (level.isAtLeast(Level.EDITING)) break;
        // No need to cleanup mode notifications

      case INTERACTIVE: // -> RENDERED
        if (level.isAtLeast(Level.INTERACTIVE)) break;

        maybeSetupGwtWidget(e);
        e.setNodeEventHandler(null);

      case RENDERED: // -> SHELVED
        if (level.isAtLeast(Level.RENDERED)) break;

        NodeMutationHandler mutationHandler = elementRegistry.getMutationHandler(e);
        if (mutationHandler instanceof PermanentMutationHandler) {
          e.setNodeMutationHandler(mutationHandler);
        } else {
          e.setNodeMutationHandler(null);
        }
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.client.editor.NodeMutationHandler

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.