Codota Logo
DocumentEx
Code IndexAdd Codota to your IDE (free)

How to use
DocumentEx
in
com.intellij.openapi.editor.ex

Best Java code snippets using com.intellij.openapi.editor.ex.DocumentEx (Showing top 5 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: JetBrains/ideavim

 public void selectionChanged(@NotNull SelectionEvent selectionEvent) {
  final Editor editor = selectionEvent.getEditor();
  final Document document = editor.getDocument();
  if (myMakingChanges || (document instanceof DocumentEx && ((DocumentEx) document).isInEventsHandling())) {
   return;
  }
  myMakingChanges = true;
  try {
   final com.intellij.openapi.util.TextRange newRange = selectionEvent.getNewRange();
   for (Editor e : EditorFactory.getInstance().getEditors(document)) {
    if (!e.equals(editor)) {
     e.getSelectionModel().setSelection(newRange.getStartOffset(), newRange.getEndOffset());
    }
   }
  } finally {
   myMakingChanges = false;
  }
 }
}
origin: JetBrains/Grammar-Kit

 collectRangeMarker(rangeHighlighter, lineOffset, leftGreedyMarker, emptyMarkers);
document.processRangeMarkers(rangeMarker -> {
 collectRangeMarker(rangeMarker, lineOffset, leftGreedyMarker, emptyMarkers);
 return true;
document.insertString(lineOffset, " ");
document.insertString(lineOffset, PRIVATE);
document.deleteString(lineOffset + PRIVATE.length(), lineOffset + PRIVATE.length() + 1);
int idx = document.getText().indexOf(PRIVATE, lineOffset);
if (idx > -1 && idx < exprOffset) {
 document.deleteString(idx, idx + PRIVATE.length());
origin: dhleong/intellivim

  @Override
  public PsiFile compute() throws IOException {
    file.setBinaryContent(originalContents);
    final PsiFile psi = ProjectUtil.getPsiFile(project, file);
    final DocumentEx doc = VimDocument.getInstance(psi);
    FileDocumentManager.getInstance().reloadFromDisk(doc);
    assertThat(doc.getText()).isEqualTo(originalString);
    // now, commit changes so the PsiFile is updated
    PsiDocumentManager.getInstance(project).commitDocument(doc);
    return psi;
  }
});
origin: dhleong/intellivim

public static RangeMarker createRangeMarker(EditorEx editor) {
  final int offset = editor.getCaretModel().getOffset();
  return editor.getDocument().createRangeMarker(offset, offset);
}
origin: huoguangjin/MultiHighlight

@Override
public void updateView(@NotNull List<NamedTextAttr> namedTextAttrList) {
  UIUtil.invokeLaterIfNeeded(() -> {
    if (myEditor.isDisposed()) {
      return;
    }
    myEditor.getMarkupModel().removeAllHighlighters();
    myEditor.getSelectionModel().removeSelection();
    if (namedTextAttrList.isEmpty()) {
      ApplicationManager.getApplication().runWriteAction(() -> {
        myEditor.getDocument().setText("");
      });
      return;
    }
    StringBuilder sb = new StringBuilder();
    for (NamedTextAttr namedTextAttr : namedTextAttrList) {
      sb.append(namedTextAttr.getName()).append("\n");
    }
    ApplicationManager.getApplication().runWriteAction(() -> {
      myEditor.getDocument().setText(sb.toString());
    });
    int size = namedTextAttrList.size();
    for (int i = 0; i < size; i++) {
      highlightLine(i, namedTextAttrList.get(i));
    }
  });
}
com.intellij.openapi.editor.exDocumentEx

Most used methods

  • getText
  • createRangeMarker
  • deleteString
  • insertString
  • isInEventsHandling
  • processRangeMarkers
  • setText

Popular in Java

  • Finding current android device location
  • findViewById (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • String (java.lang)
  • InetAddress (java.net)
    This class represents an Internet Protocol (IP) address. An IP address is either a 32-bit or 128-bit
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • URLConnection (java.net)
    The abstract class URLConnection is the superclass of all classes that represent a communications li
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now