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

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

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

origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

/**
 * Applies the given presentation to the given text widget. Helper method.
 *
 * @param presentation the style information
 * @since 2.1
 */
private void applyTextPresentation(TextPresentation presentation) {
  List<StyleRange> list= new ArrayList<>(presentation.getDenumerableRanges());
  Iterator<StyleRange> e= presentation.getAllStyleRangeIterator();
  while (e.hasNext()) {
    StyleRange range= e.next();
    range= modelStyleRange2WidgetStyleRange(range);
    if (range != null)
      list.add(range);
  }
  if (!list.isEmpty()) {
    StyleRange[] ranges= new StyleRange[list.size()];
    list.toArray(ranges);
    fTextWidget.setStyleRanges(ranges);
  }
}
origin: org.eclipse.platform/org.eclipse.jface.text

/**
 * Applies the given presentation to the given text widget. Helper method.
 *
 * @param presentation the style information
 * @since 2.1
 */
private void applyTextPresentation(TextPresentation presentation) {
  List<StyleRange> list= new ArrayList<>(presentation.getDenumerableRanges());
  Iterator<StyleRange> e= presentation.getAllStyleRangeIterator();
  while (e.hasNext()) {
    StyleRange range= e.next();
    range= modelStyleRange2WidgetStyleRange(range);
    if (range != null)
      list.add(range);
  }
  if (!list.isEmpty()) {
    StyleRange[] ranges= new StyleRange[list.size()];
    list.toArray(ranges);
    fTextWidget.setStyleRanges(ranges);
  }
}
origin: org.eclipse.platform/org.eclipse.jface.text

if (range != null) {
  range= modelStyleRange2WidgetStyleRange(range);
  if (range != null)
    fTextWidget.setStyleRange(range);
  while (e.hasNext()) {
    range= e.next();
    range= modelStyleRange2WidgetStyleRange(range);
    if (range != null)
      ranges.add(range);
  while (e.hasNext()) {
    range= e.next();
    range= modelStyleRange2WidgetStyleRange(range);
    if (range != null)
      list.add(range);
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

if (range != null) {
  range= modelStyleRange2WidgetStyleRange(range);
  if (range != null)
    fTextWidget.setStyleRange(range);
  while (e.hasNext()) {
    range= e.next();
    range= modelStyleRange2WidgetStyleRange(range);
    if (range != null)
      ranges.add(range);
  while (e.hasNext()) {
    range= e.next();
    range= modelStyleRange2WidgetStyleRange(range);
    if (range != null)
      list.add(range);
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

@Override
public void setTextColor(Color color, int start, int length, boolean controlRedraw) {
  if (fTextWidget != null) {
    StyleRange s= new StyleRange();
    s.foreground= color;
    s.start= start;
    s.length= length;
    s= modelStyleRange2WidgetStyleRange(s);
    if (s != null) {
      if (controlRedraw)
        fTextWidget.setRedraw(false);
      try {
        fTextWidget.setStyleRange(s);
      } finally {
        if (controlRedraw)
          fTextWidget.setRedraw(true);
      }
    }
  }
}
origin: org.eclipse.platform/org.eclipse.jface.text

@Override
public void setTextColor(Color color, int start, int length, boolean controlRedraw) {
  if (fTextWidget != null) {
    StyleRange s= new StyleRange();
    s.foreground= color;
    s.start= start;
    s.length= length;
    s= modelStyleRange2WidgetStyleRange(s);
    if (s != null) {
      if (controlRedraw)
        fTextWidget.setRedraw(false);
      try {
        fTextWidget.setStyleRange(s);
      } finally {
        if (controlRedraw)
          fTextWidget.setRedraw(true);
      }
    }
  }
}
org.eclipse.jface.textTextViewermodelStyleRange2WidgetStyleRange

Javadoc

Translates a style range given relative to the viewer's document into style ranges relative to the viewer's widget or null.

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
  • setSelection
  • <init>
    Create a new text viewer with the given SWT style bits. The viewer is ready to use but does not have
  • setSelection,
  • <init>,
  • canDoOperation,
  • getVisibleRegion,
  • handleDispose,
  • invalidateTextPresentation,
  • setTopIndex,
  • _getVisibleRegionOffset,
  • activatePlugins,
  • addPresentation

Popular in Java

  • Start an intent from android
  • onRequestPermissionsResult (Fragment)
  • requestLocationUpdates (LocationManager)
  • addToBackStack (FragmentTransaction)
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • JLabel (javax.swing)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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