Tabnine Logo
TextViewer.setSelection
Code IndexAdd Tabnine to your IDE (free)

How to use
setSelection
method
in
org.eclipse.jface.text.TextViewer

Best Java code snippets using org.eclipse.jface.text.TextViewer.setSelection (Showing top 8 results out of 315)

origin: anb0s/LogViewer

public void setSelection(ISelection sel) {
  txtViewer.setSelection(sel);
}
origin: org.eclipse.platform/org.eclipse.compare

public void setSelection(ISelection selection, boolean reveal) {
  if (fViewerInFocus != null) {
    if (reveal && !isSelectionInsideVisibleRegion(fViewerInFocus, selection))
      resetVisibleRegion();
    fViewerInFocus.setSelection(selection, reveal);
  }
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

  @Override
  public void run() {
    SelectionProcessor processor= new SelectionProcessor(TextViewer.this);
    try {
      /* Use the selection instead of the event's coordinates. Is this dangerous? */
      ISelection selection= getSelection();
      int length= e.text.length();
      if (length == 0 && e.character == '\0') {
        // backspace in StyledText block selection mode...
        TextEdit edit= processor.backspace(selection);
        edit.apply(fDocument, TextEdit.UPDATE_REGIONS);
        ISelection empty= processor.makeEmpty(selection, true);
        setSelection(empty);
      } else {
        int lines= processor.getCoveredLines(selection);
        String delim= fDocument.getLegalLineDelimiters()[0];
        StringBuffer text= new StringBuffer(lines * length + (lines - 1) * delim.length());
        text.append(e.text);
        for (int i= 0; i < lines - 1; i++) {
          text.append(delim);
          text.append(e.text);
        }
        processor.doReplace(selection, text.toString());
      }
    } catch (BadLocationException x) {
      if (TRACE_ERRORS)
        System.out.println(JFaceTextMessages.getString("TextViewer.error.bad_location.verifyText")); //$NON-NLS-1$
    }
  }
});
origin: org.eclipse.platform/org.eclipse.jface.text

  edit.apply(fDocument, TextEdit.UPDATE_REGIONS);
  ISelection empty= processor.makeEmpty(selection, true);
  setSelection(empty);
} else {
  int lines= processor.getCoveredLines(selection);
origin: org.eclipse.platform/org.eclipse.jface.text

  int startColumn= fSelection.getOffset() - startLineOffset + cp.fStartColumn;
  int endColumn= selectionEnd - endLineOffset + cp.fEndColumn;
  setSelection(new BlockTextSelection(document, startLine, startColumn, endLine, endColumn, tabs));
} catch (BadLocationException e) {
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

  int startColumn= fSelection.getOffset() - startLineOffset + cp.fStartColumn;
  int endColumn= selectionEnd - endLineOffset + cp.fEndColumn;
  setSelection(new BlockTextSelection(document, startLine, startColumn, endLine, endColumn, tabs));
} catch (BadLocationException e) {
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

if (fTextWidget.getBlockSelection())
  setSelection(new BlockTextSelection(doc, 0, 0, doc.getNumberOfLines() - 1, 1000, fTextWidget.getTabs()));
else
  setSelectedRange(0, doc.getLength());
origin: org.eclipse.platform/org.eclipse.jface.text

if (fTextWidget.getBlockSelection())
  setSelection(new BlockTextSelection(doc, 0, 0, doc.getNumberOfLines() - 1, 1000, fTextWidget.getTabs()));
else
  setSelectedRange(0, doc.getLength());
org.eclipse.jface.textTextViewersetSelection

Popular methods of TextViewer

  • getTextWidget
  • getControl
  • doOperation
  • setDocument
  • modelRange2WidgetRange
    Same as #modelRange2WidgetRange(IRegion) just for a org.eclipse.jface.text.Position.
  • getRewriteTarget
  • getSelection
  • modelLine2WidgetLine
    Implements the contract of ITextViewerExtension5#modelLine2WidgetLine(int).
  • getDocument
  • setSelectedRange
  • <init>
    Create a new text viewer with the given SWT style bits. The viewer is ready to use but does not have
  • canDoOperation
  • <init>,
  • canDoOperation,
  • getVisibleRegion,
  • handleDispose,
  • invalidateTextPresentation,
  • setTopIndex,
  • _getVisibleRegionOffset,
  • activatePlugins,
  • addPresentation

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • onRequestPermissionsResult (Fragment)
  • getSystemService (Context)
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Table (org.hibernate.mapping)
    A relational table
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now