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 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.
id
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
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
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 |
setJavaScriptObject(com.google.gwt.core.client.JavaScriptObject jsObj) |
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.
|
getApplyHeightToTextBox, getCanSelectText, getClipValue, getDateFormatter, getEscapeHTML, getTextBoxStyle, getWrap, setApplyHeightToTextBox, setCanSelectText, setClipValue, setDateFormatter, setDefaultProperties, setEscapeHTML, setTextBoxStyle, setWrap
_getValue, addBlurHandler, addChangedHandler, addChangeHandler, addDoubleClickHandler, addEditorEnterHandler, addEditorExitHandler, addFocusHandler, addIconClickHandler, addIconKeyPressHandler, addItemHoverHandler, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addPickerIconClickHandler, addTitleClickHandler, addTitleDoubleClickHandler, addTitleHoverHandler, addValueHoverHandler, asSGWTComponent, blurItem, canEditCriterion, clearValue, disable, enable, focusInItem, getAccessKey, getAlign, getAllowExpressions, getAlwaysFetchMissingValues, getAriaRole, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsString, getBrowserSpellCheck, getCanEdit, getCanFocus, getCanvasAutoChild, getCellHeight, getCellStyle, getClassName, getClipStaticValue, getClipTitle, getConfig, getContainerWidget, getCriteriaField, getCriterion, getCriterion, getDataPath, getDecimalPad, getDecimalPrecision, getDefaultIconSrc, getDisabled, getDisplayField, getDisplayFieldName, getDisplayValue, getDisplayValue, getEditorTypeConfig, getEditPendingCSSText, getEmptyDisplayValue, getEmptyValueIcon, getEndRow, getErrorIconHeight, getErrorIconSrc, getErrorIconWidth, getErrorMessageWidth, getFetchMissingValues, getFieldName, getFilterLocally, getForm, getFormItemAutoChild, getFullDataPath, getGlobalTabIndex, getHeight, getHint, getHintStyle, getHoverAlign, getHoverDelay, getHoverHeight, getHoverOpacity, getHoverStyle, getHoverVAlign, getHoverWidth, getIcon, getIconHeight, getIconHSpace, getIconPageRect, getIconPrompt, getIconRect, getIconWidth, getImageURLPrefix, getImageURLSuffix, getImplicitSave, getImplicitSaveOnBlur, getInputFormat, getLeft, getLocateItemBy, getMultipleValueSeparator, getName, getOperator, getOptionCriteria, getOptionFilterContext, getOptionOperationId, getPageLeft, getPageRect, getPageTop, getPicker, getPickerIconHeight, getPickerIconName, getPickerIconPrompt, getPickerIconProperties, getPickerIconSrc, getPickerIconStyle, getPickerIconWidth, getPrintTextBoxStyle, getPrintTitleStyle, getPrompt, getReadOnlyTextBoxStyle, getRect, getRedrawOnChange, getRejectInvalidValueOnChange, getRequired, getRequiredMessage, getRowSpan, getSaveOnEnter, getSelectedRecord, getSelectOnClick, getSelectOnFocus, getShouldSaveValue, getShowClippedTitleOnHover, getShowClippedValueOnHover, getShowDisabled, getShowErrorIcon, getShowErrorStyle, getShowErrorText, getShowFocused, getShowFocusedErrorState, getShowFocusedIcons, getShowFocusedPickerIcon, getShowHint, getShowIcons, getShowOverIcons, getShowPickerIcon, getShowRTL, getShowTitle, getShowValueIconOnly, getStartRow, getStopOnError, getSuppressValueIcon, getSynchronousValidation, getTabIndex, getTextAlign, getTimeFormatter, getTitle, getTitleAlign, getTitleColSpan, getTitleOrientation, getTitleStyle, getTitleVAlign, getTooltip, getTop, getType, getValidateOnChange, getValidateOnExit, getValidOperators, getVAlign, getValue, getValueAsRecordList, getValueField, getValueFieldName, getValueIconHeight, getValueIconLeftPadding, getValueIconRightPadding, getValueIconSize, getValueIconWidth, getVisible, getVisibleHeight, getVisibleWidth, getWidth, getWrapTitle, hasAdvancedCriteria, hide, hideIcon, invalidateDisplayValueCache, isCreated, isDisabled, isDrawn, isVisible, redraw, setAccessKey, setAlign, setAllowExpressions, setAlwaysFetchMissingValues, setAriaRole, setAriaState, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAutoChildConstructor, setAutoChildProperties, setAutoChildProperties, setAutoChildVisibility, setBrowserSpellCheck, setCanEdit, setCanEditCriterionPredicate, setCanFocus, setCellHeight, setCellStyle, setClipStaticValue, setClipTitle, setColSpan, setColSpan, setCriteriaField, setCriterion, setCriterionGetter, setCriterionSetter, 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, setFetchMissingValues, setFilterLocally, setGlobalTabIndex, setHeight, setHeight, setHint, setHintStyle, setHoverAlign, setHoverDelay, setHoverHeight, setHoverOpacity, setHoverStyle, setHoverVAlign, setHoverWidth, setIconHeight, setIconHSpace, setIconPrompt, setIcons, setIconWidth, setImageURLPrefix, setImageURLSuffix, setImplicitSave, setImplicitSaveOnBlur, setInitHandler, setInputFormat, setInputTransformer, setItemHoverFormatter, setItemTitleHoverFormatter, setItemValueHoverFormatter, setLeft, setLocateItemBy, setMultipleValueSeparator, setName, setOperator, setOptionCriteria, setOptionDataSource, setOptionFilterContext, setOptionOperationId, setPickerIconHeight, setPickerIconName, setPickerIconPrompt, setPickerIconProperties, setPickerIconSrc, setPickerIconStyle, setPickerIconWidth, setPrintTextBoxStyle, setPrintTitleStyle, setPrompt, setProperty, setProperty, setProperty, setProperty, setProperty, setReadOnlyTextBoxStyle, setRedrawOnChange, setRejectInvalidValueOnChange, setRequired, setRequiredMessage, setRowSpan, setSaveOnEnter, setSelectOnClick, setSelectOnFocus, setShouldSaveValue, setShowClippedTitleOnHover, setShowClippedValueOnHover, setShowDisabled, setShowErrorIcon, setShowErrorStyle, setShowErrorText, setShowFocused, setShowFocusedErrorState, setShowFocusedIcons, setShowFocusedPickerIcon, setShowHint, setShowIcons, setShowIfCondition, setShowOverIcons, setShowPickerIcon, setShowRTL, setShowTitle, setShowValueIconOnly, setStartRow, setStopOnError, setSuppressValueIcon, setSynchronousValidation, setTabIndex, setTextAlign, setTimeFormatter, setTitle, setTitleAlign, setTitleColSpan, setTitleHoverFormatter, setTitleOrientation, setTitleStyle, setTitleVAlign, setTooltip, setTop, setType, setValidateOnChange, setValidateOnExit, setValidators, setValidOperators, setVAlign, setValue, setValue, setValue, setValue, setValue, setValue, setValueField, setValueFormatter, setValueHoverFormatter, setValueIconHeight, setValueIconLeftPadding, setValueIconMapper, setValueIconRightPadding, setValueIcons, setValueIconSize, setValueIconWidth, setValueMap, setValueMap, setVisible, setWidth, setWidth, setWrapTitle, shouldApplyHeightToTextBox, shouldFetchMissingValue, shouldSaveOnEnter, show, showIcon, showPicker, stopHover, updateState, validate, valueClipped
getRef, getRef, internalSetID
doAddHandler, fireEvent, getAttributeAsDoubleArray, getAttributeAsIntArray, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsStringArray, getAttributes, getHandlerCount, getJsObj, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributeAsJavaObject
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 void setJavaScriptObject(com.google.gwt.core.client.JavaScriptObject jsObj)
setJavaScriptObject
in class StaticTextItem
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.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.AutoChildUsage
public static void changePickerIconDefaults(FormItemIcon defaults)
public void setDisableIconsOnReadOnly(java.lang.Boolean disableIconsOnReadOnly)
canEdit
is set to false, should icons
be disabled by default? This may also be specified
at the icon level. See disableOnReadOnly
.
setDisableIconsOnReadOnly
in class FormItem
disableIconsOnReadOnly
- disableIconsOnReadOnly Default value is falsepublic java.lang.Boolean getDisableIconsOnReadOnly()
canEdit
is set to false, should icons
be disabled by default? This may also be specified
at the icon level. See disableOnReadOnly
.
getDisableIconsOnReadOnly
in class FormItem
public void setIconVAlign(VerticalAlignment iconVAlign)
Note : This is an advanced setting
setIconVAlign
in class FormItem
iconVAlign
- iconVAlign 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.. See HTMLString
. Default value is nullpublic 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
- readOnlyDisplay 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
- . See String
. 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.
String
public static void setDefaultProperties(LinkItem linkItemProperties)
Note: This method is intended for setting default attributes only and will effect 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.
linkItemProperties
- properties that should be used as new defaults when instances of this class are createdpublic 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