Sort & format. git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@2144 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/user/client/ui/Composite.java b/user/src/com/google/gwt/user/client/ui/Composite.java index 7368260..9b943ae 100644 --- a/user/src/com/google/gwt/user/client/ui/Composite.java +++ b/user/src/com/google/gwt/user/client/ui/Composite.java
@@ -1,5 +1,5 @@ /* - * Copyright 2007 Google Inc. + * Copyright 2008 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 @@ -45,6 +45,12 @@ return false; } + @Override + public void onBrowserEvent(Event event) { + // Delegate events to the widget. + widget.onBrowserEvent(event); + } + /** * Provides subclasses access to the topmost widget that defines this * composite. @@ -84,12 +90,6 @@ } @Override - public void onBrowserEvent(Event event) { - // Delegate events to the widget. - widget.onBrowserEvent(event); - } - - @Override protected void onAttach() { // Call the widget's onAttach() first. widget.onAttach();
diff --git a/user/src/com/google/gwt/user/client/ui/UIObject.java b/user/src/com/google/gwt/user/client/ui/UIObject.java index ea27f10..6d395a2 100644 --- a/user/src/com/google/gwt/user/client/ui/UIObject.java +++ b/user/src/com/google/gwt/user/client/ui/UIObject.java
@@ -83,17 +83,13 @@ */ public abstract class UIObject { - static final String SETELEMENT_TWICE_ERROR = "Element may only be set once"; - - static final String MISSING_ELEMENT_ERROR = "This UIObject's element is not set; " - + "you may be missing a call to either Composite.initWidget() or " - + "UIObject.setElement()"; - /** * The implementation of the set debug id method, which does nothing by * default. */ public static class DebugIdImpl { + @SuppressWarnings("unused") + // parameters public void ensureDebugId(UIObject uiObject, String id) { } } @@ -111,13 +107,19 @@ public static final String DEBUG_ID_PREFIX = "gwt-debug-"; + static final String MISSING_ELEMENT_ERROR = "This UIObject's element is not set; " + + "you may be missing a call to either Composite.initWidget() or " + + "UIObject.setElement()"; + + static final String SETELEMENT_TWICE_ERROR = "Element may only be set once"; + + private static DebugIdImpl debugIdImpl = GWT.create(DebugIdImpl.class); + private static final String EMPTY_STYLENAME_MSG = "Style names cannot be empty"; private static final String NULL_HANDLE_MSG = "Null widget handle. If you " + "are creating a composite, ensure that initWidget() has been called."; - private static DebugIdImpl debugIdImpl = GWT.create(DebugIdImpl.class); - public static native boolean isVisible(Element elem) /*-{ return (elem.style.display != 'none'); }-*/; @@ -702,12 +704,12 @@ /** * Called when the user sets the id using the {@link #ensureDebugId(String)} * method. Subclasses of {@link UIObject} can override this method to add IDs - * to their sub elements. If a subclass does override this method, it should + * to their sub elements. If a subclass does override this method, it should * list the IDs (relative to the base ID), that will be applied to each sub - * {@link Element} with a short description. For example: + * {@link Element} with a short description. For example: * <ul> * <li>-mysubelement = Applies to my sub element.</li> - * </ul> + * </ul> * * Subclasses should make a super call to this method to ensure that the ID of * the main element is set. @@ -739,8 +741,8 @@ /** * Replaces this object's browser element. * - * This method exists only to support a specific use-case in Image, and - * should not be used by other classes. + * This method exists only to support a specific use-case in Image, and should + * not be used by other classes. * * @param elem the object's new element */
diff --git a/user/src/com/google/gwt/user/client/ui/Widget.java b/user/src/com/google/gwt/user/client/ui/Widget.java index e4590cd..054237c 100644 --- a/user/src/com/google/gwt/user/client/ui/Widget.java +++ b/user/src/com/google/gwt/user/client/ui/Widget.java
@@ -1,5 +1,5 @@ /* - * Copyright 2007 Google Inc. + * Copyright 2008 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 @@ -164,6 +164,16 @@ protected void onUnload() { } + /** + * Gets the panel-defined layout data associated with this widget. + * + * @return the widget's layout data + * @see #setLayoutData + */ + Object getLayoutData() { + return layoutData; + } + @Override void replaceElement(Element elem) { if (isAttached()) { @@ -183,16 +193,6 @@ } /** - * Gets the panel-defined layout data associated with this widget. - * - * @return the widget's layout data - * @see #setLayoutData - */ - Object getLayoutData() { - return layoutData; - } - - /** * Sets the panel-defined layout data associated with this widget. Only the * panel that currently contains a widget should ever set this value. It * serves as a place to store layout bookkeeping data associated with a