Class GridHeaderRenderer

    • Field Detail

      • wordWrap

        private boolean wordWrap
      • horizontalAlignment

        private int horizontalAlignment
      • truncationStyle

        protected int truncationStyle
        Truncation style
    • Constructor Detail

      • GridHeaderRenderer

        public GridHeaderRenderer()
    • Method Detail

      • 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