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

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

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

TableColumn.setImage介绍

暂无

代码示例

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

@Override
void updateImages () {
  if (sortColumn != null && !sortColumn.isDisposed ()) {
    if (OS.COMCTL32_MAJOR < 6) {
      switch (sortDirection) {
        case SWT.UP:
        case SWT.DOWN:
          sortColumn.setImage (display.getSortImage (sortDirection), true, true);
          break;
      }
    }
  }
}

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

public static void applyTableColumn(ActionContext actionContext){
  Thing self = (Thing) actionContext.get("self");
  TableColumn control = (TableColumn) actionContext.get("widget");
  
  //图
  Image image = (Image) createResource(self.getString("image"), 
      "xworker.swt.graphics.Image", "imageFile", actionContext);
  if(image != null){
    control.setImage(image);
  }
}

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

@Override
public void setImage (Image image) {
  checkWidget();
  if (image != null && image.isDisposed ()) {
    error (SWT.ERROR_INVALID_ARGUMENT);
  }
  super.setImage (image);
  if (parent.sortColumn != this || parent.sortDirection != SWT.NONE) {
    setImage (image, false, false);
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.datatools.sqltools.common.ui

/**
 * Create a table column with the image and the width of the column is set
 * to the image width.
 * 
 * @param parent
 *            the table that contains this column
 * @param image
 *            iamge for this column
 * @return the new table column
 */
public static TableColumn createTableColumn(Table parent, Image image,
  int index) 
{
  TableColumn column = new TableColumn(parent, SWT.LEFT, index);
  column.setImage(image);
  column.setWidth(image.getBounds().width);
  column.setResizable(false);
  return column;
}
/**

代码示例来源:origin: org.eclipse.scout.sdk.s2e/org.eclipse.scout.sdk.s2e.nls

public void createTableColumnInternal(Language language) {
 TableColumn c = new TableColumn(m_table, SWT.LEAD);
 c.setData(LANGUAGE_COLUMN_ID, language);
 if (!language.isLocal()) {
  c.setToolTipText("this language is only in the parent defined!\nCreate a new language for " + language.getLocale().toString() + " to make it locally available.");
  c.setImage(NlsCore.getImage(INlsIcons.WARNING));
 }
 c.setText(language.getDispalyName());
 c.setMoveable(true);
 c.addSelectionListener(new P_SortSelectionAdapter(m_table.indexOf(c)));
 c.setWidth(200);
}

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

/**
 * {@inheritDoc}
 */
@Override
public void createColumns(TableViewer tableViewer) {
  for (Column column : Column.values()) {
    TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
    viewerColumn.getColumn().setMoveable(true);
    viewerColumn.getColumn().setResizable(true);
    viewerColumn.getColumn().setText(column.name);
    viewerColumn.getColumn().setWidth(column.width);
    if (null != column.image) {
      viewerColumn.getColumn().setImage(column.image);
    }
  }
}

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

@Override
public void createColumns(TableViewer tableViewer) {
  for (Column column : Column.values()) {
    TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
    viewerColumn.getColumn().setMoveable(true);
    viewerColumn.getColumn().setResizable(true);
    viewerColumn.getColumn().setText(column.name);
    viewerColumn.getColumn().setWidth(column.width);
    if (null != column.image) {
      viewerColumn.getColumn().setImage(column.image);
    }
    mapTableViewerColumn(column, viewerColumn);
  }
}

代码示例来源:origin: org.codehaus.openxma/xmartclient

/**
 * Sets the sort indicators at the table headers,
 * only if showSortIndicator_ is true.
 * @since version_number
 * @author S3460
 */
private void actualizeSortIndicator2UI(){
  if(showSortIndicator_){
    ComponentClient component = ((PageClient) wModel_.getPage()).getComponent();
    TableColumn[] cols = table_.getColumns();
    for (int i = 0; i < cols.length; i++) {
      TableColumn column = cols[i];
      Image image = null;
      if(getSortingColumn()>=0&&modelCol2SwtCol_[getSortingColumn()] == i){
        if(isSortingColumnAscending()){
          image = component.getImage(ARROW_UP_ICON);
        }else{
          image = component.getImage(ARROW_DOWN_ICON);
        }
      }else{
        image = component.getImage(ARROW_EMPTY_ICON);
      }
      column.setImage(image);
    }
  }
}

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

/**
 * {@inheritDoc}
 */
@Override
public void createColumns(TableViewer tableViewer) {
  for (Column column : Column.values()) {
    TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
    viewerColumn.getColumn().setMoveable(true);
    viewerColumn.getColumn().setResizable(true);
    viewerColumn.getColumn().setText(column.name);
    viewerColumn.getColumn().setWidth(column.width);
    if (null != column.image) {
      viewerColumn.getColumn().setImage(column.image);
    }
    mapTableViewerColumn(column, viewerColumn);
  }
}

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

/**
 * {@inheritDoc}
 */
@Override
public void createColumns(TableViewer tableViewer) {
  for (Column column : Column.values()) {
    TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
    viewerColumn.getColumn().setMoveable(true);
    viewerColumn.getColumn().setResizable(true);
    viewerColumn.getColumn().setText(column.name);
    viewerColumn.getColumn().setWidth(column.width);
    if (null != column.image) {
      viewerColumn.getColumn().setImage(column.image);
    }
    mapTableViewerColumn(column, viewerColumn);
  }
}

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

/**
 * {@inheritDoc}
 */
@Override
public void createColumns(TableViewer tableViewer) {
  for (Column column : Column.values()) {
    TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
    viewerColumn.getColumn().setMoveable(true);
    viewerColumn.getColumn().setResizable(true);
    viewerColumn.getColumn().setText(column.name);
    viewerColumn.getColumn().setWidth(column.width);
    if (null != column.image) {
      viewerColumn.getColumn().setImage(column.image);
    }
    mapTableViewerColumn(column, viewerColumn);
  }
}

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

/**
 * {@inheritDoc}
 */
@Override
public void createColumns(TableViewer tableViewer) {
  for (Column column : Column.values()) {
    TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
    viewerColumn.getColumn().setMoveable(true);
    viewerColumn.getColumn().setResizable(true);
    viewerColumn.getColumn().setText(column.name);
    viewerColumn.getColumn().setWidth(column.width);
    if (null != column.image) {
      viewerColumn.getColumn().setImage(column.image);
    }
    mapTableViewerColumn(column, viewerColumn);
  }
}

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

/**
 * {@inheritDoc}
 */
@Override
public void createColumns(TableViewer tableViewer) {
  for (Column column : Column.values()) {
    TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
    viewerColumn.getColumn().setMoveable(true);
    viewerColumn.getColumn().setResizable(true);
    viewerColumn.getColumn().setText(column.name);
    viewerColumn.getColumn().setWidth(column.width);
    if (null != column.image) {
      viewerColumn.getColumn().setImage(column.image);
    }
    mapTableViewerColumn(column, viewerColumn);
  }
}

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

/**
 * {@inheritDoc}
 */
@Override
public void createColumns(TableViewer tableViewer) {
  for (Column column : Column.values()) {
    TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
    viewerColumn.getColumn().setMoveable(true);
    viewerColumn.getColumn().setResizable(true);
    viewerColumn.getColumn().setText(column.name);
    viewerColumn.getColumn().setWidth(column.width);
    if (null != column.image) {
      viewerColumn.getColumn().setImage(column.image);
    }
    mapTableViewerColumn(column, viewerColumn);
  }
}

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

/**
 * {@inheritDoc}
 */
@Override
public void createColumns(TableViewer tableViewer) {
  for (Column column : Column.values()) {
    TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
    viewerColumn.getColumn().setMoveable(true);
    viewerColumn.getColumn().setResizable(true);
    viewerColumn.getColumn().setText(column.name);
    viewerColumn.getColumn().setWidth(column.width);
    if (null != column.image) {
      viewerColumn.getColumn().setImage(column.image);
    }
    mapTableViewerColumn(column, viewerColumn);
  }
}

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

/**
 * {@inheritDoc}
 */
@Override
public void createColumns(TableViewer tableViewer) {
  for (Column column : Column.values()) {
    TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
    viewerColumn.getColumn().setMoveable(true);
    viewerColumn.getColumn().setResizable(true);
    viewerColumn.getColumn().setText(column.name);
    if (column.showInAggregatedMode) {
      viewerColumn.getColumn().setWidth(column.width);
    } else {
      viewerColumn.getColumn().setWidth(0);
    }
    if (null != column.image) {
      viewerColumn.getColumn().setImage(column.image);
    }
    mapTableViewerColumn(column, viewerColumn);
  }
}

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

/**
 * Creates columns for the {@link #tableViewer}.
 *
 * @param tableViewer
 *            {@link TableViewer}
 */
private void createColumns(TableViewer tableViewer) {
  TableViewerColumn domainColumn = new TableViewerColumn(tableViewer, SWT.NONE);
  domainColumn.getColumn().setResizable(true);
  domainColumn.getColumn().setWidth(150);
  domainColumn.getColumn().setText("Domain");
  domainColumn.getColumn().setImage(InspectIT.getDefault().getImage(InspectITImages.IMG_PACKAGE));
  domainColumn.getColumn().setToolTipText("Domain that the MBean object name is belonging to.");
  TableViewerColumn objectNameColumn = new TableViewerColumn(tableViewer, SWT.NONE);
  objectNameColumn.getColumn().setResizable(true);
  objectNameColumn.getColumn().setWidth(250);
  objectNameColumn.getColumn().setText("Object Name Properties");
  objectNameColumn.getColumn().setImage(InspectIT.getDefault().getImage(InspectITImages.IMG_BOOK));
  objectNameColumn.getColumn().setToolTipText("Object name properties patterns.");
  TableViewerColumn attributesColumn = new TableViewerColumn(tableViewer, SWT.NONE);
  attributesColumn.getColumn().setResizable(true);
  attributesColumn.getColumn().setWidth(400);
  attributesColumn.getColumn().setText("Attributes");
  attributesColumn.getColumn().setImage(InspectIT.getDefault().getImage(InspectITImages.IMG_BLUE_DOCUMENT_TABLE));
  attributesColumn.getColumn().setToolTipText("Attributes to monitor.");
}

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

/**
 * {@inheritDoc}
 */
@Override
public void createColumns(TableViewer tableViewer) {
  for (Column column : Column.values()) {
    TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
    viewerColumn.getColumn().setMoveable(true);
    viewerColumn.getColumn().setResizable(true);
    viewerColumn.getColumn().setText(column.name);
    if (column.showInAggregatedMode) {
      viewerColumn.getColumn().setWidth(column.width);
    } else {
      viewerColumn.getColumn().setWidth(0);
    }
    if (null != column.image) {
      viewerColumn.getColumn().setImage(column.image);
    }
    super.mapTableViewerColumn(column, viewerColumn);
  }
}

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

/**
 * Creates columns for Table.
 *
 * @param tableViewer
 *            Table viewer to create columns for.
 */
private void createColumns(TableViewer tableViewer) {
  TableViewerColumn classColumn = new TableViewerColumn(tableViewer, SWT.NONE);
  classColumn.getColumn().setResizable(true);
  classColumn.getColumn().setWidth(350);
  classColumn.getColumn().setText("Class");
  classColumn.getColumn().setImage(InspectIT.getDefault().getImage(InspectITImages.IMG_CLASS));
  classColumn.getColumn().setToolTipText("Fully qualified name of the class or interface.");
  TableViewerColumn methodColumn = new TableViewerColumn(tableViewer, SWT.NONE);
  methodColumn.getColumn().setResizable(true);
  methodColumn.getColumn().setWidth(450);
  methodColumn.getColumn().setText("Method");
  methodColumn.getColumn().setImage(InspectIT.getDefault().getImage(InspectITImages.IMG_METHOD_PUBLIC));
  methodColumn.getColumn().setToolTipText("Method name with parameters. Note that constructors are displayed as '<init>' methods.");
  TableViewerColumn optionsColumn = new TableViewerColumn(tableViewer, SWT.NONE);
  optionsColumn.getColumn().setResizable(true);
  optionsColumn.getColumn().setWidth(200);
  optionsColumn.getColumn().setText("Options");
  optionsColumn.getColumn().setToolTipText("Additional options that are defined for the sensor assignment.");
}

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

/**
 * {@inheritDoc}
 */
@Override
public void createColumns(TableViewer tableViewer) {
  for (Column column : Column.values()) {
    TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
    viewerColumn.getColumn().setMoveable(true);
    viewerColumn.getColumn().setResizable(true);
    viewerColumn.getColumn().setText(column.name);
    viewerColumn.getColumn().setWidth(column.width);
    if (Column.EXCLUSIVEAVERAGE.equals(column) || Column.EXCLUSIVESUM.equals(column) || Column.EXCLUSIVEMIN.equals(column) || Column.EXCLUSIVEMAX.equals(column)) {
      // TODO: Remove this tooltip and add it to the cell as soon as the image bug is
      // fixed in Eclipse.
      viewerColumn.getColumn()
          .setToolTipText("Exclusive times can only be calculated correctly if the timer is within an invocation sequence. "
              + "A warning marker is provided if not all timers are run within an invocation sequence. Please be aware that "
              + "avg, sum, min and max calculations are reflecting only the timers inside an invocation sequence.");
    }
    if (null != column.image) {
      viewerColumn.getColumn().setImage(column.image);
    }
    mapTableViewerColumn(column, viewerColumn);
  }
}

相关文章