diff options
Diffstat (limited to 'server/src/com/vaadin/ui/Window.java')
-rw-r--r-- | server/src/com/vaadin/ui/Window.java | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/server/src/com/vaadin/ui/Window.java b/server/src/com/vaadin/ui/Window.java index 022adc6373..11a6fde853 100644 --- a/server/src/com/vaadin/ui/Window.java +++ b/server/src/com/vaadin/ui/Window.java @@ -18,9 +18,6 @@ package com.vaadin.ui; import java.io.Serializable; import java.lang.reflect.Method; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; import java.util.Map; import com.vaadin.event.FieldEvents.BlurEvent; @@ -1017,15 +1014,15 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * window. Text contained in these components will be read by assistive * devices when it is opened. * - * @param connectors - * with the components to use as description + * @param components + * the components to use as description */ - public void setAssistiveDescription(Connector... connectors) { - if (connectors == null) { + public void setAssistiveDescription(Component... components) { + if (components == null) { throw new IllegalArgumentException( "Parameter connectors must be non-null"); } else { - getState().contentDescription = connectors; + getState().contentDescription = components; } } @@ -1034,11 +1031,19 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * contained in these components will be read by assistive devices when the * window is opened. * - * @return list of previously set components + * @return array of previously set components */ - public List<Connector> getAssistiveDescription() { - return Collections.unmodifiableList(Arrays - .asList(getState().contentDescription)); + public Component[] getAssistiveDescription() { + Connector[] contentDescription = getState().contentDescription; + if (contentDescription == null) { + return null; + } + + Component[] target = new Component[contentDescription.length]; + System.arraycopy(contentDescription, 0, target, 0, + contentDescription.length); + + return target; } /** |