diff options
author | Artur Signell <artur.signell@itmill.com> | 2010-12-07 09:43:43 +0000 |
---|---|---|
committer | Artur Signell <artur.signell@itmill.com> | 2010-12-07 09:43:43 +0000 |
commit | 32877d20c6d65960a9da204859fdbdae3e35d0a0 (patch) | |
tree | 674dfc9e56068f05f74ecf5e9f2b354e87e3cad5 | |
parent | 4894a553d5fe306df05a88300b907d8f834e4bd3 (diff) | |
download | vaadin-framework-32877d20c6d65960a9da204859fdbdae3e35d0a0.tar.gz vaadin-framework-32877d20c6d65960a9da204859fdbdae3e35d0a0.zip |
#6107 - VTwinColSelect should provide information about logical parts to TestBench
svn changeset:16339/svn branch:6.5
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VTwinColSelect.java | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTwinColSelect.java b/src/com/vaadin/terminal/gwt/client/ui/VTwinColSelect.java index 9369c034b7..9771e8b9fa 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTwinColSelect.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTwinColSelect.java @@ -19,6 +19,7 @@ import com.google.gwt.event.dom.client.MouseDownEvent; import com.google.gwt.event.dom.client.MouseDownHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.ListBox;
@@ -28,7 +29,7 @@ import com.vaadin.terminal.gwt.client.UIDL; import com.vaadin.terminal.gwt.client.Util;
public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler,
- MouseDownHandler, DoubleClickHandler {
+ MouseDownHandler, DoubleClickHandler, SubPartAware {
private static final String CLASSNAME = "v-select-twincol";
public static final String ATTRIBUTE_LEFT_CAPTION = "lc";
@@ -586,4 +587,51 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler, }
}
+
+ private static final String SUBPART_OPTION_SELECT = "leftSelect";
+ private static final String SUBPART_SELECTION_SELECT = "rightSelect";
+ private static final String SUBPART_LEFT_CAPTION = "leftCaption";
+ private static final String SUBPART_RIGHT_CAPTION = "rightCaption";
+ private static final String SUBPART_ADD_BUTTON = "add";
+ private static final String SUBPART_REMOVE_BUTTON = "remove";
+
+ public Element getSubPartElement(String subPart) {
+ if (SUBPART_OPTION_SELECT.equals(subPart)) {
+ return options.getElement();
+ } else if (SUBPART_SELECTION_SELECT.equals(subPart)) {
+ return selections.getElement();
+ } else if (optionsCaption != null
+ && SUBPART_LEFT_CAPTION.equals(subPart)) {
+ return optionsCaption.getElement();
+ } else if (selectionsCaption != null
+ && SUBPART_RIGHT_CAPTION.equals(subPart)) {
+ return selectionsCaption.getElement();
+ } else if (SUBPART_ADD_BUTTON.equals(subPart)) {
+ return add.getElement();
+ } else if (SUBPART_REMOVE_BUTTON.equals(subPart)) {
+ return remove.getElement();
+ }
+
+ return null;
+ }
+
+ public String getSubPartName(Element subElement) {
+ if (optionsCaption != null
+ && optionsCaption.getElement().isOrHasChild(subElement)) {
+ return SUBPART_LEFT_CAPTION;
+ } else if (selectionsCaption != null
+ && selectionsCaption.getElement().isOrHasChild(subElement)) {
+ return SUBPART_RIGHT_CAPTION;
+ } else if (options.getElement().isOrHasChild(subElement)) {
+ return SUBPART_OPTION_SELECT;
+ } else if (selections.getElement().isOrHasChild(subElement)) {
+ return SUBPART_SELECTION_SELECT;
+ } else if (add.getElement().isOrHasChild(subElement)) {
+ return SUBPART_ADD_BUTTON;
+ } else if (remove.getElement().isOrHasChild(subElement)) {
+ return SUBPART_REMOVE_BUTTON;
+ }
+
+ return null;
+ }
}
|