@Override public Image getImage(int columnIndex) { return item.getImage(columnIndex); }
private int getImageWidth( int index ) { int result = 0; Image image = getImage( index ); if( image != null ) { result = parent.getItemImageSize().x; } return result; }
@Override public void setImage(int columnIndex, Image image) { Image oldImage = item.getImage(columnIndex); if (oldImage != image) { item.setImage(columnIndex,image); } }
public void setImage(int columnIndex, Image image) { Image oldImage = item.getImage(columnIndex); if (oldImage != image) { item.setImage(columnIndex,image); } }
@Override public Image getImage() { checkWidget(); return getImage( 0 ); }
static Image[] getImages( final TableItem item ) { int columnCount = getColumnCount( item ); Image[] result = new Image[ columnCount ]; for( int i = 0; i < columnCount; i++ ) { result[ i ] = item.getImage( i ); } return result; }
@Override public void setImage(int columnIndex, Image image) { Image oldImage = item.getImage(columnIndex); if (oldImage != image) { item.setImage(columnIndex,image); } }
/** * Gets the Image currently being displayed in the given cell. * * @param item * the item to get the text of for this field * @return * the Image displayed this field, of the given item */ public Image getCellImage(final TableItem item) { if (column.isVisible()) { return item.getImage(column.id); } return null; }
@Override protected void doResetItem(Item item) { TableItem tableItem = (TableItem) item; int columnCount = Math.max(1, table.getColumnCount()); for (int i = 0; i < columnCount; i++) { tableItem.setText(i, ""); //$NON-NLS-1$ if (tableItem.getImage(i) != null) { tableItem.setImage(i, null); } } }
@Override protected void doResetItem(Item item) { TableItem tableItem = (TableItem) item; int columnCount = Math.max(1, table.getColumnCount()); for (int i = 0; i < columnCount; i++) { tableItem.setText(i, ""); //$NON-NLS-1$ if (tableItem.getImage(i) != null) { tableItem.setImage(i, null); } } }
protected void doResetItem(Item item) { TableItem tableItem = (TableItem) item; int columnCount = Math.max(1, table.getColumnCount()); for (int i = 0; i < columnCount; i++) { tableItem.setText(i, ""); //$NON-NLS-1$ if (tableItem.getImage(i) != null) { tableItem.setImage(i, null); } } }
@Override public Image getImage () { checkWidget (); if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED); return getImage (0); }
@Override public Image getImage () { checkWidget (); if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED); return getImage (0); }
@Override public Image getImage () { checkWidget (); if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED); return getImage (0); }
public boolean setTableItemImage(TableItem ti, Image img, int col) { Image orig = ti.getImage(); if (img == orig) return false; disableCallbacks(); ti.setImage(col, img); enableCallbacks(); return true; }
void setHeaderBackground () { if (!instance.startup) { table1.setHeaderBackground (headerBackgroundColor); } /* Set the header background color item's image to match the header background color. */ Color color = headerBackgroundColor; if (color == null) color = table1.getHeaderBackground(); TableItem item = colorAndFontTable.getItem(HEADER_BACKGROUND_COLOR); Image oldImage = item.getImage(); if (oldImage != null) oldImage.dispose(); item.setImage (colorImage(color)); }
void setHeaderForeground () { if (!instance.startup) { table1.setHeaderForeground (headerForegroundColor); } /* Set the header foreground color item's image to match the header foreground color. */ Color color = headerForegroundColor; if (color == null) color = table1.getHeaderForeground(); TableItem item = colorAndFontTable.getItem(HEADER_FOREGROUND_COLOR); Image oldImage = item.getImage(); if (oldImage != null) oldImage.dispose(); item.setImage (colorImage(color)); }
void setLinkForeground () { if (!instance.startup) { link1.setLinkForeground(linkForegroundColor); } Color color = linkForegroundColor; if (color == null) color = link1.getLinkForeground (); TableItem item = colorAndFontTable.getItem(LINK_FOREGROUND_COLOR); Image oldImage = item.getImage(); if (oldImage != null) oldImage.dispose(); item.setImage (colorImage(color)); }
void setHeaderBackground () { if (!instance.startup) { tree1.setHeaderBackground (headerBackgroundColor); tree2.setHeaderBackground (headerBackgroundColor); } /* Set the header background color item's image to match the header background color. */ Color color = headerBackgroundColor; if (color == null) color = tree1.getHeaderBackground(); TableItem item = colorAndFontTable.getItem(HEADER_BACKGROUND_COLOR); Image oldImage1 = item.getImage(); if (oldImage1 != null) oldImage1.dispose(); item.setImage (colorImage(color)); }
/** * Sets the foreground color of TableItem [0]. */ void setItemForeground () { if (!instance.startup) { table1.getItem (0).setForeground (itemForegroundColor); } /* Set the foreground color item's image to match the foreground color of the item. */ Color color = itemForegroundColor; if (color == null) color = table1.getItem (0).getForeground (); TableItem item = colorAndFontTable.getItem(ITEM_FOREGROUND_COLOR); Image oldImage = item.getImage(); if (oldImage != null) oldImage.dispose(); item.setImage (colorImage(color)); }