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


Java DocumentEx.setInBulkUpdate方法代码示例

本文整理汇总了Java中com.intellij.openapi.editor.ex.DocumentEx.setInBulkUpdate方法的典型用法代码示例。如果您正苦于以下问题:Java DocumentEx.setInBulkUpdate方法的具体用法?Java DocumentEx.setInBulkUpdate怎么用?Java DocumentEx.setInBulkUpdate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.editor.ex.DocumentEx的用法示例。


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

示例1: testSuccessiveBulkModeOperations

import com.intellij.openapi.editor.ex.DocumentEx; //导入方法依赖的package包/类
public void testSuccessiveBulkModeOperations() throws Exception {
  initText("some text");
  DocumentEx document = (DocumentEx)myEditor.getDocument();
  
  document.setInBulkUpdate(true);
  document.replaceString(4, 5, "-");
  document.setInBulkUpdate(false);
  
  myEditor.getCaretModel().moveToOffset(9);
  
  document.setInBulkUpdate(true);
  document.replaceString(4, 5, "+");
  document.setInBulkUpdate(false);
  
  checkResultByText("some+text<caret>");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:EditorImplTest.java

示例2: setDone

import com.intellij.openapi.editor.ex.DocumentEx; //导入方法依赖的package包/类
@Override
protected void setDone(boolean done) {
  super.setDone(done);

  if (myResetBulkUpdateState) {
    DocumentEx document = getAffectedDocument(myModel);
    if (document != null) {
      document.setInBulkUpdate(false);
      myResetBulkUpdateState = false;
    }
  }

  if (done) {
    myModel.commitChanges();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:FormatProcessor.java

示例3: testNoExceptionDuringBulkModeDocumentUpdate

import com.intellij.openapi.editor.ex.DocumentEx; //导入方法依赖的package包/类
public void testNoExceptionDuringBulkModeDocumentUpdate() throws Exception {
  initText("something");
  DocumentEx document = (DocumentEx)myEditor.getDocument();
  document.setInBulkUpdate(true);
  try {
    document.setText("something\telse");
  }
  finally {
    document.setInBulkUpdate(false);
  }
  checkResultByText("something\telse");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:EditorImplTest.java

示例4: testSoftWrapModeUpdateDuringBulkModeChange

import com.intellij.openapi.editor.ex.DocumentEx; //导入方法依赖的package包/类
public void testSoftWrapModeUpdateDuringBulkModeChange() throws Exception {
  initText("long long line<caret>");
  configureSoftWraps(12);
  DocumentEx document = (DocumentEx)myEditor.getDocument();
  document.setInBulkUpdate(true);
  document.replaceString(4, 5, "-");
  document.setInBulkUpdate(false);
  assertEquals(new VisualPosition(1, 5), myEditor.getCaretModel().getVisualPosition());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:EditorImplTest.java

示例5: prepare

import com.intellij.openapi.editor.ex.DocumentEx; //导入方法依赖的package包/类
@Override
public void prepare() {
  myBlocksToModify = collectBlocksToModify();
  // call doModifications static method to ensure no access to state
  // thus we may clear formatting state

  //reset();
  //myDisposed = true;

  if (myBlocksToModify.isEmpty()) {
    setDone(true);
    return;
  }

  myProgressCallback.beforeApplyingFormatChanges(myBlocksToModify);

  final int blocksToModifyCount = myBlocksToModify.size();
  if (blocksToModifyCount > BULK_REPLACE_OPTIMIZATION_CRITERIA) {
    applyChangesAtRewriteMode(myBlocksToModify, myModel);
    setDone(true);
  }
  else if (blocksToModifyCount > 50) {
    DocumentEx updatedDocument = getAffectedDocument(myModel);
    if (updatedDocument != null) {
      updatedDocument.setInBulkUpdate(true);
      myResetBulkUpdateState = true;
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:30,代码来源:ApplyChangesState.java

示例6: prepare

import com.intellij.openapi.editor.ex.DocumentEx; //导入方法依赖的package包/类
@Override
protected void prepare() {
  myBlocksToModify = collectBlocksToModify();
  // call doModifications static method to ensure no access to state
  // thus we may clear formatting state
  reset();

  myInfos = null;
  myRootBlockWrapper = null;
  myTextRangeToWrapper = null;
  myPreviousDependencies = null;
  myLastWhiteSpace = null;
  myFirstTokenBlock = null;
  myLastTokenBlock = null;
  myDisposed = true;

  if (myBlocksToModify.isEmpty()) {
    setDone(true);
    return;
  }

  //for GeneralCodeFormatterTest
  if (myJavaIndentOptions == null) {
    myJavaIndentOptions = mySettings.getIndentOptions(StdFileTypes.JAVA);
  }

  myProgressCallback.beforeApplyingFormatChanges(myBlocksToModify);

  final int blocksToModifyCount = myBlocksToModify.size();
  final boolean bulkReformat = blocksToModifyCount > 50;
  DocumentEx updatedDocument = bulkReformat ? getAffectedDocument(myModel) : null;
  if (updatedDocument != null) {
    updatedDocument.setInBulkUpdate(true);
    myResetBulkUpdateState = true;
  }
  if (blocksToModifyCount > BULK_REPLACE_OPTIMIZATION_CRITERIA
      && applyChangesAtRewriteMode(myBlocksToModify, myModel, myDefaultIndentOption))
  {
    setDone(true);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:42,代码来源:FormatProcessor.java


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