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

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

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

List.showSelection介绍

[英]Shows the selection. If the selection is already showing in the receiver, this method simply returns. Otherwise, the items are scrolled until the selection is visible.
[中]显示所选内容。如果选择已显示在接收器中,则此方法仅返回。否则,将滚动项目,直到所选内容可见。

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

wSelection.showSelection();

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

@Override
protected void listShowSelection() {
  list.showSelection();
}

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
  public void handleEvent(Event event) {
    lstLanguage.showSelection();
  }
});

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

@Override
protected void listShowSelection() {
  list.showSelection();
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

protected void listShowSelection() {
  list.showSelection();
}

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

void select (int [] indices, boolean scroll) {
  int i = 0;
  while (i < indices.length) {
    int index = indices [i];
    if (index != -1) {
      select (index, false);
    }
    i++;
  }
  if (scroll) showSelection ();
}

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

void select (int start, int end, boolean scroll) {
  /*
  * Note that when start = end, LB_SELITEMRANGEEX
  * deselects the item.
  */
  if (start == end) {
    select (start, scroll);
    return;
  }
  OS.SendMessage (handle, OS.LB_SELITEMRANGEEX, start, end);
  if (scroll) showSelection ();
}

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

/**
 * Selects the item at the given zero-relative index in the receiver.
 * If the item at the index was already selected, it remains selected.
 * The current selection is first cleared, then the new item is selected,
 * and if necessary the receiver is scrolled to make the new selection visible.
 * Indices that are out of range are ignored.
 *
 * @param index the index of the item to select
 *
 * @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>
 * @see List#deselectAll()
 * @see List#select(int)
 */
public void setSelection (int index) {
  checkWidget ();
  deselectAll ();
  selectFocusIndex (index);
  showSelection ();
}

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

/**
 * Selects the item at the given zero-relative index in the receiver.
 * If the item at the index was already selected, it remains selected.
 * The current selection is first cleared, then the new item is selected,
 * and if necessary the receiver is scrolled to make the new selection visible.
 * Indices that are out of range are ignored.
 *
 * @param index the index of the item to select
 *
 * @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>
 * @see List#deselectAll()
 * @see List#select(int)
 */
public void setSelection (int index) {
  checkWidget ();
  deselectAll ();
  selectFocusIndex (index);
  showSelection ();
}

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

/**
 * Selects the item at the given zero-relative index in the receiver.
 * If the item at the index was already selected, it remains selected.
 * The current selection is first cleared, then the new item is selected,
 * and if necessary the receiver is scrolled to make the new selection visible.
 * Indices that are out of range are ignored.
 *
 * @param index the index of the item to select
 *
 * @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>
 * @see List#deselectAll()
 * @see List#select(int)
 */
public void setSelection (int index) {
  checkWidget ();
  deselectAll ();
  selectFocusIndex (index);
  showSelection ();
}

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

text.selectAll ();
list.setSelection (index);
list.showSelection ();

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

text.selectAll ();
list.setSelection (index);
list.showSelection ();

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

/**
 * Selects the item at the given zero-relative index in the receiver's
 * list.  If the item at the index was already selected, it remains
 * selected. Indices that are out of range are ignored.
 *
 * @param index the index of the item to select
 *
 * @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 select (int index) {
  checkWidget();
  if (index == -1) {
    list.deselectAll ();
    text.setText (""); //$NON-NLS-1$
    return;
  }
  if (0 <= index && index < list.getItemCount()) {
    if (index != getSelectionIndex()) {
      text.setText (list.getItem (index));
      text.selectAll ();
      list.select (index);
      list.showSelection ();
    }
  }
}
@Override

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

/**
 * Selects the item at the given zero-relative index in the receiver's
 * list.  If the item at the index was already selected, it remains
 * selected. Indices that are out of range are ignored.
 *
 * @param index the index of the item to select
 *
 * @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 select (int index) {
  checkWidget();
  if (index == -1) {
    list.deselectAll ();
    text.setText (""); //$NON-NLS-1$
    return;
  }
  if (0 <= index && index < list.getItemCount()) {
    if (index != getSelectionIndex()) {
      text.setText (list.getItem (index));
      text.selectAll ();
      list.select (index);
      list.showSelection ();
    }
  }
}
@Override

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

/**
 * Selects the item at the given zero-relative index in the receiver's 
 * list.  If the item at the index was already selected, it remains
 * selected. Indices that are out of range are ignored.
 *
 * @param index the index of the item to select
 *
 * @exception org.eclipse.swt.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 select (int index) {
 checkWidget();
 if (index == -1) {
  list.deselectAll ();
  text.setText (""); //$NON-NLS-1$
  return;
 }
 if (0 <= index && index < list.getItemCount()) {
  if (index != getSelectionIndex()) {
   text.setText (list.getItem (index));
   text.selectAll ();
   list.select (index);
   list.showSelection ();
  }
 }
}
public void setBackground (Color color) {

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

/**
 * Selects the item at the given zero-relative index in the receiver's
 * list.  If the item at the index was already selected, it remains
 * selected. Indices that are out of range are ignored.
 *
 * @param index the index of the item to select
 *
 * @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 select (int index) {
  checkWidget();
  if (index == -1) {
    list.deselectAll ();
    text.setText (""); //$NON-NLS-1$
    return;
  }
  if (0 <= index && index < list.getItemCount()) {
    if (index != getSelectionIndex()) {
      text.setText (list.getItem (index));
      text.selectAll ();
      list.select (index);
      list.showSelection ();
    }
  }
}
@Override

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

/**
 * Selects the item at the given zero-relative index in the receiver's
 * list.  If the item at the index was already selected, it remains
 * selected. Indices that are out of range are ignored.
 *
 * @param index the index of the item to select
 *
 * @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 select (int index) {
  checkWidget();
  if (index == -1) {
    list.deselectAll ();
    text.setText (""); //$NON-NLS-1$
    return;
  }
  if (0 <= index && index < list.getItemCount()) {
    if (index != getSelectionIndex()) {
      text.setText (list.getItem (index));
      text.selectAll ();
      list.select (index);
      list.showSelection ();
    }
  }
}
@Override

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

/**
 * Selects the item at the given zero-relative index in the receiver's 
 * list.  If the item at the index was already selected, it remains
 * selected. Indices that are out of range are ignored.
 *
 * @param index the index of the item to select
 *
 * @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 select (int index) {
  checkWidget();
  if (index == -1) {
    list.deselectAll ();
    text.setText (""); //$NON-NLS-1$
    return;
  }
  if (0 <= index && index < list.getItemCount()) {
    if (index != getSelectionIndex()) {
      text.setText (list.getItem (index));
      text.selectAll ();
      list.select (index);
      list.showSelection ();
    }
  }
}
public void setBackground (Color color) {

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

select (indices);
showSelection ();

代码示例来源:origin: org.xworker/xworker_swt

list.select(list.getItemCount() - 1);
  list.showSelection();
  handeSelection(self, list, list.getSelectionIndex(), actionContext);
  event.doit = false;
  list.showSelection();
  handeSelection(self, list, list.getSelectionIndex(), actionContext);
}else if(event.keyCode == CR){

相关文章

微信公众号

最新文章

更多

List类方法