aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/ui/Link.java
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2012-08-30 11:30:39 +0300
committerLeif Åstrand <leif@vaadin.com>2012-08-30 12:47:35 +0300
commitfd3826abf42f69db546eff18d269e462843feb49 (patch)
tree2852b77e657e90061842bc2d99dad09b36cd4150 /server/src/com/vaadin/ui/Link.java
parente71794ee177e309a4cba15ebd6b65d5950721dd7 (diff)
downloadvaadin-framework-fd3826abf42f69db546eff18d269e462843feb49.tar.gz
vaadin-framework-fd3826abf42f69db546eff18d269e462843feb49.zip
Replace ApplicationResource with ConnectorResource (#9419)
Diffstat (limited to 'server/src/com/vaadin/ui/Link.java')
-rw-r--r--server/src/com/vaadin/ui/Link.java19
1 files changed, 7 insertions, 12 deletions
diff --git a/server/src/com/vaadin/ui/Link.java b/server/src/com/vaadin/ui/Link.java
index e98b558dbe..a2737e4483 100644
--- a/server/src/com/vaadin/ui/Link.java
+++ b/server/src/com/vaadin/ui/Link.java
@@ -18,11 +18,12 @@ package com.vaadin.ui;
import java.util.Map;
+import com.vaadin.server.LegacyComponent;
import com.vaadin.server.PaintException;
import com.vaadin.server.PaintTarget;
import com.vaadin.server.Resource;
-import com.vaadin.server.LegacyComponent;
import com.vaadin.shared.ui.BorderStyle;
+import com.vaadin.shared.ui.link.LinkConstants;
/**
* Link is used to create external or internal URL links.
@@ -45,8 +46,6 @@ public class Link extends AbstractComponent implements LegacyComponent {
@Deprecated
public static final BorderStyle TARGET_BORDER_DEFAULT = BorderStyle.DEFAULT;
- private Resource resource = null;
-
private String targetName;
private BorderStyle targetBorder = BorderStyle.DEFAULT;
@@ -70,7 +69,7 @@ public class Link extends AbstractComponent implements LegacyComponent {
*/
public Link(String caption, Resource resource) {
setCaption(caption);
- this.resource = resource;
+ setResource(resource);
}
/**
@@ -94,7 +93,7 @@ public class Link extends AbstractComponent implements LegacyComponent {
public Link(String caption, Resource resource, String targetName,
int width, int height, BorderStyle border) {
setCaption(caption);
- this.resource = resource;
+ setResource(resource);
setTargetName(targetName);
setTargetWidth(width);
setTargetHeight(height);
@@ -111,10 +110,7 @@ public class Link extends AbstractComponent implements LegacyComponent {
*/
@Override
public void paintContent(PaintTarget target) throws PaintException {
-
- if (resource != null) {
- target.addAttribute("src", resource);
- } else {
+ if (getResource() == null) {
return;
}
@@ -230,7 +226,7 @@ public class Link extends AbstractComponent implements LegacyComponent {
* @return the Resource.
*/
public Resource getResource() {
- return resource;
+ return getResource(LinkConstants.HREF_RESOURCE);
}
/**
@@ -240,8 +236,7 @@ public class Link extends AbstractComponent implements LegacyComponent {
* the resource to set.
*/
public void setResource(Resource resource) {
- this.resource = resource;
- markAsDirty();
+ setResource(LinkConstants.HREF_RESOURCE, resource);
}
@Override