Class ButtonCellPainter
java.lang.Object
org.eclipse.nebula.widgets.nattable.painter.cell.AbstractCellPainter
org.eclipse.nebula.widgets.nattable.painter.cell.ButtonCellPainter
- All Implemented Interfaces:
ICellPainter,IMouseAction
Paints a button and simulates a button click. It also notifies its listeners
when it is clicked.
-
Constructor Summary
ConstructorsConstructorDescriptionButtonCellPainter(ICellPainter interiorPainter) ButtonCellPainter(ICellPainter buttonRaisedPainter, ICellPainter buttonPressedPainter) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddClickListener(IMouseAction mouseAction) intgetPreferredHeight(ILayerCell cell, org.eclipse.swt.graphics.GC gc, IConfigRegistry configRegistry) Get the preferred height of the cell when rendered by this painter.intgetPreferredWidth(ILayerCell cell, org.eclipse.swt.graphics.GC gc, IConfigRegistry configRegistry) Get the preferred width of the cell when rendered by this painter.voidpaintCell(ILayerCell cell, org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, IConfigRegistry configRegistry) voidremoveClickListener(IMouseAction mouseAction) voidRespond to mouse click.voidsetButtonFlashTime(int flashTimeInMS) Methods inherited from class org.eclipse.nebula.widgets.nattable.painter.cell.AbstractCellPainter
getCellPainterAt
-
Constructor Details
-
ButtonCellPainter
- Parameters:
interiorPainter- to paint the contents of the cell. This will be decorated with a button like look and feel.
-
ButtonCellPainter
- Parameters:
buttonRaisedPainter- cell painter to use for painting the button raised state.buttonPressedPainter- cell painter to use for painting the button pressed state.
-
-
Method Details
-
paintCell
public void paintCell(ILayerCell cell, org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, IConfigRegistry configRegistry) - Specified by:
paintCellin interfaceICellPainter
-
getPreferredHeight
public int getPreferredHeight(ILayerCell cell, org.eclipse.swt.graphics.GC gc, IConfigRegistry configRegistry) Description copied from interface:ICellPainterGet the preferred height of the cell when rendered by this painter. Used for auto-resize.- Specified by:
getPreferredHeightin interfaceICellPainter- Parameters:
cell- The cell for which the preferred height is requested.gc- The GC that is used for rendering.configRegistry- The IConfigRegistry that contains the configuration used for rendering.- Returns:
- The preferred height of the given cell when rendered by this painter.
-
getPreferredWidth
public int getPreferredWidth(ILayerCell cell, org.eclipse.swt.graphics.GC gc, IConfigRegistry configRegistry) Description copied from interface:ICellPainterGet the preferred width of the cell when rendered by this painter. Used for auto-resize.- Specified by:
getPreferredWidthin interfaceICellPainter- Parameters:
cell- The cell for which the preferred width is requested.gc- The GC that is used for rendering.configRegistry- The IConfigRegistry that contains the configuration used for rendering.- Returns:
- The preferred width of the given cell when rendered by this painter.
-
run
Respond to mouse click. Simulate button press.- Specified by:
runin interfaceIMouseAction- Parameters:
natTable- The NatTable instance on which the MouseEvent was fired and on which the command should be executed.event- The received MouseEvent.
-
addClickListener
-
removeClickListener
-
setButtonFlashTime
public void setButtonFlashTime(int flashTimeInMS)
-