Package org.eclipse.swt.custom

Examples of org.eclipse.swt.custom.StyledText.showSelection()


    StyledText text= fViewer.getTextWidget();     
    text.addVerifyListener(this);
    text.addModifyListener(this);
    text.addPaintListener(this);
    text.showSelection();

    Shell shell= text.getShell();
    shell.addShellListener(this);

    fFramePosition= (fInitialOffset == -1) ? fManager.getFirstPosition() : fManager.getPosition(fInitialOffset);
View Full Code Here


    // invert selection to avoid jumping to the end of the selection in st.showSelection()
    viewer.setSelectedRange(offset + length, -length);
    //viewer.revealRange(offset, length); // will trigger jumping
    StyledText st= viewer.getTextWidget();
    if (st != null)
      st.showSelection(); // only minimal scrolling
  }

  /**
   * Displays information in the status line why a line move is not possible
   */
 
View Full Code Here

      text.getDisplay().beep();
      return;
    }

    text.setSelectionRange(searchResult.selection, searchResult.length);
    text.showSelection();

    // relies on the contents of the StringBuffer
    fFindString.setLength(searchResult.findLength);
    fCurrentIndex= searchResult.index;
    fFound= searchResult.found;
View Full Code Here

      document.removePosition(caret);
      if (updateCaret && st.getSelection().x == widgetInsertionOffset) {
        int widgetCaret= AbstractTextEditor.modelOffset2WidgetOffset(sv, caret.getOffset());
        if (widgetCaret != -1)
          st.setSelectionRange(widgetCaret, 0);
        st.showSelection();
      }

    } catch (BadLocationException e) {
      // ignore
    }
View Full Code Here

    }

    // reinstall selection and move it into view
    viewer.setSelectedRange(sel.x, sel.y);
    // don't use the viewer's reveal feature in order to avoid jumping around
    st.showSelection();
  }

}
View Full Code Here

    // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=132263
    widget.getDisplay().asyncExec(new Runnable() {
      public void run() {
        if (!widget.isDisposed())
          try {
          widget.showSelection();
          } catch (IllegalArgumentException e) {
            /*
             * See https://bugs.eclipse.org/bugs/show_bug.cgi?id=66914
             * if the StyledText is in setRedraw(false) mode, its
             * selection may not be up2date and calling showSelection
View Full Code Here

    // invert selection to avoid jumping to the end of the selection in st.showSelection()
    viewer.setSelectedRange(offset + length, -length);
    //viewer.revealRange(offset, length); // will trigger jumping
    StyledText st= viewer.getTextWidget();
    if (st != null)
      st.showSelection(); // only minimal scrolling
  }

  /**
   * Displays information in the status line why a line move is not possible
   */
 
View Full Code Here

      text.getDisplay().beep();
      return;
    }

    text.setSelectionRange(searchResult.selection, searchResult.length);
    text.showSelection();

    // relies on the contents of the StringBuffer
    fFindString.setLength(searchResult.findLength);
    fCurrentIndex= searchResult.index;
    fFound= searchResult.found;
View Full Code Here

    if (!(selection instanceof IBlockTextSelection))
      viewer.setSelectedRange(selection.getOffset(), selection.getLength() + adjustment);
    else
      viewer.getSelectionProvider().setSelection(selection);
    // don't use the viewer's reveal feature in order to avoid jumping around
    st.showSelection();
  }

}
View Full Code Here

    // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=132263
    widget.getDisplay().asyncExec(new Runnable() {
      public void run() {
        if (!widget.isDisposed())
          try {
          widget.showSelection();
          } catch (IllegalArgumentException e) {
            /*
             * See https://bugs.eclipse.org/bugs/show_bug.cgi?id=66914
             * if the StyledText is in setRedraw(false) mode, its
             * selection may not be up2date and calling showSelection
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.