Package org.eclipse.nebula.widgets.grid
Class GridHeaderRenderer
java.lang.Object
org.eclipse.nebula.widgets.grid.AbstractRenderer
org.eclipse.nebula.widgets.grid.AbstractInternalWidget
org.eclipse.nebula.widgets.grid.GridHeaderRenderer
- All Implemented Interfaces:
IInternalWidget
,IRenderer
- Direct Known Subclasses:
DefaultColumnGroupHeaderRenderer
,DefaultColumnHeaderRenderer
public abstract class GridHeaderRenderer extends AbstractInternalWidget
NOTE: THIS WIDGET AND ITS API ARE STILL UNDER DEVELOPMENT. THIS IS A PRE-RELEASE ALPHA VERSION. USERS SHOULD EXPECT API CHANGES IN FUTURE VERSIONS.
The super class for all grid header renderers. Contains the properties specific to a grid header.-
Field Summary
Fields Modifier and Type Field Description protected int
truncationStyle
Truncation styleFields inherited from interface org.eclipse.nebula.widgets.grid.IInternalWidget
LeftMouseButtonDown, MouseMove
-
Constructor Summary
Constructors Constructor Description GridHeaderRenderer()
-
Method Summary
Modifier and Type Method Description protected org.eclipse.swt.graphics.Rectangle
getControlBounds(java.lang.Object value, boolean preferred)
Returns the bounds of the control to displayint
getHorizontalAlignment()
Returns the header horizontal alignment.org.eclipse.swt.graphics.Rectangle
getTextBounds(java.lang.Object value, boolean preferred)
Returns the bounds of the text in the cell.org.eclipse.swt.graphics.Rectangle
getToggleBounds()
Returns the bounds of the toggle within the header (typically only group headers have toggles) or null.int
getTruncationStyle()
Get the truncation styleboolean
isWordWrap()
Returns whether or not text will be word-wrapped during the rendervoid
setHorizontalAlignment(int alignment)
Sets the header horizontal alignment.void
setTruncationStyle(int truncationStyle)
Set the truncation style to use when cell content is too large.void
setWordWrap(boolean wordWrap)
Sets whether or not text should be word-wrapped during the renderMethods inherited from class org.eclipse.nebula.widgets.grid.AbstractInternalWidget
getHoverDetail, setHoverDetail
Methods inherited from class org.eclipse.nebula.widgets.grid.AbstractRenderer
getBounds, getDisplay, getSize, isExpanded, isFocus, isHover, isMouseDown, isSelected, setBounds, setBounds, setDisplay, setExpanded, setFocus, setHover, setLocation, setLocation, setMouseDown, setSelected, setSize, setSize
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.nebula.widgets.grid.IRenderer
computeSize, paint, setBounds, setBounds, setDisplay, setExpanded, setFocus, setHover, setLocation, setLocation, setMouseDown, setSelected, setSize, setSize
-
Field Details
-
truncationStyle
protected int truncationStyleTruncation style
-
-
Constructor Details
-
GridHeaderRenderer
public GridHeaderRenderer()
-
-
Method Details
-
getTextBounds
public org.eclipse.swt.graphics.Rectangle getTextBounds(java.lang.Object value, boolean preferred)Returns the bounds of the text in the cell. This is used when displaying in-place tooltips. Ifnull
is returned here, in-place tooltips will not be displayed. If thepreferred
argument istrue
then the returned bounds should be large enough to show the entire text. Ifpreferred
isfalse
then the returned bounds should be be relative to the current bounds.- Parameters:
value
- the object being rendered.preferred
- true if the preferred width of the text should be returned.- Returns:
- bounds of the text.
-
getToggleBounds
public org.eclipse.swt.graphics.Rectangle getToggleBounds()Returns the bounds of the toggle within the header (typically only group headers have toggles) or null.- Returns:
- toggle bounds or null if no toggle exists.
-
getControlBounds
protected org.eclipse.swt.graphics.Rectangle getControlBounds(java.lang.Object value, boolean preferred)Returns the bounds of the control to display- Parameters:
value
- the control to displaypreferred
- iftrue
, compute the preferred size- Returns:
- the bounds for the control or
null
if no control is rendered
-
isWordWrap
public boolean isWordWrap()Returns whether or not text will be word-wrapped during the render- Returns:
- the wordWrap True if word wrapping is enabled
-
setWordWrap
public void setWordWrap(boolean wordWrap)Sets whether or not text should be word-wrapped during the render- Parameters:
wordWrap
- True to wrap text, false otherwise
-
getHorizontalAlignment
public int getHorizontalAlignment()Returns the header horizontal alignment.- Returns:
- SWT.LEFT, SWT.RIGHT, SWT.CENTER
- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setHorizontalAlignment
public void setHorizontalAlignment(int alignment)Sets the header horizontal alignment.- Parameters:
alignment
- The alignment to set.
-
getTruncationStyle
public int getTruncationStyle()Get the truncation style- Returns:
- the truncation style.
-
setTruncationStyle
public void setTruncationStyle(int truncationStyle)Set the truncation style to use when cell content is too large.- Parameters:
truncationStyle
-- See Also:
SWT.LEFT
,SWT.CENTER
,SWT.RIGHT
-