com.smartgwt.client.widgets.grid

## Class HeaderSpan

- java.lang.Object
- - com.smartgwt.client.core.JsObject
  - - com.smartgwt.client.core.DataClass
    - - com.smartgwt.client.widgets.grid.HeaderSpan

- All Implemented Interfaces:
    com.google.gwt.event.shared.HasHandlers

      public class HeaderSpan
      extends DataClass

  A header span appears as a second level of headers in a ListGrid, spanning one or more ListGrid columns and their associated headers.

  See `ListGrid.headerSpans`.

  In addition to the properties documented here, all other properties specified on the headerSpan object will be passed to the create() method of the `ListGrid.headerSpanConstructor`. This allows you to set properties such as `Button.baseStyle` or `StretchImgButton.src` directly in a `headerSpan`.

- - ### Field Summary

    - ### Fields inherited from class com.smartgwt.client.core.DataClass

      `factoryCreated, factoryProperties`

    - ### Fields inherited from class com.smartgwt.client.core.JsObject

      `jsObj`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HeaderSpan()`
    `HeaderSpan(com.google.gwt.core.client.JavaScriptObject jsObj)`
    `HeaderSpan(java.lang.String title, java.lang.String[] fields)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Alignment` | `getAlign()` Horizontal alignment of the title of this headerSpan.
    `java.lang.String[]` | `getFields()` List of fields that this header spans.
    `java.lang.String` | `getHeaderBaseStyle()` Custom base style to apply to the header button created for this span instead of `ListGrid.headerBaseStyle`.
    `java.lang.String` | `getHeaderTitle()` Optional title for the headerSpan button for this headerSpan.
    `java.lang.String` | `getHeaderTitleStyle()` Custom titleStyle to apply to the header button created for this span instead of `ListGrid.headerTitleStyle`.
    `java.lang.Integer` | `getHeight()` Height of this headerSpan.
    `java.lang.String` | `getName()` Name for this headerSpan, for use in APIs like `ListGrid.setHeaderSpanTitle()`.
    `static HeaderSpan` | `getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)`
    `HeaderSpan[]` | `getSpans()` This property allows developer to "nest" header spans, grouping fields together by multiple layers of granularity.
    `java.lang.String` | `getTitle()` A title for this headerSpan, to display in the headerSpan button for this headerSpan and in other contexts such as the `menu for picking visible fields`.
    `VerticalAlignment` | `getValign()` Vertical alignment of the title of this headerSpan.
    `java.lang.Boolean` | `getWrap()` Should the span title wrap if there is not enough space horizontally to accommodate it.
    `HeaderSpan` | `setAlign(Alignment align)` Horizontal alignment of the title of this headerSpan.
    `HeaderSpan` | `setFields(java.lang.String... fields)` List of fields that this header spans.
    `HeaderSpan` | `setHeaderBaseStyle(java.lang.String headerBaseStyle)` Custom base style to apply to the header button created for this span instead of `ListGrid.headerBaseStyle`.
    `void` | `setHeaderButtonProperties(Canvas buttonProperties)` Set the properties of the header button used for this span.
    `HeaderSpan` | `setHeaderTitle(java.lang.String headerTitle)` Optional title for the headerSpan button for this headerSpan.
    `HeaderSpan` | `setHeaderTitleStyle(java.lang.String headerTitleStyle)` Custom titleStyle to apply to the header button created for this span instead of `ListGrid.headerTitleStyle`.
    `HeaderSpan` | `setHeight(java.lang.Integer height)` Height of this headerSpan.
    `HeaderSpan` | `setName(java.lang.String name)` Name for this headerSpan, for use in APIs like `ListGrid.setHeaderSpanTitle()`.
    `HeaderSpan` | `setSpans(HeaderSpan... spans)` This property allows developer to "nest" header spans, grouping fields together by multiple layers of granularity.
    `HeaderSpan` | `setTitle(java.lang.String title)` A title for this headerSpan, to display in the headerSpan button for this headerSpan and in other contexts such as the `menu for picking visible fields`.
    `HeaderSpan` | `setValign(VerticalAlignment valign)` Vertical alignment of the title of this headerSpan.
    `HeaderSpan` | `setWrap(java.lang.Boolean wrap)` Should the span title wrap if there is not enough space horizontally to accommodate it.

    - ### Methods inherited from class com.smartgwt.client.core.DataClass

      `applyFactoryProperties, doAddHandler, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsDoubleArray, getAttributeAsFloat, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getAttributes, getHandlerCount, isFactoryCreated, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributeAsJavaObject, setFactoryCreated`

    - ### Methods inherited from class com.smartgwt.client.core.JsObject

      `equals, getJsObj, hashCode, isCreated, setJavaScriptObject, setJsObj`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### HeaderSpan

          public HeaderSpan()

    - #### HeaderSpan

          public HeaderSpan(com.google.gwt.core.client.JavaScriptObject jsObj)

    - #### HeaderSpan

          public HeaderSpan(java.lang.String title,
                            java.lang.String[] fields)

  - ### Method Detail

    - #### getOrCreateRef

          public static HeaderSpan getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)

    - #### setAlign

          public HeaderSpan setAlign(Alignment align)

      Horizontal alignment of the title of this headerSpan.
      Parameters:
        `align` - New align value. Default value is "center"
      Returns:
        `HeaderSpan` instance, for chaining setter calls

    - #### getAlign

          public Alignment getAlign()

      Horizontal alignment of the title of this headerSpan.
      Returns:
        Current align value. Default value is "center"

    - #### setFields

          public HeaderSpan setFields(java.lang.String... fields)

      List of fields that this header spans. Fields should be identified by their value for `ListGridField.name`.

      Developers may define multiple levels of header-spans by specifying `spans` however a span cannot be specified with both `fields` and `spans`.

      Parameters:
        `fields` - New fields value. Default value is null
      Returns:
        `HeaderSpan` instance, for chaining setter calls

    - #### getFields

          public java.lang.String[] getFields()

      List of fields that this header spans. Fields should be identified by their value for `ListGridField.name`.

      Developers may define multiple levels of header-spans by specifying `spans` however a span cannot be specified with both `fields` and `spans`.

      Returns:
        Current fields value. Default value is null

    - #### setHeaderBaseStyle

          public HeaderSpan setHeaderBaseStyle(java.lang.String headerBaseStyle)

      Custom base style to apply to the header button created for this span instead of `ListGrid.headerBaseStyle`.

      Note that depending on the header button constructor, you may have to specify `headerTitleStyle` as well.

      Parameters:
        `headerBaseStyle` - New headerBaseStyle value. Default value is null
      Returns:
        `HeaderSpan` instance, for chaining setter calls
      See Also:
        `CSSStyleName`, `Appearance overview and related methods`

    - #### getHeaderBaseStyle

          public java.lang.String getHeaderBaseStyle()

      Custom base style to apply to the header button created for this span instead of `ListGrid.headerBaseStyle`.

      Note that depending on the header button constructor, you may have to specify `headerTitleStyle` as well.

      Returns:
        Current headerBaseStyle value. Default value is null
      See Also:
        `CSSStyleName`, `Appearance overview and related methods`

    - #### setHeaderTitle

          public HeaderSpan setHeaderTitle(java.lang.String headerTitle)

      Optional title for the headerSpan button for this headerSpan. If specified this will be displayed in the headerSpan button instead of `title`. Set to an empty string to suppress the title in the header button entirely.
      Parameters:
        `headerTitle` - New headerTitle value. Default value is null
      Returns:
        `HeaderSpan` instance, for chaining setter calls

    - #### getHeaderTitle

          public java.lang.String getHeaderTitle()

      Optional title for the headerSpan button for this headerSpan. If specified this will be displayed in the headerSpan button instead of `title`. Set to an empty string to suppress the title in the header button entirely.
      Returns:
        Current headerTitle value. Default value is null

    - #### setHeaderTitleStyle

          public HeaderSpan setHeaderTitleStyle(java.lang.String headerTitleStyle)

      Custom titleStyle to apply to the header button created for this span instead of `ListGrid.headerTitleStyle`.

      Note that this will typically only have an effect if `ListGrid.headerButtonConstructor` is set to `StretchImgButton` or a subclass thereof.

      Parameters:
        `headerTitleStyle` - New headerTitleStyle value. Default value is null
      Returns:
        `HeaderSpan` instance, for chaining setter calls
      See Also:
        `setHeaderBaseStyle(java.lang.String)`, `CSSStyleName`, `Appearance overview and related methods`

    - #### getHeaderTitleStyle

          public java.lang.String getHeaderTitleStyle()

      Custom titleStyle to apply to the header button created for this span instead of `ListGrid.headerTitleStyle`.

      Note that this will typically only have an effect if `ListGrid.headerButtonConstructor` is set to `StretchImgButton` or a subclass thereof.

      Returns:
        Current headerTitleStyle value. Default value is null
      See Also:
        `getHeaderBaseStyle()`, `CSSStyleName`, `Appearance overview and related methods`

    - #### setHeight

          public HeaderSpan setHeight(java.lang.Integer height)

      Height of this headerSpan. Defaults to `ListGrid.headerSpanHeight`.
      Parameters:
        `height` - New height value. Default value is null
      Returns:
        `HeaderSpan` instance, for chaining setter calls

    - #### getHeight

          public java.lang.Integer getHeight()

      Height of this headerSpan. Defaults to `ListGrid.headerSpanHeight`.
      Returns:
        Current height value. Default value is null

    - #### setName

          public HeaderSpan setName(java.lang.String name)

      Name for this headerSpan, for use in APIs like `ListGrid.setHeaderSpanTitle()`.

      Name is optional, but if specified, must be unique for this ListGrid (but not globally unique) as well as a valid JavaScript identifier, as specified by ECMA-262 Section 7.6 (the StringUtil.isValidID() function can be used to test whether a name is a valid JavaScript identifier).

      Parameters:
        `name` - New name value. Default value is null
      Returns:
        `HeaderSpan` instance, for chaining setter calls
      See Also:
        `Identifier`

    - #### getName

          public java.lang.String getName()

      Name for this headerSpan, for use in APIs like `ListGrid.setHeaderSpanTitle()`.

      Name is optional, but if specified, must be unique for this ListGrid (but not globally unique) as well as a valid JavaScript identifier, as specified by ECMA-262 Section 7.6 (the StringUtil.isValidID() function can be used to test whether a name is a valid JavaScript identifier).

      Returns:
        Current name value. Default value is null
      See Also:
        `Identifier`

    - #### setSpans

          public HeaderSpan setSpans(HeaderSpan... spans)

      This property allows developer to "nest" header spans, grouping fields together by multiple layers of granularity.

      For example a group of fields could be nested within two layers of header spans as follows:

                 HeaderSpan france = new HeaderSpan("France", new String[] {"Paris", "Lyon"});
                 HeaderSpan uk = new HeaderSpan("UK", new String[] {"London", "Glasgow"});
                 HeaderSpan spain = new HeaderSpan("Spain", new String[] {"Barcelona"});

                 HeaderSpan europe = new HeaderSpan();
                 europe.setTitle("Europe");
                 europe.setSpans(france, uk, spain);

      Note that a span definition can not include both `spans` and `fields`.
      Parameters:
        `spans` - New spans value. Default value is null
      Returns:
        `HeaderSpan` instance, for chaining setter calls

    - #### getSpans

          public HeaderSpan[] getSpans()

      This property allows developer to "nest" header spans, grouping fields together by multiple layers of granularity.

      For example a group of fields could be nested within two layers of header spans as follows:

                 HeaderSpan france = new HeaderSpan("France", new String[] {"Paris", "Lyon"});
                 HeaderSpan uk = new HeaderSpan("UK", new String[] {"London", "Glasgow"});
                 HeaderSpan spain = new HeaderSpan("Spain", new String[] {"Barcelona"});

                 HeaderSpan europe = new HeaderSpan();
                 europe.setTitle("Europe");
                 europe.setSpans(france, uk, spain);

      Note that a span definition can not include both `spans` and `fields`.
      Returns:
        Current spans value. Default value is null

    - #### setTitle

          public HeaderSpan setTitle(java.lang.String title)

      A title for this headerSpan, to display in the headerSpan button for this headerSpan and in other contexts such as the `menu for picking visible fields`. Note: if you want to use HTML tags to affect the display of the header, you should do so via `headerTitle` instead so that other places where the title appears in the UI are not affected. Refer to discussion at `ListGridField.title`.
      Parameters:
        `title` - New title value. Default value is null
      Returns:
        `HeaderSpan` instance, for chaining setter calls

    - #### getTitle

          public java.lang.String getTitle()

      A title for this headerSpan, to display in the headerSpan button for this headerSpan and in other contexts such as the `menu for picking visible fields`. Note: if you want to use HTML tags to affect the display of the header, you should do so via `headerTitle` instead so that other places where the title appears in the UI are not affected. Refer to discussion at `ListGridField.title`.
      Returns:
        Current title value. Default value is null

    - #### setValign

          public HeaderSpan setValign(VerticalAlignment valign)

      Vertical alignment of the title of this headerSpan.

      Defaults to listGrid.headerSpanVAlign if unset.

      Parameters:
        `valign` - New valign value. Default value is null
      Returns:
        `HeaderSpan` instance, for chaining setter calls

    - #### getValign

          public VerticalAlignment getValign()

      Vertical alignment of the title of this headerSpan.

      Defaults to listGrid.headerSpanVAlign if unset.

      Returns:
        Current valign value. Default value is null

    - #### setWrap

          public HeaderSpan setWrap(java.lang.Boolean wrap)

      Should the span title wrap if there is not enough space horizontally to accommodate it. If unset, default behavior is derived from `ListGrid.wrapHeaderSpanTitles`. (This is a soft-wrap - if set the title will wrap at word boundaries.)
      Parameters:
        `wrap` - New wrap value. Default value is null
      Returns:
        `HeaderSpan` instance, for chaining setter calls
      See Also:
        `ListGridField.setWrap(java.lang.Boolean)`

    - #### getWrap

          public java.lang.Boolean getWrap()

      Should the span title wrap if there is not enough space horizontally to accommodate it. If unset, default behavior is derived from `ListGrid.wrapHeaderSpanTitles`. (This is a soft-wrap - if set the title will wrap at word boundaries.)
      Returns:
        Current wrap value. Default value is null
      See Also:
        `ListGridField.getWrap()`

    - #### setHeaderButtonProperties

          public void setHeaderButtonProperties(Canvas buttonProperties)

      Set the properties of the header button used for this span. The buttonProperties parameter should be the same class as the headerButtonConstructor for the ListGrid (most commonly Button, ImgButton or StretchImgButton, and typically set up in the load_skin.js file for the loaded theme).
      Parameters:
        `buttonProperties` - the header button properties.