@@ -0,0 +1,2410 @@
+/*%0A * Copyright 2011 Vaadin Ltd.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22); you may not%0A * use this file except in compliance with the License. You may obtain a copy of%0A * the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS, WITHOUT%0A * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the%0A * License for the specific language governing permissions and limitations under%0A * the License.%0A */%0Apackage com.vaadin.tests.components.orderedlayout;%0A%0Aimport com.vaadin.server.VaadinRequest;%0Aimport com.vaadin.tests.components.AbstractTestUI;%0Aimport com.vaadin.ui.Button;%0Aimport com.vaadin.ui.Button.ClickEvent;%0Aimport com.vaadin.ui.Button.ClickListener;%0Aimport com.vaadin.ui.ComboBox;%0Aimport com.vaadin.ui.Component;%0Aimport com.vaadin.ui.ComponentContainer;%0Aimport com.vaadin.ui.HorizontalLayout;%0Aimport com.vaadin.ui.VerticalLayout;%0A%0Apublic class InsertComponentInHorizontalLayout extends AbstractTestUI %7B%0A    private VerticalLayout layout;%0A    int added = 1;%0A%0A    private Component getTestLayout() %7B%0A        ComboBox a = new ComboBox(%22initial%22);%0A        Button b = new Button(%22x%22, new Button.ClickListener() %7B%0A%0A            @Override%0A            public void buttonClick(ClickEvent event) %7B%0A                layout.markAsDirty();%0A            %7D%0A        %7D);%0A        final HorizontalLayout hl = new HorizontalLayout(a, b);%0A        hl.setSpacing(true);%0A        Button add = new Button(%0A                %22Insert 2 comboboxes between combobox(es) and button 'x'%22);%0A        add.addClickListener(new ClickListener() %7B%0A            @Override%0A            public void buttonClick(ClickEvent event) %7B%0A                hl.addComponent(new ComboBox(%22Added %22 + added++), 1);%0A                hl.addComponent(new ComboBox(%22Added %22 + added++), 2);%0A            %7D%0A        %7D);%0A        layout = new VerticalLayout(hl, add);%0A        return layout;%0A    %7D%0A%0A    @Override%0A    protected void setup(VaadinRequest request) %7B%0A        setContent((ComponentContainer) getTestLayout());%0A    %7D%0A%0A    @Override%0A    protected String getTestDescription() %7B%0A        return %22Click the button to add two comboboxes between the existing combobox(es) and the 'x' button%22;%0A    %7D%0A%0A    @Override%0A    protected Integer getTicketNumber() %7B%0A        return 10154;%0A    %7D%0A%7D%0A

Test for #10154