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

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

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

Table.notifyListeners介绍

暂无

代码示例

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

resizeEvent.display = getDisplay();
resizeEvent.setBounds( table.getBounds() );
table.notifyListeners( SWT.Resize, resizeEvent );

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

private void checkEmptyList() {
  if (fTable.getItemCount() == 0) {
    fTable.notifyListeners(SWT.Selection, new Event());
  }
}

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

private void checkEmptyList() {
  if (fTable.getItemCount() == 0) {
    fTable.notifyListeners(SWT.Selection, new Event());
  }
}

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

private void checkEmptyList() {
  if (fTable.getItemCount() == 0) {
    fTable.notifyListeners(SWT.Selection, new Event());
  }
}

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

private void setTableSelection(int index) {
  fTable.setSelection(index);
  fTable.notifyListeners(SWT.Selection, new Event());
}

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

private void checkEmptyList() {
  if (fTable.getItemCount() == 0) {
    fTable.notifyListeners(SWT.Selection, new Event());
  }
}

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

private void setTableSelection(int index) {
  fTable.setSelection(index);
  fTable.notifyListeners(SWT.Selection, new Event());
}

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

private void setTableSelection(int index) {
  fTable.setSelection(index);
  fTable.notifyListeners(SWT.Selection, new Event());
}

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

private void setTableSelection(int index) {
  fTable.setSelection(index);
  fTable.notifyListeners(SWT.Selection, new Event());
}

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

/**
   * Select the supplied indices and notify any listeners
   *
   * @param indices
   */
  private void selectAndNotify(final int[] indices) {
    // It is possible that the table was disposed
    // before the update finished. If so then leave
    if (fTable.isDisposed()) {
      return;
    }
    fTable.setSelection(indices);
    fTable.notifyListeners(SWT.Selection, new Event());
  }
}

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

final boolean checkData( TableItem item, int index ) {
 boolean result = true;
 boolean virtual = ( style & SWT.VIRTUAL ) != 0;
 if( virtual && !item.cached && index >= 0 && index < itemCount ) {
  item.cached = true;
  Event event = new Event();
  event.item = item;
  event.index = index;
  notifyListeners( SWT.SetData, event );
  // widget could be disposed at this point
  if( isDisposed() || item.isDisposed() ) {
   result = false;
  }
 }
 return result;
}

代码示例来源:origin: anb0s/EasyShell

@Override
protected Control createContents(Composite parent) {
  // main page composite
  Composite pageComponent = new Composite(parent, SWT.NONE);
  GridLayout layout = new GridLayout(3, false);
  pageComponent.setLayout(layout);
  //parent.setLayout(layout);
  // search
  createSearchField(pageComponent);
  // table viewer
  createTableViewer(pageComponent);
  // buttons
  createButtons(pageComponent);
  // send event to refresh tableViewer
  Event event = new Event();
  event.item = null;
  tableViewer.refresh();
  tableViewer.getTable().notifyListeners(SWT.Selection, event);
  return pageComponent;
}

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

public void handleNotifySelection( Table table, JsonObject properties ) {
 TableItem item = getItem( table, properties.get( EVENT_PARAM_ITEM ).asString() );
 if( item != null ) {
  Event event = createSelectionEvent( SWT.Selection, properties );
  event.item = item;
  table.notifyListeners( SWT.Selection, event );
 }
}

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

public void handleNotifyDefaultSelection( Table table, JsonObject properties ) {
 TableItem item = getItem( table, properties.get( EVENT_PARAM_ITEM ).asString() );
 if( item == null ) {
  item = getFocusItem( table );
 }
 Event event = createSelectionEvent( SWT.DefaultSelection, properties );
 event.item = item;
 table.notifyListeners( SWT.DefaultSelection, event );
}

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

/**
 * Sets the selection of the list. Empty or null array removes selection.
 *
 * @param selection
 *            an array of indices specifying the selection.
 */
public void setSelection(int[] selection) {
  if (selection == null || selection.length == 0) {
    fList.deselectAll();
  } else {
    // If there is no working update job, or the update job is ready to
    // accept selections, set the selection immediately.
    if (fUpdateJob == null) {
      fList.setSelection(selection);
      fList.notifyListeners(SWT.Selection, new Event());
    } else {
      // There is an update job doing the population of the list, so
      // it should update the selection.
      fUpdateJob.updateSelection(selection);
    }
  }
}

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

@Override
  public void handleEvent(Event event) {
    Label label = (Label) event.widget;
    Shell shell = label.getShell();
    switch (event.type) {
    case SWT.MouseDown:
      Event e = new Event();
      e.item = (TableItem) label.getData("_TABLEITEM");
      buddy_table.setSelection(new TableItem[] { (TableItem) e.item });
      buddy_table.notifyListeners(SWT.Selection, e);
      // fall through
    case SWT.MouseExit:
      shell.dispose();
      break;
    }
  }
};

代码示例来源:origin: anb0s/EasyShell

@Override
protected Control createContents(Composite parent) {
  // main page composite
  Composite pageComponent = new Composite(parent, SWT.NONE);
  GridLayout layout = new GridLayout(3, false);
  pageComponent.setLayout(layout);
  //parent.setLayout(layout);
  // search
  createSearchField(pageComponent);
  // get the native commands list
  commandList = CommandDataDefaultCollection.getCommandsNativeAll(new CommandDataList(CommandDataStore.instance().getDataList()));
  // table viewer
  createTableViewer(pageComponent);
  // buttons
  createButtons(pageComponent);
  // refresh the viewer
  refreshTableViewer();
  // send event to refresh tableViewer selection
  Event event = new Event();
  event.item = null;
  tableViewer.getTable().notifyListeners(SWT.Selection, event);
  return pageComponent;
}

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

private void addSingleElement(Object element, ImageDescriptor imageDescriptor, String label) {
  TableItem item= null;
  Object old= null;
  if (fItems.size() > fNextElement) {
    item= (TableItem)fItems.get(fNextElement);
    old= item.getData();
    item.setForeground(null);
  } else {
    item= new TableItem(fTable, SWT.NONE);
    fItems.add(item);
  }
  item.setData(element);
  item.setImage(fImageManager.get(imageDescriptor));
  if (fNextElement == 0) {
    if (needsSelectionChange(old, element) || fLastSelection != null) {
      item.setText(label);
      fTable.setSelection(0);
      fTable.notifyListeners(SWT.Selection, new Event());
    } else {
      fLastSelection= new TableItem[] { item };
      fLastLabels= new String[] { label };
    }
  } else {
    item.setText(label);
  }
  fNextElement++;
}

代码示例来源:origin: openaudible/openaudible

@Override
  public void handleEvent(Event event) {
    Label label = (Label) event.widget;
    Shell shell = label.getShell();
    switch (event.type) {
      case SWT.MouseDown:
        Event e = new Event();
        e.item = (TableItem) label.getData("_TABLEITEM");
        // Assuming table is single select, set the selection as if
        // the mouse down event went through to the table
        table.setSelection(new TableItem[]{(TableItem) e.item});
        table.notifyListeners(SWT.Selection, e);
        shell.dispose();
        break;
      case SWT.MouseExit:
        shell.dispose();
        break;
    }
  }
};

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

/**
 * Refreshes the dialog - has to be called in UI thread.
 */
public void refresh() {
  if (list != null && !list.getTable().isDisposed()) {
    List<?> lastRefreshSelection = ((StructuredSelection) list
        .getSelection()).toList();
    list.getTable().deselectAll();
    list.setItemCount(contentProvider.getNumberOfElements());
    list.refresh();
    if (list.getTable().getItemCount() > 0) {
      // preserve previous selection
      if (refreshWithLastSelection && lastRefreshSelection != null
          && lastRefreshSelection.size() > 0) {
        list.setSelection(new StructuredSelection(
            lastRefreshSelection));
      } else {
        refreshWithLastSelection = true;
        list.getTable().setSelection(0);
        list.getTable().notifyListeners(SWT.Selection, new Event());
      }
    } else {
      list.setSelection(StructuredSelection.EMPTY);
    }
  }
  scheduleProgressMessageRefresh();
}

相关文章

Table类方法