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.
-
-
Field Summary
Fields Modifier and Type Field Description private org.eclipse.swt.graphics.RGBbackgroundprivate CellBackgroundProviderchain
-
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)org.eclipse.swt.graphics.RGBgetBackground()Returns the background color.org.eclipse.swt.graphics.RGBgetCellBackground(int row, int column, int colspan)Returns the value in the background property.inthashCode()voidsetBackground(org.eclipse.swt.graphics.RGB background)Sets the background color to the argument.
-
-
-
Field Detail
-
chain
private final CellBackgroundProvider chain
-
background
private org.eclipse.swt.graphics.RGB background
-
-
Constructor Detail
-
DefaultCellBackgroundProvider
public DefaultCellBackgroundProvider()
Constructs a DefaultGridBackgroundProvider with a null background.
-
DefaultCellBackgroundProvider
public DefaultCellBackgroundProvider(CellBackgroundProvider chain)
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 Detail
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin 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:
getCellBackgroundin 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.
-
-