com.vaadin.ui.
Class Link
java.lang.Object
com.vaadin.ui.AbstractComponent
com.vaadin.ui.Link
All Implemented Interfaces:
MethodEventSource, Paintable, Sizeable, VariableOwner, Component, Serializable, EventListener
- extends AbstractComponent
public class Link
Link is used to create external or internal URL links.
Since:
3.0
Version:
6.8.18
Author:
Vaadin Ltd.
See Also:
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.vaadin.ui.AbstractComponent |
---|
AbstractComponent.ComponentErrorEvent, AbstractComponent.ComponentErrorHandler |
Nested classes/interfaces inherited from interface com.vaadin.ui.Component |
---|
Component.ErrorEvent, Component.ErrorListener, Component.Event, Component.Focusable, Component.Listener |
Nested classes/interfaces inherited from interface com.vaadin.terminal.Paintable |
---|
Paintable.RepaintRequestEvent, Paintable.RepaintRequestListener |
Field Summary | |
---|---|
static int |
TARGET_BORDER_DEFAULT
|
static int |
TARGET_BORDER_MINIMAL
|
static int |
TARGET_BORDER_NONE
|
Fields inherited from interface com.vaadin.terminal.Sizeable |
---|
SIZE_UNDEFINED, UNIT_SYMBOLS, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS |
Constructor Summary | |
---|---|
Link()
Creates a new link. |
|
Link(String caption,
Resource resource)
Creates a new instance of Link. |
|
Link(String caption,
Resource resource,
String targetName,
int width,
int height,
int border)
Creates a new instance of Link that opens a new window. |
Method Summary | |
---|---|
Resource |
getResource()
Returns the resource this link opens. |
int |
getTargetBorder()
Returns the target window border. |
int |
getTargetHeight()
Returns the target window height or -1 if not set. |
String |
getTargetName()
Returns the target window name. |
int |
getTargetWidth()
Returns the target window width or -1 if not set. |
void |
paintContent(PaintTarget target)
Paints the content of this component. |
void |
setResource(Resource resource)
Sets the resource this link opens. |
void |
setTargetBorder(int targetBorder)
Sets the border of the target window. |
void |
setTargetHeight(int targetHeight)
Sets the target window height. |
void |
setTargetName(String targetName)
Sets the target window name. |
void |
setTargetWidth(int targetWidth)
Sets the target window width. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
TARGET_BORDER_NONE
public static final int TARGET_BORDER_NONE
See Also:
TARGET_BORDER_MINIMAL
public static final int TARGET_BORDER_MINIMAL
See Also:
TARGET_BORDER_DEFAULT
public static final int TARGET_BORDER_DEFAULT
See Also:
Constructor Detail |
---|
Link
public Link()
Creates a new link.
Link
public Link(String caption,
Resource resource)
- Parameters:
caption
-resource
-
Creates a new instance of Link.
Link
public Link(String caption,
Resource resource,
String targetName,
int width,
int height,
int border)
- Parameters:
caption
- the Link text.targetName
- the name of the target window where the link opens to. Empty name of null implies that the target is opened to the window containing the link.width
- the Width of the target window.height
- the Height of the target window.border
- the Border style of the target window.
Creates a new instance of Link that opens a new window.
Method Detail |
---|
paintContent
public void paintContent(PaintTarget target)
throws PaintException
- Overrides:
paintContent
in classAbstractComponent
- Parameters:
target
- the Paint Event.- Throws:
PaintException
- if the paint operation failed.
Paints the content of this component.
getTargetBorder
public int getTargetBorder()
- Returns:
- the target window border.
Returns the target window border.
getTargetHeight
public int getTargetHeight()
- Returns:
- the target window height.
Returns the target window height or -1 if not set.
getTargetName
public String getTargetName()
- Returns:
- the target window name.
Returns the target window name. Empty name of null implies that the target is opened to the window containing the link.
getTargetWidth
public int getTargetWidth()
- Returns:
- the target window width.
Returns the target window width or -1 if not set.
setTargetBorder
public void setTargetBorder(int targetBorder)
- Parameters:
targetBorder
- the targetBorder to set.
Sets the border of the target window.
setTargetHeight
public void setTargetHeight(int targetHeight)
- Parameters:
targetHeight
- the targetHeight to set.
Sets the target window height.
setTargetName
public void setTargetName(String targetName)
- Parameters:
targetName
- the targetName to set.
Sets the target window name.
setTargetWidth
public void setTargetWidth(int targetWidth)
- Parameters:
targetWidth
- the targetWidth to set.
Sets the target window width.
getResource
public Resource getResource()
- Returns:
- the Resource.
Returns the resource this link opens.
setResource
public void setResource(Resource resource)
- Parameters:
resource
- the resource to set.
Sets the resource this link opens.