Attached the patch file...
On Mon, Sep 8, 2008 at 2:19 PM, Eric Ayers <[EMAIL PROTECTED]> wrote:
> +GWTC
>
>
> On Mon, Sep 8, 2008 at 2:19 PM, Eric Ayers <[EMAIL PROTECTED]> wrote:
>
>> Hello Miguel,
>>
>> This is yet another JS overlay conversion. The StatusCodes type is really
>> just a collection of constants.
>>
>> D maps/maps/src/com/google/gwt/maps/client/impl/StatusCodesImpl.java
>> M maps/maps/src/com/google/gwt/maps/client/geocode/StatusCodes.java
>>
>> --
>> Eric Z. Ayers - GWT Team - Atlanta, GA USA
>> http://code.google.com/webtoolkit/
>>
>
>
>
> --
> Eric Z. Ayers - GWT Team - Atlanta, GA USA
> http://code.google.com/webtoolkit/
>
--
Eric Z. Ayers - GWT Team - Atlanta, GA USA
http://code.google.com/webtoolkit/
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---
D maps/maps/src/com/google/gwt/maps/client/impl/StatusCodesImpl.java
M maps/maps/src/com/google/gwt/maps/client/geocode/StatusCodes.java
Index: maps/maps/src/com/google/gwt/maps/client/geocode/StatusCodes.java
===================================================================
--- maps/maps/src/com/google/gwt/maps/client/geocode/StatusCodes.java (revision 760)
+++ maps/maps/src/com/google/gwt/maps/client/geocode/StatusCodes.java (working copy)
@@ -15,12 +15,12 @@
*/
package com.google.gwt.maps.client.geocode;
-import com.google.gwt.maps.client.impl.StatusCodesImpl;
+import com.google.gwt.core.client.JavaScriptObject;
/**
* Result status codes for the Google Geocoding service.
*/
-public final class StatusCodes {
+public final class StatusCodes extends JavaScriptObject {
/*
* Design note: This was not implemented as an enum because we feel that the
@@ -31,49 +31,49 @@
* The given key is either invalid or does not match the domain for which it
* was given.
*/
- public static final int BAD_KEY = StatusCodesImpl.impl.getBadKeyCode();
+ public static final int BAD_KEY = getBadKeyCode();
/**
* A directions request could not be successfully parsed.
*/
- public static final int BAD_REQUEST = StatusCodesImpl.impl.getBadRequestCode();
+ public static final int BAD_REQUEST = getBadRequestCode();
/**
* Synonym for [EMAIL PROTECTED] StatusCodes#MISSING_QUERY}.
*/
- public static final int MISSING_ADDRESS = StatusCodesImpl.impl.getMissingAddressCode();
+ public static final int MISSING_ADDRESS = getMissingAddressCode();
/**
* The HTTP q parameter was either missing or had no value. For geocoding
* requests, this means that an empty address was specified as input. For
* directions requests, this means that no query was specified in the input
*/
- public static final int MISSING_QUERY = StatusCodesImpl.impl.getMissingQueryCode();
+ public static final int MISSING_QUERY = getMissingQueryCode();
/**
* A geocoding or directions request could not be successfully processed, yet
* the exact reason for the failure is not known.
*/
- public static final int SERVER_ERROR = StatusCodesImpl.impl.getServerErrorCode();
+ public static final int SERVER_ERROR = getServerErrorCode();
/**
* No errors occurred; the address was successfully parsed and its geocode has
* been returned.
*/
- public static final int SUCCESS = StatusCodesImpl.impl.getSuccessCode();
+ public static final int SUCCESS = getSuccessCode();
/**
* The geocode for the given address or the route for the given directions
* query cannot be returned due to legal or contractual reasons.
*/
- public static final int UNAVAILABLE_ADDRESS = StatusCodesImpl.impl.getUnavailableAddressCode();
+ public static final int UNAVAILABLE_ADDRESS = getUnavailableAddressCode();
/**
* No corresponding geographic location could be found for the specified
* address. This may be due to the fact that the address is relatively new, or
* it may be incorrect.
*/
- public static final int UNKNOWN_ADDRESS = StatusCodesImpl.impl.getUnknownAddressCode();
+ public static final int UNKNOWN_ADDRESS = getUnknownAddressCode();
/**
* The [EMAIL PROTECTED] Directions} object could not compute directions between the
@@ -81,8 +81,24 @@
* available between the two points, or because we do not have data for
* routing in that region.
*/
- public static final int UNKNOWN_DIRECTIONS = StatusCodesImpl.impl.getUnknownDirectionsCode();
+ public static final int UNKNOWN_DIRECTIONS = getUnknownDirectionsCode();
+ public static native int getBadKeyCode() /*-{
+ return $wnd.G_GEO_BAD_KEY;
+ }-*/;
+
+ public static native int getBadRequestCode() /*-{
+ return $wnd.G_GEO_BAD_REQUEST;
+ }-*/;
+
+ public static native int getMissingAddressCode() /*-{
+ return $wnd.G_GEO_MISSING_ADDRESS;
+ }-*/;
+
+ public static native int getMissingQueryCode() /*-{
+ return $wnd.G_GEO_MISSING_QUERY;
+ }-*/;
+
public static String getName(int statusCode) {
if (statusCode == BAD_KEY) {
return "BAD_KEY";
@@ -106,8 +122,32 @@
return "UNKNOWN_STATUS: " + statusCode;
}
}
-
- // This class is not meant to be instantiated by end users.
- private StatusCodes() {
+
+ public static native int getServerErrorCode() /*-{
+ return $wnd.G_GEO_SERVER_ERROR;
+ }-*/;
+
+ public static native int getSuccessCode() /*-{
+ return $wnd.G_GEO_SUCCESS;
+ }-*/;
+
+ public static native int getTooManyQueriesCode() /*-{
+ return $wnd.G_GEO_TOO_MANY_QUERIES;
+ }-*/;
+
+ public static native int getUnavailableAddressCode() /*-{
+ return $wnd.G_GEO_UNAVAILABLE_ADDRESS;
+ }-*/;
+
+ public static native int getUnknownAddressCode() /*-{
+ return $wnd.G_GEO_UNKNOWN_ADDRESS;
+ }-*/;
+
+ public static native int getUnknownDirectionsCode() /*-{
+ return $wnd.G_GEO_UNKNOWN_DIRECTIONS;
+ }-*/;
+
+ protected StatusCodes() {
+ // Required for JS overlays
}
}
Index: maps/maps/src/com/google/gwt/maps/client/impl/StatusCodesImpl.java
===================================================================
--- maps/maps/src/com/google/gwt/maps/client/impl/StatusCodesImpl.java (revision 760)
+++ maps/maps/src/com/google/gwt/maps/client/impl/StatusCodesImpl.java (working copy)
@@ -1,63 +0,0 @@
-/*
- * 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
- * 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.maps.client.impl;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.maps.jsio.client.BeanProperties;
-import com.google.gwt.maps.jsio.client.FieldName;
-import com.google.gwt.maps.jsio.client.Global;
-import com.google.gwt.maps.jsio.client.JSWrapper;
-import com.google.gwt.maps.jsio.client.ReadOnly;
-
-/**
- * Provides access to the GGeoStatusCode constants.
- */
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]("$wnd")
-public interface StatusCodesImpl extends JSWrapper<StatusCodesImpl> {
- StatusCodesImpl impl = GWT.create(StatusCodesImpl.class);
-
- @FieldName("G_GEO_BAD_KEY")
- int getBadKeyCode();
-
- @FieldName("G_GEO_BAD_REQUEST")
- int getBadRequestCode();
-
- @FieldName("G_GEO_MISSING_ADDRESS")
- int getMissingAddressCode();
-
- @FieldName("G_GEO_MISSING_QUERY")
- int getMissingQueryCode();
-
- @FieldName("G_GEO_SERVER_ERROR")
- int getServerErrorCode();
-
- @FieldName("G_GEO_SUCCESS")
- int getSuccessCode();
-
- @FieldName("G_GEO_TOO_MANY_QUERIES")
- int getTooManyQueriesCode();
-
- @FieldName("G_GEO_UNAVAILABLE_ADDRESS")
- int getUnavailableAddressCode();
-
- @FieldName("G_GEO_UNKNOWN_ADDRESS")
- int getUnknownAddressCode();
-
- @FieldName("G_GEO_UNKNOWN_DIRECTIONS")
- int getUnknownDirectionsCode();
-}