Class WInternalLink
- java.lang.Object
-
- com.github.bordertech.wcomponents.AbstractWComponent
-
- com.github.bordertech.wcomponents.WInternalLink
-
- All Implemented Interfaces:
AjaxTarget
,WComponent
,WebComponent
,Serializable
public class WInternalLink extends AbstractWComponent implements AjaxTarget
This component enables the creation of links within a page.Current limitations of this component are:
- It will only link to components that render out their id
- It will not link to components nested within WRepeater of WTable components
- The text for this link is the same for all users.
- Since:
- 1.0.0
- Author:
- Martin Shevchenko
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WInternalLink.InternalLinkModel
InternalLinkModel holds Extrinsic state management of the component.-
Nested classes/interfaces inherited from class com.github.bordertech.wcomponents.AbstractWComponent
AbstractWComponent.WComponentRef
-
-
Field Summary
-
Fields inherited from interface com.github.bordertech.wcomponents.WComponent
DEFAULT_APPLICATION_ID, DEFAULT_INTERNAL_ID, DEFAULT_NO_ID, ID_CONTEXT_SEPERATOR, ID_FRAMEWORK_ASSIGNED_SEPERATOR, ID_VALIDATION_PATTERN
-
-
Constructor Summary
Constructors Constructor Description WInternalLink()
Creates a WInternalLink with no text or component.WInternalLink(String text, WComponent reference)
Creates a WInternalLink with the specified text and component to link to.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected WInternalLink.InternalLinkModel
getComponentModel()
Returns the effective component model for this component.protected WInternalLink.InternalLinkModel
getOrCreateComponentModel()
Retrieves the model for this component so that it can be modified.WComponent
getReference()
String
getText()
protected WInternalLink.InternalLinkModel
newComponentModel()
Creates a new InternalLinkModel.void
setReference(WComponent reference)
Sets the component to which this component is linked.void
setText(String text)
Sets the text to be displayed for this link.String
toString()
Creates a String representation of this component; usually for debugging purposes.-
Methods inherited from class com.github.bordertech.wcomponents.AbstractWComponent
addHtmlClass, addHtmlClass, addNotify, afterPaint, assertAddSupported, beforePaint, createErrorDiagnostic, createErrorDiagnostic, forward, getAccessibleText, getAttribute, getBaseUrl, getDefaultModel, getEnvironment, getHeaders, getHtmlClass, getHtmlClasses, getId, getIdName, getInternalId, getLabel, getName, getParent, getScratchMap, getTabIndex, getTag, getTemplate, getTemplateMarkUp, getToolTip, handleRequest, hasNoComponentModel, hasTabIndex, initialiseComponentModel, invokeLater, invokeLaters, isDebugStructure, isDefaultState, isFlagSet, isHidden, isInitialised, isLocked, isTracking, isTrackingEnabled, isValidate, isVisible, paint, paintComponent, preparePaint, preparePaintComponent, removeAttribute, removeComponentModel, removeHtmlClass, removeHtmlClass, removeNotify, replaceWComponent, reset, serviceRequest, setAccessibleText, setAttribute, setEnvironment, setFlag, setFocussed, setHidden, setHtmlClass, setHtmlClass, setIdName, setInitialised, setLocked, setTag, setToolTip, setTrackingEnabled, setValidate, setVisible, showErrorIndicators, showErrorIndicatorsForComponent, showWarningIndicators, showWarningIndicatorsForComponent, tidyUpUIContext, tidyUpUIContextForTree, validate, validateComponent, writeReplace
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.github.bordertech.wcomponents.WComponent
addHtmlClass, addHtmlClass, forward, getAccessibleText, getAttribute, getBaseUrl, getEnvironment, getHeaders, getHtmlClass, getHtmlClasses, getId, getIdName, getInternalId, getLabel, getName, getParent, getTabIndex, getTag, getToolTip, handleRequest, hasTabIndex, invokeLater, isDefaultState, isHidden, isInitialised, isLocked, isTracking, isTrackingEnabled, isValidate, isVisible, paint, preparePaint, removeAttribute, removeHtmlClass, removeHtmlClass, reset, serviceRequest, setAccessibleText, setAttribute, setEnvironment, setFocussed, setHtmlClass, setHtmlClass, setIdName, setInitialised, setLocked, setTag, setToolTip, setTrackingEnabled, setValidate, setVisible, showErrorIndicators, showWarningIndicators, tidyUpUIContextForTree, validate
-
-
-
-
Constructor Detail
-
WInternalLink
public WInternalLink()
Creates a WInternalLink with no text or component.
-
WInternalLink
public WInternalLink(String text, WComponent reference)
Creates a WInternalLink with the specified text and component to link to.- Parameters:
text
- the text to display on the link.reference
- the component to link to.
-
-
Method Detail
-
getReference
public WComponent getReference()
- Returns:
- the component to which this component is linked.
-
setReference
public void setReference(WComponent reference)
Sets the component to which this component is linked.- Parameters:
reference
- the component.
-
getText
public String getText()
- Returns:
- the text to be displayed for this link.
-
setText
public void setText(String text)
Sets the text to be displayed for this link.- Parameters:
text
- the text to be displayed.
-
toString
public String toString()
Description copied from class:AbstractWComponent
Creates a String representation of this component; usually for debugging purposes.- Overrides:
toString
in classAbstractWComponent
- Returns:
- a String representation of this component, for debugging purposes.
-
newComponentModel
protected WInternalLink.InternalLinkModel newComponentModel()
Creates a new InternalLinkModel.- Overrides:
newComponentModel
in classAbstractWComponent
- Returns:
- a new InternalLinkModel
-
getComponentModel
protected WInternalLink.InternalLinkModel getComponentModel()
Returns the effective component model for this component. Subclass may override this method to narrow the return type to their specific model type.- Overrides:
getComponentModel
in classAbstractWComponent
- Returns:
- the effective component model
-
getOrCreateComponentModel
protected WInternalLink.InternalLinkModel getOrCreateComponentModel()
Retrieves the model for this component so that it can be modified. If this method is called during request processing, and a session specific model does not yet exist, then a new model is created. Subclasses may override this method to narrow the return type to their specific model type.- Overrides:
getOrCreateComponentModel
in classAbstractWComponent
- Returns:
- the model for this component
-
-