diff options
author | Artur Signell <artur@vaadin.com> | 2012-03-23 09:52:33 +0200 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2012-03-23 09:52:33 +0200 |
commit | b052e30bb6aad20a4a7f840ff4fa646c2967e290 (patch) | |
tree | f11e9108119ec519810cf27c112fd855a5095148 /src/com/vaadin/ui/Embedded.java | |
parent | dd06b3cb695567379b381e4be28fb609d0c70074 (diff) | |
parent | 2296d93d648857c248162a1261a15e7a8c7ca378 (diff) | |
download | vaadin-framework-b052e30bb6aad20a4a7f840ff4fa646c2967e290.tar.gz vaadin-framework-b052e30bb6aad20a4a7f840ff4fa646c2967e290.zip |
Merge remote-tracking branch 'origin/6.8'
Conflicts:
src/com/vaadin/terminal/gwt/client/ui/VEmbedded.java
tests/testbench/com/vaadin/tests/components/embedded/EmbeddedPdf.java
Diffstat (limited to 'src/com/vaadin/ui/Embedded.java')
-rw-r--r-- | src/com/vaadin/ui/Embedded.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/com/vaadin/ui/Embedded.java b/src/com/vaadin/ui/Embedded.java index bc4c2a3ff4..906f1ca1ed 100644 --- a/src/com/vaadin/ui/Embedded.java +++ b/src/com/vaadin/ui/Embedded.java @@ -78,6 +78,8 @@ public class Embedded extends AbstractComponent { private String archive = null; + private String altText; + /** * Creates a new empty Embedded object. */ @@ -146,6 +148,9 @@ public class Embedded extends AbstractComponent { if (archive != null && !"".equals(archive)) { target.addAttribute("archive", archive); } + if (altText != null && !"".equals(altText)) { + target.addAttribute(EmbeddedConnector.ALTERNATE_TEXT, altText); + } // Params for (final Iterator<String> i = getParameterNames(); i.hasNext();) { @@ -158,6 +163,34 @@ public class Embedded extends AbstractComponent { } /** + * Sets this component's "alt-text", that is, an alternate text that can be + * presented instead of this component's normal content, for accessibility + * purposes. Does not work when {@link #setType(int)} has been called with + * {@link #TYPE_BROWSER}. + * + * @param altText + * A short, human-readable description of this component's + * content. + * @since 6.8 + */ + public void setAlternateText(String altText) { + if (altText != this.altText + || (altText != null && !altText.equals(this.altText))) { + this.altText = altText; + requestRepaint(); + } + } + + /** + * Gets this component's "alt-text". + * + * @see #setAlternateText(String) + */ + public String getAlternateText() { + return altText; + } + + /** * Sets an object parameter. Parameters are optional information, and they * are passed to the instantiated object. Parameters are are stored as name * value pairs. This overrides the previous value assigned to this |