当前位置: 首页>>代码示例>>Java>>正文


Java DocOpInverter.invert方法代码示例

本文整理汇总了Java中org.waveprotocol.wave.model.document.operation.algorithm.DocOpInverter.invert方法的典型用法代码示例。如果您正苦于以下问题:Java DocOpInverter.invert方法的具体用法?Java DocOpInverter.invert怎么用?Java DocOpInverter.invert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.waveprotocol.wave.model.document.operation.algorithm.DocOpInverter的用法示例。


在下文中一共展示了DocOpInverter.invert方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: leaveDraftMode

import org.waveprotocol.wave.model.document.operation.algorithm.DocOpInverter; //导入方法依赖的package包/类
@Override
public void leaveDraftMode(boolean saveChanges) {
  Preconditions.checkArgument(draftMode, "Editor is not in draft mode");
  draftMode = false;

  if (!content.getDraftOps().isEmpty()) {
    if (saveChanges) {
      for (DocOp o : content.getDraftOps()) {
        innerOutputSink.consume(o);
      }

      content.getDraftOps().clear();
    }
    else {
      DocOp inv = DocOpInverter.invert(Composer.compose(content.getDraftOps()));
      content.getDraftOps().clear();
      content.consume(inv);
    }
  }
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:21,代码来源:EditorImpl.java

示例2: restore

import org.waveprotocol.wave.model.document.operation.algorithm.DocOpInverter; //导入方法依赖的package包/类
private void restore(Document doc) {
  // No comment.
  UncheckedDocOpBuffer builder = new UncheckedDocOpBuffer();
  doc.toInitialization().apply(builder);
  DocOp state = builder.finish();
  DocOp erasure = DocOpInverter.invert(state);
  DocOp restoration;
  try {
    restoration = Composer.compose(erasure, state);
  } catch (OperationException e) {
    // If the code above fails, then there is a bug in the operation code, not
    // these tests.  Fail with an exception, not with a JUnit fail().
    throw new RuntimeException(e);
  }

  doc.hackConsume(Nindo.fromDocOp(restoration, false));
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:18,代码来源:WaveBasedConversationViewTest.java

示例3: applyAndReturnReverse

import org.waveprotocol.wave.model.document.operation.algorithm.DocOpInverter; //导入方法依赖的package包/类
@Override
public List<? extends BlipOperation> applyAndReturnReverse(final BlipData blip)
    throws OperationException {
  WaveletOperationContext reverseContext = createReverseContext(blip);

  // Update metadata
  UpdateContributorMethod reverseMethod = update(blip, method);

  blip.getContent().consume(contentOp);

  DocOp reverseContentOp = DocOpInverter.invert(contentOp);

  BlipContentOperation reverseOp =
      new BlipContentOperation(reverseContext, reverseContentOp, reverseMethod);
  return Collections.singletonList(reverseOp);
}
 
开发者ID:apache,项目名称:incubator-wave,代码行数:17,代码来源:BlipContentOperation.java

示例4: reverse

import org.waveprotocol.wave.model.document.operation.algorithm.DocOpInverter; //导入方法依赖的package包/类
@Override
public List<? extends BlipOperation> reverse(WaveletOperationContext reverseContext) throws OperationException {
  UpdateContributorMethod reverseMethod = method.reverse();

  DocOp reverseContentOp = DocOpInverter.invert(contentOp);

  BlipContentOperation reverseOp =
      new BlipContentOperation(reverseContext, reverseContentOp, reverseMethod);
  return Collections.singletonList(reverseOp);
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:11,代码来源:BlipContentOperation.java

示例5: visitBlipContentOperation

import org.waveprotocol.wave.model.document.operation.algorithm.DocOpInverter; //导入方法依赖的package包/类
@Override
public void visitBlipContentOperation(BlipContentOperation op) {
  inverse = new BlipContentOperation(reverseContext, DocOpInverter.invert(op.getContentOp()));
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:5,代码来源:WaveletOperationInverter.java

示例6: invert

import org.waveprotocol.wave.model.document.operation.algorithm.DocOpInverter; //导入方法依赖的package包/类
@Override
public DocOp invert(DocOp operation) {
  return DocOpInverter.invert(operation);
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:5,代码来源:UndoManagerFactory.java

示例7: invert

import org.waveprotocol.wave.model.document.operation.algorithm.DocOpInverter; //导入方法依赖的package包/类
private static DocOpList invert(DocOpList docOpList) {
  return new DocOpList.Singleton(DocOpInverter.invert(docOpList.composeAll()));
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:4,代码来源:AggregateOperation.java

示例8: createErasureOp

import org.waveprotocol.wave.model.document.operation.algorithm.DocOpInverter; //导入方法依赖的package包/类
/** Creates an op that deletes the doc's current state. */
private DocOp createErasureOp() {
  UncheckedDocOpBuffer builder = new UncheckedDocOpBuffer();
  doc.toInitialization().apply(builder);
  return DocOpInverter.invert(builder.finish());
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:7,代码来源:ObservableSingletonWithDocumentBasedSingletonTest.java


注:本文中的org.waveprotocol.wave.model.document.operation.algorithm.DocOpInverter.invert方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。