public class UiWidgetAdapterTest extends AbstractUiWidgetAdapter<Void> implements AttributeWriteMaximumTextLength, AttributeWriteValidationFailure, UiWidgetAdapterButton, UiWidgetAdapterCollapsableSection, UiWidgetAdapterImage, UiWidgetAdapterLabel, UiWidgetAdapterLink, UiWidgetAdapterSection, UiWidgetAdapterMenuItemClickable, UiWidgetAdapterMenuItemSeparator, AttributeWriteSelectionMode, AttributeWriteStringTitle, AttributeWriteSummary, AttributeWriteTitleVisible
UiWidgetAdapter for testing
without a native toolkit.| Modifier and Type | Field and Description |
|---|---|
private boolean |
collapsed |
private boolean |
disposed |
private String |
validationFailure |
private int |
validationFailureSetCount |
ACCESS_KEY_NONE, HTML_ATTRIBUTE_ACCESS_KEYHTML_ATTRIBUTE_ID, ID_SEPARATOR, PROPERTY_IDPROPERTY_STYLES, STYLE_PATTERN_MULTIPLE, STYLE_PATTERN_SINGLEPROPERTY_TITLEPROPERTY_SUMMARYATTRIBUTE_COLSPAN| Constructor and Description |
|---|
UiWidgetAdapterTest()
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearValidationFailureSetCount()
Sets the value of
getValidationFailureSetCount() to 0. |
String |
createAbsoluteImageUrl(String relativePath)
This method creates an absolute URL from the given
relativePath. |
protected Void |
createToplevelWidget()
This method creates the
underlying widget. |
void |
dispose()
This method disposes this object.
|
double |
getHeightInPixel()
This method gets the height of this object in pixels.
|
Length |
getLength(LengthProperty property)
This method gets the
Length for the given LengthProperty of this object. |
String |
getSummary()
This method gets the summary of this object.
|
String |
getValidationFailure()
This method gets the validation failure of this object.
|
int |
getValidationFailureSetCount() |
double |
getWidthInPixel()
This method gets the width of this object in pixels.
|
boolean |
isCollapsed()
This method determines if this object is collapsed.
|
boolean |
isTitleVisible()
|
void |
removeFromParent()
This method removes the
widget from its parent. |
void |
setAccessKey(char accessKey)
This method sets the
accessKey attribute of this object. |
void |
setAltText(String altText)
This method sets the
alternative text of this object. |
void |
setAttribute(String name,
String value)
This method sets the
attribute of this object. |
void |
setCollapsed(boolean collapsed)
This method sets the
collapsed status of this object. |
void |
setEnabled(boolean enabled)
This method sets the
enabled status of this object. |
void |
setEventSender(UiFeatureEvent source,
UiHandlerEvent sender)
This method registers the given
event handler in the widget. |
boolean |
setFocused()
This method sets the
focus to this object. |
void |
setId(String id)
This method set the
ID of this object. |
void |
setImage(UiWidgetImage image)
This method sets the
image of this object. |
void |
setLabel(String label)
This method sets the
label of this object. |
void |
setLength(LengthProperty property,
Length value)
This method sets the specified
length of this object. |
void |
setMaximumTextLength(int length)
This method sets the
maximum text length of this object. |
void |
setSelectionMode(SelectionMode selectionMode)
This method sets the
selection mode. |
void |
setStyles(String styles)
This method clears all
styles and sets them to the given styles. |
void |
setSummary(String summary)
This method sets the
summary of this object. |
void |
setTitle(String title)
This method sets the title of this object.
|
void |
setTitleVisible(boolean titleVisible)
This method sets the
titleVisible flag of this object. |
void |
setTooltip(String tooltip)
This method sets the tooltip text of this object.
|
void |
setUrl(String url)
This method sets the
URL of this object. |
void |
setValidationFailure(String validationFailure)
This method sets the
validation failure. |
void |
setVisible(boolean visible,
boolean programmatic) |
protected void |
verifyNotDisposed()
Verifies that this object is NOT already
disposed. |
addStyle, createLabel, getAccessKey, getActiveWidget, getAltText, getAttribute, getBundle, getColumnSpan, getContext, getHeightInRows, getId, getImage, getLabel, getMaximumTextLength, getPrimaryStyle, getSelectionMode, getStyles, getTitle, getTooltip, getToplevelWidget, getUiWidget, getUiWidgetTyped, getUrl, hasStyle, isDisposed, isEnabled, isFocused, isResizable, isStyleDeltaSupported, removeStyle, setMode, setParent, setPrimaryStyle, setUiWidgetclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetMaximumTextLengthgetAltTextgetUrlisFocusedgetAccessKeycreateLabel, getToplevelWidget, isStyleDeltaSupported, setMode, setParentgetIdgetTooltipisEnabledaddStyle, removeStylehasStylegetStylessetPrimaryStylegetPrimaryStyleisDisposedgetAttributegetImagegetSelectionModegetTitleprivate boolean disposed
dispose()private boolean collapsed
setEnabled(boolean)private String validationFailure
getValidationFailure()private int validationFailureSetCount
getValidationFailureSetCount()protected Void createToplevelWidget()
underlying widget. createToplevelWidget in class AbstractUiWidgetAdapter<Void>underlying widget.public void removeFromParent()
widget from its parent. After this method, the
widget is detached from the UI.removeFromParent in interface UiWidgetAdapterpublic String createAbsoluteImageUrl(String relativePath)
relativePath.createAbsoluteImageUrl in interface UiWidgetAdapterrelativePath - is the relative path (URL suffix) to the image.UiConfiguration.getTheme()public void setEventSender(UiFeatureEvent source, UiHandlerEvent sender)
event handler in the widget. This method will be called only once.setEventSender in interface UiWidgetAdaptersource - is the event source.sender - is the UiHandlerEvent where the events are send to. This is actually an adapter
that dispatches the events to the individual listeners registered in the widget.public Length getLength(LengthProperty property)
Length for the given LengthProperty of this object. getLength(LengthProperty.WIDTH)
will return the same result as AttributeReadSize.getWidth(). Unlike AttributeReadSize
this method provides access to additional properties such as e.g. LengthProperty.MIN_WIDTH or
LengthProperty.MAX_HEIGHT.getLength in interface AttributeReadLengthPropertyproperty - is the LengthProperty identifying the actual property to get.Length. Will be Length.ZERO if undefined (NOT set).public void setLength(LengthProperty property, Length value)
length of this object. setLength(LengthProperty.WIDTH, value)
will return the same result as setWidth(value).setLength in interface AttributeWriteLengthPropertyproperty - is the LengthProperty identifying the actual property to set.value - is the new length to set.public double getWidthInPixel()
int value. However, to be compatible with
Length.getAmount() and with some underlying native toolkits we
use double to prevent potential information loss.getWidthInPixel in interface AttributeReadSizeInPixelpublic double getHeightInPixel()
int value. However, to be compatible with
Length.getAmount() and with some underlying native toolkits we
use double to prevent potential information loss.getHeightInPixel in interface AttributeReadSizeInPixelpublic void setStyles(String styles)
styles and sets them to the given styles. This
will also update the primary style.setStyles in interface AttributeWriteStylesstyles - are the styles of this object. Either a single style or a list of styles separated by
whitespaces. Use the empty string to unset all styles.public void setTooltip(String tooltip)
setTooltip in interface AttributeWriteTooltiptooltip - is the new tooltip text or null to disable the tooltip.AttributeReadTooltip.getTooltip()public void setId(String id)
ID of this object. Use this method to give the object a meaningful
identifier after creation. AttributeReadHtmlId.getId() for the syntax constraints of IDs.setId in interface AttributeWriteHtmlIdsetId in interface AttributeWriteId<String>id - is the new ID for the object.public void setAttribute(String name, String value)
attribute of this object.setAttribute in interface AttributeWriteOnlyAttributename - is the name of the attribute.value - is the new value of the attribute. May
be null to unset (remove attribute).protected void verifyNotDisposed()
disposed.public void dispose()
dispose in interface AttributeWriteDisposedpublic void setEnabled(boolean enabled)
enabled status of this object. If it is disabled, the user can
not interact with the object.setEnabled in interface AttributeWriteEnabledenabled - - if true the object will be enabled, else the object will be disabled.public void setVisible(boolean visible,
boolean programmatic)
setVisible in interface UiWidgetAdaptervisible - - true to set visible (show), false to set invisible (hide).programmatic - - see UiEvent.isProgrammatic().AttributeWriteVisibleAdvanced.setVisible(boolean, boolean)public void setLabel(String label)
label of this object.setLabel in interface AttributeWriteLabellabel - is the new label to set.public void setAccessKey(char accessKey)
accessKey attribute of this object.setAccessKey in interface AttributeWriteAccessKeyaccessKey - is the new value of AttributeReadAccessKey.getAccessKey(). Use AttributeReadAccessKey.ACCESS_KEY_NONE to unset.public void setImage(UiWidgetImage image)
image of this object. A previously set image will be replaced.setImage in interface AttributeWriteImage<UiWidgetImage>image - is the new image or null to remove the image.public boolean setFocused()
focus to this object. setFocused in interface AttributeWriteOnlyFocusedtrue if the focus has been set successfully, false otherwise.public void setCollapsed(boolean collapsed)
collapsed status of this object.setCollapsed in interface AttributeWriteCollapsedcollapsed - - if true the object will be collapsed, else it will be expanded.public boolean isCollapsed()
isCollapsed in interface AttributeReadCollapsedtrue if this object is collapsed, false if expanded.public void setUrl(String url)
URL of this object.setUrl in interface AttributeWriteUrlurl - is the new URL.public void setAltText(String altText)
alternative text of this object.setAltText in interface AttributeWriteAltTextaltText - is the new alternative text.AttributeReadAltText.getAltText(),
Accessibilitypublic String getValidationFailure()
getValidationFailure in interface AttributeReadValidationFailuregetValidationFailure in class AbstractUiWidgetAdapter<Void>null for no error.public void setValidationFailure(String validationFailure)
validation failure. UiFeatureValidation. This
method is only intended as back-door for very special cases (e.g. you have to use your own validator
infrastructure and perform validation outside this framework). It is not recommended to use this method
as an API user.setValidationFailure in interface AttributeWriteValidationFailurevalidationFailure - is the validation failure text. The empty string or null will clear
the error and mark the field as valid. Otherwise the field will be invalid.public int getValidationFailureSetCount()
setValidationFailure(String) since
clearValidationFailureSetCount().public void clearValidationFailureSetCount()
getValidationFailureSetCount() to 0.public void setMaximumTextLength(int length)
maximum text length of this object. setMaximumTextLength in interface AttributeWriteMaximumTextLengthlength - is the new maximum text length to set. Use
Integer.MAX_VALUE to unset.public void setSelectionMode(SelectionMode selectionMode)
selection mode. SelectionMode immediately after creating the object. The initial
default is always SelectionMode.SINGLE_SELECTION. Dynamically changing the SelectionMode
may be expensive or not be supported (in exotic implementations) and should therefore be avoided.setSelectionMode in interface AttributeWriteSelectionModeselectionMode - is the new SelectionMode.public void setTitle(String title)
setTitle in interface AttributeWriteStringTitlesetTitle in interface AttributeWriteTitle<String>title - is the new title.AttributeReadStringTitle.getTitle()public String getSummary()
getSummary in interface AttributeReadSummarypublic void setSummary(String summary)
summary of this object.setSummary in interface AttributeWriteSummarysummary - is the new summary to set.public boolean isTitleVisible()
title of this object is
visible. For Accessibility reasons you should always
set the title of a titled object. However in specific
cases you want to save space on the screen and may not require the title to be displayed for seeing
users. Then you can hide the title while it is still recognized by assistive technology such as screen
readers.isTitleVisible in interface AttributeReadTitleVisibletrue if visible, false if hidden.public void setTitleVisible(boolean titleVisible)
titleVisible flag of this object.setTitleVisible in interface AttributeWriteTitleVisibletitleVisible - is the new value for AttributeReadTitleVisible.isTitleVisible().Copyright © 2001–2016 mmm-Team. All rights reserved.