Class GridHeaderRenderer

java.lang.Object
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 Details

  • Constructor Details

  • 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. If null is returned here, in-place tooltips will not be displayed. If the preferred argument is true then the returned bounds should be large enough to show the entire text. If preferred is false 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 display
      preferred - if true, 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