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

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

本文整理了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

final void clear() {
 data = null;
 checked = false;
 grayed = false;
 parent.updateScrollBars();
 if( ( parent.style & SWT.VIRTUAL ) != 0 ) {
  cached = false;
  parent.redraw();
 }
}

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

@Override
  public void run() {
    fExpectedItemCount= types.length;
    int lastHistoryLength= fHistoryMatches.length;
    fHistoryMatches= types;
    int length= fHistoryMatches.length + fSearchMatches.length;
    int dash= (fHistoryMatches.length > 0 && fSearchMatches.length > 0) ? 1 : 0;
    fTable.setItemCount(length + dash);
    if (length == 0) {
      // bug under windows.
      fTable.redraw();
      return;
    }
    int update= Math.max(lastHistoryLength, fHistoryMatches.length);
    if (update > 0) {
      fTable.clear(0, update + dash - 1);
    }
  }
});

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

@Override
  public void run() {
    fExpectedItemCount= types.length;
    int lastHistoryLength= fHistoryMatches.length;
    fHistoryMatches= types;
    int length= fHistoryMatches.length + fSearchMatches.length;
    int dash= (fHistoryMatches.length > 0 && fSearchMatches.length > 0) ? 1 : 0;
    fTable.setItemCount(length + dash);
    if (length == 0) {
      // bug under windows.
      fTable.redraw();
      return;
    }
    int update= Math.max(lastHistoryLength, fHistoryMatches.length);
    if (update > 0) {
      fTable.clear(0, update + dash - 1);
    }
  }
});

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

protected void
updatePartialBuddyTable()
{
  if ( init_complete ){
    partial_buddy_table.setItemCount( partial_buddies.size());
    partial_buddy_table.clearAll();
    partial_buddy_table.redraw();
  }
}

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

protected void
updateTable()
{
  if ( init_complete ){
    buddy_table.setItemCount( buddies.size());
    buddy_table.clearAll();
    buddy_table.redraw();
  }
}

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

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

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

public void run() {
    fExpectedItemCount= types.length;
    int lastHistoryLength= fHistoryMatches.length;
    fHistoryMatches= types;
    int length= fHistoryMatches.length + fSearchMatches.length; 
    int dash= (fHistoryMatches.length > 0 && fSearchMatches.length > 0) ? 1 : 0;
    fTable.setItemCount(length + dash);
    if (length == 0) {
      // bug under windows.
      fTable.redraw();
      return;
    } 
    int update= Math.max(lastHistoryLength, fHistoryMatches.length);
    if (update > 0) {
      fTable.clear(0, update + dash - 1);
    }
  }
});

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

public void run() {
    fExpectedItemCount= types.length;
    int lastHistoryLength= fHistoryMatches.length;
    fHistoryMatches= types;
    int length= fHistoryMatches.length + fSearchMatches.length; 
    int dash= (fHistoryMatches.length > 0 && fSearchMatches.length > 0) ? 1 : 0;
    fTable.setItemCount(length + dash);
    if (length == 0) {
      // bug under windows.
      fTable.redraw();
      return;
    } 
    int update= Math.max(lastHistoryLength, fHistoryMatches.length);
    if (update > 0) {
      fTable.clear(0, update + dash - 1);
    }
  }
});

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

/**
 * Sets the zero-relative index of the item which is currently
 * at the top of the receiver. This index can change when items
 * are scrolled or new items are added and removed.
 *
 * @param topIndex the index of the top item
 *
 * @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 setTopIndex( int topIndex ) {
 checkWidget();
 if( this.topIndex != topIndex && topIndex >= 0 && topIndex < itemCount ) {
  this.topIndex = topIndex;
  adjustTopIndex();
  if( ( style & SWT.VIRTUAL ) != 0 ) {
   redraw();
  }
 }
}

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

protected void
updateTable(
  boolean	async )
{
  if ( async ){
    if ( !buddy_table.isDisposed()){
      buddy_table.getDisplay().asyncExec(
          new Runnable()
          {
            @Override
            public void
            run()
            {
              if ( buddy_table.isDisposed()){
                return;
              }
              updateTable( false );
            }
          });
    }
  }else{
    buddy_table.setItemCount( participants.size());
    buddy_table.clearAll();
    buddy_table.redraw();
  }
}

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

public void run() {
    fExpectedItemCount+= types.length;
    fSearchMatches= types;
    int length= fHistoryMatches.length + fSearchMatches.length; 
    int dash= (fHistoryMatches.length > 0 && fSearchMatches.length > 0) ? 1 : 0;
    fTable.setItemCount(length + dash);
    if (length == 0) {
      // bug under windows.
      fTable.redraw();
      return;
    }
    if (fHistoryMatches.length == 0) {
      fTable.clear(0, length + dash - 1);
    } else {
      fTable.clear(fHistoryMatches.length - 1, length + dash - 1);
    }
  }
});

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

public void run() {
    fExpectedItemCount+= types.length;
    fSearchMatches= types;
    int length= fHistoryMatches.length + fSearchMatches.length; 
    int dash= (fHistoryMatches.length > 0 && fSearchMatches.length > 0) ? 1 : 0;
    fTable.setItemCount(length + dash);
    if (length == 0) {
      // bug under windows.
      fTable.redraw();
      return;
    }
    if (fHistoryMatches.length == 0) {
      fTable.clear(0, length + dash - 1);
    } else {
      fTable.clear(fHistoryMatches.length - 1, length + dash - 1);
    }
  }
});

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

private void refreshActivity() {
 if(activityChanged) {
  activityChanged = false;
  activities = dht.getControl().getActivities();
  activityTable.setItemCount(activities.length);
  activityTable.clearAll();
  //Dunno if still needed?
  activityTable.redraw();
 }
}

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

/**
 * Sets the checkbox in a Virtual Table while inside a SWT.SetData listener
 * trigger.  SWT 3.1 has an OSX bug that needs working around.
 *
 * @param item
 * @param checked
 */
public static void setCheckedInSetData(final TableItem item,
    final boolean checked) {
  item.setChecked(checked);
  if (Constants.isWindowsXP || isGTK) {
    Rectangle r = item.getBounds(0);
    Table table = item.getParent();
    Rectangle rTable = table.getClientArea();
    table.redraw(0, r.y, rTable.width, r.height, true);
  }
}

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

@Override
public Control createControl(Composite parent) {
  fPageBook = new PageBook(parent, SWT.NONE);
  createErrorPage(fPageBook);
  createTableViewer(fPageBook);
  fTableViewer.getTable().redraw();
  createToolTip();
  return fPageBook;
}

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

@Override
 public void handleEvent(Event e) {
  TableColumn tc = (TableColumn) e.widget;
  int field = ((Integer) tc.getData()).intValue();
  comparator.setField(field);
  if (field == FilterComparator.FIELD_NAME && !bIsCachingDescriptions) {
    ipFilterManager.cacheAllDescriptions();
    bIsCachingDescriptions = true;
  }
  ipRanges = getSortedRanges(filter.getRanges());
  table.setItemCount(ipRanges.length);
  table.clearAll();
  // bug 69398 on Windows
  table.redraw();
 }
};

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

@Override
 public void handleEvent(Event arg0) {
  TableItem[] selection = table.getSelection();
  if (selection.length == 0)
   return;
  removeRange((IpRange) selection[0].getData());
  ipRanges = getSortedRanges(filter.getRanges());
  table.setItemCount(ipRanges.length);
  table.clearAll();
  table.redraw();
 }
});

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

/**
 * Sets the receiver's background color to the color specified
 * by the argument, or to the default system color for the item
 * if the argument is null.
 *
 * @param color the new color (or null)
 *
 * @exception IllegalArgumentException <ul>
 *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
 * </ul>
 * @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 setBackground( Color color ) {
 checkWidget();
 if( color != null && color.isDisposed() ) {
  error( SWT.ERROR_INVALID_ARGUMENT );
 }
 if( !equals( background, color ) ) {
  background = color;
  markCached();
  parent.redraw();
 }
}

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

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

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

public void resetListToTable(int items) {
  if (isVirtual) {
    resetVirtual();
    return;
  }
  table.setItemCount(items);
  TableItem tis[] = table.getItems();
  println("resetListToTable: Table Items: " + tis.length);
  synchronized (list) {
    int rows = list.size();
    int rowCount = 0;
    for (E std : list) {
      // E d = list.get(y);
      if (std.isFiltered())
        continue;
      // TableItem ti = virtualTable.getItem(rowCount);
      TableItem ti = tis[rowCount];
      rowCount++;
      if (oddEvenColors)
        ti.setBackground(tableColors[rowCount % 2]);
      ti.setData(std); // allows us to pull out our custom data from
      // selection of TableItems.
      if (!isVirtual)
        _setTableItems(std, ti);
    }
  }
  // table.setRedraw(true);
  table.redraw();
}

相关文章

Table类方法