com.smartgwt.client.widgets.grid
Class HeaderSpan

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

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 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 headerSpanConstructor. This allows you to set properties such as baseStyle or src directly in a headerSpan.


Field Summary
 
Fields inherited from class com.smartgwt.client.core.JsObject
jsObj
 
Constructor Summary
HeaderSpan()
           
HeaderSpan(JavaScriptObject jsObj)
           
HeaderSpan(String title, String[] fields)
           
 
Method Summary
 Alignment getAlign()
          Horizontal alignment of the title of this headerSpan.
 String[] getFields()
          List of fields that this header spans.
 String getHeaderBaseStyle()
          Custom base style to apply to the header button created for this span instead of headerBaseStyle.
 String getHeaderTitle()
          Optional title for the headerSpan button for this headerSpan.
 String getHeaderTitleStyle()
          Custom titleStyle to apply to the header button created for this span instead of headerTitleStyle.
 Integer getHeight()
          Height of this headerSpan.
 String getName()
          Name for this headerSpan, for use in APIs like ListGrid.setHeaderSpanTitle.
static HeaderSpan getOrCreateRef(JavaScriptObject jsObj)
           
 HeaderSpan[] getSpans()
          This property allows developer to "nest" header spans, grouping fields together by multiple layers of granularity.
 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.
 void setAlign(Alignment align)
          Horizontal alignment of the title of this headerSpan.
 void setFields(String... fields)
          List of fields that this header spans.
 void setHeaderBaseStyle(String headerBaseStyle)
          Custom base style to apply to the header button created for this span instead of headerBaseStyle.
 void setHeaderButtonProperties(Canvas buttonProperties)
          Set the properties of the header button used for this span.
 void setHeaderTitle(String headerTitle)
          Optional title for the headerSpan button for this headerSpan.
 void setHeaderTitleStyle(String headerTitleStyle)
          Custom titleStyle to apply to the header button created for this span instead of headerTitleStyle.
 void setHeight(Integer height)
          Height of this headerSpan.
 void setName(String name)
          Name for this headerSpan, for use in APIs like ListGrid.setHeaderSpanTitle.
 void setSpans(HeaderSpan... spans)
          This property allows developer to "nest" header spans, grouping fields together by multiple layers of granularity.
 void setTitle(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.
 void setValign(VerticalAlignment valign)
          Vertical alignment of the title of this headerSpan.
 
Methods inherited from class com.smartgwt.client.core.DataClass
doAddHandler, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsDoubleArray, getAttributeAsFloat, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getAttributes, getHandlerCount, 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
 
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(JavaScriptObject jsObj)

HeaderSpan

public HeaderSpan(String title,
                  String[] fields)
Method Detail

getOrCreateRef

public static HeaderSpan getOrCreateRef(JavaScriptObject jsObj)

setAlign

public void setAlign(Alignment align)
Horizontal alignment of the title of this headerSpan.

Parameters:
align - Default value is "center"

getAlign

public Alignment getAlign()
Horizontal alignment of the title of this headerSpan.

Returns:
Alignment

setFields

public void setFields(String... fields)
List of fields that this header spans. Fields should be identified by their value for 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 - Default value is null

getFields

public String[] getFields()
List of fields that this header spans. Fields should be identified by their value for name.

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

Returns:
String...

setHeaderBaseStyle

public void setHeaderBaseStyle(String headerBaseStyle)
Custom base style to apply to the header button created for this span instead of headerBaseStyle.

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

Parameters:
headerBaseStyle - See CSSClass . Default value is null
See Also:
Appearance overview and related methods

getHeaderBaseStyle

public String getHeaderBaseStyle()
Custom base style to apply to the header button created for this span instead of headerBaseStyle.

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

Returns:
See CSSClass
See Also:
Appearance overview and related methods

setHeaderTitle

public void setHeaderTitle(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 - Default value is null

getHeaderTitle

public 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:
String

setHeaderTitleStyle

public void setHeaderTitleStyle(String headerTitleStyle)
Custom titleStyle to apply to the header button created for this span instead of headerTitleStyle.

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

Parameters:
headerTitleStyle - See CSSClass . Default value is null
See Also:
setHeaderBaseStyle(java.lang.String), Appearance overview and related methods

getHeaderTitleStyle

public String getHeaderTitleStyle()
Custom titleStyle to apply to the header button created for this span instead of headerTitleStyle.

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

Returns:
See CSSClass
See Also:
getHeaderBaseStyle(), Appearance overview and related methods

setHeight

public void setHeight(Integer height)
Height of this headerSpan. Defaults to headerSpanHeight.

Parameters:
height - Default value is null

getHeight

public Integer getHeight()
Height of this headerSpan. Defaults to headerSpanHeight.

Returns:
Integer

setName

public void setName(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 - Default value is null

getName

public 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:
String

setSpans

public void 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 - Default value is null

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:
HeaderSpan...

setTitle

public void setTitle(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 title.

Parameters:
title - Default value is null

getTitle

public 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 title.

Returns:
String

setValign

public void setValign(VerticalAlignment valign)
Vertical alignment of the title of this headerSpan.

Defaults to listGrid.headerSpanVAlign if unset.

Parameters:
valign - Default value is null

getValign

public VerticalAlignment getValign()
Vertical alignment of the title of this headerSpan.

Defaults to listGrid.headerSpanVAlign if unset.

Returns:
VerticalAlignment

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.