ti.setText( 3, cr.getText() ); Color col = ti.getBackground(); switch ( cr.getType() ) { case CheckResultInterface.TYPE_RESULT_OK:
Color col = ti.getBackground(); if ( stat.hasError() ) { col = red;
Color bg = item.getBackground(); if ( !bg.equals( defaultBackgroundColor ) ) { String colorName = "bg " + bg.toString();
TableItem item = table.getItem( i ); item.setForeground( GUIResource.getInstance().getColorBlack() ); if ( !item.getBackground().equals( GUIResource.getInstance().getColorRed() ) ) { item.setBackground( i % 2 == 0
@Override public Color getBackground(int columnIndex) { return item.getBackground(columnIndex); }
@Override public Color getBackground(int columnIndex) { return item.getBackground(columnIndex); }
public Color getBackground(int columnIndex) { return item.getBackground(columnIndex); }
defaultBackgroundColor = table.getItem( 0 ).getBackground();
/** * Returns the background color at the given column index in the receiver. * * @param index the column index * @return the background color * * @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> * * @since 3.0 */ public Color getBackground (int index) { checkWidget (); if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED); int count = Math.max (1, parent.columnCount); if (0 > index || index > count -1) return getBackground (); if (cellBackground == null || cellBackground [index] == null) return getBackground (); return cellBackground [index]; }
/** * Returns the background color at the given column index in the receiver. * * @param index the column index * @return the background color * * @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> * * @since 3.0 */ public Color getBackground (int index) { checkWidget (); if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED); int count = Math.max (1, parent.getColumnCount ()); if (0 > index || index > count - 1) return getBackground (); int pixel = cellBackground != null ? cellBackground [index] : -1; return pixel == -1 ? getBackground () : Color.win32_new (display, pixel); }
/** * Returns the background color at the given column index in the receiver. * * @param index the column index * @return the background color * * @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 Color getBackground( int index ) { checkWidget(); if( !parent.checkData( this, parent.indexOf( this ) ) ) { error( SWT.ERROR_WIDGET_DISPOSED ); } Color result = getBackground(); if( hasData( index ) && data[ index ].background != null ) { result = data[ index ].background; } return result; }
/** * Sets the background color of the Row 0 TableItem in column 1. */ void setCellBackground () { if (!instance.startup) { table1.getItem (0).setBackground (1, cellBackgroundColor); } /* Set the background color item's image to match the background color of the cell. */ Color color = cellBackgroundColor; if (color == null) color = table1.getItem (0).getBackground (1); TableItem item = colorAndFontTable.getItem(CELL_BACKGROUND_COLOR); Image oldImage = item.getImage(); if (oldImage != null) oldImage.dispose(); item.setImage (colorImage(color)); }
/** * Sets the background color of TableItem [0]. */ void setItemBackground () { if (!instance.startup) { table1.getItem (0).setBackground (itemBackgroundColor); } /* Set the background color item's image to match the background color of the item. */ Color color = itemBackgroundColor; if (color == null) color = table1.getItem (0).getBackground (); TableItem item = colorAndFontTable.getItem(ITEM_BACKGROUND_COLOR); Image oldImage = item.getImage(); if (oldImage != null) oldImage.dispose(); item.setImage (colorImage(color)); }
gc.setForeground(foreground); Color background= item.getBackground(index); gc.setBackground(background);
gc.setForeground(foreground); Color background= item.getBackground(index); gc.setBackground(background);
public static void alternateRowBackground(TableItem item) { if (Utils.TABLE_GRIDLINE_IS_ALTERNATING_COLOR) { if (!item.getParent().getLinesVisible()) item.getParent().setLinesVisible(true); return; } if (item == null || item.isDisposed()) return; Color[] colors = { Colors.getSystemColor(item.getDisplay(), SWT.COLOR_LIST_BACKGROUND), Colors.colorAltRow }; Color newColor = colors[item.getParent().indexOf(item) % colors.length]; if (!item.getBackground().equals(newColor)) { item.setBackground(newColor); } }
Color newColor = colors[iFixedIndex % colors.length]; iFixedIndex++; if (!row.getBackground().equals(newColor)) {
case ITEM_BACKGROUND_COLOR: { Color oldColor = itemBackgroundColor; if (oldColor == null) oldColor = table1.getItem (0).getBackground (); colorDialog.setRGB(oldColor.getRGB()); RGB rgb = colorDialog.open(); case CELL_BACKGROUND_COLOR: { Color oldColor = cellBackgroundColor; if (oldColor == null) oldColor = table1.getItem (0).getBackground (1); colorDialog.setRGB(oldColor.getRGB()); RGB rgb = colorDialog.open();
} else { fg = item.getForeground (columnIndex); gc.setBackground (item.getBackground (columnIndex)); } else { gc.setForeground (userForeground != null ? userForeground : item.getForeground (columnIndex)); gc.setBackground (item.getBackground (columnIndex));
gc.setForeground (display.getSystemColor (SWT.COLOR_LIST_SELECTION_TEXT)); } else { gc.setBackground (item.getBackground (columnIndex)); gc.setForeground (item.getForeground (columnIndex)); gc.setBackground (item.getBackground (columnIndex)); GdkRectangle rect = new GdkRectangle (); OS.memmove (rect, background_area, GdkRectangle.sizeof); gc.setForeground (foreground); } else { gc.setBackground (item.getBackground (columnIndex)); Color foreground = drawForeground != null ? Color.gtk_new (display, drawForeground) : item.getForeground (columnIndex); gc.setForeground (foreground);