public class Component extends Widget implements FocusEvent.HasFocusHandlers, BlurEvent.HasBlurHandlers, BeforeHideEvent.HasBeforeHideHandlers, HideEvent.HasHideHandlers, BeforeShowEvent.HasBeforeShowHandlers, ShowEvent.HasShowHandlers, EnableEvent.HasEnableHandlers, DisableEvent.HasDisableHandlers, BeforeShowContextMenuEvent.HasBeforeShowContextMenuHandler, ShowContextMenuEvent.HasShowContextMenuHandler, MoveEvent.HasMoveHandlers, HasResizeHandlers, HasItemId, HasFocusSupport, HasEnabled
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
DEBUG_ID_PREFIX
Modifier and Type | Method and Description |
---|---|
HandlerRegistration |
addBeforeHideHandler(BeforeHideEvent.BeforeHideHandler handler)
Adds a
BeforeHideEvent.BeforeHideHandler handler for BeforeHideEvent
events. |
HandlerRegistration |
addBeforeShowContextMenuHandler(BeforeShowContextMenuEvent.BeforeShowContextMenuHandler handler)
Adds a
BeforeShowContextMenuEvent.BeforeShowContextMenuHandler handler for
BeforeShowContextMenuEvent events. |
HandlerRegistration |
addBeforeShowHandler(BeforeShowEvent.BeforeShowHandler handler)
Adds a
BeforeShowEvent.BeforeShowHandler handler for BeforeShowEvent
events. |
HandlerRegistration |
addBlurHandler(BlurEvent.BlurHandler handler)
Adds a
BlurEvent.BlurHandler handler for BlurEvent
events. |
HandlerRegistration |
addDisableHandler(DisableEvent.DisableHandler handler)
Adds a
DisableEvent.DisableHandler handler for DisableEvent events. |
HandlerRegistration |
addEnableHandler(EnableEvent.EnableHandler handler)
Adds a
EnableEvent.EnableHandler handler for EnableEvent events. |
HandlerRegistration |
addFocusHandler(FocusEvent.FocusHandler handler)
Adds a
FocusEvent.FocusHandler handler for FocusEvent
events. |
HandlerRegistration |
addHideHandler(HideEvent.HideHandler handler)
Adds a
HideEvent.HideHandler handler for HideEvent events. |
HandlerRegistration |
addMoveHandler(MoveEvent.MoveHandler handler)
Adds a
MoveEvent.MoveHandler handler for MoveEvent events. |
HandlerRegistration |
addResizeHandler(ResizeHandler handler) |
HandlerRegistration |
addShowContextMenuHandler(ShowContextMenuEvent.ShowContextMenuHandler handler)
Adds a
ShowContextMenuEvent.ShowContextMenuHandler handler for
ShowContextMenuEvent events. |
HandlerRegistration |
addShowHandler(ShowEvent.ShowHandler handler)
Adds a
ShowEvent.ShowHandler handler for ShowEvent events. |
void |
addStyleOnOver(Element elem,
String style)
Adds a style to the given element on mouseover.
|
void |
clearSizeCache()
Clears the size cache (the size of the widget the last time it was changed).
|
void |
disable()
Disable this widget.
|
void |
disableEvents()
True to disable event processing.
|
void |
enable()
Enable this widget.
|
void |
enableEvents()
True to enable event processing.
|
void |
fireEvent(GwtEvent<?> event) |
void |
focus()
Try to focus this widget.
|
<X> X |
getData(String key)
Returns the application defined property for the given name, or
null if it has not been set. |
XElement |
getElement()
Gets a handle to the object's underlying DOM element.
|
FocusManagerSupport |
getFocusSupport()
Returns the focus manager support configuration.
|
Style.HideMode |
getHideMode()
Returns the widget's hide mode.
|
String |
getId()
Returns the widget's id.
|
String |
getItemId()
Returns the item id of this widget.
|
int |
getOffsetHeight(boolean content)
Returns the widget's height.
|
int |
getOffsetWidth(boolean content)
Returns the element's width.
|
boolean |
getShadow()
Returns true if the shadow is enabled.
|
Layer.ShadowPosition |
getShadowPosition()
Returns the shadow position.
|
String |
getStateId()
Returns the widget's state id.
|
int |
getTabIndex()
Returns the current tabIndex of the component.
|
ToolTip |
getToolTip()
Returns the widget's tool tip.
|
void |
hide()
Hide this widget.
|
void |
hideToolTip()
Hides the widget's tool tip (if one exists).
|
boolean |
isAllowTextSelection()
Returns the enable text selection state.
|
boolean |
isAutoHeight()
Returns the auto height state.
|
boolean |
isAutoWidth()
Returns the auto width state.
|
boolean |
isDeferHeight()
Returns true if the height is being deferred
|
boolean |
isEnabled()
Returns
true if the widget is enabled. |
boolean |
isRendered()
Returns true if the component has been rendered.
|
boolean |
isStateful()
Returns true if the widget is saving and restore it's state.
|
boolean |
isVisible() |
boolean |
isVisible(boolean deep)
Returns
true if the widget is visible. |
void |
mask()
Puts a mask over this widget to disable user interaction.
|
void |
mask(String message)
Puts a mask over this widget to disable user interaction.
|
void |
onBrowserEvent(Event event) |
void |
removeToolTip()
Removes the components tooltip (if one exists).
|
void |
setAllowTextSelection(boolean enable)
Enables and disables text selection for the widget.
|
void |
setBorders(boolean show)
Adds or removes a border.
|
void |
setBounds(int x,
int y,
int width,
int height)
Sets the widget's size.
|
void |
setBounds(Rectangle bounds)
Sets the widget's size.
|
void |
setContextMenu(Menu menu)
Sets the widget's context menu.
|
void |
setData(String key,
Object data)
Sets the application defined property with the given name.
|
void |
setDeferHeight(boolean deferHeight)
True to defer height calculations to an external widget, false to allow this widget to set its own height (defaults
to false).
|
void |
setEnabled(boolean enabled)
Convenience function for setting disabled/enabled by boolean.
|
void |
setHeight(int height)
Sets the widget's height.
|
void |
setHeight(String height)
Sets the height of the widget.
|
void |
setHideMode(Style.HideMode hideMode)
Sets the components hide mode (defaults to HideMode.DISPLAY).
|
void |
setId(String id)
Sets the component's id.
|
void |
setItemId(String id)
Sets the widget's item id.
|
void |
setPagePosition(int x,
int y)
Sets the page XY position of the widget.
|
void |
setPixelSize(int width,
int height)
Sets the component's size.
|
void |
setPosition(int left,
int top)
Sets the left and top of the widget.
|
void |
setShadow(boolean shadow)
True to enable a shadow that will be displayed behind the widget (defaults to false, pre-render).
|
void |
setShadowPosition(Layer.ShadowPosition shadowPosition)
Sets the shadow position (defaults to SIDES, pre-render).
|
void |
setSize(String width,
String height)
Sets the width and height of the widget.
|
void |
setStateful(boolean stateful)
A flag which specifies if the component is stateful (defaults to false).
|
void |
setStateId(String stateId)
Sets the widget's state id which is a unique id for this widget to use for state management purposes (defaults to
the widget id if one was set, otherwise null if the widget is using a generated id).
|
void |
setTabIndex(int tabIndex)
Sets the component's tab index.
|
void |
setToolTip(SafeHtml html)
Sets the widget's tool tip.
|
void |
setToolTip(String text)
Sets the widget's tool tip.
|
void |
setToolTipConfig(ToolTipConfig config)
Sets the widget's tool tip with the given config.
|
void |
setVisible(boolean visible)
Convenience function to hide or show this widget by boolean.
|
void |
setWidth(int width)
Sets the width of the widget.
|
void |
setWidth(String width)
Sets the width of the widget.
|
void |
show()
Show this widget.
|
void |
sync(boolean show)
Syncs the layer of the widget.
|
void |
syncSize()
Clears the size cache and resets to the last known size.
|
void |
unmask()
Unmasks the widget.
|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString
public HandlerRegistration addBeforeHideHandler(BeforeHideEvent.BeforeHideHandler handler)
BeforeHideEvent.HasBeforeHideHandlers
BeforeHideEvent.BeforeHideHandler
handler for BeforeHideEvent
events.addBeforeHideHandler
in interface BeforeHideEvent.HasBeforeHideHandlers
handler
- the handlerpublic HandlerRegistration addBeforeShowContextMenuHandler(BeforeShowContextMenuEvent.BeforeShowContextMenuHandler handler)
BeforeShowContextMenuEvent.HasBeforeShowContextMenuHandler
BeforeShowContextMenuEvent.BeforeShowContextMenuHandler
handler for
BeforeShowContextMenuEvent
events.addBeforeShowContextMenuHandler
in interface BeforeShowContextMenuEvent.HasBeforeShowContextMenuHandler
handler
- the handlerpublic HandlerRegistration addBeforeShowHandler(BeforeShowEvent.BeforeShowHandler handler)
BeforeShowEvent.HasBeforeShowHandlers
BeforeShowEvent.BeforeShowHandler
handler for BeforeShowEvent
events.addBeforeShowHandler
in interface BeforeShowEvent.HasBeforeShowHandlers
handler
- the handlerpublic HandlerRegistration addBlurHandler(BlurEvent.BlurHandler handler)
BlurEvent.HasBlurHandlers
BlurEvent.BlurHandler
handler for BlurEvent
events.addBlurHandler
in interface BlurEvent.HasBlurHandlers
handler
- the handlerpublic HandlerRegistration addDisableHandler(DisableEvent.DisableHandler handler)
DisableEvent.HasDisableHandlers
DisableEvent.DisableHandler
handler for DisableEvent
events.addDisableHandler
in interface DisableEvent.HasDisableHandlers
handler
- the handlerpublic HandlerRegistration addEnableHandler(EnableEvent.EnableHandler handler)
EnableEvent.HasEnableHandlers
EnableEvent.EnableHandler
handler for EnableEvent
events.addEnableHandler
in interface EnableEvent.HasEnableHandlers
handler
- the handlerpublic HandlerRegistration addFocusHandler(FocusEvent.FocusHandler handler)
FocusEvent.HasFocusHandlers
FocusEvent.FocusHandler
handler for FocusEvent
events.addFocusHandler
in interface FocusEvent.HasFocusHandlers
handler
- the handlerpublic HandlerRegistration addHideHandler(HideEvent.HideHandler handler)
HideEvent.HasHideHandlers
HideEvent.HideHandler
handler for HideEvent
events.addHideHandler
in interface HideEvent.HasHideHandlers
handler
- the handlerpublic HandlerRegistration addMoveHandler(MoveEvent.MoveHandler handler)
MoveEvent.HasMoveHandlers
MoveEvent.MoveHandler
handler for MoveEvent
events.addMoveHandler
in interface MoveEvent.HasMoveHandlers
handler
- the handlerpublic HandlerRegistration addResizeHandler(ResizeHandler handler)
addResizeHandler
in interface HasResizeHandlers
public HandlerRegistration addShowContextMenuHandler(ShowContextMenuEvent.ShowContextMenuHandler handler)
ShowContextMenuEvent.HasShowContextMenuHandler
ShowContextMenuEvent.ShowContextMenuHandler
handler for
ShowContextMenuEvent
events.addShowContextMenuHandler
in interface ShowContextMenuEvent.HasShowContextMenuHandler
handler
- the handlerpublic HandlerRegistration addShowHandler(ShowEvent.ShowHandler handler)
ShowEvent.HasShowHandlers
ShowEvent.ShowHandler
handler for ShowEvent
events.addShowHandler
in interface ShowEvent.HasShowHandlers
handler
- the handlerpublic void addStyleOnOver(Element elem, String style)
elem
- the over elementstyle
- the style to addpublic void clearSizeCache()
public void disable()
public void disableEvents()
public void enable()
public void enableEvents()
public void fireEvent(GwtEvent<?> event)
fireEvent
in interface HasHandlers
fireEvent
in class Widget
public void focus()
public <X> X getData(String key)
null
if it has not been set.key
- the name of the propertynull
if it has not been setpublic XElement getElement()
UIObject.setElement(com.google.gwt.dom.client.Element)
.getElement
in class UIObject
public FocusManagerSupport getFocusSupport()
getFocusSupport
in interface HasFocusSupport
public Style.HideMode getHideMode()
public String getId()
public String getItemId()
public int getOffsetHeight(boolean content)
content
- true to get the height minus borders and paddingpublic int getOffsetWidth(boolean content)
content
- true to get the width minus borders and paddingpublic boolean getShadow()
public Layer.ShadowPosition getShadowPosition()
public String getStateId()
public int getTabIndex()
public ToolTip getToolTip()
public void hide()
public void hideToolTip()
public boolean isAllowTextSelection()
public boolean isAutoHeight()
public boolean isAutoWidth()
public boolean isDeferHeight()
public boolean isEnabled()
true
if the widget is enabled.isEnabled
in interface HasEnabled
public boolean isRendered()
public boolean isStateful()
public boolean isVisible()
isVisible
in interface HasVisibility
isVisible
in class UIObject
public boolean isVisible(boolean deep)
true
if the widget is visible.deep
- true to search up the widget hierarchypublic void mask()
public void mask(String message)
message
- a message to display in the maskpublic void onBrowserEvent(Event event)
onBrowserEvent
in interface EventListener
onBrowserEvent
in class Widget
public void removeToolTip()
public void setAllowTextSelection(boolean enable)
enable
- true to enable, false to disablepublic void setBorders(boolean show)
show
- true
to display a borderpublic void setBounds(int x, int y, int width, int height)
x
- the x coordinatey
- the y coordinatewidth
- the widthheight
- the heightpublic void setBounds(Rectangle bounds)
bounds
- the update box@UiChild(tagname="contextmenu", limit=1) public void setContextMenu(Menu menu)
menu
- the context menupublic void setData(String key, Object data)
key
- the name of the propertydata
- the new value for the propertypublic void setDeferHeight(boolean deferHeight)
deferHeight
- true to defer heightpublic void setEnabled(boolean enabled)
setEnabled
in interface HasEnabled
enabled
- the enabled statepublic void setHeight(int height)
height
- the new heightpublic void setHeight(String height)
public void setHideMode(Style.HideMode hideMode)
hideMode
- the hide mode.public void setId(String id)
id
- the idpublic void setItemId(String id)
public void setPagePosition(int x, int y)
setPosition(int, int)
.x
- the x coordinatey
- the y coordinatepublic void setPixelSize(int width, int height)
setPixelSize
in class UIObject
width
- new width, in pixelsheight
- height, in pixelspublic void setPosition(int left, int top)
setPagePosition(int, int)
.left
- the new lefttop
- the new toppublic void setShadow(boolean shadow)
shadow
- true to enable the shadowpublic void setShadowPosition(Layer.ShadowPosition shadowPosition)
shadowPosition
- the positionpublic void setSize(String width, String height)
public void setStateful(boolean stateful)
setStateId(String)
or setId(String)
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
widget.stateful
- true to enable statepublic void setStateId(String stateId)
stateId
- the state idpublic void setTabIndex(int tabIndex)
tabIndex
- the tab indexpublic void setToolTip(SafeHtml html)
html
- the tip text or htmlpublic void setToolTip(String text)
text
- the tip textpublic void setToolTipConfig(ToolTipConfig config)
config
- the tool tip configpublic void setVisible(boolean visible)
setVisible
in interface HasVisibility
setVisible
in class UIObject
visible
- the visible statepublic void setWidth(int width)
width
- the new width to setpublic void setWidth(String width)
public void show()
public void sync(boolean show)
show
- true to show the layerpublic void syncSize()
public void unmask()
Copyright © 2015. All rights reserved.