public class LinkItem extends StaticTextItem
canEdit
is false
) the URL is shown as a link;
in editable mode the URL is shown in a textbox. The link to open is specified as the item value with FormItem.setValue()
or FormItem.defaultValue
. The link title defaults to the
URL unless linkTitle
is specified.
Additionally, a custom action can be triggered when the link is clicked: see target
for details.
FormItem.CustomStateGetter, FormItem.StateCustomizer
configOnly, scClassName, warnOnEditorTypeConversion, warnOnEditorTypeConversionDefault
id
factoryCreated, factoryProperties
Constructor and Description |
---|
LinkItem() |
LinkItem(com.google.gwt.core.client.JavaScriptObject jsObj) |
LinkItem(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
com.google.gwt.event.shared.HandlerRegistration |
addClickHandler(ClickHandler handler)
Add a click handler.
|
static void |
changeAutoChildDefaults(java.lang.String autoChildName,
Canvas defaults)
Changes the defaults for Canvas AutoChildren named
autoChildName . |
static void |
changeAutoChildDefaults(java.lang.String autoChildName,
FormItem defaults)
Changes the defaults for FormItem AutoChildren named
autoChildName . |
static void |
changePickerIconDefaults(FormItemIcon defaults) |
java.lang.Boolean |
getDisableIconsOnReadOnly()
If
FormItem.canEdit is set to false, should icons be disabled by default? |
VerticalAlignment |
getIconVAlign()
How should icons be aligned vertically for this form item.
|
java.lang.String |
getLinkTitle()
Optional title HTML to display for this item's link.
|
static LinkItem |
getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj) |
ReadOnlyDisplayAppearance |
getReadOnlyDisplay()
|
java.lang.String |
getTarget()
By default, clicking a link rendered by this item opens it in a new browser window.
|
static void |
setDefaultProperties(LinkItem linkItemProperties)
Class level method to set the default properties of this class.
|
void |
setDisableIconsOnReadOnly(java.lang.Boolean disableIconsOnReadOnly)
If
FormItem.canEdit is set to false, should icons be disabled by default? |
void |
setIconVAlign(VerticalAlignment iconVAlign)
How should icons be aligned vertically for this form item.
|
void |
setLinkTitle(java.lang.String linkTitle)
Optional title HTML to display for this item's link.
|
void |
setReadOnlyDisplay(ReadOnlyDisplayAppearance readOnlyDisplay)
|
void |
setTarget(java.lang.String target)
By default, clicking a link rendered by this item opens it in a new browser window.
|
getApplyAlignToText, getApplyHeightToTextBox, getCanSelectText, getClipValue, getDateFormatter, getEditProxyConstructor, getEscapeHTML, getTextBoxStyle, getWrap, setApplyAlignToText, setApplyHeightToTextBox, setCanSelectText, setClipValue, setDateFormatter, setDefaultProperties, setEditProxyConstructor, setEscapeHTML, setTextBoxStyle, setWrap
_getValue, addBlurHandler, addChangedHandler, addChangeHandler, addDoubleClickHandler, addEditorEnterHandler, addEditorExitHandler, addFocusHandler, addIcon, addIcon, addIconClickHandler, addIconKeyPressHandler, addItemHoverHandler, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addPendingStatusChangedHandler, addPickerIconClickHandler, addShowContextMenuHandler, addTitleClickHandler, addTitleDoubleClickHandler, addTitleHoverHandler, addValueHoverHandler, addValueIconClickHandler, applyFormula, asSGWTComponent, blurItem, canEditCriterion, clearErrors, clearValue, disable, disableIcon, enable, enableIcon, error, error, errorIfNotCreated, focusAfterItem, focusInItem, getAccessKey, getAlign, getAllowExpressions, getAlwaysFetchMissingValues, getAlwaysShowControlBox, getAriaRole, getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsObject, getAttributeAsString, getAutoComplete, getAutoCompleteKeywords, getBrowserInputType, getBrowserSpellCheck, getCanEdit, getCanEditOpaqueValues, getCanFocus, getCanTabToIcons, getCanvasAutoChild, getCellHeight, getCellStyle, getChangeOnKeypress, getClassName, getClipStaticValue, getClipTitle, getConfig, getContainerWidget, getControlStyle, getCriteriaField, getCriterion, getCriterion, getCursorPosition, getCustomState, getDataPath, getDecimalPad, getDecimalPrecision, getDefaultIconSrc, getDisabled, getDisplayField, getDisplayFieldName, getDisplayValue, getDisplayValue, getEditorTypeConfig, getEditPendingCSSText, getEmptyDisplayValue, getEmptyValueIcon, getEndRow, getErrorIconHeight, getErrorIconSrc, getErrorIconWidth, getErrorMessageWidth, getErrors, getExportFormat, getFetchMissingValues, getFieldName, getFilterLocally, getForeignDisplayField, getForm, getFormat, getFormItemAutoChild, getFormula, getFullDataPath, getGlobalTabIndex, getGridColNum, getGridRowNum, getHeight, getHeightAsString, getHidden, getHint, getHintStyle, getHoverAlign, getHoverDelay, getHoverHeight, getHoverOpacity, getHoverStyle, getHoverVAlign, getHoverWidth, getIcon, getIconHeight, getIconHSpace, getIconPageRect, getIconPrompt, getIconRect, getIcons, getIconTabPosition, getIconWidth, getID, getImageURLPrefix, getImageURLSuffix, getImplicitSave, getImplicitSaveOnBlur, getInputFormat, getLeft, getListGrid, getLoadingDisplayValue, getLocateItemBy, getMinHintWidth, getMultiple, getMultipleValueSeparator, getName, getOperator, getOptionCriteria, getOptionDataSource, getOptionDataSourceAsString, getOptionFilterContext, getOptionOperationId, getOriginalValueMessage, getPageLeft, getPageRect, getPageTop, getPaletteDefaults, getPicker, getPickerIcon, getPickerIcon, getPickerIconHeight, getPickerIconName, getPickerIconPrompt, getPickerIconProperties, getPickerIconSrc, getPickerIconStyle, getPickerIconTabPosition, getPickerIconWidth, getPixelHeight, getPixelWidth, getPrintTextBoxStyle, getPrintTitleStyle, getPrompt, getReadOnlyHover, getReadOnlyTextBoxStyle, getReadOnlyWhen, getRect, getRedrawOnChange, getRejectInvalidValueOnChange, getRequired, getRequiredMessage, getRequiredWhen, getRowSpan, getSaveOnEnter, getScClassName, getSelectedRecord, getSelectOnClick, getSelectOnFocus, getShouldSaveValue, getShowClippedTitleOnHover, getShowClippedValueOnHover, getShowDeletions, getShowDisabled, getShowDisabledIconsOnFocus, getShowDisabledPickerIconOnFocus, getShowErrorIcon, getShowErrorStyle, getShowErrorText, getShowFocused, getShowFocusedErrorState, getShowFocusedIcons, getShowFocusedPickerIcon, getShowHint, getShowIcons, getShowIconsOnFocus, getShowOldValueInHover, getShowOver, getShowOverIcons, getShowPending, getShowPickerIcon, getShowPickerIconOnFocus, getShowRTL, getShowTitle, getShowValueIconOnly, getStartRow, getStaticHeight, getStopOnError, getSupportsCutPasteEvents, getSuppressValueIcon, getSynchronousValidation, getTabIndex, getTextAlign, getTextFormula, getTimeFormatter, getTitle, getTitleAlign, getTitleColSpan, getTitleOrientation, getTitleStyle, getTitleVAlign, getTooltip, getTop, getType, getUpdateControlOnOver, getUpdatePickerIconOnOver, getUpdateTextBoxOnOver, getUseAdvancedCriteria, getUseDisabledHintStyleForReadOnly, getUseLocalDisplayFieldValue, getValidateOnChange, getValidateOnExit, getValidOperators, getVAlign, getValue, getValueAsRecordList, getValueDeselectedCSSText, getValueField, getValueFieldName, getValueIconHeight, getValueIconLeftPadding, getValueIconRightPadding, getValueIconSize, getValueIconWidth, getValueMap, getValueMapAsArray, getVisible, getVisibleHeight, getVisibleTitleWidth, getVisibleWhen, getVisibleWidth, getWarnOnEditorTypeConversion, getWarnOnEditorTypeConversionDefault, getWidth, getWidthAsString, getWrapHintText, getWrapTitle, handleWarnOnEditorTypeConversion, hasAdvancedCriteria, hasErrors, hide, hideIcon, invalidateDisplayValueCache, isConfigOnly, isCreated, isCutEvent, isDisabled, isDrawn, isFocused, isInGrid, isPasteEvent, isVisible, linkToInstanceUponCreate, mapDisplayToValue, mapValueToDisplay, mapValueToDisplay, mapValueToDisplay, redraw, redraw, removeIcon, setAccessKey, setAlign, setAllowExpressions, setAlwaysFetchMissingValues, setAlwaysShowControlBox, setAriaRole, setAriaState, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAutoChildConstructor, setAutoChildProperties, setAutoChildProperties, setAutoChildProperties, setAutoChildVisibility, setAutoComplete, setAutoCompleteKeywords, setBrowserInputType, setBrowserSpellCheck, setCanEdit, setCanEditCriterionPredicate, setCanEditOpaqueValues, setCanFocus, setCanTabToIcons, setCellHeight, setCellStyle, setChangeOnKeypress, setClipStaticValue, setClipTitle, setColSpan, setColSpan, setConfigOnly, setControlStyle, setCriteriaField, setCriterion, setCriterionGetter, setCriterionSetter, setCustomStateGetter, setDataPath, setDecimalPad, setDecimalPrecision, setDefaultIconSrc, setDefaultProperties, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDisabled, setDisplayField, setDisplayFormat, setDisplayFormat, setEditorProperties, setEditorType, setEditorType, setEditorType, setEditorValueFormatter, setEditorValueParser, setEditPendingCSSText, setEmptyDisplayValue, setEmptyValueIcon, setEndRow, setErrorFormatter, setErrorIconHeight, setErrorIconSrc, setErrorIconWidth, setErrorMessageWidth, setErrorOrientation, setErrors, setErrors, setExportFormat, setFetchMissingValues, setFilterLocally, setForeignDisplayField, setFormat, setFormula, setGlobalTabIndex, setHeight, setHeight, setHidden, setHint, setHintStyle, setHoverAlign, setHoverDelay, setHoverHeight, setHoverOpacity, setHoverStyle, setHoverVAlign, setHoverWidth, setIconDisabled, setIconHeight, setIconHSpace, setIconPrompt, setIcons, setIconShowOnFocus, setIconWidth, setID, setImageURLPrefix, setImageURLSuffix, setImplicitSave, setImplicitSaveOnBlur, setInitHandler, setInputFormat, setInputTransformer, setItemHoverFormatter, setItemTitleHoverFormatter, setItemValueHoverFormatter, setJavaScriptObject, setLeft, setLoadingDisplayValue, setLocateItemBy, setMinHintWidth, setMultiple, setMultipleValueSeparator, setName, setNullProperty, setOperator, setOptionCriteria, setOptionDataSource, setOptionDataSource, setOptionFilterContext, setOptionOperationId, setOriginalValueMessage, setPickerIconHeight, setPickerIconName, setPickerIconPrompt, setPickerIconProperties, setPickerIconSrc, setPickerIconStyle, setPickerIconWidth, setPrintTextBoxStyle, setPrintTitleStyle, setPrompt, setProperty, setProperty, setProperty, setProperty, setProperty, setReadOnlyHover, setReadOnlyTextBoxStyle, setReadOnlyWhen, setRedrawOnChange, setRejectInvalidValueOnChange, setRequired, setRequiredMessage, setRequiredWhen, setRowSpan, setSaveOnEnter, setScClassName, setSelectOnClick, setSelectOnFocus, setShouldSaveValue, setShowClippedTitleOnHover, setShowClippedValueOnHover, setShowDeletions, setShowDisabled, setShowDisabledIconsOnFocus, setShowDisabledPickerIconOnFocus, setShowErrorIcon, setShowErrorStyle, setShowErrorText, setShowFocused, setShowFocusedErrorState, setShowFocusedIcons, setShowFocusedPickerIcon, setShowHint, setShowIcons, setShowIconsOnFocus, setShowIfCondition, setShowOldValueInHover, setShowOver, setShowOverIcons, setShowPending, setShowPickerIcon, setShowPickerIconOnFocus, setShowRTL, setShowTitle, setShowValueIconOnly, setStartRow, setStateCustomizer, setStaticHeight, setStopOnError, setSupportsCutPasteEvents, setSuppressValueIcon, setSynchronousValidation, setTabIndex, setTextAlign, setTextFormula, setTimeFormatter, setTitle, setTitleAlign, setTitleColSpan, setTitleHoverFormatter, setTitleOrientation, setTitleStyle, setTitleVAlign, setTooltip, setTop, setType, setUpdateControlOnOver, setUpdatePickerIconOnOver, setUpdateTextBoxOnOver, setUseAdvancedCriteria, setUseDisabledHintStyleForReadOnly, setUseLocalDisplayFieldValue, setValidateOnChange, setValidateOnExit, setValidators, setValidOperators, setVAlign, setValue, setValue, setValue, setValue, setValue, setValue, setValueDeselectedCSSText, setValueField, setValueFormatter, setValueHoverFormatter, setValueIconHeight, setValueIconLeftPadding, setValueIconMapper, setValueIconRightPadding, setValueIcons, setValueIconSize, setValueIconWidth, setValueMap, setValueMap, setVisible, setVisibleWhen, setWarnOnEditorTypeConversion, setWarnOnEditorTypeConversionDefault, setWidth, setWidth, setWrapHintText, setWrapTitle, shouldApplyHeightToTextBox, shouldFetchMissingValue, shouldSaveOnEnter, shouldStopKeyPressBubbling, show, showIcon, showPicker, stopHover, storeValue, storeValue, updateState, validate, valueClipped
getRef, getRef, internalSetID
applyFactoryProperties, doAddHandler, fireEvent, getAttributeAsDoubleArray, getAttributeAsIntArray, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsStringArray, getAttributes, getHandlerCount, isFactoryCreated, setAttribute, setAttribute, setAttribute, setAttributeAsJavaObject, setFactoryCreated
public LinkItem()
public LinkItem(com.google.gwt.core.client.JavaScriptObject jsObj)
public LinkItem(java.lang.String name)
public static LinkItem getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
public static void changeAutoChildDefaults(java.lang.String autoChildName, Canvas defaults)
autoChildName
.autoChildName
- name of an AutoChild to customize the defaults for.defaults
- Canvas defaults to apply. These defaults override any existing properties
without destroying or wiping out non-overridden properties. For usage tips on this
param, see SGWTProperties
.AutoChildUsage
public static void changeAutoChildDefaults(java.lang.String autoChildName, FormItem defaults)
autoChildName
.autoChildName
- name of an AutoChild to customize the defaults for.defaults
- FormItem defaults to apply. These defaults override any existing properties
without destroying or wiping out non-overridden properties. For usage tips on this
param, see SGWTProperties
.AutoChildUsage
public static void changePickerIconDefaults(FormItemIcon defaults)
public void setDisableIconsOnReadOnly(java.lang.Boolean disableIconsOnReadOnly)
FormItem.canEdit
is set to false, should icons
be disabled by default? This may also be specified
at the icon level. See FormItemIcon.disableOnReadOnly
.
setDisableIconsOnReadOnly
in class FormItem
disableIconsOnReadOnly
- New disableIconsOnReadOnly value. Default value is falsepublic java.lang.Boolean getDisableIconsOnReadOnly()
FormItem.canEdit
is set to false, should icons
be disabled by default? This may also be specified
at the icon level. See FormItemIcon.disableOnReadOnly
.
getDisableIconsOnReadOnly
in class FormItem
public void setIconVAlign(VerticalAlignment iconVAlign)
Note : This is an advanced setting
setIconVAlign
in class FormItem
iconVAlign
- New iconVAlign value. Default value is "center"public VerticalAlignment getIconVAlign()
getIconVAlign
in class FormItem
public void setLinkTitle(java.lang.String linkTitle)
LinkItem
's value (the URL) will be used
for the link's title.
linkTitle
.linkTitle
- new linkTitle
HTML. Default value is nullHTMLString
public java.lang.String getLinkTitle()
LinkItem
's value (the URL) will be used
for the link's title.HTMLString
public void setReadOnlyDisplay(ReadOnlyDisplayAppearance readOnlyDisplay)
canEdit
is set to false
, how should
this LinkItem
be displayed to the user? Link items are, by default, canEdit:false. Note that the link
remains active regardless of the readOnlyDisplay
setting.
setReadOnlyDisplay
in class FormItem
readOnlyDisplay
- New readOnlyDisplay value. Default value is nullDynamicForm.setReadOnlyDisplay(com.smartgwt.client.types.ReadOnlyDisplayAppearance)
public ReadOnlyDisplayAppearance getReadOnlyDisplay()
canEdit
is set to false
, how should
this LinkItem
be displayed to the user? Link items are, by default, canEdit:false. Note that the link
remains active regardless of the readOnlyDisplay
setting.
getReadOnlyDisplay
in class FormItem
DynamicForm.getReadOnlyDisplay()
public void setTarget(java.lang.String target)
target
attribute of
the anchor tag used to render the link. If you set linkItem.target to "javascript", the default behaviour is to
catch and consume mouse-clicks that would result in the link being followed. Instead, the FormItem.click()
event is fired.
target
- New target value. Default value is "_blank"public java.lang.String getTarget()
target
attribute of
the anchor tag used to render the link. If you set linkItem.target to "javascript", the default behaviour is to
catch and consume mouse-clicks that would result in the link being followed. Instead, the FormItem.click()
event is fired.
public static void setDefaultProperties(LinkItem linkItemProperties)
Note: This method is intended for setting default attributes only and will affect all instances of the underlying class (including those automatically generated in JavaScript). This method should not be used to apply standard EventHandlers or override methods for a class - use a custom subclass instead. Calling this method after instances have been created can result in undefined behavior, since it bypasses any setters and a class instance may have already examined a particular property and not be expecting any changes through this route.
linkItemProperties
- properties that should be used as new defaults when instances of this class are createdSGWTProperties
public com.google.gwt.event.shared.HandlerRegistration addClickHandler(ClickHandler handler)
FormItem
Called when this FormItem is clicked on.
Note: click()
is available on StaticTextItem, BlurbItems,
ButtonItem, and derivatives. Other form items (such as HiddenItem) do not support click()
.
addClickHandler
in interface HasClickHandlers
addClickHandler
in class FormItem
handler
- the click handlerHandlerRegistration
used to remove this handler