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

x33g5p2x  于2022-01-23 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(150)

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

List.sendSelectionEvent介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

void sendSelection () {
  if (ignoreSelect) return;
  sendSelectionEvent(SWT.Selection);
}

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

@Override
long /*int*/ gtk_changed (long /*int*/ widget) {
  sendSelectionEvent (SWT.Selection);
  return 0;
}

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

@Override
int /*long*/ gtk_changed (int /*long*/ widget) {
  sendSelectionEvent (SWT.Selection);
  return 0;
}

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

@Override
int /*long*/ gtk_changed (int /*long*/ widget) {
  sendSelectionEvent (SWT.Selection);
  return 0;
}

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

void sendDoubleSelection() {
  if (((NSTableView)view).clickedRow () != -1) {
    sendSelectionEvent (SWT.DefaultSelection);
  }
}

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

@Override
LRESULT wmCommandChild (int /*long*/ wParam, int /*long*/ lParam) {
  int code = OS.HIWORD (wParam);
  switch (code) {
    case OS.LBN_SELCHANGE:
      sendSelectionEvent (SWT.Selection);
      break;
    case OS.LBN_DBLCLK:
      sendSelectionEvent (SWT.DefaultSelection);
      break;
  }
  return super.wmCommandChild (wParam, lParam);
}

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

boolean sendKeyEvent (NSEvent nsEvent, int type) {
  boolean result = super.sendKeyEvent (nsEvent, type);
  if (!result) return result;
  if (type != SWT.KeyDown) return result;
  short keyCode = nsEvent.keyCode ();
  switch (keyCode) {
    case 76: /* KP Enter */
    case 36: { /* Return */
      sendSelectionEvent (SWT.DefaultSelection);
      break;
    }
  }
  return result;
}

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

void sendTreeDefaultSelection() {

  //Note, similar DefaultSelectionHandling in SWT List/Table/Tree
  Event event = new Event ();
  event.index = this.getFocusIndex ();

  if (event.index >= 0)
    event.text = this.getItem (event.index);
  sendSelectionEvent (SWT.DefaultSelection, event, false);
}

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

void sendTreeDefaultSelection() {

  //Note, similar DefaultSelectionHandling in SWT List/Table/Tree
  Event event = new Event ();
  event.index = this.getFocusIndex ();

  if (event.index >= 0)
    event.text = this.getItem (event.index);
  sendSelectionEvent (SWT.DefaultSelection, event, false);
}

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

void sendTreeDefaultSelection() {

  //Note, similar DefaultSelectionHandling in SWT List/Table/Tree
  Event event = new Event ();
  event.index = this.getFocusIndex ();

  if (event.index >= 0)
    event.text = this.getItem (event.index);
  sendSelectionEvent (SWT.DefaultSelection, event, false);
}

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

@Override
LRESULT WM_CHAR (int /*long*/ wParam, int /*long*/ lParam) {
  LRESULT result = super.WM_CHAR (wParam, lParam);
  if (result != null) return result;
  /*
  * Feature in Windows.  The Windows list box does not implement
  * the control key interface for multi-select list boxes, making
  * it inaccessible from the keyboard.  The fix is to implement
  * the key processing.
  */
  if (OS.GetKeyState (OS.VK_CONTROL) < 0 && OS.GetKeyState (OS.VK_SHIFT) >= 0) {
    int bits = OS.GetWindowLong (handle, OS.GWL_STYLE);
    if ((bits & OS.LBS_EXTENDEDSEL) != 0) {
      switch ((int)/*64*/wParam) {
        case OS.VK_SPACE: {
          int index = (int)/*64*/OS.SendMessage (handle, OS.LB_GETCARETINDEX, 0, 0);
          int code = (int)/*64*/OS.SendMessage (handle, OS.LB_GETSEL, index, 0);
          if (code == OS.LB_ERR) break;
          OS.SendMessage (handle, OS.LB_SETSEL, code != 0 ? 0 : 1, index);
          OS.SendMessage (handle, OS.LB_SETANCHORINDEX, index, 0);
          sendSelectionEvent (SWT.Selection);
          return LRESULT.ZERO;
        }
      }
    }
  }
  return result;
}

相关文章

微信公众号

最新文章

更多

List类方法