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


Java DocOpBuilder.deleteCharacters方法代碼示例

本文整理匯總了Java中org.waveprotocol.wave.model.document.operation.impl.DocOpBuilder.deleteCharacters方法的典型用法代碼示例。如果您正苦於以下問題:Java DocOpBuilder.deleteCharacters方法的具體用法?Java DocOpBuilder.deleteCharacters怎麽用?Java DocOpBuilder.deleteCharacters使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.waveprotocol.wave.model.document.operation.impl.DocOpBuilder的用法示例。


在下文中一共展示了DocOpBuilder.deleteCharacters方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testDeleteCharactersAndElements

import org.waveprotocol.wave.model.document.operation.impl.DocOpBuilder; //導入方法依賴的package包/類
public void testDeleteCharactersAndElements() {
  DocOpBuilder m = new DocOpBuilder();

  Attributes a = new AttributesImpl(ImmutableMap.of("a1", "1", "a2", "2"));
  Attributes b = new AttributesImpl();
  Attributes c = new AttributesImpl(ImmutableMap.of("c1", "1", "c2", "2", "c3", "3"));

  m.deleteElementStart("a", a);
  m.deleteCharacters("hello");
  m.deleteElementStart("b", b);
  m.deleteCharacters("world");
  m.deleteElementStart("c", c);
  m.deleteElementEnd();
  m.deleteCharacters("blah");
  m.deleteElementEnd();
  m.deleteElementEnd();

  assertReversible(makeBlipOp("deleteCharactersAndElements", m.build()));
}
 
開發者ID:jorkey,項目名稱:Wiab.pro,代碼行數:20,代碼來源:WaveletOperationSerializerTest.java

示例2: testDeleteCharacters

import org.waveprotocol.wave.model.document.operation.impl.DocOpBuilder; //導入方法依賴的package包/類
public void testDeleteCharacters() {
  DocOpBuilder m = new DocOpBuilder();

  m.characters("hello");
  m.retain(1);
  m.deleteCharacters("ab");
  m.characters("world");
  m.retain(2);
  m.deleteCharacters("cd");

  assertReversible(makeBlipOp("deleteCharacters", m.build()));
}
 
開發者ID:jorkey,項目名稱:Wiab.pro,代碼行數:13,代碼來源:WaveletOperationSerializerTest.java

示例3: testScrubs

import org.waveprotocol.wave.model.document.operation.impl.DocOpBuilder; //導入方法依賴的package包/類
public void testScrubs() {
  DocOpBuilder b1 = new DocOpBuilder();
  DocOpBuilder b2 = new DocOpBuilder();

  b1.characters(VALID);
  b2.characters(VALID_SCRUBBED);

  b1.deleteCharacters(VALID);
  b2.deleteCharacters(VALID_SCRUBBED);

  b1.characters(INVALID);
  b2.characters(INVALID_SCRUBBED);

  b1.deleteCharacters(INVALID);
  b2.deleteCharacters(INVALID_SCRUBBED);

  b1.elementStart("abc", ATTRS);
  b2.elementStart("abc", ATTRS_SCRUBBED);

  b1.elementEnd();
  b2.elementEnd();

  b1.deleteElementStart("abc", ATTRS);
  b2.deleteElementStart("abc", ATTRS_SCRUBBED);

  b1.deleteElementEnd();
  b2.deleteElementEnd();

  b1.retain(5);
  b2.retain(5);

  b1.replaceAttributes(ATTRS, ATTRS);
  b2.replaceAttributes(ATTRS_SCRUBBED, ATTRS_SCRUBBED);

  b1.updateAttributes(ATTRSUP);
  b2.updateAttributes(ATTRSUP_SCRUBBED);

  b1.annotationBoundary(ANNO);
  b2.annotationBoundary(ANNO_SCRUBBED);

  DocOp o1 = DocOpScrub.scrub(b1.buildUnchecked());
  DocOp o2 = b2.buildUnchecked();
  assertTrue("\n" + o1 + "\n but expected \n" + o2,
      OpComparators.SYNTACTIC_IDENTITY.equal(o1, o2));
}
 
開發者ID:jorkey,項目名稱:Wiab.pro,代碼行數:46,代碼來源:DocOpScrubTest.java


注:本文中的org.waveprotocol.wave.model.document.operation.impl.DocOpBuilder.deleteCharacters方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。