|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.extjs.gxt.ui.client.widget.Component
public abstract class Component
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).
BoxComponent.
All components are registered and unregistred with the @link
ComponentManager when the are attached and detached.
doit field to false to cancel the action.doit field to false to cancel the action.doit field to false to cancel the action.onComponentEvent(ComponentEvent) is called. Listeners can set the
doit field to false to cancel the processing of the
event.doit field to false to cancel the action.
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 |
|---|
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Constructor Summary | |
|---|---|
Component()
Creates a new component.. |
|
| Method Summary | ||
|---|---|---|
void |
addListener(int eventType,
Listener 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. |
|
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) |
|
|
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 |
isDisabledEvents()
Returns true if events are disabled. |
|
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. |
|
void |
sinkEvents(int eventBitsToAdd)
|
|
java.lang.String |
toString()
|
|
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
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 |
|---|
public Component()
| Method Detail |
|---|
public void addListener(int eventType,
Listener listener)
addListener in interface ObservableeventType - the eventTypelistener - the listener to be addedpublic void addPlugin(ComponentPlugin plugin)
plugin - the component pluginpublic void addStyleName(java.lang.String style)
addStyleName in class com.google.gwt.user.client.ui.UIObjectstyle - the CSS style name to addpublic void addWidgetListener(WidgetListener listener)
listener - the listener to be addedpublic void disable()
public void disableEvents(boolean disable)
disable - true to disablepublic void disableTextSelection(boolean disable)
disable - true to disable text selectionpublic El el()
public void enable()
public void enableEvents(boolean enable)
enable - the enable statepublic boolean fireEvent(int type)
type - the event type
false if any listeners return false
public boolean fireEvent(int eventType,
BaseEvent be)
Observable
fireEvent in interface ObservableeventType - eventType the event typebe - the base event
true if any listeners cancel the event.
public boolean fireEvent(int type,
ComponentEvent ce)
type - the event typece - the base event
false if any listeners return falsepublic boolean isDisabledEvents()
public El fly(com.google.gwt.user.client.Element elem)
elem - the new wrapped dom element
public void focus()
public java.lang.String getBaseStyle()
public boolean getBorders()
public java.lang.Object getData()
getData(String)
null if it has not been set.
public <X> X getData(java.lang.String key)
null if it has not been set.
key - the name of the property
null if it has not been setpublic com.google.gwt.user.client.Element getElement()
getElement in class com.google.gwt.user.client.ui.UIObjectpublic java.lang.String getId()
public java.lang.String getItemId()
public ModelData getModel()
public java.util.Map<java.lang.String,java.lang.Object> getState()
public ToolTip getToolTip()
public void hide()
public void hideToolTip()
public boolean isEnabled()
true if the component is enabled.
public boolean isRendered()
true if the component is rendered.
public boolean isVisible()
true if the component is visible.
isVisible in class com.google.gwt.user.client.ui.UIObjectpublic void onBrowserEvent(com.google.gwt.user.client.Event event)
onComponentEvent(ComponentEvent). Sublcasses should not override.
onBrowserEvent in interface com.google.gwt.user.client.EventListeneronBrowserEvent in class com.google.gwt.user.client.ui.Widgetevent - the dom eventpublic void onComponentEvent(ComponentEvent ce)
onBrowserEvent(com.google.gwt.user.client.Event) method
should not be overridden or modified.
ce - the base eventpublic void recalculate()
public void removeAllListeners()
removeAllListeners in interface Observablepublic void removeFromParent()
removeFromParent in class com.google.gwt.user.client.ui.Widget
public void removeListener(int eventType,
Listener listener)
removeListener in interface ObservableeventType - the event typelistener - the listener to be removedpublic void removeStyleName(java.lang.String style)
removeStyleName in class com.google.gwt.user.client.ui.UIObjectstyle - the CSS style name to removepublic void removeWidgetListener(WidgetListener listener)
listener - the listener to be removedpublic void render(com.google.gwt.user.client.Element target)
target - the element this component should be rendered into
public void render(com.google.gwt.user.client.Element target,
int index)
target - the element this component should be rendered intoindex - 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)public void saveState()
public void setBorders(boolean show)
show - true to display a borderpublic void setData(java.lang.Object data)
setData(String, Object)
data - the widget data
public void setData(java.lang.String key,
java.lang.Object data)
key - the name of the propertydata - the new value for the propertypublic void setElement(com.google.gwt.user.client.Element elem)
setElement in class com.google.gwt.user.client.ui.UIObjectpublic void setEnabled(boolean enabled)
enabled - the enabled statepublic void setEnableState(boolean enable)
enable - true to enablepublic void setHeight(java.lang.String height)
setHeight in class com.google.gwt.user.client.ui.UIObjectpublic void setId(java.lang.String id)
id - the new id
public void setIntStyleAttribute(java.lang.String attr,
int value)
attr - the attributevalue - the attribute valuepublic void setItemId(java.lang.String id)
id - the item id
public void setPixelSize(int width,
int height)
setPixelSize in class com.google.gwt.user.client.ui.UIObject
public void setSize(java.lang.String width,
java.lang.String height)
setSize in class com.google.gwt.user.client.ui.UIObject
public void setStyleAttribute(java.lang.String attr,
java.lang.String value)
attr - the attributevalue - the attribute valuepublic void setStyleName(java.lang.String style)
setStyleName in class com.google.gwt.user.client.ui.UIObjectpublic void setTitle(java.lang.String title)
setTitle in class com.google.gwt.user.client.ui.UIObjectpublic void setToolTip(java.lang.String text)
text - the textpublic void setToolTip(ToolTipConfig config)
config - the tool tip configpublic void setVisible(boolean visible)
setVisible in class com.google.gwt.user.client.ui.UIObjectvisible - the visible statepublic void setWidth(java.lang.String width)
setWidth in class com.google.gwt.user.client.ui.UIObjectpublic void show()
public void sinkEvents(int eventBitsToAdd)
sinkEvents in class com.google.gwt.user.client.ui.UIObjectpublic java.lang.String toString()
toString in class com.google.gwt.user.client.ui.UIObject
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||