diff options
author | Markus Koivisto <markus@vaadin.com> | 2014-12-11 12:10:48 +0000 |
---|---|---|
committer | Markus Koivisto <markus@vaadin.com> | 2014-12-11 12:11:49 +0000 |
commit | dd879668f5f74dfea8a804f3ff3c1e7c2f89a5a3 (patch) | |
tree | fca874febb8fbff176bd5651ae94c3ab6895c085 | |
parent | 4e477009c14231b5ecbd6bd0d289ac88eace2391 (diff) | |
download | vaadin-framework-dd879668f5f74dfea8a804f3ff3c1e7c2f89a5a3.tar.gz vaadin-framework-dd879668f5f74dfea8a804f3ff3c1e7c2f89a5a3.zip |
Revert "Notify server side component about clicks in form layout (#6346)."
This reverts commit 23bdb6e90d970bd4e9ef11c79c095e65b6963414.
The included test (FormLayoutClickListenerTest) fails on all other browsers except PhantomJS.
Change-Id: Ib60d051da9100eef8f30e6578ac73314bcda3ec3
3 files changed, 0 insertions, 155 deletions
diff --git a/client/src/com/vaadin/client/ui/formlayout/FormLayoutConnector.java b/client/src/com/vaadin/client/ui/formlayout/FormLayoutConnector.java index ae4b03e0f8..494a1a87ff 100644 --- a/client/src/com/vaadin/client/ui/formlayout/FormLayoutConnector.java +++ b/client/src/com/vaadin/client/ui/formlayout/FormLayoutConnector.java @@ -24,41 +24,18 @@ import com.vaadin.client.Util; import com.vaadin.client.communication.StateChangeEvent; import com.vaadin.client.ui.AbstractFieldConnector; import com.vaadin.client.ui.AbstractLayoutConnector; -import com.vaadin.client.ui.LayoutClickEventHandler; import com.vaadin.client.ui.VFormLayout; import com.vaadin.client.ui.VFormLayout.Caption; import com.vaadin.client.ui.VFormLayout.ErrorFlag; import com.vaadin.client.ui.VFormLayout.VFormLayoutTable; import com.vaadin.shared.ui.Connect; -import com.vaadin.shared.ui.LayoutClickRpc; import com.vaadin.shared.ui.MarginInfo; -import com.vaadin.shared.ui.orderedlayout.AbstractOrderedLayoutServerRpc; import com.vaadin.shared.ui.orderedlayout.AbstractOrderedLayoutState; import com.vaadin.ui.FormLayout; @Connect(FormLayout.class) public class FormLayoutConnector extends AbstractLayoutConnector { - /* - * Handlers & Listeners - */ - - private LayoutClickEventHandler clickEventHandler = new LayoutClickEventHandler( - this) { - - @Override - protected ComponentConnector getChildComponent( - com.google.gwt.user.client.Element element) { - return Util.getConnectorForElement(getConnection(), getWidget(), - element); - } - - @Override - protected LayoutClickRpc getLayoutClickRPC() { - return getRpcProxy(AbstractOrderedLayoutServerRpc.class); - } - }; - @Override public AbstractOrderedLayoutState getState() { return (AbstractOrderedLayoutState) super.getState(); @@ -68,7 +45,6 @@ public class FormLayoutConnector extends AbstractLayoutConnector { public void onStateChanged(StateChangeEvent stateChangeEvent) { super.onStateChanged(stateChangeEvent); - clickEventHandler.handleEventHandlerRegistration(); VFormLayoutTable formLayoutTable = getWidget().table; formLayoutTable.setMargins(new MarginInfo(getState().marginsBitmask)); diff --git a/uitest/src/com/vaadin/tests/components/formlayout/FormLayoutClickListener.java b/uitest/src/com/vaadin/tests/components/formlayout/FormLayoutClickListener.java deleted file mode 100644 index 35b8d9ca86..0000000000 --- a/uitest/src/com/vaadin/tests/components/formlayout/FormLayoutClickListener.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2000-2014 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.vaadin.tests.components.formlayout; - -import com.vaadin.event.LayoutEvents.LayoutClickEvent; -import com.vaadin.event.LayoutEvents.LayoutClickListener; -import com.vaadin.server.VaadinRequest; -import com.vaadin.tests.components.AbstractTestUIWithLog; -import com.vaadin.ui.FormLayout; -import com.vaadin.ui.Label; - -/** - * Test UI for Form layout click listener. - * - * @author Vaadin Ltd - */ -public class FormLayoutClickListener extends AbstractTestUIWithLog { - - @Override - protected void setup(VaadinRequest request) { - FormLayout layout = new FormLayout(); - - layout.addStyleName("form"); - - Label label = new Label("target"); - label.addStyleName("label"); - layout.addComponent(label); - - layout.addLayoutClickListener(new LayoutClickListener() { - - @Override - public void layoutClick(LayoutClickEvent event) { - log("Child component: " - + (event.getChildComponent() == null ? null : event - .getChildComponent().getStyleName())); - log("Clicked component: " - + (event.getClickedComponent() == null ? null : event - .getClickedComponent().getStyleName())); - log("Source component: " + event.getComponent().getStyleName()); - } - }); - - addComponent(layout); - } - - @Override - protected String getTestDescription() { - return "LayoutClickListener should work in FormLayout"; - } - - @Override - protected Integer getTicketNumber() { - return 6346; - } - -} diff --git a/uitest/src/com/vaadin/tests/components/formlayout/FormLayoutClickListenerTest.java b/uitest/src/com/vaadin/tests/components/formlayout/FormLayoutClickListenerTest.java deleted file mode 100644 index bcab514a5d..0000000000 --- a/uitest/src/com/vaadin/tests/components/formlayout/FormLayoutClickListenerTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2000-2014 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.vaadin.tests.components.formlayout; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.openqa.selenium.By; - -import com.vaadin.testbench.elements.FormLayoutElement; -import com.vaadin.tests.tb3.MultiBrowserTest; - -/** - * Test for form layout click listener. - * - * @author Vaadin Ltd - */ -public class FormLayoutClickListenerTest extends MultiBrowserTest { - - @Before - public void setUp() { - openTestURL(); - } - - @Test - public void layoutClickListener_clickOnLayout_childAndClickedComponentsAreNull() { - $(FormLayoutElement.class).first().click(); - - Assert.assertEquals("Source component for click event must be form", - "3. Source component: form", getLogRow(0)); - Assert.assertEquals("Clicked component for click event must be null", - "2. Clicked component: null", getLogRow(1)); - Assert.assertEquals("Child component for click event must be null", - "1. Child component: null", getLogRow(2)); - } - - @Test - public void layoutClickListener_clickOnLabel_lableIsChildAndClickedComponent() { - findElement(By.className("label")).click(); - - Assert.assertEquals("Source component for click event must be form", - "3. Source component: form", getLogRow(0)); - Assert.assertEquals("Clicked component for click event must be label", - "2. Clicked component: label", getLogRow(1)); - Assert.assertEquals("Child component for click event must be label", - "1. Child component: label", getLogRow(2)); - } - -} |