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

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

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

Table.redraw介绍

暂无

代码示例

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

  1. final void clear() {
  2. data = null;
  3. checked = false;
  4. grayed = false;
  5. parent.updateScrollBars();
  6. if( ( parent.style & SWT.VIRTUAL ) != 0 ) {
  7. cached = false;
  8. parent.redraw();
  9. }
  10. }

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

  1. @Override
  2. public void run() {
  3. fExpectedItemCount= types.length;
  4. int lastHistoryLength= fHistoryMatches.length;
  5. fHistoryMatches= types;
  6. int length= fHistoryMatches.length + fSearchMatches.length;
  7. int dash= (fHistoryMatches.length > 0 && fSearchMatches.length > 0) ? 1 : 0;
  8. fTable.setItemCount(length + dash);
  9. if (length == 0) {
  10. // bug under windows.
  11. fTable.redraw();
  12. return;
  13. }
  14. int update= Math.max(lastHistoryLength, fHistoryMatches.length);
  15. if (update > 0) {
  16. fTable.clear(0, update + dash - 1);
  17. }
  18. }
  19. });

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

  1. @Override
  2. public void run() {
  3. fExpectedItemCount= types.length;
  4. int lastHistoryLength= fHistoryMatches.length;
  5. fHistoryMatches= types;
  6. int length= fHistoryMatches.length + fSearchMatches.length;
  7. int dash= (fHistoryMatches.length > 0 && fSearchMatches.length > 0) ? 1 : 0;
  8. fTable.setItemCount(length + dash);
  9. if (length == 0) {
  10. // bug under windows.
  11. fTable.redraw();
  12. return;
  13. }
  14. int update= Math.max(lastHistoryLength, fHistoryMatches.length);
  15. if (update > 0) {
  16. fTable.clear(0, update + dash - 1);
  17. }
  18. }
  19. });

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

  1. protected void
  2. updatePartialBuddyTable()
  3. {
  4. if ( init_complete ){
  5. partial_buddy_table.setItemCount( partial_buddies.size());
  6. partial_buddy_table.clearAll();
  7. partial_buddy_table.redraw();
  8. }
  9. }

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

  1. protected void
  2. updateTable()
  3. {
  4. if ( init_complete ){
  5. buddy_table.setItemCount( buddies.size());
  6. buddy_table.clearAll();
  7. buddy_table.redraw();
  8. }
  9. }

代码示例来源:origin: com.diffplug.durian/durian-swt

  1. /** Marks the given row as requiring redraw. */
  2. public void redrawRow(int row) {
  3. if (row < itemCount) {
  4. boolean redrawChildren = true;
  5. Rectangle itemBounds = table.getItem(row).getBounds();
  6. table.redraw(0, itemBounds.y, width, rowHeight, redrawChildren);
  7. }
  8. }

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

  1. public void run() {
  2. fExpectedItemCount= types.length;
  3. int lastHistoryLength= fHistoryMatches.length;
  4. fHistoryMatches= types;
  5. int length= fHistoryMatches.length + fSearchMatches.length;
  6. int dash= (fHistoryMatches.length > 0 && fSearchMatches.length > 0) ? 1 : 0;
  7. fTable.setItemCount(length + dash);
  8. if (length == 0) {
  9. // bug under windows.
  10. fTable.redraw();
  11. return;
  12. }
  13. int update= Math.max(lastHistoryLength, fHistoryMatches.length);
  14. if (update > 0) {
  15. fTable.clear(0, update + dash - 1);
  16. }
  17. }
  18. });

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

  1. public void run() {
  2. fExpectedItemCount= types.length;
  3. int lastHistoryLength= fHistoryMatches.length;
  4. fHistoryMatches= types;
  5. int length= fHistoryMatches.length + fSearchMatches.length;
  6. int dash= (fHistoryMatches.length > 0 && fSearchMatches.length > 0) ? 1 : 0;
  7. fTable.setItemCount(length + dash);
  8. if (length == 0) {
  9. // bug under windows.
  10. fTable.redraw();
  11. return;
  12. }
  13. int update= Math.max(lastHistoryLength, fHistoryMatches.length);
  14. if (update > 0) {
  15. fTable.clear(0, update + dash - 1);
  16. }
  17. }
  18. });

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

  1. /**
  2. * Sets the zero-relative index of the item which is currently
  3. * at the top of the receiver. This index can change when items
  4. * are scrolled or new items are added and removed.
  5. *
  6. * @param topIndex the index of the top item
  7. *
  8. * @exception SWTException <ul>
  9. * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  10. * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  11. * </ul>
  12. */
  13. public void setTopIndex( int topIndex ) {
  14. checkWidget();
  15. if( this.topIndex != topIndex && topIndex >= 0 && topIndex < itemCount ) {
  16. this.topIndex = topIndex;
  17. adjustTopIndex();
  18. if( ( style & SWT.VIRTUAL ) != 0 ) {
  19. redraw();
  20. }
  21. }
  22. }

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

  1. protected void
  2. updateTable(
  3. boolean async )
  4. {
  5. if ( async ){
  6. if ( !buddy_table.isDisposed()){
  7. buddy_table.getDisplay().asyncExec(
  8. new Runnable()
  9. {
  10. @Override
  11. public void
  12. run()
  13. {
  14. if ( buddy_table.isDisposed()){
  15. return;
  16. }
  17. updateTable( false );
  18. }
  19. });
  20. }
  21. }else{
  22. buddy_table.setItemCount( participants.size());
  23. buddy_table.clearAll();
  24. buddy_table.redraw();
  25. }
  26. }

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

  1. public void run() {
  2. fExpectedItemCount+= types.length;
  3. fSearchMatches= types;
  4. int length= fHistoryMatches.length + fSearchMatches.length;
  5. int dash= (fHistoryMatches.length > 0 && fSearchMatches.length > 0) ? 1 : 0;
  6. fTable.setItemCount(length + dash);
  7. if (length == 0) {
  8. // bug under windows.
  9. fTable.redraw();
  10. return;
  11. }
  12. if (fHistoryMatches.length == 0) {
  13. fTable.clear(0, length + dash - 1);
  14. } else {
  15. fTable.clear(fHistoryMatches.length - 1, length + dash - 1);
  16. }
  17. }
  18. });

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

  1. public void run() {
  2. fExpectedItemCount+= types.length;
  3. fSearchMatches= types;
  4. int length= fHistoryMatches.length + fSearchMatches.length;
  5. int dash= (fHistoryMatches.length > 0 && fSearchMatches.length > 0) ? 1 : 0;
  6. fTable.setItemCount(length + dash);
  7. if (length == 0) {
  8. // bug under windows.
  9. fTable.redraw();
  10. return;
  11. }
  12. if (fHistoryMatches.length == 0) {
  13. fTable.clear(0, length + dash - 1);
  14. } else {
  15. fTable.clear(fHistoryMatches.length - 1, length + dash - 1);
  16. }
  17. }
  18. });

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

  1. private void refreshActivity() {
  2. if(activityChanged) {
  3. activityChanged = false;
  4. activities = dht.getControl().getActivities();
  5. activityTable.setItemCount(activities.length);
  6. activityTable.clearAll();
  7. //Dunno if still needed?
  8. activityTable.redraw();
  9. }
  10. }

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

  1. /**
  2. * Sets the checkbox in a Virtual Table while inside a SWT.SetData listener
  3. * trigger. SWT 3.1 has an OSX bug that needs working around.
  4. *
  5. * @param item
  6. * @param checked
  7. */
  8. public static void setCheckedInSetData(final TableItem item,
  9. final boolean checked) {
  10. item.setChecked(checked);
  11. if (Constants.isWindowsXP || isGTK) {
  12. Rectangle r = item.getBounds(0);
  13. Table table = item.getParent();
  14. Rectangle rTable = table.getClientArea();
  15. table.redraw(0, r.y, rTable.width, r.height, true);
  16. }
  17. }

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

  1. @Override
  2. public Control createControl(Composite parent) {
  3. fPageBook = new PageBook(parent, SWT.NONE);
  4. createErrorPage(fPageBook);
  5. createTableViewer(fPageBook);
  6. fTableViewer.getTable().redraw();
  7. createToolTip();
  8. return fPageBook;
  9. }

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

  1. @Override
  2. public void handleEvent(Event e) {
  3. TableColumn tc = (TableColumn) e.widget;
  4. int field = ((Integer) tc.getData()).intValue();
  5. comparator.setField(field);
  6. if (field == FilterComparator.FIELD_NAME && !bIsCachingDescriptions) {
  7. ipFilterManager.cacheAllDescriptions();
  8. bIsCachingDescriptions = true;
  9. }
  10. ipRanges = getSortedRanges(filter.getRanges());
  11. table.setItemCount(ipRanges.length);
  12. table.clearAll();
  13. // bug 69398 on Windows
  14. table.redraw();
  15. }
  16. };

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

  1. @Override
  2. public void handleEvent(Event arg0) {
  3. TableItem[] selection = table.getSelection();
  4. if (selection.length == 0)
  5. return;
  6. removeRange((IpRange) selection[0].getData());
  7. ipRanges = getSortedRanges(filter.getRanges());
  8. table.setItemCount(ipRanges.length);
  9. table.clearAll();
  10. table.redraw();
  11. }
  12. });

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

  1. /**
  2. * Sets the receiver's background color to the color specified
  3. * by the argument, or to the default system color for the item
  4. * if the argument is null.
  5. *
  6. * @param color the new color (or null)
  7. *
  8. * @exception IllegalArgumentException <ul>
  9. * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
  10. * </ul>
  11. * @exception SWTException <ul>
  12. * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  13. * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  14. * </ul>
  15. */
  16. public void setBackground( Color color ) {
  17. checkWidget();
  18. if( color != null && color.isDisposed() ) {
  19. error( SWT.ERROR_INVALID_ARGUMENT );
  20. }
  21. if( !equals( background, color ) ) {
  22. background = color;
  23. markCached();
  24. parent.redraw();
  25. }
  26. }

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

  1. data[ index ].background = color;
  2. markCached();
  3. parent.redraw();

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

  1. public void resetListToTable(int items) {
  2. if (isVirtual) {
  3. resetVirtual();
  4. return;
  5. }
  6. table.setItemCount(items);
  7. TableItem tis[] = table.getItems();
  8. println("resetListToTable: Table Items: " + tis.length);
  9. synchronized (list) {
  10. int rows = list.size();
  11. int rowCount = 0;
  12. for (E std : list) {
  13. // E d = list.get(y);
  14. if (std.isFiltered())
  15. continue;
  16. // TableItem ti = virtualTable.getItem(rowCount);
  17. TableItem ti = tis[rowCount];
  18. rowCount++;
  19. if (oddEvenColors)
  20. ti.setBackground(tableColors[rowCount % 2]);
  21. ti.setData(std); // allows us to pull out our custom data from
  22. // selection of TableItems.
  23. if (!isVirtual)
  24. _setTableItems(std, ti);
  25. }
  26. }
  27. // table.setRedraw(true);
  28. table.redraw();
  29. }

相关文章

Table类方法