Package org.waveprotocol.wave.model.document.operation

Examples of org.waveprotocol.wave.model.document.operation.Attributes


        }
      }

      RandomizerOperationComponent generate(final DocOpAutomaton a, final boolean valid) {
        final String tag = a.currentElementStartTag();
        final Attributes oldAttrs = a.currentElementStartAttributes();
        if (tag == null) {
          assert oldAttrs == null;
          return null;
        }
        assert oldAttrs != null;
View Full Code Here


      @Override
      RandomizerOperationComponent generate(final DocOpAutomaton a, boolean valid, Stage stage) {
        if (stage != Stage.S1_UNRESTRICTED) {
          return null;
        }
        final Attributes oldAttrs = a.currentElementStartAttributes();
        if (oldAttrs == null) {
          if (valid) {
            return null;
          }
        }
        if (!valid) {
          // TODO: bring this back.
          // several cases: invalid because of wrong old attributes, or invalid
          // because of schema violation of new attributes, or because no
          // element start here
          throw new RuntimeException("Not implemented");
        }
        AttributesUpdate u = generateRandomAttributesUpdate(valid,
            oldAttrs, new AttributesUpdateChecker() {
          @Override
          public ValidationResult check(AttributesUpdate u) {
            return a.checkReplaceAttributes(oldAttrs, oldAttrs.updateWith(u), null);
          }
        });

        if (u == null) {
          return null;
        }

        final Attributes newAttrs = oldAttrs.updateWith(u);
        return new RandomizerOperationComponent() {
          @Override
          public void apply(DocOpAutomaton a) {
            a.doReplaceAttributes(oldAttrs, newAttrs);
          }
View Full Code Here

      @Override
      RandomizerOperationComponent generate(final DocOpAutomaton a, boolean valid, Stage stage) {
        if (stage != Stage.S1_UNRESTRICTED) {
          return null;
        }
        final Attributes oldAttrs = a.currentElementStartAttributes();
        if (oldAttrs == null) {
          if (valid) {
            return null;
          }
        }
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.model.document.operation.Attributes

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.