當前位置: 首頁>>代碼示例>>Java>>正文


Java DocOpInverter類代碼示例

本文整理匯總了Java中org.waveprotocol.wave.model.document.operation.algorithm.DocOpInverter的典型用法代碼示例。如果您正苦於以下問題:Java DocOpInverter類的具體用法?Java DocOpInverter怎麽用?Java DocOpInverter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DocOpInverter類屬於org.waveprotocol.wave.model.document.operation.algorithm包,在下文中一共展示了DocOpInverter類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: invert

import org.waveprotocol.wave.model.document.operation.algorithm.DocOpInverter; //導入依賴的package包/類
@Override
public DocOp invert(DocOp operation) {
  EvaluatingDocOpCursor<DocOp> inverter =
      new DocOpInverter<DocOp>(new DocOpBuffer());
  operation.apply(inverter);
  return inverter.finish();
}
 
開發者ID:jorkey,項目名稱:Wiab.pro,代碼行數:8,代碼來源:DocumentDomain.java

示例6: 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

示例7: getInverse

import org.waveprotocol.wave.model.document.operation.algorithm.DocOpInverter; //導入依賴的package包/類
@Override
public CoreWaveletOperation getInverse() {
  DocOpInverter<DocOp> inverse = new DocOpInverter<DocOp>(new DocOpBuffer());
  operation.apply(inverse);
  return new CoreWaveletDocumentOperation(documentId, inverse.finish());
}
 
開發者ID:jorkey,項目名稱:Wiab.pro,代碼行數:7,代碼來源:CoreWaveletDocumentOperation.java

示例8: 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

示例9: 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

示例10: 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類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。