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, HasGestureRecognizers
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. |
void |
addGestureRecognizer(GestureRecognizer gestureRecognizer)
Adds a GestureRecognizer.
|
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.
|
GestureRecognizer |
getGestureRecognizer(int index)
Get GestureRecognizer at given index
|
int |
getGestureRecognizerCount()
Provides the count of GestureRecognizers
|
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 addGestureRecognizer(GestureRecognizer gestureRecognizer)
HasGestureRecognizers
addGestureRecognizer
in interface HasGestureRecognizers
gestureRecognizer
- the gesture recognizerpublic GestureRecognizer getGestureRecognizer(int index)
HasGestureRecognizers
getGestureRecognizer
in interface HasGestureRecognizers
index
- the index you wantpublic int getGestureRecognizerCount()
HasGestureRecognizers
getGestureRecognizerCount
in interface HasGestureRecognizers
public 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.X
- the type of data being returnedkey
- 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 void setHideMode(Style.HideMode hideMode)
hideMode
- the hide mode.public String getId()
public void setId(String id)
id
- the idpublic String getItemId()
public void setItemId(String id)
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 void setShadow(boolean shadow)
shadow
- true to enable the shadowpublic Layer.ShadowPosition getShadowPosition()
public void setShadowPosition(Layer.ShadowPosition shadowPosition)
shadowPosition
- the positionpublic String getStateId()
public void setStateId(String stateId)
stateId
- the state idpublic int getTabIndex()
public void setTabIndex(int tabIndex)
tabIndex
- the tab indexpublic ToolTip getToolTip()
public void hide()
public void hideToolTip()
public boolean isAllowTextSelection()
public void setAllowTextSelection(boolean enable)
enable
- true to enable, false to disablepublic boolean isAutoHeight()
public boolean isAutoWidth()
public boolean isDeferHeight()
public void setDeferHeight(boolean deferHeight)
deferHeight
- true to defer heightpublic boolean isEnabled()
true
if the widget is enabled.isEnabled
in interface HasEnabled
public void setEnabled(boolean enabled)
setEnabled
in interface HasEnabled
enabled
- the enabled statepublic boolean isRendered()
public boolean isStateful()
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 boolean isVisible()
isVisible
in interface HasVisibility
isVisible
in class UIObject
public void setVisible(boolean visible)
setVisible
in interface HasVisibility
setVisible
in class UIObject
visible
- the visible statepublic 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 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 setHeight(int height)
height
- the new heightpublic void setHeight(String height)
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 setSize(String width, String height)
public 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 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 © 2016. All rights reserved.