Class DefaultCellBackgroundProvider
java.lang.Object
org.eclipse.nebula.paperclips.core.grid.DefaultCellBackgroundProvider
- All Implemented Interfaces:
CellBackgroundProvider
public class DefaultCellBackgroundProvider extends java.lang.Object implements CellBackgroundProvider
Default implementation of the CellBackgroundProvider interface.
-
Constructor Summary
Constructors Constructor Description DefaultCellBackgroundProvider()
Constructs a DefaultGridBackgroundProvider with a null background.DefaultCellBackgroundProvider(CellBackgroundProvider chain)
Constructs a DefaultGridBackgroundProvider which chains to the argument if this instance has a null background color. -
Method Summary
Modifier and Type Method Description boolean
equals(java.lang.Object obj)
org.eclipse.swt.graphics.RGB
getBackground()
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()- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equals
in classjava.lang.Object
-
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.
-