com.vaadin.ui
Class Link

java.lang.Object
  extended by com.vaadin.server.AbstractClientConnector
      extended by com.vaadin.ui.AbstractComponent
          extended by com.vaadin.ui.Link
All Implemented Interfaces:
ConnectorEventListener, MethodEventSource, ClientConnector, Sizeable, VariableOwner, com.vaadin.shared.Connector, Component, LegacyComponent, java.io.Serializable, java.util.EventListener

public class Link
extends AbstractComponent
implements LegacyComponent

Link is used to create external or internal URL links.

Since:
3.0
Author:
Vaadin Ltd.
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.vaadin.ui.Component
Component.ErrorEvent, Component.Event, Component.Focusable, Component.Listener
 
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
 
Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable
Sizeable.Unit
 
Field Summary
static com.vaadin.shared.ui.BorderStyle TARGET_BORDER_DEFAULT
          Deprecated. As of 7.0, use BorderStyle.DEFAULT instead
static com.vaadin.shared.ui.BorderStyle TARGET_BORDER_MINIMAL
          Deprecated. As of 7.0, use BorderStyle.MINIMAL instead
static com.vaadin.shared.ui.BorderStyle TARGET_BORDER_NONE
          Deprecated. As of 7.0, use BorderStyle.NONE instead
 
Fields inherited from interface com.vaadin.server.Sizeable
SIZE_UNDEFINED, 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(java.lang.String caption, Resource resource)
          Creates a new instance of Link.
Link(java.lang.String caption, Resource resource, java.lang.String targetName, int width, int height, com.vaadin.shared.ui.BorderStyle border)
          Creates a new instance of Link that opens a new window.
 
Method Summary
 void changeVariables(java.lang.Object source, java.util.Map<java.lang.String,java.lang.Object> variables)
          Called when one or more variables handled by the implementing class are changed.
 Resource getResource()
          Returns the resource this link opens.
 com.vaadin.shared.ui.BorderStyle getTargetBorder()
          Returns the target window border.
 int getTargetHeight()
          Returns the target window height or -1 if not set.
 java.lang.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(com.vaadin.shared.ui.BorderStyle targetBorder)
          Sets the border of the target window.
 void setTargetHeight(int targetHeight)
          Sets the target window height.
 void setTargetName(java.lang.String targetName)
          Sets the target window name.
 void setTargetWidth(int targetWidth)
          Sets the target window width.
 
Methods inherited from class com.vaadin.ui.AbstractComponent
addListener, addShortcutListener, addStyleName, attach, beforeClientResponse, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, focus, getActionManager, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getState, getState, getStyleName, getWidth, getWidthUnits, isConnectorEnabled, isEnabled, isImmediate, isReadOnly, isVisible, removeListener, removeShortcutListener, removeStyleName, setCaption, setComponentError, setData, setDebugId, setDescription, setEnabled, setHeight, setHeight, setIcon, setId, setImmediate, setLocale, setParent, setPrimaryStyleName, setReadOnly, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidth
 
Methods inherited from class com.vaadin.server.AbstractClientConnector
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hasListeners, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.vaadin.ui.LegacyComponent
markAsDirty
 
Methods inherited from interface com.vaadin.server.VariableOwner
isEnabled, isImmediate
 
Methods inherited from interface com.vaadin.ui.Component
addListener, addStyleName, attach, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setEnabled, setIcon, setId, setPrimaryStyleName, setReadOnly, setStyleName, setVisible
 
Methods inherited from interface com.vaadin.server.ClientConnector
addAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isConnectorEnabled, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setParent
 
Methods inherited from interface com.vaadin.shared.Connector
getConnectorId
 
Methods inherited from interface com.vaadin.server.Sizeable
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setSizeFull, setSizeUndefined, setWidth, setWidth
 

Field Detail

TARGET_BORDER_NONE

@Deprecated
public static final com.vaadin.shared.ui.BorderStyle TARGET_BORDER_NONE
Deprecated. As of 7.0, use BorderStyle.NONE instead

TARGET_BORDER_MINIMAL

@Deprecated
public static final com.vaadin.shared.ui.BorderStyle TARGET_BORDER_MINIMAL
Deprecated. As of 7.0, use BorderStyle.MINIMAL instead

TARGET_BORDER_DEFAULT

@Deprecated
public static final com.vaadin.shared.ui.BorderStyle TARGET_BORDER_DEFAULT
Deprecated. As of 7.0, use BorderStyle.DEFAULT instead
Constructor Detail

Link

public Link()
Creates a new link.


Link

public Link(java.lang.String caption,
            Resource resource)
Creates a new instance of Link.

Parameters:
caption -
resource -

Link

public Link(java.lang.String caption,
            Resource resource,
            java.lang.String targetName,
            int width,
            int height,
            com.vaadin.shared.ui.BorderStyle border)
Creates a new instance of Link that opens a new window.

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.
Method Detail

paintContent

public void paintContent(PaintTarget target)
                  throws PaintException
Paints the content of this component.

Specified by:
paintContent in interface LegacyComponent
Parameters:
target - the Paint Event.
Throws:
PaintException - if the paint operation failed.

getTargetBorder

public com.vaadin.shared.ui.BorderStyle getTargetBorder()
Returns the target window border.

Returns:
the target window border.

getTargetHeight

public int getTargetHeight()
Returns the target window height or -1 if not set.

Returns:
the target window height.

getTargetName

public java.lang.String getTargetName()
Returns the target window name. Empty name of null implies that the target is opened to the window containing the link.

Returns:
the target window name.

getTargetWidth

public int getTargetWidth()
Returns the target window width or -1 if not set.

Returns:
the target window width.

setTargetBorder

public void setTargetBorder(com.vaadin.shared.ui.BorderStyle targetBorder)
Sets the border of the target window.

Parameters:
targetBorder - the targetBorder to set.

setTargetHeight

public void setTargetHeight(int targetHeight)
Sets the target window height.

Parameters:
targetHeight - the targetHeight to set.

setTargetName

public void setTargetName(java.lang.String targetName)
Sets the target window name.

Parameters:
targetName - the targetName to set.

setTargetWidth

public void setTargetWidth(int targetWidth)
Sets the target window width.

Parameters:
targetWidth - the targetWidth to set.

getResource

public Resource getResource()
Returns the resource this link opens.

Returns:
the Resource.

setResource

public void setResource(Resource resource)
Sets the resource this link opens.

Parameters:
resource - the resource to set.

changeVariables

public void changeVariables(java.lang.Object source,
                            java.util.Map<java.lang.String,java.lang.Object> variables)
Description copied from interface: VariableOwner
Called when one or more variables handled by the implementing class are changed.

Specified by:
changeVariables in interface VariableOwner
Parameters:
source - the Source of the variable change. This is the origin of the event. For example in Web Adapter this is the request.
variables - the Mapping from variable names to new variable values.


Copyright © 2000-2011 Vaadin Ltd. All Rights Reserved.