Package net.sf.paperclips
Class DefaultCellBackgroundProvider
java.lang.Object
net.sf.paperclips.DefaultCellBackgroundProvider
- All Implemented Interfaces:
CellBackgroundProvider
Default implementation of the CellBackgroundProvider interface.
- Author:
- Matthew Hall
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a DefaultGridBackgroundProvider with a null background.Constructs a DefaultGridBackgroundProvider which chains to the argument if this instance has a null background color. -
Method Summary
Modifier and TypeMethodDescriptionboolean
org.eclipse.swt.graphics.RGB
Returns the background color.org.eclipse.swt.graphics.RGB
getCellBackground
(int row, int column, int colspan) Returns the value in the background property.int
hashCode()
void
setBackground
(org.eclipse.swt.graphics.RGB background) Sets the background color to the argument.
-
Constructor Details
-
DefaultCellBackgroundProvider
public DefaultCellBackgroundProvider()Constructs a DefaultGridBackgroundProvider with a null background. -
DefaultCellBackgroundProvider
Constructs a DefaultGridBackgroundProvider which chains to the argument if this instance has a null background color. (DefaultGridLook uses this constructor to cause header and footer background colors to default to the body background color.)- Parameters:
chain
- the provider to chain a getCellBackground(...) call to if this instance would return null. Ignored if null.
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
getCellBackground
public org.eclipse.swt.graphics.RGB getCellBackground(int row, int column, int colspan) Returns the value in the background property. If the background property is null, the chained provider will be consulted to obtain a background color.- Specified by:
getCellBackground
in interfaceCellBackgroundProvider
- Parameters:
row
- the row index (zero-based)column
- the column index (zero-based). This is the grid column index, not the cell index within the row.colspan
- the number of grid columns that the cell occupies.- Returns:
- the background color to display for the given header cell.
-
getBackground
public org.eclipse.swt.graphics.RGB getBackground()Returns the background color.- Returns:
- the background color.
-
setBackground
public void setBackground(org.eclipse.swt.graphics.RGB background) Sets the background color to the argument.- Parameters:
background
- the new background color.
-