com.extjs.gxt.ui.client.widget
クラス 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
すべての実装インターフェース:
Observable, com.google.gwt.user.client.EventListener
Direct Known Subclasses:
BoxComponent, Button, DataListItem, DataViewItem, FramePanel, Header, Item, PagingToolBar, ProgressBar, StatusBar, TabItem.HeaderItem, TableItem, ToolItem, 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.

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 set the doit field to false to cancel the action.
BeforeShow : ComponentEvent(component)
Fires before the component is shown. Listeners can set the doit field to false to cancel the action.
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 set the doit field to false to cancel the action.
Render : ComponentEvent(component)
Fires after the component is rendered.
BrowserEvent : ComponentEvent(component, event)
Fires on any browser event the component receives. Listners will be called prior to any event processing and before onComponentEvent(ComponentEvent) is called. Listeners can set the doit field to false to cancel the processing of the event.
BeforeStateRestore : ComponentEvent(component, state)
Fires before the state of the component is restored. Listeners can set the doit field to false to cancel the action.
StateRestore : ComponentEvent(component, state)
Fires after the state of the component is restored.
StateRestore : ComponentEvent(component, state)
Fires before the state of the component is saved to the configured state provider.
StateSave : ComponentEvent(component, state)
Fires after the state of the component is saved to the configured state provider.


入れ子クラス 概要
 
クラス com.google.gwt.user.client.ui.UIObject から継承された 入れ子クラス/インターフェース
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field 概要
 
クラス com.google.gwt.user.client.ui.UIObject から継承されたフィールド(Fields)
DEBUG_ID_PREFIX
 
コンストラクタ 概要
Component()
          Creates a new component..
 
メソッド 概要
 void addListener(int eventType, Listener listener)
          Appends an event handler to this component.
 void addStyleName(java.lang.String style)
          Adds a CSS style name to the component's underlying element.
 void addWidgetListener(WidgetListener listener)
          Adds a listener to receive widget events.
 void disable()
          Disable this component.
 void disableEvents(boolean disable)
          True to disable event processing.
 void disableTextSelection(boolean disable)
          Enables and disables text selection for the component.
 El el()
          Returns the component's el instance.
 void enable()
          Enable this component.
 void enableEvents(boolean enable)
          Enables or disables event processing.
 boolean fireEvent(int type)
          Fires an event with the given event type.
 boolean fireEvent(int eventType, BaseEvent be)
          Fires an event.
 boolean fireEvent(int 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.
 java.lang.String getBaseStyle()
          Returns the component's base style.
 boolean getBorders()
          Returns the component's border state.
 java.lang.Object getData()
          Deprecated. Use getData(String)
<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()
           
 java.lang.String getId()
          Returns the id of this component.
 java.lang.String getItemId()
          Returns the item id of this component.
 ModelData getModel()
          Returns the component's model.
 java.util.Map<java.lang.String,java.lang.Object> getState()
          Returns the component's state.
 ToolTip getToolTip()
          Returns the component's tool tip.
 void hide()
          Hide this component.
 void hideToolTip()
          Hides the component's tool tip (if one exists).
 boolean isEnabled()
          Returns true if the component is enabled.
 boolean isRendered()
          Returns true if the component is rendered.
 boolean isVisible()
          Returns true if the component is visible.
 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.
 void recalculate()
          Called when the component is in a LayoutContainer and the container's layout executes.
 void removeAllListeners()
          Removes all listeners.
 void removeFromParent()
           
 void removeListener(int eventType, Listener listener)
          Removes a listener.
 void removeStyleName(java.lang.String style)
          Removes a CSS style name from the component's underlying element.
 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 saveState()
          Saves the component's current state.
 void setBorders(boolean show)
          Adds or removes a border.
 void setData(java.lang.Object data)
          Deprecated. use setData(String, Object)
 void setData(java.lang.String key, java.lang.Object data)
          Sets the application defined property with the given name.
 void setElement(com.google.gwt.user.client.Element elem)
           
 void setEnabled(boolean enabled)
          Convenience function for setting disabled/enabled by boolean.
 void setEnableState(boolean enable)
          Sets whether the component's state is enabled (defaults to true).
 void setHeight(java.lang.String height)
          Overrides UIObject and does nothing.
 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.
 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 setStyleAttribute(java.lang.String attr, java.lang.String value)
          Sets a style attribute.
 void setStyleName(java.lang.String style)
           
 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.
 void show()
          Show this component.
 java.lang.String toString()
           
 
クラス com.google.gwt.user.client.ui.Widget から継承されたメソッド
getParent, isAttached
 
クラス com.google.gwt.user.client.ui.UIObject から継承されたメソッド
addStyleDependentName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, setStylePrimaryName, setVisible, sinkEvents, unsinkEvents
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

コンストラクタ 詳細

Component

public Component()
Creates a new component..

メソッド 詳細

addListener

public void addListener(int eventType,
                        Listener listener)
Appends an event handler to this component.

Specified by:
addListener in interface Observable
パラメータ:
eventType - the eventType
listener - the listener to be added

addStyleName

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

オーバーライド:
addStyleName in class com.google.gwt.user.client.ui.UIObject
パラメータ:
style - the CSS style name to add

addWidgetListener

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

パラメータ:
listener - the listener to be added

disable

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


disableEvents

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

パラメータ:
disable - true to disable

disableTextSelection

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

パラメータ:
disable - true to disable text selection

el

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

戻り値:
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.

パラメータ:
enable - the enable state

fireEvent

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

パラメータ:
type - the event type
戻り値:
false if any listeners return false

fireEvent

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

Specified by:
fireEvent in interface Observable
パラメータ:
eventType - eventType the event type
be - the base event
戻り値:
true if any listeners cancel the event.

fireEvent

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

パラメータ:
type - the event type
ce - the base event
戻り値:
false if any listeners return false

fly

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

パラメータ:
elem - the new wrapped dom element
戻り値:
the global flyweight instance

focus

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


getBaseStyle

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

戻り値:
the base style

getBorders

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

戻り値:
true if borders are visisble

getData

public java.lang.Object getData()
Deprecated. Use getData(String)

Returns the application defined data associated with the component, or null if it has not been set.

戻り値:
the data

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.

パラメータ:
key - the name of the property
戻り値:
the value or null if it has not been set

getElement

public com.google.gwt.user.client.Element getElement()
オーバーライド:
getElement in class com.google.gwt.user.client.ui.UIObject

getId

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

戻り値:
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.

戻り値:
the component's item id

getModel

public ModelData getModel()
Returns the component's model.

戻り値:
the model

getState

public java.util.Map<java.lang.String,java.lang.Object> getState()
Returns the component's state.

戻り値:
the state

getToolTip

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

戻り値:
the tool tip

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).


isEnabled

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

戻り値:
the enabled state

isRendered

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

戻り値:
the rendered state

isVisible

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

オーバーライド:
isVisible in class com.google.gwt.user.client.ui.UIObject

onBrowserEvent

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

Specified by:
onBrowserEvent in interface com.google.gwt.user.client.EventListener
オーバーライド:
onBrowserEvent in class com.google.gwt.user.client.ui.Widget
パラメータ:
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.

パラメータ:
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()
オーバーライド:
removeFromParent in class com.google.gwt.user.client.ui.Widget

removeListener

public void removeListener(int eventType,
                           Listener listener)
Removes a listener.

Specified by:
removeListener in interface Observable
パラメータ:
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.

オーバーライド:
removeStyleName in class com.google.gwt.user.client.ui.UIObject
パラメータ:
style - the CSS style name to remove

removeWidgetListener

public void removeWidgetListener(WidgetListener listener)
Removes a listener.

パラメータ:
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.

パラメータ:
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.

パラメータ:
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)

saveState

public void saveState()
Saves the component's current state.


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.

パラメータ:
show - true to display a border

setData

public void setData(java.lang.Object data)
Deprecated. use setData(String, Object)

Sets the application defined component data.

パラメータ:
data - the widget data

setData

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

パラメータ:
key - the name of the property
data - the new value for the property

setElement

public void setElement(com.google.gwt.user.client.Element elem)
オーバーライド:
setElement in class com.google.gwt.user.client.ui.UIObject

setEnabled

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

パラメータ:
enabled - the enabled state

setEnableState

public void setEnableState(boolean enable)
Sets whether the component's state is enabled (defaults to true).

パラメータ:
enable - true to enable

setHeight

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

オーバーライド:
setHeight in class com.google.gwt.user.client.ui.UIObject

setId

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

パラメータ:
id - the new id

setIntStyleAttribute

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

パラメータ:
attr - the attribute
value - the attribute value

setItemId

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

パラメータ:
id - the item id

setPixelSize

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

オーバーライド:
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.

オーバーライド:
setSize in class com.google.gwt.user.client.ui.UIObject

setStyleAttribute

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

パラメータ:
attr - the attribute
value - the attribute value

setStyleName

public void setStyleName(java.lang.String style)
オーバーライド:
setStyleName in class com.google.gwt.user.client.ui.UIObject

setTitle

public void setTitle(java.lang.String title)
オーバーライド:
setTitle in class com.google.gwt.user.client.ui.UIObject

setToolTip

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

パラメータ:
text - the text

setToolTip

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

パラメータ:
config - the tool tip config

setVisible

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

オーバーライド:
setVisible in class com.google.gwt.user.client.ui.UIObject
パラメータ:
visible - the visible state

setWidth

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

オーバーライド:
setWidth in class com.google.gwt.user.client.ui.UIObject

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.


toString

public java.lang.String toString()
オーバーライド:
toString in class com.google.gwt.user.client.ui.UIObject