public abstract class AbstractComponentConnector extends AbstractConnector implements HasErrorIndicator
| Modifier and Type | Field and Description |
|---|---|
protected int |
SIGNIFICANT_MOVE_THRESHOLD
Default threshold for determining whether touch move is significant.
|
| Constructor and Description |
|---|
AbstractComponentConnector()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected com.google.gwt.user.client.ui.Widget |
createWidget()
Creates and returns the widget for this VPaintableWidget.
|
boolean |
delegateCaptionHandling()
Return true if parent handles caption, false if the paintable handles the
caption itself.
|
void |
flush()
Called for the active (focused) connector when a situation occurs that
the focused connector might have buffered changes which need to be
processed before other activity takes place.
|
protected Icon |
getIcon()
Gets the icon set for this component.
|
protected String |
getIconUri()
Gets the URI of the icon set for this component.
|
LayoutManager |
getLayoutManager() |
AbstractComponentState |
getState()
Returns the shared state object for this connector.
|
TooltipInfo |
getTooltipInfo(com.google.gwt.dom.client.Element element)
Gets the tooltip info for the given element.
|
com.google.gwt.user.client.ui.Widget |
getWidget()
Returns the widget associated with this paintable.
|
boolean |
hasTooltip()
Check whether there might be a tooltip for this component.
|
boolean |
isErrorIndicatorVisible()
Checks if an error indicator should be shown for the given connector.
|
static boolean |
isRealUpdate(UIDL uidl)
Deprecated.
|
boolean |
isRelativeHeight()
Returns
true if the height of this paintable is currently
relative. |
boolean |
isRelativeWidth()
Returns
true if the width of this paintable is currently
relative. |
boolean |
isUndefinedHeight()
Returns
true if the height of this paintable is currently
undefined. |
boolean |
isUndefinedWidth()
Returns
true if the width of this paintable is currently
undefined. |
void |
onDragSourceAttached()
Invoked when a
DragSourceExtensionConnector has been attached to
this component. |
void |
onDragSourceDetached()
Invoked when a
DragSourceExtensionConnector has been removed from
this component. |
void |
onDropTargetAttached()
Invoked when a
DropTargetExtensionConnector has been attached to
this component. |
void |
onDropTargetDetached()
Invoked when a
DropTargetExtensionConnector has been removed from
this component. |
void |
onStateChanged(StateChangeEvent stateChangeEvent)
Notifies the event handler that the state has changed.
|
void |
onUnregister()
Event called when connector has been unregistered.
|
protected void |
registerTouchHandlers()
The new default behavior is for long taps to fire a contextclick event if
there's a contextclick listener attached to the component.
|
protected void |
sendContextClickEvent(MouseEventDetails details,
com.google.gwt.dom.client.EventTarget eventTarget)
This method sends the context menu event to the server-side.
|
void |
setWidgetEnabled(boolean widgetEnabled)
Sets the enabled state of the widget associated to this connector.
|
protected void |
setWidgetStyleName(String styleName,
boolean add)
This is used to add / remove state related style names from the widget.
|
protected void |
setWidgetStyleNameWithPrefix(String prefix,
String styleName,
boolean add)
Deprecated.
This will be removed once styles are no longer added with
prefixes.
|
protected boolean |
shouldHandleLongTap()
Checks whether a long tap needs handling.
|
protected void |
unregisterTouchHandlers()
The new default behavior is for long taps to fire a contextclick event if
there's a contextclick listener attached to the component.
|
protected void |
updateComponentSize()
Updates the component size based on the shared state, invoking the
layout manager if necessary. |
protected void |
updateComponentSize(String newWidth,
String newHeight)
Updates the component size, invoking the
layout
manager if necessary. |
void |
updateEnabledState(boolean enabledState) |
protected void |
updateWidgetSize(String newWidth,
String newHeight)
Updates the DOM size of this connector's
widget. |
protected void |
updateWidgetStyleNames()
Updates the user defined, read-only and error style names for the widget
based the shared state.
|
addStateChangeHandler, addStateChangeHandler, createState, doInit, ensureHandlerManager, fireEvent, forceStateChange, getChildren, getConnection, getConnectorId, getParent, getResourceUrl, getRpcImplementations, getRpcProxy, getStateType, getTag, hasEventListener, init, isEnabled, registerRpc, removeStateChangeHandler, removeStateChangeHandler, setChildren, setParent, setTag, unregisterRpcclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddStateChangeHandler, addStateChangeHandler, doInit, fireEvent, getChildren, getConnection, getParent, getRpcImplementations, getTag, hasEventListener, isEnabled, removeStateChangeHandler, removeStateChangeHandler, setChildren, setParent, setTaggetConnectorIdprotected int SIGNIFICANT_MOVE_THRESHOLD
public AbstractComponentConnector()
protected void unregisterTouchHandlers()
protected void registerTouchHandlers()
protected boolean shouldHandleLongTap()
true if long tap handling is needed, false
otherwiseprotected void sendContextClickEvent(MouseEventDetails details, com.google.gwt.dom.client.EventTarget eventTarget)
details - the mouse event detailseventTarget - the target of the eventprotected com.google.gwt.user.client.ui.Widget createWidget()
You should typically not override this method since the framework by
default generates an implementation that uses GWT.create(Class)
to create a widget of the same type as returned by the most specific
override of getWidget(). If you do override the method, you
can't call super.createWidget() since the metadata needed
for that implementation is not generated if there's an override of the
method.
public com.google.gwt.user.client.ui.Widget getWidget()
@Deprecated public static boolean isRealUpdate(UIDL uidl)
uidl - the UIDL to checktrue if doesn't have "cached" attribute, false
otherwisepublic AbstractComponentState getState()
AbstractConnectorgetState in interface ComponentConnectorgetState in interface ServerConnectorgetState in class AbstractConnectorpublic void onStateChanged(StateChangeEvent stateChangeEvent)
StateChangeEvent.StateChangeHandleronStateChanged in interface StateChangeEvent.StateChangeHandleronStateChanged in class AbstractConnectorstateChangeEvent - the state change event with details about the changepublic void setWidgetEnabled(boolean widgetEnabled)
ComponentConnectorsetWidgetEnabled in interface ComponentConnectorwidgetEnabled - true if the widget should be enabled, false otherwiseprotected void updateComponentSize()
layout manager if necessary.protected void updateComponentSize(String newWidth, String newHeight)
layout
manager if necessary.newWidth - The new width as a CSS string. Cannot be null.newHeight - The new height as a CSS string. Cannot be null.protected void updateWidgetSize(String newWidth, String newHeight)
widget.newWidth - The new width as a CSS string. Cannot be null.newHeight - The new height as a CSS string. Cannot be null.public boolean isRelativeHeight()
ComponentConnectortrue if the height of this paintable is currently
relative. If the height is relative, the actual height of the paintable
is a percentage of the size allocated to it by its parent.isRelativeHeight in interface ComponentConnectortrue if the width is undefined, else
falsepublic boolean isRelativeWidth()
ComponentConnectortrue if the width of this paintable is currently
relative. If the width is relative, the actual width of the paintable is
a percentage of the size allocated to it by its parent.isRelativeWidth in interface ComponentConnectortrue if the width is undefined, else
falsepublic boolean isUndefinedHeight()
ComponentConnectortrue if the height of this paintable is currently
undefined. If the height is undefined, the actual height of the paintable
is defined by its contents.isUndefinedHeight in interface ComponentConnectortrue if the height is undefined, else
falsepublic boolean isUndefinedWidth()
ComponentConnectortrue if the width of this paintable is currently
undefined. If the width is undefined, the actual width of the paintable
is defined by its contents.isUndefinedWidth in interface ComponentConnectortrue if the width is undefined, else
falsepublic boolean delegateCaptionHandling()
ComponentConnectorThis should always return true and all components should let the parent handle the caption and use other attributes for internal texts in the component
delegateCaptionHandling in interface ComponentConnectorprotected void updateWidgetStyleNames()
getWidget()
This method can be overridden to provide additional style names for the
component, for example see AbstractFieldConnector
protected void setWidgetStyleName(String styleName, boolean add)
Override this method for example if the style name given here should be
updated in another widget in addition to the one returned by the
getWidget().
styleName - the style name to be added or removedadd - true to add the given style, false
to remove it@Deprecated protected void setWidgetStyleNameWithPrefix(String prefix, String styleName, boolean add)
Override this method if the prefixed style name given here should be
updated in another widget in addition to the one returned by the
Connector's getWidget(), or if the prefix should be
different. For example see
TextualDateConnector.setWidgetStyleNameWithPrefix(String, String, boolean)
prefix - the prefix for the style namestyleName - the style name to be added or removedadd - true to add the given style, false
to remove itpublic LayoutManager getLayoutManager()
getLayoutManager in interface ComponentConnectorpublic void updateEnabledState(boolean enabledState)
updateEnabledState in interface ServerConnectorupdateEnabledState in class AbstractConnectorpublic void onUnregister()
ServerConnectoronUnregister in interface ServerConnectoronUnregister in class AbstractConnectorpublic TooltipInfo getTooltipInfo(com.google.gwt.dom.client.Element element)
ComponentConnector
When overriding this method, ComponentConnector.hasTooltip() should also be
overridden to return true in all situations where this
method might return a non-empty result.
getTooltipInfo in interface ComponentConnectorelement - The element to lookup a tooltip forpublic boolean hasTooltip()
ComponentConnectorComponentConnector.getTooltipInfo(Element)) if this method returns true.
This is only done to optimize performance, so in cases where the status
is not known, it's safer to return true so that there will
be a tooltip handler even though it might not be needed in all cases.
hasTooltip in interface ComponentConnectortrue if some part of the component might have a
tooltip, otherwise falseprotected String getIconUri()
null if no icon has been
defined.protected Icon getIcon()
null if no icon has been defined.public void flush()
ComponentConnectorThis is currently called when the user changes the fragment using the back/forward button in the browser and allows the focused field to submit its value to the server before the fragment change event takes place.
flush in interface ComponentConnectorpublic boolean isErrorIndicatorVisible()
HasErrorIndicatorisErrorIndicatorVisible in interface HasErrorIndicatortrue to show an indicator, false
otherwisepublic void onDragSourceAttached()
DragSourceExtensionConnector has been attached to
this component.
By default, does nothing. If you need to apply some changes to the widget, override this method.
This is a framework internal method, and should not be invoked manually.
onDragSourceDetached()public void onDragSourceDetached()
DragSourceExtensionConnector has been removed from
this component.
By default, does nothing.
This is a framework internal method, and should not be invoked manually.
onDragSourceAttached()public void onDropTargetAttached()
DropTargetExtensionConnector has been attached to
this component.
By default, does nothing. If you need to apply some changes to the widget, override this method.
This is a framework internal method, and should not be invoked manually.
onDropTargetDetached()public void onDropTargetDetached()
DropTargetExtensionConnector has been removed from
this component.
By default, does nothing.
This is a framework internal method, and should not be invoked manually.
onDropTargetAttached()Copyright © 2023 Vaadin Ltd. All rights reserved.