summaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/ui/Panel.java
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/com/vaadin/ui/Panel.java')
-rw-r--r--server/src/com/vaadin/ui/Panel.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/server/src/com/vaadin/ui/Panel.java b/server/src/com/vaadin/ui/Panel.java
index 9b1d8fd5fa..46ad801a6d 100644
--- a/server/src/com/vaadin/ui/Panel.java
+++ b/server/src/com/vaadin/ui/Panel.java
@@ -16,8 +16,11 @@
package com.vaadin.ui;
+import java.util.Collection;
import java.util.Map;
+import org.jsoup.nodes.Element;
+
import com.vaadin.event.Action;
import com.vaadin.event.Action.Handler;
import com.vaadin.event.ActionManager;
@@ -31,6 +34,8 @@ import com.vaadin.shared.MouseEventDetails;
import com.vaadin.shared.ui.panel.PanelServerRpc;
import com.vaadin.shared.ui.panel.PanelState;
import com.vaadin.ui.Component.Focusable;
+import com.vaadin.ui.declarative.DesignAttributeHandler;
+import com.vaadin.ui.declarative.DesignContext;
/**
* Panel - a simple single component container.
@@ -339,4 +344,32 @@ public class Panel extends AbstractSingleComponentContainer implements
return (PanelState) super.getState(markAsDirty);
}
+ @Override
+ public void synchronizeFromDesign(Element design,
+ DesignContext designContext) {
+ super.synchronizeFromDesign(design, designContext);
+ // handle tabindex
+ Panel def = designContext.getDefaultInstance(this.getClass());
+ int tabIndex = DesignAttributeHandler.readAttribute("tabindex",
+ design.attributes(), def.getTabIndex(), Integer.class);
+ setTabIndex(tabIndex);
+ }
+
+ @Override
+ protected Collection<String> getCustomAttributes() {
+ Collection<String> attributes = super.getCustomAttributes();
+ attributes.add("tabindex");
+ attributes.add("tab-index");
+ return attributes;
+ }
+
+ @Override
+ public void synchronizeToDesign(Element design, DesignContext designContext) {
+ super.synchronizeToDesign(design, designContext);
+ // handle tabindex
+ Panel def = designContext.getDefaultInstance(this.getClass());
+ DesignAttributeHandler.writeAttribute("tabindex", design.attributes(),
+ getTabIndex(), def.getTabIndex(), Integer.class);
+ }
+
}