Class 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
    • 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 class AbstractWComponent
        Returns:
        a String representation of this component, for debugging purposes.
      • 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 class AbstractWComponent
        Returns:
        the model for this component