Class AbstractGridCell<RENDERER extends AbstractRenderer<?>>
- java.lang.Object
-
- org.eclipse.emf.ecp.view.model.common.AbstractGridCell<RENDERER>
-
- Type Parameters:
RENDERER- the renderer type (e.g. SWT or JavaFX renderer)
- Direct Known Subclasses:
SWTGridCell
public abstract class AbstractGridCell<RENDERER extends AbstractRenderer<?>> extends java.lang.ObjectAAbstractGridCellhas a row, a column and a renderer it is rendered by a renderer.- Author:
- Eugen Neufeld, Lucas Köhler
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractGridCell.AlignmentEither horizontal or vertical alignment within the cell.
-
Constructor Summary
Constructors Constructor Description AbstractGridCell(int row, int column, RENDERER renderer)Default constructor to create a grid cell.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)intgetColumn()The id of the column.AbstractGridCell.AlignmentgetHorizontalAlignment()Returns the horizontal alignment of the control that is used if horizontal fill is set to false.intgetHorizontalSpan()Return the horizontalSpan of this control.RENDERERgetRenderer()intgetRow()The id of the row.AbstractGridCell.AlignmentgetVerticalAlignment()Returns the vertical alignment of the control that is used if vertical fill is set to false.inthashCode()booleanisHorizontalFill()Returns whether the control should fill the available horizontal space.booleanisHorizontalGrab()Returns whether this cell will take all available horizontal space.booleanisVerticalFill()Returns whether the control should fill the available vertical space.booleanisVerticalGrab()Returns whether this cell will take all available vertical space.voidsetHorizontalAlignment(AbstractGridCell.Alignment horizontalAlignment)Set the horizontal alignment.voidsetHorizontalFill(boolean horizontalFill)True if the available horizontal space should be filled.voidsetHorizontalGrab(boolean horizontalGrab)True if all available horizontal space should be taken.voidsetHorizontalSpan(int horizontalSpan)Set the horizontal span of this cell.voidsetRenderer(RENDERER renderer)voidsetVerticalAlignment(AbstractGridCell.Alignment verticalAlignment)Set the vertical alignment.voidsetVerticalFill(boolean verticalFill)True if the available vertical space should be filled.voidsetVerticalGrab(boolean verticalGrab)True if all available vertical space should be taken.
-
-
-
Constructor Detail
-
AbstractGridCell
public AbstractGridCell(int row, int column, RENDERER renderer)Default constructor to create a grid cell.- Parameters:
row- the row of the cellcolumn- the column of the cellrenderer- theAbstractRendererthat renderes the cell
-
-
Method Detail
-
getRow
public int getRow()
The id of the row.- Returns:
- the row
-
getColumn
public int getColumn()
The id of the column.- Returns:
- the column
-
getRenderer
public RENDERER getRenderer()
- Returns:
- the renderer
-
setRenderer
public void setRenderer(RENDERER renderer)
- Parameters:
renderer- the renderer to set
-
getHorizontalSpan
public int getHorizontalSpan()
Return the horizontalSpan of this control. Default is 1.- Returns:
- the horizontalSpan
-
setHorizontalSpan
public void setHorizontalSpan(int horizontalSpan)
Set the horizontal span of this cell.- Parameters:
horizontalSpan- the horizontalSpan to set
-
isVerticalGrab
public boolean isVerticalGrab()
Returns whether this cell will take all available vertical space.- Returns:
- the verticalGrab
-
setVerticalGrab
public void setVerticalGrab(boolean verticalGrab)
True if all available vertical space should be taken.- Parameters:
verticalGrab- the verticalGrab to set
-
isVerticalFill
public boolean isVerticalFill()
Returns whether the control should fill the available vertical space.- Returns:
- the verticalFill
-
setVerticalFill
public void setVerticalFill(boolean verticalFill)
True if the available vertical space should be filled.- Parameters:
verticalFill- the verticalFill to set
-
isHorizontalGrab
public boolean isHorizontalGrab()
Returns whether this cell will take all available horizontal space.- Returns:
- the horizontalGrab
-
setHorizontalGrab
public void setHorizontalGrab(boolean horizontalGrab)
True if all available horizontal space should be taken.- Parameters:
horizontalGrab- the horizontalGrab to set
-
isHorizontalFill
public boolean isHorizontalFill()
Returns whether the control should fill the available horizontal space.- Returns:
- the horizontalFill
-
setHorizontalFill
public void setHorizontalFill(boolean horizontalFill)
True if the available horizontal space should be filled.- Parameters:
horizontalFill- the horizontalFill to set
-
getHorizontalAlignment
public AbstractGridCell.Alignment getHorizontalAlignment()
Returns the horizontal alignment of the control that is used if horizontal fill is set to false. Default isAbstractGridCell.Alignment.BEGINNING.- Returns:
- the horizontalAlignment
- Since:
- 1.9
-
setHorizontalAlignment
public void setHorizontalAlignment(AbstractGridCell.Alignment horizontalAlignment)
Set the horizontal alignment. This alignment is only considered if horizontal fill is set to false.- Parameters:
horizontalAlignment- the horizontalAlignment to set- Since:
- 1.9
-
getVerticalAlignment
public AbstractGridCell.Alignment getVerticalAlignment()
Returns the vertical alignment of the control that is used if vertical fill is set to false. Default isAbstractGridCell.Alignment.CENTER.- Returns:
- the verticalAlignment
- Since:
- 1.9
-
setVerticalAlignment
public void setVerticalAlignment(AbstractGridCell.Alignment verticalAlignment)
Set the vertical alignment. This alignment is only considered if vertical fill is set to false.- Parameters:
verticalAlignment- the verticalAlignment to set- Since:
- 1.9
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object- See Also:
Object.hashCode()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object- See Also:
Object.equals(java.lang.Object)
-
-