com.extjs.gxt.ui.client.widget
Class Header

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.extjs.gxt.ui.client.widget.Component
              extended by com.extjs.gxt.ui.client.widget.Header
All Implemented Interfaces:
Observable, IconSupport, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener

public class Header
extends Component
implements IconSupport

A custom component that supports an icon, text, and tool area.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
Header()
           
 
Method Summary
 void addTool(Component tool)
          Adds a tool.
 com.google.gwt.user.client.ui.AbstractImagePrototype getIcon()
          Returns the icon.
 java.lang.String getText()
          Returns the header's text.
 java.lang.String getTextStyle()
          Returns the item's text style.
 Component getTool(int index)
          Returns the tool at the given index.
 int getToolCount()
          Returns the number of tool items.
 void insertTool(Component tool, int index)
          Inserts a tool.
 void removeTool(Component tool)
          Removes a tool.
 void setIcon(com.google.gwt.user.client.ui.AbstractImagePrototype icon)
          Sets the header's icon style.
 void setIconStyle(java.lang.String icon)
          Sets the icon style.
 void setText(java.lang.String text)
          Sets the header's text.
 void setTextStyle(java.lang.String textStyle)
          Sets the style name added to the header's text element.
 
Methods inherited from class com.extjs.gxt.ui.client.widget.Component
addListener, addPlugin, addStyleName, addWidgetListener, clearState, disable, disableEvents, disableTextSelection, el, enable, enableEvents, fireEvent, fireEvent, fireEvent, fly, focus, getBaseStyle, getBorders, getContextMenu, getData, getElement, getHideMode, getId, getItemId, getListeners, getModel, getState, getStateId, getToolTip, hasListeners, hasListeners, hide, hideToolTip, isDisabledEvents, isEnabled, isRendered, isStateful, isVisible, mask, mask, mask, onBrowserEvent, onComponentEvent, recalculate, removeAllListeners, removeFromParent, removeListener, removeStyleName, removeSwallow, removeToolTip, removeWidgetListener, render, render, repaint, saveState, setBorders, setContextMenu, setData, setElement, setEnabled, setHeight, setHideMode, setId, setIntStyleAttribute, setItemId, setPixelSize, setSize, setStateful, setStateId, setStyleAttribute, setStyleName, setTitle, setToolTip, setToolTip, setVisible, setWidth, setZIndex, show, sinkEvents, swallowEvent, swallowEvent, toString, unmask
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
fireEvent, getParent, isAttached
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, setStylePrimaryName, setVisible, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Header

public Header()
Method Detail

addTool

public void addTool(Component tool)
Adds a tool.

Parameters:
tool - the tool to be inserted

getIcon

public com.google.gwt.user.client.ui.AbstractImagePrototype getIcon()
Description copied from interface: IconSupport
Returns the icon.

Specified by:
getIcon in interface IconSupport
Returns:
the icon

getText

public java.lang.String getText()
Returns the header's text.

Returns:
the text

getTextStyle

public java.lang.String getTextStyle()
Returns the item's text style.

Returns:
the textStyle the text style

getTool

public Component getTool(int index)
Returns the tool at the given index.

Parameters:
index - the index
Returns:
the tool

getToolCount

public int getToolCount()
Returns the number of tool items.

Returns:
the count

insertTool

public void insertTool(Component tool,
                       int index)
Inserts a tool.

Parameters:
tool - the tool to insert
index - the insert location

removeTool

public void removeTool(Component tool)
Removes a tool.

Parameters:
tool - the tool to remove

setIcon

public void setIcon(com.google.gwt.user.client.ui.AbstractImagePrototype icon)
Sets the header's icon style. The style name should match a CSS style that specifies a background image using the following format:
 <code>
 .my-icon {
    background: url(images/icons/my-icon.png) no-repeat center left !important;
 }
 </code>
 

Specified by:
setIcon in interface IconSupport
Parameters:
icon - the icon

setIconStyle

public void setIconStyle(java.lang.String icon)
Description copied from interface: IconSupport
Sets the icon style.

Specified by:
setIconStyle in interface IconSupport
Parameters:
icon - a CSS style name

setText

public void setText(java.lang.String text)
Sets the header's text.

Parameters:
text - the new text

setTextStyle

public void setTextStyle(java.lang.String textStyle)
Sets the style name added to the header's text element.

Parameters:
textStyle - the text style