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

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
All Implemented Interfaces:
Observable, com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.IsWidget
Direct Known Subclasses:
BoxComponent, ColorPalette, DataListItem, DataViewItem, Document, FillToolItem, FramePanel, Header, Item, MenuBarItem, SeparatorToolItem, Shortcut, TabItem.HeaderItem, TableItem, TreeItem

public abstract class Component
extends com.google.gwt.user.client.ui.Widget
implements Observable

Base class for GXT components. All subclasses of Component can automatically participate in the standard GXT component lifecycle of creation, attach and detach. They also have automatic support for basic hide/show and enable/disable behavior. Component allows any subclass to be lazy-rendered into any GXT Container. Components added to a GWT Panel will be rendered when inserted. All visual widgets that require rendering into a layout should subclass Component (or BoxComponent if managed box model handling is required).

The following 4 methods inherited from UIObject (setSize, setWidth, setHeight, setPixelSize) have been overridden and do nothing. Any component whose size can change should subclass BoxComponent.

All components are registered and unregistered with the ComponentManager when the are attached and detached.

Events:
Enable : ComponentEvent(component)
Fires after the component is enabled.
Disable : ComponentEvent(component)
Fires after the component is disabled.
BeforeHide : ComponentEvent(component)
Fires before the component is hidden. Listeners can cancel the action by calling BaseEvent.setCancelled(boolean).
BeforeShow : ComponentEvent(component)
Fires before the component is shown. Listeners can cancel the action by calling BaseEvent.setCancelled(boolean).
Hide : ComponentEvent(component)
Fires after the component is hidden.
Show : ComponentEvent(component)
Fires after the component is shown.
Attach : ComponentEvent(component)
Fires after the component is attached.
Detach : ComponentEvent(component)
Fires after the component is detached.
BeforeRender : ComponentEvent(component)
Fires before the component is rendered. Listeners can cancel the action by calling BaseEvent.setCancelled(boolean).
Render : ComponentEvent(component)
Fires after the component is rendered.
BrowserEvent : ComponentEvent(component, event)
Fires on any browser event the component receives. Listeners will be called prior to any event processing and before onComponentEvent(ComponentEvent) is called. Listeners can call BaseEvent.setCancelled(boolean) to cancel the processing of the event.
BeforeStateRestore : ComponentEvent(component, state)
Fires before the state of the component is restored. Listeners can cancel the action by calling BaseEvent.setCancelled(boolean).
StateRestore : ComponentEvent(component, state)
Fires after the state of the component is restored.
BeforeStateSave : ComponentEvent(component, state)
Fires before the state of the component is saved to the configured state provider. Listeners can cancel the action by calling BaseEvent.setCancelled(boolean).
StateSave : ComponentEvent(component, state)
Fires after the state of the component is saved to the configured state provider.

See Also:
ComponentManager

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
protected  boolean afterRender
           
protected  java.util.List<ComponentAttachable> attachables
           
protected  java.lang.String baseStyle
          The base style is typically set as the component's style when rendered.
protected  boolean disabled
          True if the component is disabled.
protected  java.lang.String disabledStyle
          The style used when a component is disabled (defaults to 'x-item-disabled').
protected  int disableTextSelection
           
protected  com.google.gwt.user.client.Element dummy
           
protected  boolean focusable
          True if the component is can receive focus (defaults to false).
protected  boolean hidden
          True if this component is hidden.
protected  boolean mask
           
protected  java.lang.String maskMessage
           
protected  java.lang.String maskMessageStyleName
           
protected  boolean monitorWindowResize
           
protected  boolean rendered
          True if this component has been rendered.
protected  com.google.gwt.event.shared.HandlerRegistration resizeHandler
           
protected  boolean setElementRender
           
protected  java.lang.String stateId
           
protected  java.util.List<SwallowEvent> swallowEvents
           
protected  ToolTip toolTip
           
protected  int windowResizeDelay
           
protected  DelayedTask windowResizeTask
           
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
  Component()
          Creates a new component.
protected Component(com.google.gwt.user.client.Element element, boolean attach)
          Specialized constructor for creating components from existing nodes.
 
Method Summary
protected  void addAttachable(ComponentAttachable a)
           
 void addListener(EventType eventType, Listener<? extends BaseEvent> listener)
          Appends an event handler to this component.
 void addPlugin(ComponentPlugin plugin)
          Adds a component plugin.
 void addStyleName(java.lang.String style)
          Adds a CSS style name to the component's underlying element.
protected  void addStyleOnOver(com.google.gwt.user.client.Element elem, java.lang.String style)
          Adds a style to the given element on mouseover.
 void addWidgetListener(WidgetListener listener)
          Adds a listener to receive widget events.
protected  void afterRender()
          Called after the component has been rendered and is attached for the first time.
protected  void applyState(java.util.Map<java.lang.String,java.lang.Object> state)
           
protected  void assertAfterRender()
           
protected  void assertPreRender()
           
protected  void beforeRender()
          Called before the component has been rendered.
protected  void blur()
          Tries to remove focus from the component.
 void clearState()
          Clears the component's state.
protected  ComponentEvent createComponentEvent(com.google.gwt.user.client.Event event)
           
protected  Observable createObservable()
           
protected  void createStyles(java.lang.String baseStyle)
           
 void disable()
          Disable this component.
protected  void disableContextMenu(boolean disable)
          Enables and disables the component's context menu.
 void disableEvents(boolean disable)
          True to disable event processing.
 void disableTextSelection(boolean disable)
          Enables and disables text selection for the component.
protected  void doAttachChildren()
           
protected  void doDetachChildren()
           
 El el()
          Returns the component's el instance.
 void enable()
          Enable this component.
 void enableEvents(boolean enable)
          Enables or disables event processing.
 boolean fireEvent(EventType type)
          Fires an event with the given event type.
 boolean fireEvent(EventType eventType, BaseEvent be)
          Fires an event.
 boolean fireEvent(EventType type, ComponentEvent ce)
          Fires the specified event with the given event type.
 El fly(com.google.gwt.user.client.Element elem)
          Returns the global flyweight instance.
 void focus()
          Try to focus this component.
protected  void frame()
           
 AriaSupport getAriaSupport()
          Returns the ARIA support configuration.
 java.lang.String getBaseStyle()
          Returns the component's base style.
 boolean getBorders()
          Returns the component's border state.
 Menu getContextMenu()
          Returns the component's context menu.
<X> X
getData(java.lang.String key)
          Returns the application defined property for the given name, or null if it has not been set.
 com.google.gwt.user.client.Element getElement()
           
protected  El getFocusEl()
           
 FocusManagerSupport getFocusSupport()
          Returns the focus manager support configuration.
 Style.HideMode getHideMode()
          Returns the component's hide mode.
 java.lang.String getId()
          Returns the id of this component.
 java.lang.String getItemId()
          Returns the item id of this component.
 java.util.List<Listener<? extends BaseEvent>> getListeners(EventType eventType)
          Returns a list of listeners registered for the given event type.
<X> X
getModel()
          Returns the component's model.
protected  Observable getObservable()
           
 java.util.List<ComponentPlugin> getPlugins()
          Returns the component's plugins.
 java.util.Map<java.lang.String,java.lang.Object> getState()
          Returns the component's state.
 java.lang.String getStateId()
          Returns the component's state id.
 int getTabIndex()
          Returns the component's tab index.
 java.lang.String getTitle()
           
 ToolTip getToolTip()
          Returns the component's tool tip.
protected  int getWindowResizeDelay()
          Returns the window resize delay.
 boolean hasListeners()
          Returns true if the observable has any listeners.
 boolean hasListeners(EventType eventType)
          Returns true if the observable has listeners for the given event type.
 void hide()
          Hide this component.
 void hideToolTip()
          Hides the component's tool tip (if one exists).
protected  void initState()
           
 boolean isDisabledEvents()
          Returns true if events are disabled.
 boolean isDisableTextSelection()
          Returns true if text selection is disabled.
 boolean isEnabled()
          Returns true if the component is enabled.
 boolean isMasked()
          Returns true if the component is masked.
protected  boolean isMonitorWindowResize()
          Returns true if browser resizing is monitored
 boolean isRendered()
          Returns true if the component is rendered.
 boolean isStateful()
          Returns true if the component is saving and restore it's state.
 boolean isVisible()
          Returns true if the component is visible.
 boolean isVisible(boolean deep)
          Returns true if the component is visible.
 El mask()
          Puts a mask over this component to disable user interaction.
 El mask(java.lang.String message)
          Puts a mask over this component to disable user interaction.
 El mask(java.lang.String message, java.lang.String messageStyleName)
          Puts a mask over this component to disable user interaction.
protected  void notifyHide()
           
protected  void notifyShow()
           
protected  void onAttach()
           
 void onBrowserEvent(com.google.gwt.user.client.Event event)
          Components delegate event handling to onComponentEvent(ComponentEvent).
 void onComponentEvent(ComponentEvent ce)
          Any events a component receives will be forwarded to this method.
protected  void onDetach()
           
protected  void onDetachHelper()
           
protected  void onDisable()
           
protected  void onEnable()
           
protected  void onEnsureDebugId(java.lang.String baseID)
           
protected  void onHide()
           
protected  void onHideContextMenu()
           
protected  void onLoad()
           
protected  void onRender(com.google.gwt.user.client.Element target, int index)
          Subclasses must override and ensure setElement is called for lazy rendered components.
protected  void onRightClick(ComponentEvent ce)
           
protected  void onShow()
           
protected  void onShowContextMenu(int x, int y)
           
protected  void onWindowResize(int width, int height)
           
protected  ComponentEvent previewEvent(EventType type, ComponentEvent ce)
           
 void recalculate()
          Called when the component is in a LayoutContainer and the container's layout executes.
 void removeAllListeners()
          Removes all listeners.
protected  void removeAttachagle(ComponentAttachable a)
           
 void removeFromParent()
           
 void removeListener(EventType eventType, Listener<? extends BaseEvent> listener)
          Removes a listener.
 void removeStyleName(java.lang.String style)
          Removes a CSS style name from the component's underlying element.
protected  void removeStyleOnOver(com.google.gwt.user.client.Element elem)
           
 void removeSwallow(SwallowEvent e)
          Removes a swallow event.
 void removeToolTip()
           
 void removeWidgetListener(WidgetListener listener)
          Removes a listener.
 void render(com.google.gwt.user.client.Element target)
          Renders the element.
 void render(com.google.gwt.user.client.Element target, int index)
          Renders the element.
 void repaint()
          Repaints the component if rendered.
 void saveState()
          Saves the component's current state by passing it to the StateManager and saving it using the state id or component id as the key.
protected  void setAriaRole(java.lang.String roleName)
           
protected  void setAriaState(java.lang.String stateName, java.lang.String stateValue)
           
 void setAriaSupport(AriaSupport ariaSupport)
          Sets the ARIA support configuration.
 void setBorders(boolean show)
          Adds or removes a border.
 void setContextMenu(Menu menu)
          Sets the component's context menu.
 void setData(java.lang.String key, java.lang.Object data)
          Sets the application defined property with the given name.
protected  void setEl(El el)
           
 void setElement(com.google.gwt.user.client.Element elem)
           
protected  void setElement(com.google.gwt.user.client.Element elem, com.google.gwt.user.client.Element parent, int index)
           
 void setEnabled(boolean enabled)
          Convenience function for setting disabled/enabled by boolean.
protected  void setFiresEvents(boolean firesEvents)
           
 void setHeight(java.lang.String height)
          Overrides UIObject and does nothing.
 void setHideMode(Style.HideMode hideMode)
          Sets the components hide mode (default to HideMode.DISPLAY).
 void setId(java.lang.String id)
          Sets the component's id.
 void setIntStyleAttribute(java.lang.String attr, int value)
          Sets a style attribute.
 void setItemId(java.lang.String id)
          Sets the component's item id.
protected  void setModel(ModelData model)
           
protected  void setMonitorWindowResize(boolean monitorWindowResize)
          True to have onWindowResize executed when the browser window is resized (default to false).
protected  void setParent(com.google.gwt.user.client.ui.Widget parent)
           
 void setPixelSize(int width, int height)
          Overrides UIObject and does nothing.
 void setSize(java.lang.String width, java.lang.String height)
          Overrides UIObject and does nothing.
 void setStateful(boolean stateful)
          A flag which causes the Component to attempt to restore the state of internal properties from a saved state on startup (defaults to false).
 void setStateId(java.lang.String stateId)
          Sets the component's state id which is a unique id for this component to use for state management purposes (defaults to the component id if one was set, otherwise null if the component is using a generated id).
 void setStyleAttribute(java.lang.String attr, java.lang.String value)
          Sets a style attribute.
 void setStyleName(java.lang.String style)
           
 void setTabIndex(int tabIndex)
          Sets the component's tab index.
 void setTitle(java.lang.String title)
           
 void setToolTip(java.lang.String text)
          Sets the component's tool tip.
 void setToolTip(ToolTipConfig config)
          Sets the component's tool tip with the given config.
 void setVisible(boolean visible)
          Convenience function to hide or show this component by boolean.
 void setWidth(java.lang.String width)
          Overrides UIObject and does nothing.
protected  void setWindowResizeDelay(int delay)
          Sets delay in milliseconds used to buffer window resizing (defaults to 100).
 void setZIndex(int zIndex)
           
 void show()
          Show this component.
 void sinkEvents(int eventBitsToAdd)
           
 SwallowEvent swallowEvent(EventType eventType, com.google.gwt.user.client.Element element, boolean preventDefault)
          Adds a swallow event.
 SwallowEvent swallowEvent(SwallowEvent e)
           
 java.lang.String toString()
           
protected  void unframe()
           
 void unmask()
          Unmasks the component.
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onUnload, setLayoutData
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, removeStyleDependentName, setElement, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

baseStyle

protected java.lang.String baseStyle
The base style is typically set as the component's style when rendered. All child styles should be calculated based on the base style when the component is rendered. This allows a component's style to be swapped by simply modifying the base style (defaults to null).


disabled

protected boolean disabled
True if the component is disabled. Read only.


disabledStyle

protected java.lang.String disabledStyle
The style used when a component is disabled (defaults to 'x-item-disabled').


focusable

protected boolean focusable
True if the component is can receive focus (defaults to false). A hidden input field will be created created for Safari.


hidden

protected boolean hidden
True if this component is hidden. Read only.


rendered

protected boolean rendered
True if this component has been rendered. Read-only.


afterRender

protected boolean afterRender

dummy

protected com.google.gwt.user.client.Element dummy

stateId

protected java.lang.String stateId

swallowEvents

protected java.util.List<SwallowEvent> swallowEvents

toolTip

protected ToolTip toolTip

mask

protected boolean mask

maskMessage

protected java.lang.String maskMessage

maskMessageStyleName

protected java.lang.String maskMessageStyleName

attachables

protected java.util.List<ComponentAttachable> attachables

setElementRender

protected boolean setElementRender

monitorWindowResize

protected boolean monitorWindowResize

windowResizeDelay

protected int windowResizeDelay

disableTextSelection

protected int disableTextSelection

windowResizeTask

protected DelayedTask windowResizeTask

resizeHandler

protected com.google.gwt.event.shared.HandlerRegistration resizeHandler
Constructor Detail

Component

public Component()
Creates a new component.


Component

protected Component(com.google.gwt.user.client.Element element,
                    boolean attach)
Specialized constructor for creating components from existing nodes. The given element should be part of the dom and have a a parent element.

Parameters:
element - the element
attach - true to attach the component
Method Detail

addListener

public void addListener(EventType eventType,
                        Listener<? extends BaseEvent> listener)
Appends an event handler to this component.

Specified by:
addListener in interface Observable
Parameters:
eventType - the eventType
listener - the listener to be added

addPlugin

public void addPlugin(ComponentPlugin plugin)
Adds a component plugin.

Parameters:
plugin - the component plugin

addStyleName

public void addStyleName(java.lang.String style)
Adds a CSS style name to the component's underlying element.

Overrides:
addStyleName in class com.google.gwt.user.client.ui.UIObject
Parameters:
style - the CSS style name to add

addWidgetListener

public void addWidgetListener(WidgetListener listener)
Adds a listener to receive widget events.

Parameters:
listener - the listener to be added

clearState

public void clearState()
Clears the component's state.


disable

public void disable()
Disable this component. Fires the Disable event.


disableEvents

public void disableEvents(boolean disable)
True to disable event processing.

Parameters:
disable - true to disable

disableTextSelection

public void disableTextSelection(boolean disable)
Enables and disables text selection for the component.

Parameters:
disable - true to disable text selection

el

public El el()
Returns the component's el instance.

Returns:
the el instance

enable

public void enable()
Enable this component. Fires the Enable event.


enableEvents

public void enableEvents(boolean enable)
Enables or disables event processing.

Parameters:
enable - the enable state

fireEvent

public boolean fireEvent(EventType type)
Fires an event with the given event type.

Parameters:
type - the event type
Returns:
false if any listeners return false

fireEvent

public boolean fireEvent(EventType eventType,
                         BaseEvent be)
Description copied from interface: Observable
Fires an event.

Specified by:
fireEvent in interface Observable
Parameters:
eventType - eventType the event type
be - the base event
Returns:
false if any listeners cancel the event.

fireEvent

public boolean fireEvent(EventType type,
                         ComponentEvent ce)
Fires the specified event with the given event type.

Parameters:
type - the event type
ce - the base event
Returns:
false if any listeners return false

fly

public El fly(com.google.gwt.user.client.Element elem)
Returns the global flyweight instance.

Parameters:
elem - the new wrapped dom element
Returns:
the global flyweight instance

focus

public void focus()
Try to focus this component. Fires the Focus event.


getAriaSupport

public AriaSupport getAriaSupport()
Returns the ARIA support configuration.

Returns:
the ARIA support configuration

getBaseStyle

public java.lang.String getBaseStyle()
Returns the component's base style.

Returns:
the base style

getBorders

public boolean getBorders()
Returns the component's border state.

Returns:
true if borders are visible

getContextMenu

public Menu getContextMenu()
Returns the component's context menu.

Returns:
the context menu

getData

public <X> X getData(java.lang.String key)
Returns the application defined property for the given name, or null if it has not been set.

Parameters:
key - the name of the property
Returns:
the value or null if it has not been set

getElement

public com.google.gwt.user.client.Element getElement()
Overrides:
getElement in class com.google.gwt.user.client.ui.UIObject

getFocusSupport

public FocusManagerSupport getFocusSupport()
Returns the focus manager support configuration. Only applicable when the focus manager has been enabled.

Returns:
the focus manager configuration

getHideMode

public Style.HideMode getHideMode()
Returns the component's hide mode.

Returns:
the hide mode

getId

public java.lang.String getId()
Returns the id of this component. A new id is generated if an id has not been set.

Returns:
the component's id

getItemId

public java.lang.String getItemId()
Returns the item id of this component. Unlike the component's id, the item id does not have to be unique.

Returns:
the component's item id

getListeners

public java.util.List<Listener<? extends BaseEvent>> getListeners(EventType eventType)
Description copied from interface: Observable
Returns a list of listeners registered for the given event type. The returned list may be modified.

Specified by:
getListeners in interface Observable
Parameters:
eventType - the event type
Returns:
the list of listeners

getModel

public <X> X getModel()
Returns the component's model.

Returns:
the model

getPlugins

public java.util.List<ComponentPlugin> getPlugins()
Returns the component's plugins.

Returns:
the plugins

getState

public java.util.Map<java.lang.String,java.lang.Object> getState()
Returns the component's state. To save changes made to the state map returned by this method, call saveState().

Returns:
the component's state

getStateId

public java.lang.String getStateId()
Returns the component's state id. If a state id is specified, it is used as the key when saving and retrieving the component's state.

Returns:
the state id

getTabIndex

public int getTabIndex()
Returns the component's tab index.

Returns:
the tab index

getTitle

public java.lang.String getTitle()
Overrides:
getTitle in class com.google.gwt.user.client.ui.UIObject

getToolTip

public ToolTip getToolTip()
Returns the component's tool tip.

Returns:
the tool tip

hasListeners

public boolean hasListeners()
Description copied from interface: Observable
Returns true if the observable has any listeners.

Specified by:
hasListeners in interface Observable
Returns:
true for any listeners

hasListeners

public boolean hasListeners(EventType eventType)
Description copied from interface: Observable
Returns true if the observable has listeners for the given event type.

Specified by:
hasListeners in interface Observable
Parameters:
eventType - the event type
Returns:
true for 1 or more listeners with the given event type

hide

public void hide()
Hide this component. Fires the BeforeHide event before the component is hidden, the fires the Hide event after the component is hidden.


hideToolTip

public void hideToolTip()
Hides the component's tool tip (if one exists).


isDisabledEvents

public boolean isDisabledEvents()
Returns true if events are disabled.

Returns:
true if events disabled

isDisableTextSelection

public boolean isDisableTextSelection()
Returns true if text selection is disabled.

Returns:
true for disabled

isEnabled

public boolean isEnabled()
Returns true if the component is enabled.

Returns:
the enabled state

isMasked

public boolean isMasked()
Returns true if the component is masked.

Returns:
true if masked

isRendered

public boolean isRendered()
Returns true if the component is rendered.

Returns:
the rendered state

isStateful

public boolean isStateful()
Returns true if the component is saving and restore it's state.

Returns:
true if stateful

isVisible

public boolean isVisible()
Returns true if the component is visible.

Overrides:
isVisible in class com.google.gwt.user.client.ui.UIObject

isVisible

public boolean isVisible(boolean deep)
Returns true if the component is visible.

Parameters:
deep - true to search up the component hierarchy

mask

public El mask()
Puts a mask over this component to disable user interaction.

Returns:
the mask element

mask

public El mask(java.lang.String message)
Puts a mask over this component to disable user interaction.

Parameters:
message - a message to display in the mask
Returns:
the mask element

mask

public El mask(java.lang.String message,
               java.lang.String messageStyleName)
Puts a mask over this component to disable user interaction.

Parameters:
message - a message to display in the mask
messageStyleName - a CSS style name to be applied to the message text
Returns:
the mask element

onBrowserEvent

public void onBrowserEvent(com.google.gwt.user.client.Event event)
Components delegate event handling to onComponentEvent(ComponentEvent). Subclasses should not override.

Specified by:
onBrowserEvent in interface com.google.gwt.user.client.EventListener
Overrides:
onBrowserEvent in class com.google.gwt.user.client.ui.Widget
Parameters:
event - the dom event

onComponentEvent

public void onComponentEvent(ComponentEvent ce)
Any events a component receives will be forwarded to this method. Subclasses should override as needed. The onBrowserEvent(com.google.gwt.user.client.Event) method should not be overridden or modified.

Parameters:
ce - the base event

recalculate

public void recalculate()
Called when the component is in a LayoutContainer and the container's layout executes. This method will not be called on container instances. Default implementation does nothing.


removeAllListeners

public void removeAllListeners()
Removes all listeners.

Specified by:
removeAllListeners in interface Observable

removeFromParent

public void removeFromParent()
Overrides:
removeFromParent in class com.google.gwt.user.client.ui.Widget

removeListener

public void removeListener(EventType eventType,
                           Listener<? extends BaseEvent> listener)
Removes a listener.

Specified by:
removeListener in interface Observable
Parameters:
eventType - the event type
listener - the listener to be removed

removeStyleName

public void removeStyleName(java.lang.String style)
Removes a CSS style name from the component's underlying element.

Overrides:
removeStyleName in class com.google.gwt.user.client.ui.UIObject
Parameters:
style - the CSS style name to remove

removeSwallow

public void removeSwallow(SwallowEvent e)
Removes a swallow event.

Parameters:
e - the swallow event to be removed

removeToolTip

public void removeToolTip()

removeWidgetListener

public void removeWidgetListener(WidgetListener listener)
Removes a listener.

Parameters:
listener - the listener to be removed

render

public void render(com.google.gwt.user.client.Element target)
Renders the element. Typically, this method does not need to be called directly. A component will rendered by its parent if it is a container, or rendered when attached if added to a gwt panel.

Parameters:
target - the element this component should be rendered into

render

public void render(com.google.gwt.user.client.Element target,
                   int index)
Renders the element. Typically, this method does not need to be called directly. A component will rendered by its parent if it is a container, or rendered when attached if added to a gwt panel.

Parameters:
target - the element this component should be rendered into
index - the index within the container before which this component will be inserted (defaults to appending to the end of the container if value is -1)

repaint

public void repaint()
Repaints the component if rendered.


saveState

public void saveState()
Saves the component's current state by passing it to the StateManager and saving it using the state id or component id as the key.


setAriaSupport

public void setAriaSupport(AriaSupport ariaSupport)
Sets the ARIA support configuration.

Parameters:
ariaSupport - the ARIA support configuration

setBorders

public void setBorders(boolean show)
Adds or removes a border. The style name 'x-border' is added to the widget to display a border.

Parameters:
show - true to display a border

setContextMenu

public void setContextMenu(Menu menu)
Sets the component's context menu.

Parameters:
menu - the context menu

setData

public void setData(java.lang.String key,
                    java.lang.Object data)
Sets the application defined property with the given name.

Parameters:
key - the name of the property
data - the new value for the property

setElement

public void setElement(com.google.gwt.user.client.Element elem)
Overrides:
setElement in class com.google.gwt.user.client.ui.UIObject

setEnabled

public void setEnabled(boolean enabled)
Convenience function for setting disabled/enabled by boolean.

Parameters:
enabled - the enabled state

setHeight

public void setHeight(java.lang.String height)
Overrides UIObject and does nothing.

Overrides:
setHeight in class com.google.gwt.user.client.ui.UIObject

setHideMode

public void setHideMode(Style.HideMode hideMode)
Sets the components hide mode (default to HideMode.DISPLAY).

Parameters:
hideMode - the hide mode.

setId

public void setId(java.lang.String id)
Sets the component's id.

Parameters:
id - the new id

setIntStyleAttribute

public void setIntStyleAttribute(java.lang.String attr,
                                 int value)
Sets a style attribute.

Parameters:
attr - the attribute
value - the attribute value

setItemId

public void setItemId(java.lang.String id)
Sets the component's item id.

Parameters:
id - the item id

setPixelSize

public void setPixelSize(int width,
                         int height)
Overrides UIObject and does nothing.

Overrides:
setPixelSize in class com.google.gwt.user.client.ui.UIObject

setSize

public void setSize(java.lang.String width,
                    java.lang.String height)
Overrides UIObject and does nothing.

Overrides:
setSize in class com.google.gwt.user.client.ui.UIObject

setStateful

public void setStateful(boolean stateful)
A flag which causes the Component to attempt to restore the state of internal properties from a saved state on startup (defaults to false). The component must have either a stateId or id assigned for state to be managed. Auto-generated ids are not guaranteed to be stable across page loads and cannot be relied upon to save and restore the same state for a component.

Parameters:
stateful - true to enable state

setStateId

public void setStateId(java.lang.String stateId)
Sets the component's state id which is a unique id for this component to use for state management purposes (defaults to the component id if one was set, otherwise null if the component is using a generated id).

Parameters:
stateId - the state id

setStyleAttribute

public void setStyleAttribute(java.lang.String attr,
                              java.lang.String value)
Sets a style attribute.

Parameters:
attr - the attribute
value - the attribute value

setStyleName

public void setStyleName(java.lang.String style)
Overrides:
setStyleName in class com.google.gwt.user.client.ui.UIObject

setTabIndex

public void setTabIndex(int tabIndex)
Sets the component's tab index.

Parameters:
tabIndex - the tab index

setTitle

public void setTitle(java.lang.String title)
Overrides:
setTitle in class com.google.gwt.user.client.ui.UIObject

setToolTip

public void setToolTip(java.lang.String text)
Sets the component's tool tip.

Parameters:
text - the text

setToolTip

public void setToolTip(ToolTipConfig config)
Sets the component's tool tip with the given config.

Parameters:
config - the tool tip config

setVisible

public void setVisible(boolean visible)
Convenience function to hide or show this component by boolean.

Overrides:
setVisible in class com.google.gwt.user.client.ui.UIObject
Parameters:
visible - the visible state

setWidth

public void setWidth(java.lang.String width)
Overrides UIObject and does nothing.

Overrides:
setWidth in class com.google.gwt.user.client.ui.UIObject

setZIndex

public void setZIndex(int zIndex)

show

public void show()
Show this component. Fires the BeforeShow event before the component is made visible, then fires the Show event after the component is visible.


sinkEvents

public void sinkEvents(int eventBitsToAdd)
Overrides:
sinkEvents in class com.google.gwt.user.client.ui.Widget

swallowEvent

public SwallowEvent swallowEvent(EventType eventType,
                                 com.google.gwt.user.client.Element element,
                                 boolean preventDefault)
Adds a swallow event. When enabled, any events of the given type whose target is or is a child of the given element are swallowed.

Parameters:
eventType - the event type
element - the target element
preventDefault - true to prevent the default action
Returns:
the swallow event config that can be used when removing a swallowing event

swallowEvent

public SwallowEvent swallowEvent(SwallowEvent e)

toString

public java.lang.String toString()
Overrides:
toString in class com.google.gwt.user.client.ui.UIObject

unmask

public void unmask()
Unmasks the component.


addAttachable

protected void addAttachable(ComponentAttachable a)

addStyleOnOver

protected void addStyleOnOver(com.google.gwt.user.client.Element elem,
                              java.lang.String style)
Adds a style to the given element on mouseover. The component must be sinking mouse events for the over style to function.

Parameters:
elem - the over element
style - the style to add

afterRender

protected void afterRender()
Called after the component has been rendered and is attached for the first time. At this time, the component will be part of the DOM which is required when retrieving location and offsets.


applyState

protected void applyState(java.util.Map<java.lang.String,java.lang.Object> state)

assertAfterRender

protected void assertAfterRender()

assertPreRender

protected void assertPreRender()

beforeRender

protected void beforeRender()
Called before the component has been rendered.

This method can be used to lazily alter this component pre-render


blur

protected void blur()
Tries to remove focus from the component. Fires the Blur event.


createComponentEvent

protected ComponentEvent createComponentEvent(com.google.gwt.user.client.Event event)

createObservable

protected Observable createObservable()

createStyles

protected void createStyles(java.lang.String baseStyle)

disableContextMenu

protected void disableContextMenu(boolean disable)
Enables and disables the component's context menu.

Parameters:
disable - true to disable the context menu

doAttachChildren

protected void doAttachChildren()
Overrides:
doAttachChildren in class com.google.gwt.user.client.ui.Widget

doDetachChildren

protected void doDetachChildren()
Overrides:
doDetachChildren in class com.google.gwt.user.client.ui.Widget

frame

protected void frame()

getFocusEl

protected El getFocusEl()

getObservable

protected Observable getObservable()

getWindowResizeDelay

protected int getWindowResizeDelay()
Returns the window resize delay.

Returns:
the delay

initState

protected void initState()

isMonitorWindowResize

protected boolean isMonitorWindowResize()
Returns true if browser resizing is monitored

Returns:
true if window resize monitoring is enabled

notifyHide

protected void notifyHide()

notifyShow

protected void notifyShow()

onAttach

protected void onAttach()
Overrides:
onAttach in class com.google.gwt.user.client.ui.Widget

onDetach

protected void onDetach()
Overrides:
onDetach in class com.google.gwt.user.client.ui.Widget

onDetachHelper

protected void onDetachHelper()

onDisable

protected void onDisable()

onEnable

protected void onEnable()

onEnsureDebugId

protected void onEnsureDebugId(java.lang.String baseID)
Overrides:
onEnsureDebugId in class com.google.gwt.user.client.ui.UIObject

onHide

protected void onHide()

onHideContextMenu

protected void onHideContextMenu()

onLoad

protected void onLoad()
Overrides:
onLoad in class com.google.gwt.user.client.ui.Widget

onRender

protected void onRender(com.google.gwt.user.client.Element target,
                        int index)
Subclasses must override and ensure setElement is called for lazy rendered components.

Parameters:
target - the target element
index - the insert location

onRightClick

protected void onRightClick(ComponentEvent ce)

onShow

protected void onShow()

onShowContextMenu

protected void onShowContextMenu(int x,
                                 int y)

onWindowResize

protected void onWindowResize(int width,
                              int height)

previewEvent

protected ComponentEvent previewEvent(EventType type,
                                      ComponentEvent ce)

removeAttachagle

protected void removeAttachagle(ComponentAttachable a)

removeStyleOnOver

protected void removeStyleOnOver(com.google.gwt.user.client.Element elem)

setAriaRole

protected void setAriaRole(java.lang.String roleName)

setAriaState

protected void setAriaState(java.lang.String stateName,
                            java.lang.String stateValue)

setEl

protected void setEl(El el)

setElement

protected void setElement(com.google.gwt.user.client.Element elem,
                          com.google.gwt.user.client.Element parent,
                          int index)

setFiresEvents

protected void setFiresEvents(boolean firesEvents)

setModel

protected void setModel(ModelData model)

setMonitorWindowResize

protected void setMonitorWindowResize(boolean monitorWindowResize)
True to have onWindowResize executed when the browser window is resized (default to false). You need to override onWindowResize to get your needed functionality

Parameters:
monitorWindowResize - true to monitor window resizing

setParent

protected void setParent(com.google.gwt.user.client.ui.Widget parent)

setWindowResizeDelay

protected void setWindowResizeDelay(int delay)
Sets delay in milliseconds used to buffer window resizing (defaults to 100).

Parameters:
delay - the delay

unframe

protected void unframe()