[gwt-contrib] Change in gwt[master]: Adds FocusComposite and PanelComposite.

2013-05-22 Thread Goktug Gokdogan

Goktug Gokdogan has uploaded a new change for review.

  https://gwt-review.googlesource.com/2940


Change subject: Adds FocusComposite and PanelComposite.
..

Adds FocusComposite and PanelComposite.

Change-Id: I372f9c4942c11b799eeb57870163dd999ad095cb
---
A user/src/com/google/gwt/user/client/ui/FocusComposite.java
A user/src/com/google/gwt/user/client/ui/PanelComposite.java
2 files changed, 301 insertions(+), 0 deletions(-)



diff --git a/user/src/com/google/gwt/user/client/ui/FocusComposite.java  
b/user/src/com/google/gwt/user/client/ui/FocusComposite.java

new file mode 100644
index 000..0173bb0
--- /dev/null
+++ b/user/src/com/google/gwt/user/client/ui/FocusComposite.java
@@ -0,0 +1,229 @@
+/*
+ * Copyright 2013 Google Inc.
+ *
+ * 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.google.gwt.user.client.ui;
+
+import com.google.gwt.event.dom.client.BlurHandler;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.DoubleClickHandler;
+import com.google.gwt.event.dom.client.DragEndHandler;
+import com.google.gwt.event.dom.client.DragEnterHandler;
+import com.google.gwt.event.dom.client.DragHandler;
+import com.google.gwt.event.dom.client.DragLeaveHandler;
+import com.google.gwt.event.dom.client.DragOverHandler;
+import com.google.gwt.event.dom.client.DragStartHandler;
+import com.google.gwt.event.dom.client.DropHandler;
+import com.google.gwt.event.dom.client.FocusHandler;
+import com.google.gwt.event.dom.client.GestureChangeHandler;
+import com.google.gwt.event.dom.client.GestureEndHandler;
+import com.google.gwt.event.dom.client.GestureStartHandler;
+import com.google.gwt.event.dom.client.HasAllDragAndDropHandlers;
+import com.google.gwt.event.dom.client.HasAllFocusHandlers;
+import com.google.gwt.event.dom.client.HasAllGestureHandlers;
+import com.google.gwt.event.dom.client.HasAllKeyHandlers;
+import com.google.gwt.event.dom.client.HasAllMouseHandlers;
+import com.google.gwt.event.dom.client.HasAllTouchHandlers;
+import com.google.gwt.event.dom.client.HasClickHandlers;
+import com.google.gwt.event.dom.client.HasDoubleClickHandlers;
+import com.google.gwt.event.dom.client.KeyDownHandler;
+import com.google.gwt.event.dom.client.KeyPressHandler;
+import com.google.gwt.event.dom.client.KeyUpHandler;
+import com.google.gwt.event.dom.client.MouseDownHandler;
+import com.google.gwt.event.dom.client.MouseMoveHandler;
+import com.google.gwt.event.dom.client.MouseOutHandler;
+import com.google.gwt.event.dom.client.MouseOverHandler;
+import com.google.gwt.event.dom.client.MouseUpHandler;
+import com.google.gwt.event.dom.client.MouseWheelHandler;
+import com.google.gwt.event.dom.client.TouchCancelHandler;
+import com.google.gwt.event.dom.client.TouchEndHandler;
+import com.google.gwt.event.dom.client.TouchMoveHandler;
+import com.google.gwt.event.dom.client.TouchStartHandler;
+import com.google.gwt.event.shared.HandlerRegistration;
+
+/**
+ * A {@link Composite} that wraps a {@link Focusable} widget.
+ *
+ * @param T type of the widget wrapped
+ */
+public class FocusCompositeT extends FocusWidget extends CompositeT
+implements Focusable, HasEnabled, HasAllFocusHandlers,  
HasAllKeyHandlers, HasClickHandlers,
+HasDoubleClickHandlers, HasAllMouseHandlers,  
HasAllDragAndDropHandlers, HasAllGestureHandlers,

+HasAllTouchHandlers {
+
+  @Override
+  public int getTabIndex() {
+return getDelegate().getTabIndex();
+  }
+
+  @Override
+  public void setAccessKey(char key) {
+getDelegate().setAccessKey(key);
+  }
+
+  @Override
+  public void setFocus(boolean focused) {
+getDelegate().setFocus(focused);
+  }
+
+  @Override
+  public void setTabIndex(int index) {
+getDelegate().setTabIndex(index);
+  }
+
+  @Override
+  public HandlerRegistration addFocusHandler(FocusHandler handler) {
+return getDelegate().addFocusHandler(handler);
+  }
+
+  @Override
+  public HandlerRegistration addBlurHandler(BlurHandler handler) {
+return getDelegate().addBlurHandler(handler);
+  }
+
+  @Override
+  public void setEnabled(boolean enabled) {
+getDelegate().setEnabled(enabled);
+  }
+
+  @Override
+  public boolean isEnabled() {
+return getDelegate().isEnabled();
+  }
+
+  @Override
+  public HandlerRegistration addKeyDownHandler(KeyDownHandler handler) {
+return getDelegate().addKeyDownHandler(handler);
+  }
+
+  @Override
+  public 

[gwt-contrib] Change in gwt[master]: Adds FocusComposite and PanelComposite.

2013-05-22 Thread Goktug Gokdogan

Goktug Gokdogan has posted comments on this change.

Change subject: Adds FocusComposite and PanelComposite.
..


Patch Set 1:

Bringing the discussion to its own patch. Will looking into alternatives  
for event source correction.


--
To view, visit https://gwt-review.googlesource.com/2940
To unsubscribe, visit https://gwt-review.googlesource.com/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I372f9c4942c11b799eeb57870163dd999ad095cb
Gerrit-PatchSet: 1
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: Goktug Gokdogan gok...@google.com
Gerrit-Reviewer: Goktug Gokdogan gok...@google.com
Gerrit-HasComments: No

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- 
You received this message because you are subscribed to the Google Groups GWT Contributors group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[gwt-contrib] Change in gwt[master]: Adds FocusComposite and PanelComposite.

2013-05-22 Thread Goktug Gokdogan

Goktug Gokdogan has posted comments on this change.

Change subject: Adds FocusComposite and PanelComposite.
..


Patch Set 1:

I thought little bit more on this.

As we must always call specific addXYZHandler methods expecting specific  
handler classes, I think it is impossible to avoid boilerplate without  
codegen.


The minimal boilerplate that I found is my previous proposal of updating  
the source of the event (we can put a helper in composite for source  
override). Anybody who wants to be good citizen can choose to do that.


If we do code generation, we can simplify it a lot and everybody can use it:

  interface FocusForwardingHandlers extends HasXHandlers, HasYHandlers,  
ForwardingHandler;


  FocusForwardingHandlers helper;

  protected void initWidget(Widget widget, T delegate) {
super.initWidget(widget, delegate);
helper = GWT.create(FocusForwardingHandlers.class);
helper.init(this, delegate);
  };

  public HandlerRegistration addFocusHandler(FocusHandler handler) {
return helper.addHandler(handler);
  }

but writing the codegen is also a lot of work. I'm not sure if it will  
worth for just fixing the source of event.


--
To view, visit https://gwt-review.googlesource.com/2940
To unsubscribe, visit https://gwt-review.googlesource.com/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I372f9c4942c11b799eeb57870163dd999ad095cb
Gerrit-PatchSet: 1
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: Goktug Gokdogan gok...@google.com
Gerrit-Reviewer: Brian Slesinsky skybr...@google.com
Gerrit-Reviewer: Goktug Gokdogan gok...@google.com
Gerrit-Reviewer: Jens Nehlmeier jens.nehlme...@gmail.com
Gerrit-Reviewer: Leeroy Jenkins jenk...@gwtproject.org
Gerrit-Reviewer: Thomas Broyer t.bro...@gmail.com
Gerrit-HasComments: No

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- 
You received this message because you are subscribed to the Google Groups GWT Contributors group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.