@@ -0,0 +1,1799 @@
+package com.itmill.toolkit.tests;%0A%0Aimport com.itmill.toolkit.ui.AbstractSelect;%0Aimport com.itmill.toolkit.ui.Button;%0Aimport com.itmill.toolkit.ui.ComboBox;%0Aimport com.itmill.toolkit.ui.CustomComponent;%0Aimport com.itmill.toolkit.ui.DateField;%0Aimport com.itmill.toolkit.ui.GridLayout;%0Aimport com.itmill.toolkit.ui.ListSelect;%0Aimport com.itmill.toolkit.ui.NativeSelect;%0Aimport com.itmill.toolkit.ui.OptionGroup;%0Aimport com.itmill.toolkit.ui.TextField;%0Aimport com.itmill.toolkit.ui.Button.ClickEvent;%0A%0A/**%0A * Simple test helper to test Focusable.focus() method.%0A * %0A */%0Apublic class FocusingComponents extends CustomComponent %7B%0A    GridLayout lo = new GridLayout(2, 1);%0A%0A    public FocusingComponents() %7B%0A%0A        setCompositionRoot(lo);%0A        lo.setSpacing(true);%0A%0A        Focusable f;%0A%0A        f = new Button();%0A%0A        addFocusableTest(f);%0A        addFocusableTest(new ComboBox());%0A        addFocusableTest(new TextField());%0A        addFocusableTest(new DateField());%0A        addFocusableTest(new NativeSelect());%0A        addFocusableTest(new ListSelect());%0A        addFocusableTest(new OptionGroup());%0A        OptionGroup optionGroup = new OptionGroup();%0A        optionGroup.setMultiSelect(true);%0A        addFocusableTest(optionGroup);%0A%0A    %7D%0A%0A    private void addFocusableTest(final Focusable f) %7B%0A%0A        f.setCaption(f.getClass().getSimpleName());%0A        lo.addComponent(f);%0A%0A        if (f instanceof AbstractSelect) %7B%0A            AbstractSelect s = (AbstractSelect) f;%0A            s.addItem(%22Foo%22);%0A            s.addItem(%22Bar%22);%0A        %7D%0A%0A        Button focus = new Button(%22focus%22);%0A        focus.addListener(new Button.ClickListener() %7B%0A            public void buttonClick(ClickEvent event) %7B%0A                f.focus();%0A            %7D%0A        %7D);%0A        lo.addComponent(focus);%0A%0A    %7D%0A%0A%7D%0A

test for focusing components