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.Object
AAbstractGridCell
has 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 class
AbstractGridCell.Alignment
Either 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 boolean
equals(java.lang.Object obj)
int
getColumn()
The id of the column.AbstractGridCell.Alignment
getHorizontalAlignment()
Returns the horizontal alignment of the control that is used if horizontal fill is set to false.int
getHorizontalSpan()
Return the horizontalSpan of this control.RENDERER
getRenderer()
int
getRow()
The id of the row.AbstractGridCell.Alignment
getVerticalAlignment()
Returns the vertical alignment of the control that is used if vertical fill is set to false.int
hashCode()
boolean
isHorizontalFill()
Returns whether the control should fill the available horizontal space.boolean
isHorizontalGrab()
Returns whether this cell will take all available horizontal space.boolean
isVerticalFill()
Returns whether the control should fill the available vertical space.boolean
isVerticalGrab()
Returns whether this cell will take all available vertical space.void
setHorizontalAlignment(AbstractGridCell.Alignment horizontalAlignment)
Set the horizontal alignment.void
setHorizontalFill(boolean horizontalFill)
True if the available horizontal space should be filled.void
setHorizontalGrab(boolean horizontalGrab)
True if all available horizontal space should be taken.void
setHorizontalSpan(int horizontalSpan)
Set the horizontal span of this cell.void
setRenderer(RENDERER renderer)
void
setVerticalAlignment(AbstractGridCell.Alignment verticalAlignment)
Set the vertical alignment.void
setVerticalFill(boolean verticalFill)
True if the available vertical space should be filled.void
setVerticalGrab(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
- theAbstractRenderer
that 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:
hashCode
in classjava.lang.Object
- See Also:
Object.hashCode()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
- See Also:
Object.equals(java.lang.Object)
-
-