本文整理了Java中org.eclipse.swt.widgets.Text.clearSegments()
方法的一些代码示例,展示了Text.clearSegments()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Text.clearSegments()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Text
类名称:Text
方法名:clearSegments
暂无
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
@Override
boolean updateTextDirection(int textDirection) {
if (super.updateTextDirection(textDirection)) {
clearSegments (true);
applySegments ();
return true;
}
return false;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
@Override
int /*long*/ windowProc (int /*long*/ handle, int /*long*/ arg0, int /*long*/ user_data) {
if (hooks (SWT.Segments) || filters (SWT.Segments) || segments != null) {
switch ((int)/*64*/user_data) {
case DIRECTION_CHANGED: {
clearSegments (true);
applySegments ();
break;
}
}
}
return super.windowProc (handle, arg0, user_data);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
@Override
long /*int*/ windowProc (long /*int*/ handle, long /*int*/ arg0, long /*int*/ user_data) {
if (hooks (SWT.Segments) || filters (SWT.Segments) || segments != null) {
switch ((int)/*64*/user_data) {
case DIRECTION_CHANGED: {
clearSegments (true);
applySegments ();
break;
}
}
}
return super.windowProc (handle, arg0, user_data);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
@Override
int /*long*/ windowProc (int /*long*/ handle, int /*long*/ arg0, int /*long*/ user_data) {
if (hooks (SWT.Segments) || filters (SWT.Segments) || segments != null) {
switch ((int)/*64*/user_data) {
case DIRECTION_CHANGED: {
clearSegments (true);
applySegments ();
break;
}
}
}
return super.windowProc (handle, arg0, user_data);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
@Override
int /*long*/ windowProc (int /*long*/ handle, int /*long*/ arg0, int /*long*/ arg1, int /*long*/ user_data) {
if (hooks (SWT.Segments) || filters (SWT.Segments) || segments != null) {
switch ((int)/*64*/user_data) {
case DELETE_FROM_CURSOR: {
clearSegments (true);
break;
}
case DELETE_FROM_CURSOR_INVERSE: {
applySegments ();
break;
}
}
}
return super.windowProc (handle, arg0, arg1, user_data);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
@Override
long /*int*/ windowProc (long /*int*/ handle, long /*int*/ arg0, long /*int*/ arg1, long /*int*/ user_data) {
if (hooks (SWT.Segments) || filters (SWT.Segments) || segments != null) {
switch ((int)/*64*/user_data) {
case DELETE_FROM_CURSOR: {
clearSegments (true);
break;
}
case DELETE_FROM_CURSOR_INVERSE: {
applySegments ();
break;
}
}
}
return super.windowProc (handle, arg0, arg1, user_data);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
@Override
int /*long*/ windowProc (int /*long*/ handle, int /*long*/ arg0, int /*long*/ arg1, int /*long*/ user_data) {
if (hooks (SWT.Segments) || filters (SWT.Segments) || segments != null) {
switch ((int)/*64*/user_data) {
case DELETE_FROM_CURSOR: {
clearSegments (true);
break;
}
case DELETE_FROM_CURSOR_INVERSE: {
applySegments ();
break;
}
}
}
return super.windowProc (handle, arg0, arg1, user_data);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
@Override
long /*int*/ windowProc (long /*int*/ handle, long /*int*/ arg0, long /*int*/ arg1, long /*int*/ arg2, long /*int*/ user_data) {
if (hooks (SWT.Segments) || filters (SWT.Segments) || segments != null) {
switch ((int)/*64*/user_data) {
case MOVE_CURSOR: {
if (arg0 == OS.GTK_MOVEMENT_VISUAL_POSITIONS) {
clearSegments (true);
}
break;
}
case MOVE_CURSOR_INVERSE: {
if (arg0 == OS.GTK_MOVEMENT_VISUAL_POSITIONS) {
applySegments ();
}
break;
}
}
}
return super.windowProc (handle, arg0, arg1, arg2, user_data);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
@Override
int /*long*/ windowProc (int /*long*/ handle, int /*long*/ arg0, int /*long*/ arg1, int /*long*/ arg2, int /*long*/ user_data) {
if (hooks (SWT.Segments) || filters (SWT.Segments) || segments != null) {
switch ((int)/*64*/user_data) {
case MOVE_CURSOR: {
if (arg0 == OS.GTK_MOVEMENT_VISUAL_POSITIONS) {
clearSegments (true);
}
break;
}
case MOVE_CURSOR_INVERSE: {
if (arg0 == OS.GTK_MOVEMENT_VISUAL_POSITIONS) {
applySegments ();
}
break;
}
}
}
return super.windowProc (handle, arg0, arg1, arg2, user_data);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
@Override
int /*long*/ windowProc (int /*long*/ handle, int /*long*/ arg0, int /*long*/ arg1, int /*long*/ arg2, int /*long*/ user_data) {
if (hooks (SWT.Segments) || filters (SWT.Segments) || segments != null) {
switch ((int)/*64*/user_data) {
case MOVE_CURSOR: {
if (arg0 == OS.GTK_MOVEMENT_VISUAL_POSITIONS) {
clearSegments (true);
}
break;
}
case MOVE_CURSOR_INVERSE: {
if (arg0 == OS.GTK_MOVEMENT_VISUAL_POSITIONS) {
applySegments ();
}
break;
}
}
}
return super.windowProc (handle, arg0, arg1, arg2, user_data);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
@Override
long /*int*/ windowProc (long /*int*/ handle, long /*int*/ user_data) {
if (hooks (SWT.Segments) || filters (SWT.Segments) || segments != null) {
switch ((int)/*64*/user_data) {
case BACKSPACE:
case COPY_CLIPBOARD:
case CUT_CLIPBOARD:
case PASTE_CLIPBOARD: {
clearSegments (true);
break;
}
case BACKSPACE_INVERSE:
case COPY_CLIPBOARD_INVERSE:
case CUT_CLIPBOARD_INVERSE:
case PASTE_CLIPBOARD_INVERSE: {
applySegments ();
break;
}
}
}
return super.windowProc (handle, user_data);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
@Override
int /*long*/ windowProc (int /*long*/ handle, int /*long*/ user_data) {
if (hooks (SWT.Segments) || filters (SWT.Segments) || segments != null) {
switch ((int)/*64*/user_data) {
case BACKSPACE:
case COPY_CLIPBOARD:
case CUT_CLIPBOARD:
case PASTE_CLIPBOARD: {
clearSegments (true);
break;
}
case BACKSPACE_INVERSE:
case COPY_CLIPBOARD_INVERSE:
case CUT_CLIPBOARD_INVERSE:
case PASTE_CLIPBOARD_INVERSE: {
applySegments ();
break;
}
}
}
return super.windowProc (handle, user_data);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
@Override
int /*long*/ windowProc (int /*long*/ handle, int /*long*/ user_data) {
if (hooks (SWT.Segments) || filters (SWT.Segments) || segments != null) {
switch ((int)/*64*/user_data) {
case BACKSPACE:
case COPY_CLIPBOARD:
case CUT_CLIPBOARD:
case PASTE_CLIPBOARD: {
clearSegments (true);
break;
}
case BACKSPACE_INVERSE:
case COPY_CLIPBOARD_INVERSE:
case CUT_CLIPBOARD_INVERSE:
case PASTE_CLIPBOARD_INVERSE: {
applySegments ();
break;
}
}
}
return super.windowProc (handle, user_data);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
/**
* Copies the selected text.
* <p>
* The current selection is copied to the clipboard.
* </p>
*
* @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 void copy () {
checkWidget ();
if ((style & SWT.SINGLE) != 0) {
OS.gtk_editable_copy_clipboard (handle);
} else {
long /*int*/ clipboard = OS.gtk_clipboard_get (OS.GDK_NONE);
clearSegments (true);
OS.gtk_text_buffer_copy_clipboard (bufferHandle, clipboard);
applySegments ();
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
/**
* Copies the selected text.
* <p>
* The current selection is copied to the clipboard.
* </p>
*
* @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 void copy () {
checkWidget ();
if ((style & SWT.SINGLE) != 0) {
OS.gtk_editable_copy_clipboard (handle);
} else {
int /*long*/ clipboard = OS.gtk_clipboard_get (OS.GDK_NONE);
clearSegments (true);
OS.gtk_text_buffer_copy_clipboard (bufferHandle, clipboard);
applySegments ();
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
/**
* Copies the selected text.
* <p>
* The current selection is copied to the clipboard.
* </p>
*
* @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 void copy () {
checkWidget ();
if ((style & SWT.SINGLE) != 0) {
OS.gtk_editable_copy_clipboard (handle);
} else {
int /*long*/ clipboard = OS.gtk_clipboard_get (OS.GDK_NONE);
clearSegments (true);
OS.gtk_text_buffer_copy_clipboard (bufferHandle, clipboard);
applySegments ();
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
/**
* Cuts the selected text.
* <p>
* The current selection is first copied to the
* clipboard and then deleted from the widget.
* </p>
*
* @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 void cut () {
checkWidget ();
if ((style & SWT.SINGLE) != 0) {
OS.gtk_editable_cut_clipboard (handle);
} else {
int /*long*/ clipboard = OS.gtk_clipboard_get (OS.GDK_NONE);
clearSegments (true);
OS.gtk_text_buffer_cut_clipboard (bufferHandle, clipboard, OS.gtk_text_view_get_editable (handle));
applySegments ();
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
/**
* Pastes text from clipboard.
* <p>
* The selected text is deleted from the widget
* and new text inserted from the clipboard.
* </p>
*
* @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 void paste () {
checkWidget ();
if ((style & SWT.SINGLE) != 0) {
OS.gtk_editable_paste_clipboard (handle);
} else {
int /*long*/ clipboard = OS.gtk_clipboard_get (OS.GDK_NONE);
clearSegments (true);
OS.gtk_text_buffer_paste_clipboard (bufferHandle, clipboard, null, OS.gtk_text_view_get_editable (handle));
applySegments ();
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
/**
* Pastes text from clipboard.
* <p>
* The selected text is deleted from the widget
* and new text inserted from the clipboard.
* </p>
*
* @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 void paste () {
checkWidget ();
if ((style & SWT.SINGLE) != 0) {
OS.gtk_editable_paste_clipboard (handle);
} else {
long /*int*/ clipboard = OS.gtk_clipboard_get (OS.GDK_NONE);
clearSegments (true);
OS.gtk_text_buffer_paste_clipboard (bufferHandle, clipboard, null, OS.gtk_text_view_get_editable (handle));
applySegments ();
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
@Override
int /*long*/ gtk_key_press_event (int /*long*/ widget, int /*long*/ event) {
boolean handleSegments = false, segmentsCleared = false;
if (hooks (SWT.Segments) || filters (SWT.Segments)) {
GdkEventKey gdkEvent = new GdkEventKey ();
OS.memmove (gdkEvent, event, GdkEventKey.sizeof);
if (gdkEvent.length > 0 && (gdkEvent.state & (OS.GDK_MOD1_MASK | OS.GDK_CONTROL_MASK)) == 0) {
handleSegments = true;
if (segments != null) {
clearSegments (true);
segmentsCleared = true;
}
}
}
int /*long*/ result = super.gtk_key_press_event (widget, event);
if (result != 0) fixIM ();
if (gdkEventKey == -1) result = 1;
gdkEventKey = 0;
if (handleSegments && (result != 0 || segmentsCleared)) {
applySegments ();
}
return result;
}
内容来源于网络,如有侵权,请联系作者删除!