Java Code Examples for org.eclipse.swt.widgets.Table#setBackgroundImage()

The following examples show how to use org.eclipse.swt.widgets.Table#setBackgroundImage() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ColumnBrowserWidget.java    From nebula with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * Create a column that displays data
 */
private void createTable() {
	final Table table = new Table(composite, SWT.SINGLE | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.BORDER);
	new TableColumn(table, SWT.LEFT);

	table.setLayoutData(new RowData(150, 175));
	columns.add(table);

	addTableListeners(table);

	if (super.getBackground() != null && super.getBackground().getRed() != 240 && super.getBackground().getGreen() != 240 && super.getBackground().getBlue() != 240) {
		table.setBackground(super.getBackground());
	}
	table.setBackgroundImage(super.getBackgroundImage());
	table.setBackgroundMode(super.getBackgroundMode());
	table.setCursor(super.getCursor());
	table.setFont(super.getFont());
	table.setForeground(super.getForeground());
	table.setMenu(super.getMenu());
	table.setToolTipText(super.getToolTipText());

}
 
Example 2
Source File: ColumnBrowserWidget.java    From nebula with Eclipse Public License 2.0 3 votes vote down vote up
/**
 * Sets the receiver's background image to the image specified by the argument,
 * or to the default system color for the control if the argument is null. The
 * background image is tiled to fill the available space.
 * <p>
 * Note: This operation is a hint and may be overridden by the platform. For
 * example, on Windows the background of a Button cannot be changed.
 * </p>
 *
 * @param image the new image (or null)
 *
 * @exception IllegalArgumentException
 *                <ul>
 *                <li>ERROR_INVALID_ARGUMENT - if the argument has been
 *                disposed</li>
 *                <li>ERROR_INVALID_ARGUMENT - if the argument is not a
 *                bitmap</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>
 *
 * @see org.eclipse.swt.widgets.Control#setBackgroundImage(org.eclipse.swt.graphics.Image)
 */
@Override
public void setBackgroundImage(final Image image) {
	super.setBackgroundImage(image);
	for (final Table column : columns) {
		column.setBackgroundImage(image);
	}
}