com.vaadin.flow.component.html.

Class Anchor

    • Method Detail

      • removeHref

        public void removeHref()

        Removes href attribute.

        See Also:

        setHref(String)

      • setHref

        public void setHref(AbstractStreamResource href)

        Sets the URL that this anchor links to with the URL of the given StreamResource.

        Parameters:

        href - the resource value, not null

      • getHref

        public String getHref()

        Gets the URL that this anchor links to.

        Returns:

        the href value, or "" if no href has been set

        See Also:

        setHref(String)

      • setTarget

        public void setTarget(String target)

        Sets the target window, tab or frame for this anchor. The target is either the window.name of a specific target, or one of these special values:

        • _self: Open the link in the current context. This is the default behavior.
        • _blank: Opens the link in a new unnamed context.
        • _parent: Opens the link in the parent context, or the current context if there is no parent context.
        • _top: Opens the link in the top most grandparent context, or the current context if there is no parent context.

        Parameters:

        target - the target value, or "" to remove the target value

      • getTarget

        public Optional<String> getTarget()

        Gets the target window, tab or frame name for this anchor.

        Returns:

        an optional target, or an empty optional if no target has been set

        See Also:

        setTarget(String)