]> source.dussan.org Git - vaadin-framework.git/commitdiff
Brought branch up to date with /versions/6.2
authorArtur Signell <artur.signell@itmill.com>
Wed, 25 Nov 2009 15:08:37 +0000 (15:08 +0000)
committerArtur Signell <artur.signell@itmill.com>
Wed, 25 Nov 2009 15:08:37 +0000 (15:08 +0000)
svn changeset:10027/svn branch:event-framework-3234

1  2 
src/TestListeners.java
src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
src/com/vaadin/ui/AbstractComponent.java
src/com/vaadin/ui/Table.java
src/com/vaadin/ui/TextField.java
src/com/vaadin/ui/Tree.java

index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..1c415bd0aa48d958a772cecdd1f41b743bb32381
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,136 @@@
++import com.vaadin.Application;
++import com.vaadin.event.FieldEvents.BlurEvent;
++import com.vaadin.event.FieldEvents.BlurListener;
++import com.vaadin.event.FieldEvents.FocusEvent;
++import com.vaadin.event.FieldEvents.FocusListener;
++import com.vaadin.event.LayoutEvents.LayoutClickEvent;
++import com.vaadin.event.LayoutEvents.LayoutClickListener;
++import com.vaadin.event.MouseEvents.ClickEvent;
++import com.vaadin.event.MouseEvents.ClickListener;
++import com.vaadin.terminal.ExternalResource;
++import com.vaadin.ui.AbsoluteLayout;
++import com.vaadin.ui.Embedded;
++import com.vaadin.ui.GridLayout;
++import com.vaadin.ui.Label;
++import com.vaadin.ui.TextField;
++import com.vaadin.ui.Window;
++
++public class TestListeners extends Application implements LayoutClickListener,
++        ClickListener, FocusListener {
++
++    @Override
++    public void init() {
++        Window w = new Window("main window");
++        setMainWindow(w);
++
++        // Panel p = new Panel("My panel");
++        // p.addListener(new ClickListener() {
++        //
++        // public void click(ClickEvent event) {
++        // getMainWindow().showNotification("Clicked!");
++        //
++        // }
++        // });
++        // w.addComponent(p);
++        // if (true) {
++        // return;
++        // }
++        // VerticalLayout vl = new VerticalLayout();
++
++        AbsoluteLayout al = new AbsoluteLayout();
++        al.setWidth("200px");
++        al.setHeight("200px");
++        al.addComponent(new TextField("This is its caption",
++                "This is a textfield"), "top: 20px; left: 0px; width: 100px;");
++        al.addComponent(new TextField("Antoerh caption",
++                "This is another textfield"),
++                "top: 120px; left: 0px; width: 100px;");
++        al.addListener(new LayoutClickListener() {
++
++            public void layoutClick(LayoutClickEvent event) {
++                System.out.println("Click on " + event.getChildComponent());
++
++            }
++        });
++
++        GridLayout vl = new GridLayout();
++        vl.addComponent(al);
++        vl.setSpacing(true);
++        for (int i = 0; i < 10; i++) {
++            vl.addComponent(new Label("Component " + i));
++            ExternalResource res = new ExternalResource(
++                    "http://vaadin.com/image/image_gallery?uuid=07c1f6d5-2e94-4f4d-a707-b548bf22279d&groupId=10919&t=1241012632062");
++            Embedded e = new Embedded("an image", res);
++            e.setType(Embedded.TYPE_IMAGE);
++            e.addListener(new ClickListener() {
++
++                public void click(ClickEvent event) {
++                    TestListeners.this.click(event);
++
++                }
++            });
++            // e.addListener(this);
++            vl.addComponent(e);
++            TextField tf = new TextField("tf");
++            tf.setInputPrompt("Please enter a value");
++
++            // tf.addListener(this);
++            tf.addListener(new BlurListener() {
++
++                public void blur(BlurEvent event) {
++                    getMainWindow().showNotification(
++                            "Blurred " + event.getComponent());
++
++                }
++            });
++            tf.addListener(new FocusListener() {
++
++                public void focus(FocusEvent event) {
++                    getMainWindow().showNotification(
++                            "Focused " + event.getComponent());
++
++                }
++            });
++            vl.addComponent(tf);
++        }
++
++        // vl.addListener(this);
++        vl.addListener(new LayoutClickListener() {
++
++            public void layoutClick(LayoutClickEvent event) {
++                TestListeners.this.layoutClick(event);
++
++            }
++        });
++        vl.setMargin(true);
++        w.setContent(vl);
++
++    }
++
++    public void layoutClick(LayoutClickEvent event) {
++        if (event.getChildComponent() == null) {
++            getMainWindow().showNotification("You missed!");
++        } else {
++            getMainWindow().showNotification(
++                    "Clicked on " + event.getChildComponent() + "!");
++            // getMainWindow().removeComponent(event.getChildComponent());
++
++        }
++
++    }
++
++    public void click(ClickEvent event) {
++        getMainWindow().showNotification(
++                "Clicked on " + event.getComponent() + " using "
++                        + event.getButton());
++    }
++
++    public void focus(FocusEvent event) {
++        TextField tf = (TextField) event.getComponent();
++        // tf.addStyleName("a");
++        // tf.setValue("");
++        getMainWindow().requestRepaintAll();
++
++    }
++
++}
index c72701b8ac63e09d2a8e4d7527a451c5cc903795,dbf988377ff94fabf8bcd052680156905c99f6d1..9a3d84a80361ced8ca190ec7ae98c3be201189f1
@@@ -836,8 -820,7 +836,8 @@@ public abstract class AbstractComponen
       * comment here, we use the default documentation from implemented
       * interface.
       */
-     public void changeVariables(Object source, Map variables) {
+     public void changeVariables(Object source, Map<String, Object> variables) {
 +
      }
  
      /* General event framework */
Simple merge
Simple merge
Simple merge