From 7b0485a5838a070b971d91f8321d6bf6778c3f86 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Wed, 28 Nov 2012 18:03:47 +0200 Subject: Moved setVisible dirty logic to AbstractComponent where it belongs (#10414) Change-Id: I05f8b739e862c3dd4a52492f2df41862bacd3ce4 --- .../CustomComponentChildVisibility.html | 47 +++++++++++++++++ .../CustomComponentChildVisibility.java | 60 ++++++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 uitest/src/com/vaadin/tests/components/customcomponent/CustomComponentChildVisibility.html create mode 100644 uitest/src/com/vaadin/tests/components/customcomponent/CustomComponentChildVisibility.java (limited to 'uitest/src/com') diff --git a/uitest/src/com/vaadin/tests/components/customcomponent/CustomComponentChildVisibility.html b/uitest/src/com/vaadin/tests/components/customcomponent/CustomComponentChildVisibility.html new file mode 100644 index 0000000000..ac2f0452b3 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/customcomponent/CustomComponentChildVisibility.html @@ -0,0 +1,47 @@ + + + + + + +New Test + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
New Test
open/run/com.vaadin.tests.components.customcomponent.CustomComponentChildVisibility?debug&restartApplication
assertTextvaadin=runcomvaadintestscomponentscustomcomponentCustomComponentChildVisibility::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCustomComponent[0]/VPanel[0]/VLabel[0]In panel
mouseClickvaadin=runcomvaadintestscomponentscustomcomponentCustomComponentChildVisibility::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VCheckBox[0]/domChild[0]7,7
assertElementNotPresentvaadin=runcomvaadintestscomponentscustomcomponentCustomComponentChildVisibility::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCustomComponent[0]/VPanel[0]/VLabel[0]In panel
mouseClickvaadin=runcomvaadintestscomponentscustomcomponentCustomComponentChildVisibility::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCheckBox[0]/domChild[0]7,7
assertTextvaadin=runcomvaadintestscomponentscustomcomponentCustomComponentChildVisibility::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCustomComponent[0]/VPanel[0]/VLabel[0]In panel
+ + diff --git a/uitest/src/com/vaadin/tests/components/customcomponent/CustomComponentChildVisibility.java b/uitest/src/com/vaadin/tests/components/customcomponent/CustomComponentChildVisibility.java new file mode 100644 index 0000000000..a9899b2815 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/customcomponent/CustomComponentChildVisibility.java @@ -0,0 +1,60 @@ +/* + * Copyright 2012 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.customcomponent; + +import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.data.Property.ValueChangeListener; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.CheckBox; +import com.vaadin.ui.CustomComponent; +import com.vaadin.ui.Label; +import com.vaadin.ui.Panel; + +public class CustomComponentChildVisibility extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + final CustomComponent cc = new CustomComponent(new Panel( + "In CustomComponent", new Label("In panel"))); + + final CheckBox cb = new CheckBox("CustomComponent visible"); + cb.setValue(true); + cb.setImmediate(true); + cb.addValueChangeListener(new ValueChangeListener() { + @Override + public void valueChange(ValueChangeEvent event) { + cc.setVisible(cb.getValue()); + } + }); + addComponent(cc); + addComponent(cb); + + } + + @Override + protected String getTestDescription() { + // TODO Auto-generated method stub + return null; + } + + @Override + protected Integer getTicketNumber() { + // TODO Auto-generated method stub + return null; + } + +} -- cgit v1.2.3