aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--client/src/com/vaadin/client/ui/accordion/VAccordion.java12
-rw-r--r--client/src/com/vaadin/client/ui/popupview/PopupViewConnector.java122
-rw-r--r--client/src/com/vaadin/client/ui/popupview/VPopupView.java42
-rw-r--r--client/src/com/vaadin/client/ui/popupview/VisibilityChangeEvent.java36
-rw-r--r--client/src/com/vaadin/client/ui/popupview/VisibilityChangeHandler.java8
-rw-r--r--client/src/com/vaadin/client/ui/table/VScrollTable.java2
-rw-r--r--server/ivy.xml2
-rw-r--r--server/src/com/vaadin/ui/PopupView.java76
-rw-r--r--server/tests/src/com/vaadin/tests/VaadinClasses.java4
-rw-r--r--shared/src/com/vaadin/shared/ui/popupview/PopupViewServerRpc.java10
-rw-r--r--shared/src/com/vaadin/shared/ui/popupview/PopupViewState.java10
-rw-r--r--theme-compiler/src/com/vaadin/sass/resolver/ClassloaderResolver.java4
-rw-r--r--theme-compiler/src/com/vaadin/sass/visitor/ParentSelectorHandler.java2
-rw-r--r--uitest/src/com/vaadin/tests/components/combobox/ComboBoxInPopupView.java15
-rw-r--r--uitest/src/com/vaadin/tests/components/table/RowFocusAppliedAndRemovedOnSelection.html52
15 files changed, 246 insertions, 151 deletions
diff --git a/client/src/com/vaadin/client/ui/accordion/VAccordion.java b/client/src/com/vaadin/client/ui/accordion/VAccordion.java
index ce973f9630..70398c238f 100644
--- a/client/src/com/vaadin/client/ui/accordion/VAccordion.java
+++ b/client/src/com/vaadin/client/ui/accordion/VAccordion.java
@@ -131,7 +131,7 @@ public class VAccordion extends VTabsheetBase {
Widget itemWidget = item.getComponent();
if (tabContent != null) {
- if (tabContent != itemWidget) {
+ if (tabContent.getWidget() != itemWidget) {
/*
* This is not the same widget as before, find out if it has
* been moved
@@ -542,8 +542,14 @@ public class VAccordion extends VTabsheetBase {
@Override
protected ComponentConnector getTab(int index) {
if (index < getWidgetCount()) {
- Widget w = getStackItem(index);
- return ConnectorMap.get(client).getConnector(w);
+ StackItem stackItem = getStackItem(index);
+ if (stackItem == null) {
+ return null;
+ }
+ Widget w = stackItem.getChildWidget();
+ if (w != null) {
+ return ConnectorMap.get(client).getConnector(w);
+ }
}
return null;
diff --git a/client/src/com/vaadin/client/ui/popupview/PopupViewConnector.java b/client/src/com/vaadin/client/ui/popupview/PopupViewConnector.java
index eba09b6a19..ca06b28bdd 100644
--- a/client/src/com/vaadin/client/ui/popupview/PopupViewConnector.java
+++ b/client/src/com/vaadin/client/ui/popupview/PopupViewConnector.java
@@ -15,86 +15,56 @@
*/
package com.vaadin.client.ui.popupview;
-import com.vaadin.client.ApplicationConnection;
+import java.util.ArrayList;
+import java.util.List;
+
+import com.google.gwt.event.shared.HandlerRegistration;
import com.vaadin.client.ComponentConnector;
import com.vaadin.client.ConnectorHierarchyChangeEvent;
-import com.vaadin.client.Paintable;
-import com.vaadin.client.UIDL;
import com.vaadin.client.VCaption;
import com.vaadin.client.VCaptionWrapper;
+import com.vaadin.client.communication.StateChangeEvent;
import com.vaadin.client.ui.AbstractComponentContainerConnector;
import com.vaadin.client.ui.PostLayoutListener;
import com.vaadin.shared.ui.ComponentStateUtil;
import com.vaadin.shared.ui.Connect;
+import com.vaadin.shared.ui.popupview.PopupViewServerRpc;
+import com.vaadin.shared.ui.popupview.PopupViewState;
import com.vaadin.ui.PopupView;
@Connect(PopupView.class)
public class PopupViewConnector extends AbstractComponentContainerConnector
- implements Paintable, PostLayoutListener {
+ implements PostLayoutListener, VisibilityChangeHandler {
private boolean centerAfterLayout = false;
+ private final List<HandlerRegistration> handlerRegistration = new ArrayList<HandlerRegistration>();
+
+ @Override
+ protected void init() {
+ super.init();
+
+ handlerRegistration.add(getWidget().addVisibilityChangeHandler(
+ this));
+ }
+
@Override
public boolean delegateCaptionHandling() {
return false;
}
- /**
- *
- *
- * @see com.vaadin.client.ComponentConnector#updateFromUIDL(com.vaadin.client.UIDL,
- * com.vaadin.client.ApplicationConnection)
- */
@Override
- public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
- if (!isRealUpdate(uidl)) {
- return;
- }
- // These are for future server connections
- getWidget().client = client;
- getWidget().uidlId = uidl.getId();
-
- getWidget().hostPopupVisible = uidl
- .getBooleanVariable("popupVisibility");
+ public void onStateChanged(StateChangeEvent stateChangeEvent) {
+ super.onStateChanged(stateChangeEvent);
- getWidget().setHTML(uidl.getStringAttribute("html"));
-
- if (uidl.hasAttribute("hideOnMouseOut")) {
- getWidget().popup.setHideOnMouseOut(uidl
- .getBooleanAttribute("hideOnMouseOut"));
- }
-
- // Render the popup if visible and show it.
- if (getWidget().hostPopupVisible) {
- UIDL popupUIDL = uidl.getChildUIDL(0);
-
- // showPopupOnTop(popup, hostReference);
- getWidget().preparePopup(getWidget().popup);
- getWidget().popup.updateFromUIDL(popupUIDL, client);
- if (ComponentStateUtil.hasStyles(getState())) {
- final StringBuffer styleBuf = new StringBuffer();
- final String primaryName = getWidget().popup
- .getStylePrimaryName();
- styleBuf.append(primaryName);
- for (String style : getState().styles) {
- styleBuf.append(" ");
- styleBuf.append(primaryName);
- styleBuf.append("-");
- styleBuf.append(style);
- }
- getWidget().popup.setStyleName(styleBuf.toString());
- } else {
- getWidget().popup.setStyleName(getWidget().popup
- .getStylePrimaryName());
- }
- getWidget().showPopup(getWidget().popup);
- centerAfterLayout = true;
+ getWidget().setHTML(getState().html);
+ getWidget().popup.setHideOnMouseOut(getState().hideOnMouseOut);
+ }
- // The popup shouldn't be visible, try to hide it.
- } else {
- getWidget().popup.hide();
- }
- }// updateFromUIDL
+ @Override
+ public PopupViewState getState() {
+ return (PopupViewState) super.getState();
+ }
@Override
public void updateCaption(ComponentConnector component) {
@@ -131,7 +101,41 @@ public class PopupViewConnector extends AbstractComponentContainerConnector
@Override
public void onConnectorHierarchyChange(
ConnectorHierarchyChangeEvent connectorHierarchyChangeEvent) {
- // TODO Move code from updateFromUIDL to this method
+ // Render the popup if visible and show it.
+ if (!getChildren().isEmpty()) {
+ getWidget().preparePopup(getWidget().popup);
+ getWidget().popup
+ .setPopupConnector((ComponentConnector) getChildren()
+ .get(0));
+ if (ComponentStateUtil.hasStyles(getState())) {
+ final StringBuffer styleBuf = new StringBuffer();
+ final String primaryName = getWidget().popup
+ .getStylePrimaryName();
+ styleBuf.append(primaryName);
+ for (String style : getState().styles) {
+ styleBuf.append(" ");
+ styleBuf.append(primaryName);
+ styleBuf.append("-");
+ styleBuf.append(style);
+ }
+ getWidget().popup.setStyleName(styleBuf.toString());
+ } else {
+ getWidget().popup.setStyleName(getWidget().popup
+ .getStylePrimaryName());
+ }
+ getWidget().showPopup(getWidget().popup);
+ centerAfterLayout = true;
+
+ // The popup shouldn't be visible, try to hide it.
+ } else {
+ getWidget().popup.hide();
+ }
+ }
+
+ @Override
+ public void onVisibilityChange(VisibilityChangeEvent event) {
+ getRpcProxy(PopupViewServerRpc.class).setPopupVisibility(
+ event.isVisible());
}
-}
+} \ No newline at end of file
diff --git a/client/src/com/vaadin/client/ui/popupview/VPopupView.java b/client/src/com/vaadin/client/ui/popupview/VPopupView.java
index 88ee3afada..e8bc19038d 100644
--- a/client/src/com/vaadin/client/ui/popupview/VPopupView.java
+++ b/client/src/com/vaadin/client/ui/popupview/VPopupView.java
@@ -26,6 +26,7 @@ import com.google.gwt.event.dom.client.KeyDownEvent;
import com.google.gwt.event.dom.client.KeyDownHandler;
import com.google.gwt.event.logical.shared.CloseEvent;
import com.google.gwt.event.logical.shared.CloseHandler;
+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.Event;
@@ -36,9 +37,7 @@ import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Widget;
-import com.vaadin.client.ApplicationConnection;
import com.vaadin.client.ComponentConnector;
-import com.vaadin.client.UIDL;
import com.vaadin.client.VCaptionWrapper;
import com.vaadin.client.VConsole;
import com.vaadin.client.ui.ShortcutActionHandler;
@@ -50,10 +49,6 @@ public class VPopupView extends HTML {
public static final String CLASSNAME = "v-popupview";
- /** For server-client communication */
- String uidlId;
- ApplicationConnection client;
-
/** This variable helps to communicate popup visibility to the server */
boolean hostPopupVisible;
@@ -78,7 +73,7 @@ public class VPopupView extends HTML {
addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
- updateState(true);
+ fireEvent(new VisibilityChangeEvent(true));
}
});
@@ -86,25 +81,13 @@ public class VPopupView extends HTML {
popup.addCloseHandler(new CloseHandler<PopupPanel>() {
@Override
public void onClose(CloseEvent<PopupPanel> event) {
- updateState(false);
+ fireEvent(new VisibilityChangeEvent(false));
}
});
popup.setAnimationEnabled(true);
}
- /**
- * Update popup visibility to server
- *
- * @param visibility
- */
- private void updateState(boolean visible) {
- // If we know the server connection
- // then update the current situation
- if (uidlId != null && client != null && isAttached()) {
- client.updateVariable(uidlId, "popupVisibility", visible, true);
- }
- }
void preparePopup(final CustomPopup popup) {
popup.setVisible(false);
@@ -191,7 +174,7 @@ public class VPopupView extends HTML {
*/
protected class CustomPopup extends VOverlay {
- private ComponentConnector popupComponentPaintable = null;
+ private ComponentConnector popupComponentConnector = null;
Widget popupComponentWidget = null;
VCaptionWrapper captionWrapper = null;
@@ -327,23 +310,20 @@ public class VPopupView extends HTML {
@Override
public boolean remove(Widget w) {
- popupComponentPaintable = null;
+ popupComponentConnector = null;
popupComponentWidget = null;
captionWrapper = null;
return super.remove(w);
}
- public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
-
- ComponentConnector newPopupComponent = client.getPaintable(uidl
- .getChildUIDL(0));
+ public void setPopupConnector(ComponentConnector newPopupComponent) {
- if (newPopupComponent != popupComponentPaintable) {
+ if (newPopupComponent != popupComponentConnector) {
Widget newWidget = newPopupComponent.getWidget();
setWidget(newWidget);
popupComponentWidget = newWidget;
- popupComponentPaintable = newPopupComponent;
+ popupComponentConnector = newPopupComponent;
}
}
@@ -384,4 +364,10 @@ public class VPopupView extends HTML {
}// class CustomPopup
+ public HandlerRegistration addVisibilityChangeHandler(
+ final VisibilityChangeHandler visibilityChangeHandler) {
+ return addHandler(visibilityChangeHandler,
+ VisibilityChangeEvent.getType());
+ }
+
}// class VPopupView
diff --git a/client/src/com/vaadin/client/ui/popupview/VisibilityChangeEvent.java b/client/src/com/vaadin/client/ui/popupview/VisibilityChangeEvent.java
new file mode 100644
index 0000000000..e2cec40a8f
--- /dev/null
+++ b/client/src/com/vaadin/client/ui/popupview/VisibilityChangeEvent.java
@@ -0,0 +1,36 @@
+package com.vaadin.client.ui.popupview;
+
+import com.google.gwt.event.shared.GwtEvent;
+
+public class VisibilityChangeEvent extends
+ GwtEvent<VisibilityChangeHandler> {
+
+ private static Type<VisibilityChangeHandler> TYPE;
+
+ private boolean visible;
+
+ public VisibilityChangeEvent(final boolean visible) {
+ this.visible = visible;
+ }
+
+ public boolean isVisible() {
+ return visible;
+ }
+
+ @Override
+ public Type<VisibilityChangeHandler> getAssociatedType() {
+ return getType();
+ }
+
+ public static Type<VisibilityChangeHandler> getType() {
+ if (TYPE == null) {
+ TYPE = new Type<VisibilityChangeHandler>();
+ }
+ return TYPE;
+ }
+
+ @Override
+ protected void dispatch(final VisibilityChangeHandler handler) {
+ handler.onVisibilityChange(this);
+ }
+}
diff --git a/client/src/com/vaadin/client/ui/popupview/VisibilityChangeHandler.java b/client/src/com/vaadin/client/ui/popupview/VisibilityChangeHandler.java
new file mode 100644
index 0000000000..3f8d715264
--- /dev/null
+++ b/client/src/com/vaadin/client/ui/popupview/VisibilityChangeHandler.java
@@ -0,0 +1,8 @@
+package com.vaadin.client.ui.popupview;
+
+import com.google.gwt.event.shared.EventHandler;
+
+public interface VisibilityChangeHandler extends EventHandler {
+
+ void onVisibilityChange(VisibilityChangeEvent event);
+}
diff --git a/client/src/com/vaadin/client/ui/table/VScrollTable.java b/client/src/com/vaadin/client/ui/table/VScrollTable.java
index df44f58740..066c60a2ce 100644
--- a/client/src/com/vaadin/client/ui/table/VScrollTable.java
+++ b/client/src/com/vaadin/client/ui/table/VScrollTable.java
@@ -6503,7 +6503,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
// Remove previous selection
if (focusedRow != null && focusedRow != row) {
- focusedRow.removeStyleName(getStylePrimaryName());
+ focusedRow.removeStyleName(getStylePrimaryName() + "-focus");
}
if (row != null) {
diff --git a/server/ivy.xml b/server/ivy.xml
index 5ef49db80a..6911a7054f 100644
--- a/server/ivy.xml
+++ b/server/ivy.xml
@@ -62,7 +62,7 @@
<dependency org="commons-io" name="commons-io" rev="1.4"
conf="tests->default" />
<dependency org="commons-lang" name="commons-lang"
- rev="2.3" conf="tests,ide->default" />
+ rev="2.6" conf="tests,ide->default" />
<!-- Bean Validation implementation -->
<dependency org="org.slf4j" name="slf4j-log4j12" rev="1.6.1"
conf="tests -> default" />
diff --git a/server/src/com/vaadin/ui/PopupView.java b/server/src/com/vaadin/ui/PopupView.java
index de07630029..b6d5012e20 100644
--- a/server/src/com/vaadin/ui/PopupView.java
+++ b/server/src/com/vaadin/ui/PopupView.java
@@ -18,11 +18,9 @@ package com.vaadin.ui;
import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.Iterator;
-import java.util.Map;
-import com.vaadin.server.LegacyPaint;
-import com.vaadin.server.PaintException;
-import com.vaadin.server.PaintTarget;
+import com.vaadin.shared.ui.popupview.PopupViewServerRpc;
+import com.vaadin.shared.ui.popupview.PopupViewState;
/**
*
@@ -34,11 +32,9 @@ import com.vaadin.server.PaintTarget;
* @author Vaadin Ltd.
*/
@SuppressWarnings("serial")
-public class PopupView extends AbstractComponentContainer implements
- LegacyComponent {
+public class PopupView extends AbstractComponentContainer {
private Content content;
- private boolean hideOnMouseOut;
private Component visibleComponent;
private static final Method POPUP_VISIBILITY_METHOD;
@@ -54,6 +50,14 @@ public class PopupView extends AbstractComponentContainer implements
}
}
+ private final PopupViewServerRpc rpc = new PopupViewServerRpc() {
+
+ @Override
+ public void setPopupVisibility(boolean visible) {
+ setPopupVisible(visible);
+ }
+ };
+
/**
* Iterator for the visible components (zero or one components), used by
* {@link PopupView#getComponentIterator()}.
@@ -126,7 +130,8 @@ public class PopupView extends AbstractComponentContainer implements
*/
public PopupView(PopupView.Content content) {
super();
- hideOnMouseOut = true;
+ registerRpc(rpc);
+ setHideOnMouseOut(true);
setContent(content);
}
@@ -182,6 +187,16 @@ public class PopupView extends AbstractComponentContainer implements
}
}
+ @Override
+ public void beforeClientResponse(boolean initial) {
+ super.beforeClientResponse(initial);
+ String html = content.getMinimizedValueAsHTML();
+ if (html == null) {
+ html = "";
+ }
+ getState().html = html;
+ }
+
/**
* Return whether the popup is visible.
*
@@ -198,7 +213,7 @@ public class PopupView extends AbstractComponentContainer implements
* @return true if the popup is hidden on mouse out, false otherwise
*/
public boolean isHideOnMouseOut() {
- return hideOnMouseOut;
+ return getState().hideOnMouseOut;
}
/**
@@ -210,7 +225,7 @@ public class PopupView extends AbstractComponentContainer implements
*
*/
public void setHideOnMouseOut(boolean hideOnMouseOut) {
- this.hideOnMouseOut = hideOnMouseOut;
+ getState().hideOnMouseOut = hideOnMouseOut;
}
/*
@@ -301,46 +316,9 @@ public class PopupView extends AbstractComponentContainer implements
}
- /*
- * Methods for server-client communications.
- */
-
- /**
- * Paint (serialize) the component for the client.
- *
- * @see com.vaadin.ui.AbstractComponent#paintContent(com.vaadin.server.PaintTarget)
- */
- @Override
- public void paintContent(PaintTarget target) throws PaintException {
- String html = content.getMinimizedValueAsHTML();
- if (html == null) {
- html = "";
- }
- target.addAttribute("html", html);
- target.addAttribute("hideOnMouseOut", hideOnMouseOut);
-
- // Only paint component to client if we know that the popup is showing
- if (isPopupVisible()) {
- target.startTag("popupComponent");
- LegacyPaint.paint(visibleComponent, target);
- target.endTag("popupComponent");
- }
-
- target.addVariable(this, "popupVisibility", isPopupVisible());
- }
-
- /**
- * Deserialize changes received from client.
- *
- * @see com.vaadin.ui.AbstractComponent#changeVariables(java.lang.Object,
- * java.util.Map)
- */
@Override
- public void changeVariables(Object source, Map<String, Object> variables) {
- if (variables.containsKey("popupVisibility")) {
- setPopupVisible(((Boolean) variables.get("popupVisibility"))
- .booleanValue());
- }
+ protected PopupViewState getState() {
+ return (PopupViewState) super.getState();
}
/**
diff --git a/server/tests/src/com/vaadin/tests/VaadinClasses.java b/server/tests/src/com/vaadin/tests/VaadinClasses.java
index c0e026a5ca..b0d06ea897 100644
--- a/server/tests/src/com/vaadin/tests/VaadinClasses.java
+++ b/server/tests/src/com/vaadin/tests/VaadinClasses.java
@@ -244,7 +244,9 @@ public class VaadinClasses {
Class<?> c = Class.forName(fullyQualifiedClassName);
if (baseClass.isAssignableFrom(c)
- && !Modifier.isAbstract(c.getModifiers())) {
+ && !Modifier.isAbstract(c.getModifiers())
+ && !c.isAnonymousClass() && !c.isMemberClass()
+ && !c.isLocalClass()) {
result.add((Class<? extends T>) c);
}
} catch (Exception e) {
diff --git a/shared/src/com/vaadin/shared/ui/popupview/PopupViewServerRpc.java b/shared/src/com/vaadin/shared/ui/popupview/PopupViewServerRpc.java
new file mode 100644
index 0000000000..6b38e2e9f2
--- /dev/null
+++ b/shared/src/com/vaadin/shared/ui/popupview/PopupViewServerRpc.java
@@ -0,0 +1,10 @@
+package com.vaadin.shared.ui.popupview;
+
+import com.vaadin.shared.communication.ServerRpc;
+
+
+public interface PopupViewServerRpc extends ServerRpc {
+
+ public void setPopupVisibility(boolean visible);
+
+}
diff --git a/shared/src/com/vaadin/shared/ui/popupview/PopupViewState.java b/shared/src/com/vaadin/shared/ui/popupview/PopupViewState.java
new file mode 100644
index 0000000000..0f83d0fcd4
--- /dev/null
+++ b/shared/src/com/vaadin/shared/ui/popupview/PopupViewState.java
@@ -0,0 +1,10 @@
+package com.vaadin.shared.ui.popupview;
+
+import com.vaadin.shared.ComponentState;
+
+public class PopupViewState extends ComponentState {
+
+ public String html;
+ public boolean hideOnMouseOut;
+
+}
diff --git a/theme-compiler/src/com/vaadin/sass/resolver/ClassloaderResolver.java b/theme-compiler/src/com/vaadin/sass/resolver/ClassloaderResolver.java
index 84ac6dc530..28ab086be5 100644
--- a/theme-compiler/src/com/vaadin/sass/resolver/ClassloaderResolver.java
+++ b/theme-compiler/src/com/vaadin/sass/resolver/ClassloaderResolver.java
@@ -1,5 +1,6 @@
package com.vaadin.sass.resolver;
+import java.io.File;
import java.io.InputStream;
import org.w3c.css.sac.InputSource;
@@ -21,6 +22,9 @@ public class ClassloaderResolver implements ScssStylesheetResolver {
fileName = fileName + ext;
}
+ // Ensure only "/" is used, also in Windows
+ fileName = fileName.replace(File.separatorChar, '/');
+
// Can the classloader find it?
InputStream is = getClass().getClassLoader().getResourceAsStream(
fileName);
diff --git a/theme-compiler/src/com/vaadin/sass/visitor/ParentSelectorHandler.java b/theme-compiler/src/com/vaadin/sass/visitor/ParentSelectorHandler.java
index 3cc49b06dd..4098cc7cad 100644
--- a/theme-compiler/src/com/vaadin/sass/visitor/ParentSelectorHandler.java
+++ b/theme-compiler/src/com/vaadin/sass/visitor/ParentSelectorHandler.java
@@ -35,7 +35,7 @@ public class ParentSelectorHandler {
BlockNode parentBlock = (BlockNode) parentNode;
for (final String s : block.getSelectorList()) {
- if (s.startsWith("&") || s.endsWith("&")) {
+ if (s.contains("&")) {
for (final String parentSelector : parentBlock
.getSelectorList()) {
newList.add(s.replace("&", parentSelector));
diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxInPopupView.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxInPopupView.java
index 5a488e5dc5..131ab7effa 100644
--- a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxInPopupView.java
+++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxInPopupView.java
@@ -1,10 +1,10 @@
package com.vaadin.tests.components.combobox;
-import java.util.Map;
-
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.PopupView;
+import com.vaadin.ui.PopupView.PopupVisibilityEvent;
+import com.vaadin.ui.PopupView.PopupVisibilityListener;
public class ComboBoxInPopupView extends TestBase {
@@ -28,15 +28,14 @@ public class ComboBoxInPopupView extends TestBase {
final ComboBox cb2 = new ComboBox();
cb2.setWidth("260px");
- PopupView pv2 = new PopupView("<u>2. focused (click)</u>", cb2) {
+ PopupView pv2 = new PopupView("<u>2. focused (click)</u>", cb2);
+ pv2.addListener(new PopupVisibilityListener() {
+
@Override
- public void changeVariables(Object source,
- Map<String, Object> variables) {
- super.changeVariables(source, variables);
+ public void popupVisibilityChange(PopupVisibilityEvent event) {
cb2.focus();
}
-
- };
+ });
getLayout().addComponent(pv2);
}
diff --git a/uitest/src/com/vaadin/tests/components/table/RowFocusAppliedAndRemovedOnSelection.html b/uitest/src/com/vaadin/tests/components/table/RowFocusAppliedAndRemovedOnSelection.html
new file mode 100644
index 0000000000..a2f57aa085
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/table/RowFocusAppliedAndRemovedOnSelection.html
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="http://localhost:8888/" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.table.WideSelectableTable</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentstableWideSelectableTable::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[6]/domChild[0]</td>
+ <td>13,15</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentstableWideSelectableTable::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[6]/domChild[0]</td>
+ <td>15,14</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentstableWideSelectableTable::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[3]/domChild[6]/domChild[0]</td>
+ <td>15,12</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentstableWideSelectableTable::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]</td>
+ <td>v-table-focus</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentstableWideSelectableTable::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]</td>
+ <td>v-table-focus</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentstableWideSelectableTable::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[3]</td>
+ <td>v-table-focus</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>