org.eclipse.swt.widgets.Text.deprocessText()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(108)

本文整理了Java中org.eclipse.swt.widgets.Text.deprocessText()方法的一些代码示例,展示了Text.deprocessText()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Text.deprocessText()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Text
类名称:Text
方法名:deprocessText

Text.deprocessText介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

TCHAR buffer = new TCHAR (getCodePage (), length + 1);
OS.GetWindowText (handle, buffer, length + 1);
if (segments != null) buffer = deprocessText (buffer, 0, -1, false);
char [] chars = new char [length];
System.arraycopy (buffer.chars, 0, chars, 0, length);

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

Arrays.fill (buffer, (byte) 0);
if (segments != null) {
  result = deprocessText (result, 0, -1);

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

/**
 * Returns the widget text.
 * <p>
 * The text for a text widget is the characters in the widget, or
 * an empty string if this has never been set.
 * </p>
 *
 * @return the widget text
 *
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 */
public String getText () {
  checkWidget ();
  int length = OS.GetWindowTextLength (handle);
  if (length == 0) return "";
  TCHAR buffer = new TCHAR (getCodePage (), length + 1);
  OS.GetWindowText (handle, buffer, length + 1);
  if (segments != null) {
    buffer = deprocessText (buffer, 0, -1, false);
    return buffer.toString ();
  }
  return buffer.toString (0, length);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

Arrays.fill (buffer, (byte) 0);
if (segments != null) {
  result = deprocessText (result, 0, -1);

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

Arrays.fill (buffer, (byte) 0);
if (segments != null) {
  result = deprocessText (result, 0, -1);

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

@Override
int resolveTextDirection() {
  int textDirection = SWT.NONE;
  int length = OS.GetWindowTextLength (handle);
  if (length > 0) {
    TCHAR buffer = new TCHAR (getCodePage (), length + 1);
    OS.GetWindowText (handle, buffer, length + 1);
    if (segments != null) {
      buffer = deprocessText (buffer, 0, -1, false);
      textDirection = BidiUtil.resolveTextDirection(buffer.toString ());
    } else {
      textDirection = BidiUtil.resolveTextDirection(buffer.toString (0, length));
    }
    if (textDirection == SWT.NONE) {
      /*
       * Force direction update also when there are no strong bidi chars.
      */
      textDirection = (style & SWT.RIGHT_TO_LEFT) != 0 ? SWT.RIGHT_TO_LEFT : SWT.LEFT_TO_RIGHT;
    }
  }
  return textDirection;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

/**
 * Gets the selected text, or an empty string if there is no current selection.
 *
 * @return the selected text
 *
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 */
public String getSelectionText () {
  checkWidget ();
  int length = OS.GetWindowTextLength (handle);
  if (length == 0) return "";
  int [] start = new int [1], end = new int [1];
  OS.SendMessage (handle, OS.EM_GETSEL, start, end);
  if (start [0] == end [0]) return "";
  TCHAR buffer = new TCHAR (getCodePage (), length + 1);
  OS.GetWindowText (handle, buffer, length + 1);
  if (segments != null) {
    buffer = deprocessText (buffer, start [0], end [0], false);
    return buffer.toString ();
  }
  return buffer.toString (start [0], end [0] - start [0]);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

TCHAR buffer = new TCHAR (cp, length + 1);
if (length > 0) OS.GetWindowText (handle, buffer, length + 1);
buffer = deprocessText (buffer, 0, -1, true);

相关文章

微信公众号

最新文章

更多

Text类方法