Cherry picking bug fixes from trunk into release branch: 980801, 975801, 992801, 985801 git-svn-id: https://google-web-toolkit.googlecode.com/svn/releases/2.1@9064 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/activity/shared/ActivityManager.java b/user/src/com/google/gwt/activity/shared/ActivityManager.java index 2f044e5..6be2d6d 100644 --- a/user/src/com/google/gwt/activity/shared/ActivityManager.java +++ b/user/src/com/google/gwt/activity/shared/ActivityManager.java
@@ -198,7 +198,7 @@ * setDisplay(null) to get it to deregister from the event bus, so that it can * be garbage collected. * - * @param display + * @param display an instance of AcceptsOneWidget */ public void setDisplay(AcceptsOneWidget display) { boolean wasActive = (null != this.display);
diff --git a/user/src/com/google/gwt/activity/shared/ActivityMapper.java b/user/src/com/google/gwt/activity/shared/ActivityMapper.java index 87a85c9..f9c95a9 100644 --- a/user/src/com/google/gwt/activity/shared/ActivityMapper.java +++ b/user/src/com/google/gwt/activity/shared/ActivityMapper.java
@@ -28,7 +28,7 @@ */ public interface ActivityMapper { /** - * Returns the activity to run for the given {@link Place}, or null. + * Returns the activity to run for the given {@link Place}. * * @param place a Place object */
diff --git a/user/src/com/google/gwt/activity/shared/CachingActivityMapper.java b/user/src/com/google/gwt/activity/shared/CachingActivityMapper.java index a651649..8f0a570 100644 --- a/user/src/com/google/gwt/activity/shared/CachingActivityMapper.java +++ b/user/src/com/google/gwt/activity/shared/CachingActivityMapper.java
@@ -28,6 +28,11 @@ private Place lastPlace; private Activity lastActivity; + /** + * Constructs a CachingActivityMapper object. + * + * @param wrapped an ActivityMapper object + */ public CachingActivityMapper(ActivityMapper wrapped) { this.wrapped = wrapped; }
diff --git a/user/src/com/google/gwt/activity/shared/FilteredActivityMapper.java b/user/src/com/google/gwt/activity/shared/FilteredActivityMapper.java index 16b774c..5833263 100644 --- a/user/src/com/google/gwt/activity/shared/FilteredActivityMapper.java +++ b/user/src/com/google/gwt/activity/shared/FilteredActivityMapper.java
@@ -27,12 +27,24 @@ * Implemented by objects that want to interpret one place as another. */ public interface Filter { + /** + * Returns the filtered interpretation of the given {@link Place}. + * + * @param place the input {@link Place}. + * @return the output {@link Place}. + */ Place filter(Place place); } private final Filter filter; private final ActivityMapper wrapped; + /** + * Constructs a FilteredActivityMapper object. + * + * @param filter a Filter object + * @param wrapped an ActivityMapper object + */ public FilteredActivityMapper(Filter filter, ActivityMapper wrapped) { this.filter = filter; this.wrapped = wrapped;
diff --git a/user/src/com/google/gwt/animation/client/Animation.java b/user/src/com/google/gwt/animation/client/Animation.java index bb3da8b..f4225b2 100644 --- a/user/src/com/google/gwt/animation/client/Animation.java +++ b/user/src/com/google/gwt/animation/client/Animation.java
@@ -198,10 +198,12 @@ /** * Called when the animation should be updated. * - * The value of progress is between 0.0 and 1.0 inclusively (unless you + * The value of progress is between 0.0 and 1.0 (inclusive) (unless you * override the {@link #interpolate(double)} method to provide a wider range * of values). You can override {@link #onStart()} and {@link #onComplete()} * to perform setup and tear down procedures. + * + * @param progress a double, normally between 0.0 and 1.0 (inclusive) */ protected abstract void onUpdate(double progress);
diff --git a/user/src/com/google/gwt/cell/client/DatePickerCell.java b/user/src/com/google/gwt/cell/client/DatePickerCell.java index d8c957b..65ca6ef 100644 --- a/user/src/com/google/gwt/cell/client/DatePickerCell.java +++ b/user/src/com/google/gwt/cell/client/DatePickerCell.java
@@ -37,16 +37,16 @@ /** * A {@link Cell} used to render and edit {@link Date}s. When a cell is selected * by clicking on it, a {@link DatePicker} is popped up. When a date is selected - * using the {@code DatePicker}, the new date is passed to the + * using the {@link DatePicker}, the new date is passed to the * {@link ValueUpdater#update update} method of the {@link ValueUpdater} that * was passed to {@link #onBrowserEvent} for the click event. Note that this - * means that the call to {@code ValueUpdater.update} will occur after {@code - * onBrowserEvent} has returned. Pressing the 'escape' key dismisses the {@code - * DatePicker} popup without calling {@code ValueUpdater.update}. + * means that the call to {@link ValueUpdater#update} will occur after {@link + * #onBrowserEvent} has returned. Pressing the 'escape' key dismisses the {@link + * DatePicker} popup without calling {@link ValueUpdater#update}. * * <p> - * Each {@code DatePickerCell} has a unique {@code DatePicker} popup associated - * with it; thus, if a single {@code DatePickerCell} is used as the cell for a + * Each {@link DatePickerCell} has a unique {@link DatePicker} popup associated + * with it; thus, if a single {@link DatePickerCell} is used as the cell for a * column in a table, only one entry in that column will be editable at a given * time. * </p>
diff --git a/user/src/com/google/gwt/cell/client/HasCell.java b/user/src/com/google/gwt/cell/client/HasCell.java index 01e782a..7afbb3e 100644 --- a/user/src/com/google/gwt/cell/client/HasCell.java +++ b/user/src/com/google/gwt/cell/client/HasCell.java
@@ -27,6 +27,8 @@ /** * Returns the {@link Cell} of type C. + * + * @return a Cell */ Cell<C> getCell();
diff --git a/user/src/com/google/gwt/dom/client/SelectElement.java b/user/src/com/google/gwt/dom/client/SelectElement.java index 0dd4ec9..70d2234 100644 --- a/user/src/com/google/gwt/dom/client/SelectElement.java +++ b/user/src/com/google/gwt/dom/client/SelectElement.java
@@ -139,9 +139,9 @@ }-*/; /** - * The current form control value (i.e. the value of the currently selected - * option), if multiple options are selected this is the value of the first - * selected option. + * The current form control value (i.e., the value of the currently + * selected option), if multiple options are selected this is the value of the + * first selected option. */ public final native String getValue() /*-{ return this.value; @@ -238,9 +238,9 @@ }-*/; /** - * The current form control value (i.e. the value of the currently selected - * option), if multiple options are selected this is the value of the first - * selected option. + * The current form control value (i.e., the value of the currently + * selected option), if multiple options are selected this is the value of the + * first selected option. */ public final native void setValue(String value) /*-{ this.value = value;
diff --git a/user/src/com/google/gwt/editor/rebind/AutoBeanFactoryGenerator.java b/user/src/com/google/gwt/editor/rebind/AutoBeanFactoryGenerator.java index f4698bc..0c0dae5 100644 --- a/user/src/com/google/gwt/editor/rebind/AutoBeanFactoryGenerator.java +++ b/user/src/com/google/gwt/editor/rebind/AutoBeanFactoryGenerator.java
@@ -31,13 +31,14 @@ import com.google.gwt.editor.client.AutoBeanVisitor; import com.google.gwt.editor.client.AutoBeanVisitor.PropertyContext; import com.google.gwt.editor.client.impl.AbstractAutoBean; -import com.google.gwt.editor.client.impl.AbstractAutoBeanFactory; import com.google.gwt.editor.client.impl.AbstractAutoBean.OneShotContext; +import com.google.gwt.editor.client.impl.AbstractAutoBeanFactory; import com.google.gwt.editor.rebind.model.AutoBeanFactoryMethod; import com.google.gwt.editor.rebind.model.AutoBeanFactoryModel; import com.google.gwt.editor.rebind.model.AutoBeanMethod; -import com.google.gwt.editor.rebind.model.AutoBeanType; import com.google.gwt.editor.rebind.model.AutoBeanMethod.Action; +import com.google.gwt.editor.rebind.model.AutoBeanType; +import com.google.gwt.editor.rebind.model.ModelUtils; import com.google.gwt.user.rebind.ClassSourceFileComposerFactory; import com.google.gwt.user.rebind.SourceWriter; @@ -91,8 +92,8 @@ StringBuilder parameters = new StringBuilder(); for (JParameter param : jmethod.getParameters()) { parameters.append(",").append( - AutoBeanFactoryModel.ensureBaseType(param.getType()).getQualifiedSourceName()).append( - " ").append(param.getName()); + ModelUtils.getQualifiedBaseName(param.getType())).append(" ").append( + param.getName()); } if (parameters.length() > 0) { parameters = parameters.deleteCharAt(0); @@ -102,13 +103,12 @@ if (jmethod.getThrows().length > 0) { for (JType thrown : jmethod.getThrows()) { throwsDeclaration.append(". ").append( - AutoBeanFactoryModel.ensureBaseType(thrown).getQualifiedSourceName()); + ModelUtils.getQualifiedBaseName(thrown)); } throwsDeclaration.deleteCharAt(0); throwsDeclaration.insert(0, "throws "); } - String returnName = AutoBeanFactoryModel.ensureBaseType( - jmethod.getReturnType()).getQualifiedSourceName(); + String returnName = ModelUtils.getQualifiedBaseName(jmethod.getReturnType()); assert !returnName.contains("extends"); return String.format("%s %s(%s) %s", returnName, jmethod.getName(), parameters, throwsDeclaration); @@ -225,9 +225,8 @@ sw.println("}"); } else { // return (ReturnType) values.get(\"foo\"); - sw.println( - "return (%s) values.get(\"%s\");", - AutoBeanFactoryModel.ensureBaseType(jmethod.getReturnType()).getQualifiedSourceName(), + sw.println("return (%s) values.get(\"%s\");", + ModelUtils.getQualifiedBaseName(jmethod.getReturnType()), method.getPropertyName()); } } @@ -411,7 +410,7 @@ // Foo toReturn=FooAutoBean.this.get("getFoo", getWrapped().getFoo()); sw.println( "%s toReturn = %3$s.this.get(\"%2$s\", getWrapped().%2$s());", - AutoBeanFactoryModel.ensureBaseType(jmethod.getReturnType()).getQualifiedSourceName(), + ModelUtils.getQualifiedBaseName(jmethod.getReturnType()), methodName, type.getSimpleSourceName()); // Non-value types might need to be wrapped @@ -442,7 +441,7 @@ // Type toReturn = getWrapped().doFoo(params); sw.println( "%s toReturn = %s.this.getWrapped().%s(%s);", - AutoBeanFactoryModel.ensureBaseType(jmethod.getReturnType()).getQualifiedSourceName(), + ModelUtils.ensureBaseType(jmethod.getReturnType()).getQualifiedSourceName(), type.getSimpleSourceName(), methodName, arguments); // Non-value types might need to be wrapped writeReturnWrapper(sw, type, method);
diff --git a/user/src/com/google/gwt/editor/rebind/model/AutoBeanFactoryModel.java b/user/src/com/google/gwt/editor/rebind/model/AutoBeanFactoryModel.java index 8fac3b2..c8d6646 100644 --- a/user/src/com/google/gwt/editor/rebind/model/AutoBeanFactoryModel.java +++ b/user/src/com/google/gwt/editor/rebind/model/AutoBeanFactoryModel.java
@@ -17,7 +17,6 @@ import com.google.gwt.core.ext.TreeLogger; import com.google.gwt.core.ext.UnableToCompleteException; -import com.google.gwt.core.ext.typeinfo.JArrayType; import com.google.gwt.core.ext.typeinfo.JClassType; import com.google.gwt.core.ext.typeinfo.JGenericType; import com.google.gwt.core.ext.typeinfo.JMethod; @@ -47,28 +46,6 @@ public class AutoBeanFactoryModel { private static final JType[] EMPTY_JTYPE = new JType[0]; - @SuppressWarnings("unchecked") - public static <T extends JType> T ensureBaseType(T maybeParameterized) { - if (maybeParameterized.isArray() != null) { - JArrayType array = maybeParameterized.isArray(); - return (T) array.getOracle().getArrayType( - ensureBaseType(array.getComponentType())); - } - if (maybeParameterized.isTypeParameter() != null) { - return (T) maybeParameterized.isTypeParameter().getBaseType(); - } - if (maybeParameterized.isParameterized() != null) { - return (T) maybeParameterized.isParameterized().getBaseType(); - } - if (maybeParameterized.isRawType() != null) { - return (T) maybeParameterized.isRawType().getBaseType(); - } - if (maybeParameterized.isWildcard() != null) { - return (T) maybeParameterized.isWildcard().getBaseType(); - } - return maybeParameterized; - } - private final JGenericType autoBeanInterface; private final JClassType autoBeanFactoryInterface; private final List<JClassType> categoryTypes; @@ -212,7 +189,7 @@ } public AutoBeanType getPeer(JClassType beanType) { - beanType = ensureBaseType(beanType); + beanType = ModelUtils.ensureBaseType(beanType); return peers.get(beanType); } @@ -377,7 +354,7 @@ } private AutoBeanType getAutoBeanType(JClassType beanType) { - beanType = ensureBaseType(beanType); + beanType = ModelUtils.ensureBaseType(beanType); AutoBeanType toReturn = peers.get(beanType); if (toReturn == null) { AutoBeanType.Builder builder = new AutoBeanType.Builder(); @@ -413,7 +390,7 @@ // Check using base types to account for erasure semantics JParameterizedType expectedFirst = oracle.getParameterizedType( - autoBeanInterface, new JClassType[] {ensureBaseType(beanType)}); + autoBeanInterface, new JClassType[] {ModelUtils.ensureBaseType(beanType)}); return expectedFirst.isAssignableTo(paramAsClass); }
diff --git a/user/src/com/google/gwt/editor/rebind/model/ModelUtils.java b/user/src/com/google/gwt/editor/rebind/model/ModelUtils.java index 22b22d3..1a2c815 100644 --- a/user/src/com/google/gwt/editor/rebind/model/ModelUtils.java +++ b/user/src/com/google/gwt/editor/rebind/model/ModelUtils.java
@@ -15,6 +15,7 @@ */ package com.google.gwt.editor.rebind.model; +import com.google.gwt.core.ext.typeinfo.JArrayType; import com.google.gwt.core.ext.typeinfo.JClassType; import com.google.gwt.core.ext.typeinfo.JParameterizedType; import com.google.gwt.core.ext.typeinfo.JType; @@ -53,7 +54,28 @@ AUTOBOX_MAP = Collections.unmodifiableMap(autoBoxMap); } - + @SuppressWarnings("unchecked") + public static <T extends JType> T ensureBaseType(T maybeParameterized) { + if (maybeParameterized.isArray() != null) { + JArrayType array = maybeParameterized.isArray(); + return (T) array.getOracle().getArrayType( + ensureBaseType(array.getComponentType())); + } + if (maybeParameterized.isTypeParameter() != null) { + return (T) maybeParameterized.isTypeParameter().getBaseType(); + } + if (maybeParameterized.isParameterized() != null) { + return (T) maybeParameterized.isParameterized().getBaseType(); + } + if (maybeParameterized.isRawType() != null) { + return (T) maybeParameterized.isRawType().getBaseType(); + } + if (maybeParameterized.isWildcard() != null) { + return (T) maybeParameterized.isWildcard().getBaseType(); + } + return maybeParameterized; + } + public static JClassType[] findParameterizationOf(JClassType intfType, JClassType subType) { assert intfType.isAssignableFrom(subType) : subType.getParameterizedQualifiedSourceName() @@ -72,6 +94,15 @@ return null; } + /** + * Given a JType, return the source name of the class that is most proximately + * assignable to the type. This method will resolve type parameters as well as + * wildcard types. + */ + public static String getQualifiedBaseName(JType type) { + return ensureBaseType(type).getErasedType().getQualifiedSourceName(); + } + public static boolean isValueType(TypeOracle oracle, JType type) { JClassType classType = type.isClassOrInterface(); if (classType == null) {
diff --git a/user/src/com/google/gwt/requestfactory/rebind/RequestFactoryGenerator.java b/user/src/com/google/gwt/requestfactory/rebind/RequestFactoryGenerator.java index bb26a22..53aaeed 100644 --- a/user/src/com/google/gwt/requestfactory/rebind/RequestFactoryGenerator.java +++ b/user/src/com/google/gwt/requestfactory/rebind/RequestFactoryGenerator.java
@@ -23,11 +23,13 @@ import com.google.gwt.core.ext.typeinfo.JClassType; import com.google.gwt.core.ext.typeinfo.JMethod; import com.google.gwt.core.ext.typeinfo.JParameter; +import com.google.gwt.core.ext.typeinfo.JTypeParameter; import com.google.gwt.core.ext.typeinfo.TypeOracle; import com.google.gwt.editor.client.AutoBean; import com.google.gwt.editor.client.AutoBeanFactory; import com.google.gwt.editor.client.AutoBeanFactory.Category; import com.google.gwt.editor.client.AutoBeanFactory.NoWrap; +import com.google.gwt.editor.rebind.model.ModelUtils; import com.google.gwt.requestfactory.client.impl.AbstractRequest; import com.google.gwt.requestfactory.client.impl.AbstractRequestContext; import com.google.gwt.requestfactory.client.impl.AbstractRequestFactory; @@ -158,11 +160,17 @@ StringBuilder parameterArray = new StringBuilder(); // final Foo foo, final Bar bar, final Baz baz StringBuilder parameterDeclaration = new StringBuilder(); + // <P extends Blah> + StringBuilder typeParameterDeclaration = new StringBuilder(); if (request.isInstance()) { // Leave a spot for the using() method to fill in later parameterArray.append(",null"); } + for (JTypeParameter param : jmethod.getTypeParameters()) { + typeParameterDeclaration.append(",").append( + param.getQualifiedSourceName()); + } for (JParameter param : jmethod.getParameters()) { parameterArray.append(",").append(param.getName()); parameterDeclaration.append(",final ").append( @@ -175,15 +183,17 @@ if (parameterDeclaration.length() > 0) { parameterDeclaration.deleteCharAt(0); } + if (typeParameterDeclaration.length() > 0) { + typeParameterDeclaration.deleteCharAt(0).insert(0, "<").append(">"); + } // public Request<Foo> doFoo(final Foo foo) { - sw.println("public %s %s(%s) {", + sw.println("public %s %s %s(%s) {", typeParameterDeclaration, jmethod.getReturnType().getParameterizedQualifiedSourceName(), jmethod.getName(), parameterDeclaration); sw.indent(); - // Have to cover the old Request sub-interfaces - // TODO: ProxyListRequest et al. be removed? - // class X extends AbstractRequest<Return> implements ReturnType { + // The implements clause covers InstanceRequest + // class X extends AbstractRequest<Return> implements Request<Return> { sw.println("class X extends %s<%s> implements %s {", AbstractRequest.class.getCanonicalName(), request.getDataType().getParameterizedQualifiedSourceName(), @@ -221,16 +231,19 @@ // decodeReturnObjectList(FooEntityProxy.class,obj, (List)decoded); String decodeMethod = request.isValueType() ? "decodeReturnValueList" : "decodeReturnObjectList"; - sw.println("%s(%s.class, obj, (%s)decoded);", decodeMethod, - request.getCollectionElementType().getQualifiedSourceName(), + sw.println( + "%s(%s.class, obj, (%s)decoded);", + decodeMethod, + ModelUtils.getQualifiedBaseName(request.getCollectionElementType()), collectionType.getCanonicalName()); } else if (request.isValueType()) { // decoded = ValueCodex.cFString(Integer.class, String.valueOf(obj)); sw.println( "decoded = %s.convertFromString(%s.class, String.valueOf(obj));", ValueCodex.class.getCanonicalName(), - request.getDataType().getQualifiedSourceName()); + ModelUtils.getQualifiedBaseName(request.getDataType())); } else if (request.isEntityType()) { + // Implicitly erased sw.println("decoded = decodeReturnObject(%s.class, obj);", request.getEntityType().getQualifiedSourceName()); } else {
diff --git a/user/src/com/google/gwt/requestfactory/rebind/model/ContextMethod.java b/user/src/com/google/gwt/requestfactory/rebind/model/ContextMethod.java index ba674df..be744e4 100644 --- a/user/src/com/google/gwt/requestfactory/rebind/model/ContextMethod.java +++ b/user/src/com/google/gwt/requestfactory/rebind/model/ContextMethod.java
@@ -69,7 +69,7 @@ } /** - * The qualified source name of the RequestContext sub-interface (i.e. the + * The qualified source name of the RequestContext sub-interface (i.e., the * return type of the method declaration). */ public String getImplementedInterfaceQualifiedSourceName() {
diff --git a/user/src/com/google/gwt/requestfactory/rebind/model/EntityProxyModel.java b/user/src/com/google/gwt/requestfactory/rebind/model/EntityProxyModel.java index 418448a..52989d1 100644 --- a/user/src/com/google/gwt/requestfactory/rebind/model/EntityProxyModel.java +++ b/user/src/com/google/gwt/requestfactory/rebind/model/EntityProxyModel.java
@@ -49,6 +49,7 @@ } public void setQualifiedSourceName(String name) { + assert !name.contains(" "); toReturn.qualifiedSourceName = name; }
diff --git a/user/src/com/google/gwt/requestfactory/rebind/model/RequestFactoryModel.java b/user/src/com/google/gwt/requestfactory/rebind/model/RequestFactoryModel.java index da5607f..3ecc1f5 100644 --- a/user/src/com/google/gwt/requestfactory/rebind/model/RequestFactoryModel.java +++ b/user/src/com/google/gwt/requestfactory/rebind/model/RequestFactoryModel.java
@@ -164,8 +164,8 @@ contextType.getQualifiedSourceName(), Service.class.getSimpleName()); return; } - Class<?> serviceClass = serviceAnnotation.value(); - contextBuilder.setServiceClass(serviceClass); + Class<?> serviceClass = serviceAnnotation.value(); + contextBuilder.setServiceClass(serviceClass); List<RequestMethod> requestMethods = new ArrayList<RequestMethod>(); for (JMethod method : contextType.getInheritableMethods()) { @@ -177,7 +177,8 @@ RequestMethod.Builder methodBuilder = new RequestMethod.Builder(); methodBuilder.setDeclarationMethod(method); - if (!validateContextMethodAndSetDataType(methodBuilder, method, serviceClass)) { + if (!validateContextMethodAndSetDataType(methodBuilder, method, + serviceClass)) { continue; } @@ -208,6 +209,7 @@ private EntityProxyModel getEntityProxyType(JClassType entityProxyType) throws UnableToCompleteException { + entityProxyType = ModelUtils.ensureBaseType(entityProxyType); EntityProxyModel toReturn = peers.get(entityProxyType); if (toReturn == null) { EntityProxyModel.Builder inProgress = peerBuilders.get(entityProxyType); @@ -219,7 +221,7 @@ EntityProxyModel.Builder builder = new EntityProxyModel.Builder(); peerBuilders.put(entityProxyType, builder); - builder.setQualifiedSourceName(entityProxyType.getQualifiedSourceName()); + builder.setQualifiedSourceName(ModelUtils.getQualifiedBaseName(entityProxyType)); // Get the server domain object type ProxyFor proxyFor = entityProxyType.getAnnotation(ProxyFor.class); @@ -301,7 +303,7 @@ * Examine a RequestContext method to see if it returns a transportable type. */ private boolean validateContextMethodAndSetDataType( - RequestMethod.Builder methodBuilder, JMethod method, Class<?> serviceClass) + RequestMethod.Builder methodBuilder, JMethod method, Class<?> serviceClass) throws UnableToCompleteException { JClassType requestReturnType = method.getReturnType().isInterface(); JClassType invocationReturnType; @@ -313,12 +315,11 @@ } /* - * TODO: bad assumption - * Implicit assumption is that the Service and ProxyFor + * TODO: bad assumption Implicit assumption is that the Service and ProxyFor * classes are the same. This is because an instance method should - * technically be looked up on the class that is the instance parameter, - * and not on the serviceClass, which consists of static service methods. - * Can't be fixed until it is fixed in JsonRequestProcessor. + * technically be looked up on the class that is the instance parameter, and + * not on the serviceClass, which consists of static service methods. Can't + * be fixed until it is fixed in JsonRequestProcessor. */ Method domainMethod = validateExistsAndNotOverriden(method, serviceClass, false); @@ -331,8 +332,7 @@ if (isStatic(domainMethod)) { poison("Method %s.%s is an instance method, " + "while the corresponding method on %s is static", - method.getEnclosingType().getName(), - method.getName(), + method.getEnclosingType().getName(), method.getName(), serviceClass.getName()); return false; } @@ -345,8 +345,7 @@ if (!isStatic(domainMethod)) { poison("Method %s.%s is a static method, " + "while the corresponding method on %s is not", - method.getEnclosingType().getName(), - method.getName(), + method.getEnclosingType().getName(), method.getName(), serviceClass.getName()); return false; } @@ -368,8 +367,7 @@ Class<?>[] domainParams = domainMethod.getParameterTypes(); if (params.length != domainParams.length) { poison("Method %s.%s parameters do not match same method on %s", - method.getEnclosingType().getName(), - method.getName(), + method.getEnclosingType().getName(), method.getName(), serviceClass.getName()); } for (int i = 0; i < params.length; ++i) { @@ -378,16 +376,14 @@ paramsOk = validateTransportableType(new RequestMethod.Builder(), param.getType(), false) && paramsOk; - paramsOk = validateProxyAndDomainTypeEquals(param.getType(), domainParam, i, - methodLocation(method), methodLocation(domainMethod)) - && paramsOk; + paramsOk = validateProxyAndDomainTypeEquals(param.getType(), domainParam, + i, methodLocation(method), methodLocation(domainMethod)) && paramsOk; } return validateTransportableType(methodBuilder, invocationReturnType, true) && validateProxyAndDomainTypeEquals(invocationReturnType, - domainMethod.getReturnType(), -1, methodLocation(method), - methodLocation(domainMethod)) - && paramsOk; + domainMethod.getReturnType(), -1, methodLocation(method), + methodLocation(domainMethod)) && paramsOk; } /** @@ -398,8 +394,8 @@ JMethod proxyMethod = requestMethod.getDeclarationMethod(); // check if method exists on domain object Class<?> domainType = entityBuilder.peek().getProxyFor(); - Method domainMethod = validateExistsAndNotOverriden(proxyMethod, domainType, - true); + Method domainMethod = validateExistsAndNotOverriden(proxyMethod, + domainType, true); if (domainMethod == null) { return false; } @@ -409,27 +405,24 @@ // compare return type of domain to proxy return type String returnTypeName = domainMethod.getReturnType().getName(); // isEntityType() returns true for collections, but we want the Collection - String propertyTypeName = - requestMethod.isCollectionType() || requestMethod.isValueType() ? - requestMethod.getDataType().getQualifiedBinaryName() : - requestMethod.getEntityType().getProxyFor().getName(); + String propertyTypeName = requestMethod.isCollectionType() + || requestMethod.isValueType() + ? requestMethod.getDataType().getQualifiedBinaryName() + : requestMethod.getEntityType().getProxyFor().getName(); if (!returnTypeName.equals(propertyTypeName)) { - poison("Method %s.%s return type %s does not match return type %s " - + " of method %s.%s", domainType.getName(), - domainMethod.getName(), returnTypeName, - propertyTypeName, - proxyMethod.getEnclosingType().getName(), proxyMethod.getName()); + poison("Method %s.%s return type %s does not match return type %s " + + " of method %s.%s", domainType.getName(), domainMethod.getName(), + returnTypeName, propertyTypeName, + proxyMethod.getEnclosingType().getName(), proxyMethod.getName()); return false; } } JParameter[] proxyParams = proxyMethod.getParameters(); Class<?>[] domainParams = domainMethod.getParameterTypes(); if (proxyParams.length != domainParams.length) { - poison("Method %s.%s parameter mismatch with %s.%s", - proxyMethod.getEnclosingType().getName(), - proxyMethod.getName(), - domainType.getName(), - domainMethod.getName()); + poison("Method %s.%s parameter mismatch with %s.%s", + proxyMethod.getEnclosingType().getName(), proxyMethod.getName(), + domainType.getName(), domainMethod.getName()); return false; } for (int i = 0; i < proxyParams.length; i++) { @@ -437,11 +430,9 @@ Class<?> domainParam = domainParams[i]; if (!validateProxyAndDomainTypeEquals(proxyParam, domainParam, i, methodLocation(proxyMethod), methodLocation(domainMethod))) { - poison("Parameter %d of %s.%s doesn't match method %s.%s", - i, proxyMethod.getEnclosingType().getName(), - proxyMethod.getName(), - domainType.getName(), - domainMethod.getName()); + poison("Parameter %d of %s.%s doesn't match method %s.%s", i, + proxyMethod.getEnclosingType().getName(), proxyMethod.getName(), + domainType.getName(), domainMethod.getName()); return false; } } @@ -453,16 +444,17 @@ */ private boolean validateDomainType(Class<?> domainType) { try { - domainType.getMethod("getId"); + domainType.getMethod("getId"); } catch (NoSuchMethodException e) { - poison("The class %s is missing method getId()", domainType.getName()); - return false; + poison("The class %s is missing method getId()", domainType.getName()); + return false; } try { - domainType.getMethod("getVersion"); + domainType.getMethod("getVersion"); } catch (NoSuchMethodException e) { - poison("The class %s is missing method getVersion()", domainType.getName()); - return false; + poison("The class %s is missing method getVersion()", + domainType.getName()); + return false; } return true; } @@ -503,18 +495,18 @@ // allow int to match int or Integer matchOk = proxyType.getQualifiedSourceName().equals( ModelUtils.maybeAutobox(domainType).getName()) - || proxyType.getQualifiedSourceName().equals(domainType.getName()); + || proxyType.getQualifiedSourceName().equals(domainType.getName()); } else { - matchOk = getEntityProxyType( - proxyType.isClassOrInterface()).getProxyFor().equals(domainType); + matchOk = getEntityProxyType(proxyType.isClassOrInterface()).getProxyFor().equals( + domainType); } if (!matchOk) { if (paramNumber < 0) { - poison("Return type of method %s does not match method %s", clientMethod, - serverMethod); + poison("Return type of method %s does not match method %s", + clientMethod, serverMethod); } else { - poison("Parameter %d of method %s does not match method %s", - paramNumber, clientMethod, serverMethod); + poison("Parameter %d of method %s does not match method %s", + paramNumber, clientMethod, serverMethod); } } return matchOk;
diff --git a/user/src/com/google/gwt/requestfactory/server/RequestFactoryServlet.java b/user/src/com/google/gwt/requestfactory/server/RequestFactoryServlet.java index cb48321..cdf9ef3 100644 --- a/user/src/com/google/gwt/requestfactory/server/RequestFactoryServlet.java +++ b/user/src/com/google/gwt/requestfactory/server/RequestFactoryServlet.java
@@ -117,8 +117,7 @@ requestProcessor.setOperationRegistry(new ReflectionBasedOperationRegistry( new DefaultSecurityProvider())); requestProcessor.setExceptionHandler(exceptionHandler); - response.setHeader("Content-Type", - RequestFactory.JSON_CONTENT_TYPE_UTF8); + response.setContentType(RequestFactory.JSON_CONTENT_TYPE_UTF8); writer.print(requestProcessor.decodeAndInvokeRequest(jsonRequestString)); writer.flush(); }
diff --git a/user/src/com/google/gwt/safehtml/client/SafeHtmlTemplates.java b/user/src/com/google/gwt/safehtml/client/SafeHtmlTemplates.java index 7b969a9..3046049 100644 --- a/user/src/com/google/gwt/safehtml/client/SafeHtmlTemplates.java +++ b/user/src/com/google/gwt/safehtml/client/SafeHtmlTemplates.java
@@ -28,11 +28,13 @@ * <p>Example usage: * <pre> * public interface MyTemplate extends SafeHtmlTemplates { - * @Template("<span class=\"{3}\">{0}: <a href=\"{1}\">{2}</a></span>") + * @Template("<span class=\"{3}\">{0}: <a href=\"{1}\">{2}</a></span>") * SafeHtml messageWithLink(SafeHtml message, String url, String linkText, * String style); * } + * * private static final MyTemplate TEMPLATE = GWT.create(MyTemplate.class); + * * public void useTemplate(...) { * SafeHtml message; * String url; @@ -44,12 +46,12 @@ * } * </pre> * - * Instantiating a SafeHtmlTemplates interface with GWT.create() returns an - * instance of an implementation that is generated at compile time. The code - * generator parses the value of each template method's @Template annotation as - * a (X)HTML template, with template variables denoted by curly-brace - * placeholders that refer by index to the corresponding template method - * parameter. + * Instantiating a SafeHtmlTemplates interface with {@code GWT.create()} returns + * an instance of an implementation that is generated at compile time. The code + * generator parses the value of each template method's {@code @Template} + * annotation as a (X)HTML template, with template variables denoted by + * curly-brace placeholders that refer by index to the corresponding template + * method parameter. */ public interface SafeHtmlTemplates {
diff --git a/user/src/com/google/gwt/safehtml/client/package.html b/user/src/com/google/gwt/safehtml/client/package.html new file mode 100644 index 0000000..3163def --- /dev/null +++ b/user/src/com/google/gwt/safehtml/client/package.html
@@ -0,0 +1,7 @@ +<html> +<body> +Contains interfaces for creating safe HTML content using templates. + +@since GWT 2.1 +</body> +</html>
diff --git a/user/src/com/google/gwt/safehtml/shared/OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml.java b/user/src/com/google/gwt/safehtml/shared/OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml.java index 4d7a03d..a32ad27 100644 --- a/user/src/com/google/gwt/safehtml/shared/OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml.java +++ b/user/src/com/google/gwt/safehtml/shared/OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml.java
@@ -27,6 +27,11 @@ implements SafeHtml { private String html; + /** + * Constructs an instance from a given HTML String. + * + * @param html an HTML String that is assumed to be safe + */ public OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml(String html) { if (html == null) { throw new NullPointerException("html is null");
diff --git a/user/src/com/google/gwt/safehtml/shared/SafeHtml.java b/user/src/com/google/gwt/safehtml/shared/SafeHtml.java index 9226b32..700f2bd 100644 --- a/user/src/com/google/gwt/safehtml/shared/SafeHtml.java +++ b/user/src/com/google/gwt/safehtml/shared/SafeHtml.java
@@ -45,11 +45,11 @@ * requirement implies that for any value {@code A} of this type, if {@code * A.asString()} includes HTML markup, the string must end in an "inner HTML" * context and not inside a tag or attribute. For example, a value of {@code - * <div style="} or {@code <img src="} would not satisfy the SafeHtml contract. + * <div style="} or {@code <img src="} would not satisfy the SafeHtml contract. * This is because concatenating such strings with a second value that itself * does not contain script-executing HTML markup can result in an overall string - * that does. For example, if {@code javascript:malicious()">} is appended to - * {@code <img src="}, the resulting string may result in script execution. + * that does. For example, if {@code javascript:malicious()">} is appended to + * {@code <img src="}, the resulting string may result in script execution. * * <p> * All implementations must implement equals() and hashCode() to behave @@ -82,12 +82,16 @@ * <p> * Based on this class' contract, the returned value will be non-null and a * string that is safe to use in an HTML context. + * + * @return the contents as a String */ String asString(); /** * Compares this string to the specified object. * Must be equal to asString().equals(). + * + * @param anObject the object to compare to */ boolean equals(Object anObject);
diff --git a/user/src/com/google/gwt/safehtml/shared/SafeHtmlBuilder.java b/user/src/com/google/gwt/safehtml/shared/SafeHtmlBuilder.java index f2e8a2c..9a26ed9 100644 --- a/user/src/com/google/gwt/safehtml/shared/SafeHtmlBuilder.java +++ b/user/src/com/google/gwt/safehtml/shared/SafeHtmlBuilder.java
@@ -180,10 +180,10 @@ * * <li>The value of the argument must end in "inner HTML" context and not * contain incomplete HTML tags. I.e., the following is not a correct use of - * this method, because the {@code <a>} tag is incomplete: + * this method, because the {@code <a>} tag is incomplete: * * <pre class="code"> - * {@code shb.appendConstantHtml("<a href='").append(url)}</pre> + * {@code shb.appendConstantHtml("<a href='").append(url)}</pre> * * </ol> * @@ -214,6 +214,8 @@ /** * Returns the safe HTML accumulated in the builder as a {@link SafeHtml}. + * + * @return a SafeHtml instance */ public SafeHtml toSafeHtml() { return new SafeHtmlString(sb.toString());
diff --git a/user/src/com/google/gwt/safehtml/shared/SafeHtmlHostedModeUtils.java b/user/src/com/google/gwt/safehtml/shared/SafeHtmlHostedModeUtils.java index 14d2eb6..08cbd27 100644 --- a/user/src/com/google/gwt/safehtml/shared/SafeHtmlHostedModeUtils.java +++ b/user/src/com/google/gwt/safehtml/shared/SafeHtmlHostedModeUtils.java
@@ -16,7 +16,6 @@ package com.google.gwt.safehtml.shared; import com.google.gwt.core.client.GWT; -import com.google.gwt.thirdparty.guava.common.annotations.VisibleForTesting; import com.google.gwt.thirdparty.guava.common.base.Preconditions; import com.google.gwt.thirdparty.streamhtmlparser.HtmlParser; import com.google.gwt.thirdparty.streamhtmlparser.HtmlParserFactory; @@ -30,6 +29,9 @@ */ public class SafeHtmlHostedModeUtils { + /** + * If true, perform checks in server-side code. + */ public static final String FORCE_CHECK_COMPLETE_HTML = "com.google.gwt.safehtml.ForceCheckCompleteHtml"; @@ -46,23 +48,23 @@ * <p> * This method parses the provided string as HTML and determines the HTML * context at the end of the string. If the context is not "inner HTML text", - * a {@link IllegalArgumentException} or {@link AssertionError} is thrown. + * an {@link IllegalArgumentException} or {@link AssertionError} is thrown. * * <p> * For example, this check will pass for the following strings: * * <pre>{@code - * <foo>blah - * baz<em>foo</em> <x a="b">hello + * <foo>blah + * baz<em>foo</em> <x a="b">hello * }</pre> * * <p> * The check will fail for the following strings: * * <pre>{@code - * baz<em>foo</em> <x - * baz<em>foo</em> <x a="b - * baz<em>foo</em> <x a="b" + * baz<em>foo</em> <x + * baz<em>foo</em> <x a="b + * baz<em>foo</em> <x a="b" * }</pre> * * <p> @@ -105,12 +107,25 @@ * Sets a global flag that controls whether or not * {@link #maybeCheckCompleteHtml(String)} should perform its check in a * server-side environment. + * + * @param check if true, perform server-side checks. */ public static void setForceCheckCompleteHtml(boolean check) { forceCheckCompleteHtml = check; } - @VisibleForTesting + /** + * Sets a global flag that controls whether or not + * {@link #maybeCheckCompleteHtml(String)} should perform its check in a + * server-side environment from the value of the {@value + * FORCE_CHECK_COMPLETE_HTML} property. + */ + // The following annotation causes javadoc to crash on Mac OS X 10.5.8, + // using java 1.5.0_24. + // + // See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6442982 + // + // @VisibleForTesting public static void setForceCheckCompleteHtmlFromProperty() { forceCheckCompleteHtml = System.getProperty(FORCE_CHECK_COMPLETE_HTML) != null;
diff --git a/user/src/com/google/gwt/safehtml/shared/SafeHtmlUtils.java b/user/src/com/google/gwt/safehtml/shared/SafeHtmlUtils.java index ddede90..1febb8a 100644 --- a/user/src/com/google/gwt/safehtml/shared/SafeHtmlUtils.java +++ b/user/src/com/google/gwt/safehtml/shared/SafeHtmlUtils.java
@@ -25,6 +25,9 @@ private static final String HTML_ENTITY_REGEX = "[a-z]+|#[0-9]+|#x[0-9a-fA-F]+"; + /** + * An empty String. + */ public static final SafeHtml EMPTY_SAFE_HTML = new SafeHtmlString(""); private static final RegExp AMP_RE = RegExp.compile("&", "g"); @@ -34,8 +37,8 @@ private static final RegExp QUOT_RE = RegExp.compile("\"", "g"); /** - * Returns a SafeHtml constructed from a safe string, i.e. without escaping - * the string. + * Returns a SafeHtml constructed from a safe string, i.e., without + * escaping the string. * * <p> * <b>Important</b>: For this method to be able to honor the {@link SafeHtml} @@ -47,10 +50,10 @@ * * <li>The value of the argument must end in "inner HTML" context and not * contain incomplete HTML tags. I.e., the following is not a correct use of - * this method, because the {@code <a>} tag is incomplete: + * this method, because the {@code <a>} tag is incomplete: * * <pre class="code"> - * {@code shb.appendConstantHtml("<a href='").append(url)}</pre> + * {@code shb.appendConstantHtml("<a href='").append(url)}</pre> * * </ol> * @@ -78,16 +81,22 @@ } /** - * Returns a SafeHtml containing the escaped string. + * Returns a {@link SafeHtml} containing the escaped string. + * + * @param s the input String + * @return a SafeHtml instance */ public static SafeHtml fromString(String s) { return new SafeHtmlString(htmlEscape(s)); } /** - * Returns a SafeHtml constructed from a trusted string, i.e. without escaping - * the string. No checks are performed. The calling code should be carefully - * reviewed to ensure the argument meets the SafeHtml contract. + * Returns a {@link SafeHtml} constructed from a trusted string, i.e., without + * escaping the string. No checks are performed. The calling code should be + * carefully reviewed to ensure the argument meets the SafeHtml contract. + * + * @param s the input String + * @return a SafeHtml instance */ public static SafeHtml fromTrustedString(String s) { return new SafeHtmlString(s); @@ -96,7 +105,7 @@ /** * HTML-escapes a string. * - * Note: The following variants of this function were profiled on FF36, + * Note: The following variants of this function were profiled on FF36, * Chrome6, IE8: * #1) for each case, check indexOf, then use s.replace(regex, string) * #2) for each case, check indexOf, then use s.replaceAll()
diff --git a/user/src/com/google/gwt/safehtml/shared/SimpleHtmlSanitizer.java b/user/src/com/google/gwt/safehtml/shared/SimpleHtmlSanitizer.java index 101d032..6a9a123 100644 --- a/user/src/com/google/gwt/safehtml/shared/SimpleHtmlSanitizer.java +++ b/user/src/com/google/gwt/safehtml/shared/SimpleHtmlSanitizer.java
@@ -15,8 +15,6 @@ */ package com.google.gwt.safehtml.shared; -import com.google.gwt.regexp.shared.RegExp; - import java.util.Arrays; import java.util.HashSet; import java.util.Set; @@ -25,11 +23,20 @@ * A simple and relatively inexpensive HTML sanitizer. * * <p> - * This sanitizer accepts the subset of HTML consisting of attribute-free tags - * in a whitelist (including {@code <b>, <em>, <i>}, etc; for the exact list - * consult the source), as well as numeric HTML entities and HTML entity - * references. Any HTML metacharacters that do not appear as part of markup in - * this subset will be HTML-escaped. + * This sanitizer accepts the subset of HTML consisting of the following + * attribute-free tags: + * + * <ul> + * <li>{@code <b>}, {@code <em>}, {@code <i>}</li> + * <li>{@code <h1>}, {@code <h2>}, {@code <h3>}, + * {@code <h4>}, {@code <h5>}, {@code <h6>}</li> + * <li>{@code <ul>}, {@code <ol>}. {@code <li>}</li> + * <li>{@code <hr>}</li> + * </ul> + * + * as well as numeric HTML entities and HTML entity references. Any HTML + * metacharacters that do not appear as part of markup in this subset will be + * HTML-escaped. */ public final class SimpleHtmlSanitizer implements HtmlSanitizer { @@ -38,9 +45,12 @@ private static final Set<String> TAG_WHITELIST = new HashSet<String>( Arrays.asList("b", "em", "i", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "ul", "ol", "li")); - - private static final RegExp LT_RE = RegExp.compile("<", "g"); + /** + * Return a singleton SimpleHtmlSanitizer instance. + * + * @return the instance + */ public static SimpleHtmlSanitizer getInstance() { return INSTANCE; } @@ -53,6 +63,9 @@ * the string is guaranteed to be safe to use (with respect to XSS * vulnerabilities) in HTML contexts, and is returned as an instance of the * {@link SafeHtml} type. + * + * @param html the input String + * @return a sanitized SafeHtml instance */ public static SafeHtml sanitizeHtml(String html) { if (html == null) { @@ -83,7 +96,7 @@ if (firstSegment) { /* * the first segment is never part of a valid tag; note that if the - * input string starts with a tag, we will get an empty segment at the + * input string starts with a tag, we will get an empty segment at the * beginning. */ firstSegment = false; @@ -137,8 +150,8 @@ * construction of SafeHtml objects that are not stable in the sense that for * a {@code SafeHtml s} it may not be true that {@code s.asString()} equals * {@code SimpleHtmlSanitizer.sanitizeHtml(s.asString()).asString()}. While - * this is not currently an issue, it might become one and result in - * unexpected behavior if this class were to become serializable and enforce + * this is not currently an issue, it might become one and result in + * unexpected behavior if this class were to become serializable and enforce * its class invariant upon deserialization. */
diff --git a/user/src/com/google/gwt/safehtml/shared/UriUtils.java b/user/src/com/google/gwt/safehtml/shared/UriUtils.java index f477d04..c177518 100644 --- a/user/src/com/google/gwt/safehtml/shared/UriUtils.java +++ b/user/src/com/google/gwt/safehtml/shared/UriUtils.java
@@ -89,7 +89,8 @@ * of a URI-valued HTML attribute according to {@link #isSafeUri}, or the URI * "{@code #}" otherwise. * - * @param uri the URI to sanitize. + * @param uri the URI to sanitize + * @return a sanitized String */ public static String sanitizeUri(String uri) { if (isSafeUri(uri)) {
diff --git a/user/src/com/google/gwt/safehtml/shared/package.html b/user/src/com/google/gwt/safehtml/shared/package.html new file mode 100644 index 0000000..4286e34 --- /dev/null +++ b/user/src/com/google/gwt/safehtml/shared/package.html
@@ -0,0 +1,7 @@ +<html> +<body> +Contains utilities to create safe HTML content. + +@since GWT 2.1 +</body> +</html>
diff --git a/user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java b/user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java index 78f96e6..9a93a1e 100644 --- a/user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java +++ b/user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java
@@ -947,7 +947,7 @@ } /** - * Parses a package uri (i.e. package://com.google...). + * Parses a package uri (e.g., package://com.google...). * * @throws UnableToCompleteException on bad package name */
diff --git a/user/src/com/google/gwt/user/cellview/client/AbstractHasData.java b/user/src/com/google/gwt/user/cellview/client/AbstractHasData.java index ac5d9c4..9b3c431 100644 --- a/user/src/com/google/gwt/user/cellview/client/AbstractHasData.java +++ b/user/src/com/google/gwt/user/cellview/client/AbstractHasData.java
@@ -273,7 +273,9 @@ /** * Constructs an {@link AbstractHasData} with the given page size. * + * @param elem the parent {@link Element} * @param pageSize the page size + * @param keyProvider the key provider, or null */ public AbstractHasData(Element elem, final int pageSize, final ProvidesKey<T> keyProvider) { @@ -304,6 +306,7 @@ * Get the access key. * * @return the access key, or -1 if not set + * @see #setAccessKey(char) */ public char getAccessKey() { return accessKey; @@ -322,7 +325,9 @@ } /** - * Get the row values that the widget is currently displaying. + * Return the row values that the widget is currently displaying. + * + * @return a List of displayed items */ public List<T> getDisplayedItems() { return new ArrayList<T>(presenter.getRowData()); @@ -342,7 +347,11 @@ /** * Return the range size. + * + * @return the size of the range as an int + * * @see #getVisibleRange() + * @see #setPageSize(int) */ public final int getPageSize() { return getVisibleRange().getLength(); @@ -350,7 +359,11 @@ /** * Return the range start. + * + * @return the start of the range as an int + * * @see #getVisibleRange() + * @see #setPageStart(int) */ public final int getPageStart() { return getVisibleRange().getStart(); @@ -461,6 +474,11 @@ presenter.redraw(); } + /** + * {@inheritDoc} + * + * @see #getAccessKey() + */ public void setAccessKey(char key) { this.accessKey = key; setKeyboardSelected(getKeyboardSelectedRow(), true, false); @@ -490,6 +508,7 @@ * * @param pageSize the page size * @see #setVisibleRange(Range) + * @see #getPageSize() */ public final void setPageSize(int pageSize) { setVisibleRange(getPageStart(), pageSize); @@ -502,6 +521,7 @@ * @param pageStart the index of the row that should appear at the start of * the page * @see #setVisibleRange(Range) + * @see #getPageStart() */ public final void setPageStart(int pageStart) { setVisibleRange(pageStart, getPageSize()); @@ -515,7 +535,7 @@ presenter.setRowCount(size, isExact); } - public void setRowData(int start, List<T> values) { + public void setRowData(int start, List<? extends T> values) { presenter.setRowData(start, values); } @@ -586,6 +606,8 @@ /** * Return the element that holds the rendered cells. + * + * @return the container {@link Element} */ protected abstract Element getChildContainer();
diff --git a/user/src/com/google/gwt/user/cellview/client/AbstractPager.java b/user/src/com/google/gwt/user/cellview/client/AbstractPager.java index 4303770..1ea9866 100644 --- a/user/src/com/google/gwt/user/cellview/client/AbstractPager.java +++ b/user/src/com/google/gwt/user/cellview/client/AbstractPager.java
@@ -46,6 +46,7 @@ * Get the {@link HasRows} being paged. * * @return the {@link HasRows} + * @see #setDisplay(HasRows) */ public HasRows getDisplay() { return display; @@ -55,6 +56,7 @@ * Get the page size. * * @return the page size, or -1 if the display is not set + * @see #setPageSize(int) */ public int getPageSize() { return display == null ? -1 : display.getVisibleRange().getLength(); @@ -64,6 +66,7 @@ * Get the page start index. * * @return the page start index, or -1 if the display is not set + * @see #setPageStart(int) */ public int getPageStart() { return display == null ? -1 : display.getVisibleRange().getStart(); @@ -74,6 +77,7 @@ * true. * * @return true if the range is limited to the data size + * @see #setRangeLimited(boolean) */ public boolean isRangeLimited() { return isRangeLimited; @@ -85,6 +89,7 @@ * visible on the page. * * @param isRangeLimited true to limit the range, false not to + * @see #isRangeLimited() */ public void setRangeLimited(boolean isRangeLimited) { this.isRangeLimited = isRangeLimited; @@ -94,6 +99,7 @@ * Set the {@link HasRows} to be paged. * * @param display the {@link HasRows} + * @see #getDisplay() */ public void setDisplay(HasRows display) { // Remove the old handlers. @@ -150,6 +156,7 @@ * </p> * * @return the page index, or -1 if the display is not set + * @see #setPage(int) */ protected int getPage() { if (display == null) { @@ -177,6 +184,8 @@ * Returns true if there is enough data such that a call to * {@link #nextPage()} will succeed in moving the starting point of the table * forward. + * + * @return true if there is a next page */ protected boolean hasNextPage() { if (display == null) { @@ -191,6 +200,9 @@ /** * Returns true if there is enough data to display a given number of * additional pages. + * + * @param pages the number of pages to query + * @return true if there are {@code pages} next pages */ protected boolean hasNextPages(int pages) { if (display == null) { @@ -203,6 +215,9 @@ /** * Returns true if there is enough data such that the specified page is within * range. + * + * @param index the page index + * @return true if the specified page is in range */ protected boolean hasPage(int index) { return display == null ? false : getPageSize() * index @@ -213,6 +228,8 @@ * Returns true if there is enough data such that a call to * {@link #previousPage()} will succeed in moving the starting point of the * table backward. + * + * @return true if there is a previous page */ protected boolean hasPreviousPage() { return display == null ? false : getPageStart() > 0 @@ -222,6 +239,9 @@ /** * Returns true if there is enough data to display a given number of previous * pages. + * + * @param pages the number of previous pages to query + * @return true if there are {@code pages} previous pages */ protected boolean hasPreviousPages(int pages) { if (display == null) { @@ -277,6 +297,7 @@ * Go to a specific page. * * @param index the page index + * @see #getPage() */ protected void setPage(int index) { if (display != null @@ -293,6 +314,7 @@ * Set the page size of the display. * * @param pageSize the new page size + * @see #getPageSize() */ protected void setPageSize(int pageSize) { if (display != null) { @@ -310,6 +332,7 @@ * Set the page start index. * * @param index the index + * @see #getPageStart() */ protected void setPageStart(int index) { if (display != null) {
diff --git a/user/src/com/google/gwt/user/cellview/client/CellBrowser.java b/user/src/com/google/gwt/user/cellview/client/CellBrowser.java index 64fabc2..7ab531e 100644 --- a/user/src/com/google/gwt/user/cellview/client/CellBrowser.java +++ b/user/src/com/google/gwt/user/cellview/client/CellBrowser.java
@@ -775,6 +775,7 @@ * Get the default width of new columns. * * @return the default width in pixels + * @see #setDefaultColumnWidth(int) */ public int getDefaultColumnWidth() { return defaultWidth; @@ -784,6 +785,7 @@ * Get the minimum width of columns. * * @return the minimum width in pixels + * @see #setMinimumColumnWidth(int) */ public int getMinimumColumnWidth() { return minWidth; @@ -821,6 +823,7 @@ * Set the default width of new columns. * * @param width the default width in pixels + * @see #getDefaultColumnWidth() */ public void setDefaultColumnWidth(int width) { this.defaultWidth = width; @@ -838,6 +841,7 @@ * Set the minimum width of columns. * * @param minWidth the minimum width in pixels + * @see #getMinimumColumnWidth() */ public void setMinimumColumnWidth(int minWidth) { this.minWidth = minWidth;
diff --git a/user/src/com/google/gwt/user/cellview/client/CellList.java b/user/src/com/google/gwt/user/cellview/client/CellList.java index fbfeaeb..2906315 100644 --- a/user/src/com/google/gwt/user/cellview/client/CellList.java +++ b/user/src/com/google/gwt/user/cellview/client/CellList.java
@@ -223,6 +223,7 @@ * Get the message that is displayed when there is no data. * * @return the empty message + * @see #setEmptyListMessage(SafeHtml) */ public SafeHtml getEmptyListMessage() { return emptyListMessage; @@ -249,6 +250,7 @@ * Set the message to display when there is no data. * * @param html the message to display when there are no results + * @see #getEmptyListMessage() */ public void setEmptyListMessage(SafeHtml html) { this.emptyListMessage = html;
diff --git a/user/src/com/google/gwt/user/cellview/client/CellTable.java b/user/src/com/google/gwt/user/cellview/client/CellTable.java index 302185a..5b3cb50 100644 --- a/user/src/com/google/gwt/user/cellview/client/CellTable.java +++ b/user/src/com/google/gwt/user/cellview/client/CellTable.java
@@ -594,6 +594,8 @@ /** * Adds a column to the table. + * + * @param col the column to be added */ public void addColumn(Column<T, ?> col) { addColumn(col, (Header<?>) null, (Header<?>) null); @@ -601,6 +603,9 @@ /** * Adds a column to the table with an associated header. + * + * @param col the column to be added + * @param header the associated {@link Header} */ public void addColumn(Column<T, ?> col, Header<?> header) { addColumn(col, header, null); @@ -608,6 +613,10 @@ /** * Adds a column to the table with an associated header and footer. + * + * @param col the column to be added + * @param header the associated {@link Header} + * @param footer the associated footer (as a {@link Header} object) */ public void addColumn(Column<T, ?> col, Header<?> header, Header<?> footer) { headers.add(header); @@ -649,13 +658,19 @@ /** * Adds a column to the table with an associated String header. + * + * @param col the column to be added + * @param headerString the associated header text, as a String */ public void addColumn(Column<T, ?> col, String headerString) { addColumn(col, new TextHeader(headerString), null); } /** - * Adds a column to the table with an associated SafeHtml header. + * Adds a column to the table with an associated {@link SafeHtml} header. + * + * @param col the column to be added + * @param headerHtml the associated header text, as safe HTML */ public void addColumn(Column<T, ?> col, SafeHtml headerHtml) { addColumn(col, new SafeHtmlHeader(headerHtml), null); @@ -663,6 +678,10 @@ /** * Adds a column to the table with an associated String header and footer. + * + * @param col the column to be added + * @param headerString the associated header text, as a String + * @param footerString the associated footer text, as a String */ public void addColumn(Column<T, ?> col, String headerString, String footerString) { @@ -670,14 +689,19 @@ } /** - * Adds a column to the table with an associated SafeHtml header and footer. + * Adds a column to the table with an associated {@link SafeHtml} header and + * footer. + * + * @param col the column to be added + * @param headerHtml the associated header text, as safe HTML + * @param footerHtml the associated footer text, as safe HTML */ public void addColumn(Column<T, ?> col, SafeHtml headerHtml, SafeHtml footerHtml) { addColumn(col, new SafeHtmlHeader(headerHtml), new SafeHtmlHeader( footerHtml)); } - + /** * Add a style name to the {@link TableColElement} at the specified index, * creating it if necessary. @@ -691,6 +715,8 @@ /** * Return the height of the table body. + * + * @return an int representing the body height */ public int getBodyHeight() { int height = getClientHeight(tbody); @@ -699,6 +725,8 @@ /** * Return the height of the table header. + * + * @return an int representing the header height */ public int getHeaderHeight() { int height = getClientHeight(thead); @@ -799,6 +827,8 @@ /** * Sets the object used to determine how a row is styled; the change will take * effect the next time that the table is rendered. + * + * @param rowStyles a {@link RowStyles} object */ public void setRowStyles(RowStyles<T> rowStyles) { this.rowStyles = rowStyles;
diff --git a/user/src/com/google/gwt/user/cellview/client/CellTree.java b/user/src/com/google/gwt/user/cellview/client/CellTree.java index 0c1333a..fa93a60 100644 --- a/user/src/com/google/gwt/user/cellview/client/CellTree.java +++ b/user/src/com/google/gwt/user/cellview/client/CellTree.java
@@ -81,6 +81,9 @@ @ImageOptions(flipRtl = true) ImageResource cellTreeOpenItem(); + /** + * The styles used in this widget. + */ @Source(BasicStyle.DEFAULT_CSS) BasicStyle cellTreeStyle(); } @@ -105,6 +108,8 @@ /** * Return the duration of the animation in milliseconds. + * + * @see #setDuration(int) */ public int getDuration() { return duration; @@ -112,6 +117,9 @@ /** * Set the duration of the animation in milliseconds. + * + * @param duration the duration in milliseconds + * @see #getDuration() */ public void setDuration(int duration) { this.duration = duration; @@ -598,6 +606,7 @@ * * @return the animation * @see #isAnimationEnabled() + * @see #setAnimation(NodeAnimation) */ public NodeAnimation getAnimation() { return animation; @@ -607,6 +616,7 @@ * Get the default maximum number of children to display under each tree node. * * @return the default node size + * @see #setDefaultNodeSize(int) */ public int getDefaultNodeSize() { return defaultNodeSize; @@ -717,6 +727,8 @@ * <p> * Setting the key to (int) 0 will disable the access key. * </p> + * + * @see #getAccessKey() */ public void setAccessKey(char key) { this.accessKey = key; @@ -729,6 +741,7 @@ * * @param animation a {@link NodeAnimation} * @see #setAnimationEnabled(boolean) + * @see #getAnimation() */ public void setAnimation(NodeAnimation animation) { assert animation != null : "animation cannot be null"; @@ -749,6 +762,7 @@ * tree nodes that are already open. * * @param defaultNodeSize the max + * @see #getDefaultNodeSize() */ public void setDefaultNodeSize(int defaultNodeSize) { this.defaultNodeSize = defaultNodeSize; @@ -767,15 +781,22 @@ * Get the access key. * * @return the access key, or -1 if not set + * @see #setAccessKey(char) */ protected char getAccessKey() { return accessKey; } + /** + * Called when the keyboard selected node loses focus. + */ protected void onBlur() { keyboardSelectedNode.setKeyboardSelectedStyle(false); } + /** + * Called when the keyboard selected node gains focus. + */ protected void onFocus() { keyboardSelectedNode.setKeyboardSelectedStyle(true); }
diff --git a/user/src/com/google/gwt/user/cellview/client/CellTreeNodeView.java b/user/src/com/google/gwt/user/cellview/client/CellTreeNodeView.java index 2afe4b7..f9e524b 100644 --- a/user/src/com/google/gwt/user/cellview/client/CellTreeNodeView.java +++ b/user/src/com/google/gwt/user/cellview/client/CellTreeNodeView.java
@@ -492,7 +492,7 @@ presenter.setRowCount(size, isExact); } - public void setRowData(int start, List<C> values) { + public void setRowData(int start, List<? extends C> values) { presenter.setRowData(start, values); }
diff --git a/user/src/com/google/gwt/user/cellview/client/Column.java b/user/src/com/google/gwt/user/cellview/client/Column.java index c2a178d..83055bb 100644 --- a/user/src/com/google/gwt/user/cellview/client/Column.java +++ b/user/src/com/google/gwt/user/cellview/client/Column.java
@@ -47,20 +47,27 @@ /** * Construct a new Column with a given {@link Cell}. + * + * @param cell the Cell used by this Column */ public Column(Cell<C> cell) { this.cell = cell; } /** - * Return the {@link Cell} responsible for rendering items in the column. + * Returns the {@link Cell} responsible for rendering items in the column. + * + * @return a Cell */ public Cell<C> getCell() { return cell; } /** - * Return the {@link FieldUpdater} used for updating values in the column. + * Returns the {@link FieldUpdater} used for updating values in the column. + * + * @return an instance of FieldUpdater<T, C> + * @see #setFieldUpdater(FieldUpdater) */ public FieldUpdater<T, C> getFieldUpdater() { return fieldUpdater; @@ -108,6 +115,9 @@ /** * Set the {@link FieldUpdater} used for updating values in the column. + * + * @param fieldUpdater the field updater + * @see #getFieldUpdater() */ public void setFieldUpdater(FieldUpdater<T, C> fieldUpdater) { this.fieldUpdater = fieldUpdater;
diff --git a/user/src/com/google/gwt/user/cellview/client/HasDataPresenter.java b/user/src/com/google/gwt/user/cellview/client/HasDataPresenter.java index 55c2398..e158c81 100644 --- a/user/src/com/google/gwt/user/cellview/client/HasDataPresenter.java +++ b/user/src/com/google/gwt/user/cellview/client/HasDataPresenter.java
@@ -651,7 +651,7 @@ RowCountChangeEvent.fire(display, count, rowCountIsExact); } - public void setRowData(int start, List<T> values) { + public void setRowData(int start, List<? extends T> values) { int valuesLength = values.size(); int valuesEnd = start + valuesLength;
diff --git a/user/src/com/google/gwt/user/cellview/client/HasKeyboardPagingPolicy.java b/user/src/com/google/gwt/user/cellview/client/HasKeyboardPagingPolicy.java index 62d7b87..341fca3 100644 --- a/user/src/com/google/gwt/user/cellview/client/HasKeyboardPagingPolicy.java +++ b/user/src/com/google/gwt/user/cellview/client/HasKeyboardPagingPolicy.java
@@ -54,11 +54,17 @@ /** * Get the {@link KeyboardPagingPolicy}. + * + * @return the paging policy + * @see #setKeyboardPagingPolicy(KeyboardPagingPolicy) */ KeyboardPagingPolicy getKeyboardPagingPolicy(); /** * Set the {@link KeyboardPagingPolicy}. + * + * @param policy the paging policy + * @see #getKeyboardPagingPolicy() */ void setKeyboardPagingPolicy(KeyboardPagingPolicy policy); }
diff --git a/user/src/com/google/gwt/user/cellview/client/HasKeyboardSelectionPolicy.java b/user/src/com/google/gwt/user/cellview/client/HasKeyboardSelectionPolicy.java index 23713bdb0..393a602 100644 --- a/user/src/com/google/gwt/user/cellview/client/HasKeyboardSelectionPolicy.java +++ b/user/src/com/google/gwt/user/cellview/client/HasKeyboardSelectionPolicy.java
@@ -44,11 +44,17 @@ /** * Get the {@link KeyboardSelectionPolicy}. + * + * @return the selection policy + * @see #setKeyboardSelectionPolicy(KeyboardSelectionPolicy) */ KeyboardSelectionPolicy getKeyboardSelectionPolicy(); /** * Set the {@link KeyboardSelectionPolicy}. + * + * @param policy the selection policy + * @see #getKeyboardSelectionPolicy() */ void setKeyboardSelectionPolicy(KeyboardSelectionPolicy policy); }
diff --git a/user/src/com/google/gwt/user/cellview/client/Header.java b/user/src/com/google/gwt/user/cellview/client/Header.java index c3c3ac6..3739fc3 100644 --- a/user/src/com/google/gwt/user/cellview/client/Header.java +++ b/user/src/com/google/gwt/user/cellview/client/Header.java
@@ -34,6 +34,8 @@ /** * Construct a Header with a given {@link Cell}. + * + * @param cell the {@link Cell} responsible for rendering items in the header */ public Header(Cell<H> cell) { this.cell = cell; @@ -41,6 +43,8 @@ /** * Return the {@link Cell} responsible for rendering items in the header. + * + * @return the header Cell */ public Cell<H> getCell() { return cell; @@ -48,6 +52,8 @@ /** * Return the header value. + * + * @return the header value */ public abstract H getValue(); @@ -73,6 +79,8 @@ /** * Set the {@link ValueUpdater}. + * + * @param updater the value updater to use */ public void setUpdater(ValueUpdater<H> updater) { this.updater = updater;
diff --git a/user/src/com/google/gwt/user/cellview/client/IdentityColumn.java b/user/src/com/google/gwt/user/cellview/client/IdentityColumn.java index 614c144..2b9569d 100644 --- a/user/src/com/google/gwt/user/cellview/client/IdentityColumn.java +++ b/user/src/com/google/gwt/user/cellview/client/IdentityColumn.java
@@ -27,6 +27,8 @@ /** * Construct a new IdentityColumn with a given {@link Cell}. + * + * @param cell the {@link Cell} responsible for rendering items in the column */ public IdentityColumn(Cell<T> cell) { super(cell); @@ -34,6 +36,8 @@ /** * Return the passed-in object. + * + * @param object the object to return */ @Override public T getValue(T object) {
diff --git a/user/src/com/google/gwt/user/cellview/client/SafeHtmlHeader.java b/user/src/com/google/gwt/user/cellview/client/SafeHtmlHeader.java index 651506f..e239d50 100644 --- a/user/src/com/google/gwt/user/cellview/client/SafeHtmlHeader.java +++ b/user/src/com/google/gwt/user/cellview/client/SafeHtmlHeader.java
@@ -27,6 +27,8 @@ /** * Construct a Header with a given {@link SafeHtml} text value. + * + * @param text the header text, as safe HTML */ public SafeHtmlHeader(SafeHtml text) { super(new SafeHtmlCell());
diff --git a/user/src/com/google/gwt/user/cellview/client/TextHeader.java b/user/src/com/google/gwt/user/cellview/client/TextHeader.java index 609f483..f33aa2d 100644 --- a/user/src/com/google/gwt/user/cellview/client/TextHeader.java +++ b/user/src/com/google/gwt/user/cellview/client/TextHeader.java
@@ -25,7 +25,9 @@ private String text; /** - * Construct a new TextColumn. + * Construct a new TextHeader. + * + * @param text the header text as a String */ public TextHeader(String text) { super(new TextCell());
diff --git a/user/src/com/google/gwt/user/cellview/client/TreeNode.java b/user/src/com/google/gwt/user/cellview/client/TreeNode.java index c7eedab..c9008bd 100644 --- a/user/src/com/google/gwt/user/cellview/client/TreeNode.java +++ b/user/src/com/google/gwt/user/cellview/client/TreeNode.java
@@ -30,6 +30,7 @@ /** * Get the value associated with a child node. * + * @param index the child index * @return the value */ Object getChildValue(int index);
diff --git a/user/src/com/google/gwt/user/cellview/client/package.html b/user/src/com/google/gwt/user/cellview/client/package.html index 5da4d42..b37bf8a 100644 --- a/user/src/com/google/gwt/user/cellview/client/package.html +++ b/user/src/com/google/gwt/user/cellview/client/package.html
@@ -21,5 +21,7 @@ {@link com.google.gwt.user.cellview.client.SimplePager SimplePager}, {@link com.google.gwt.user.cellview.client.PageSizePager PageSizePager}, or a user-defined subclass of {@link com.google.gwt.user.cellview.client.AbstractPager AbstractPager}. </p> + +@since GWT 2.1 </body> </html>
diff --git a/user/src/com/google/gwt/user/client/ui/AbsolutePanel.java b/user/src/com/google/gwt/user/client/ui/AbsolutePanel.java index 1f4da9f..66bb445 100644 --- a/user/src/com/google/gwt/user/client/ui/AbsolutePanel.java +++ b/user/src/com/google/gwt/user/client/ui/AbsolutePanel.java
@@ -228,8 +228,8 @@ } /** - * Verify that the given widget is not statically positioned on the page, i.e. - * relative to the document window, unless the widget is in fact directly + * Verify that the given widget is not statically positioned on the page + * (relative to the document window), unless the widget is in fact directly * attached to the document BODY. Note that the current use of this method is * not comprehensive, since we can only verify the offsetParent if both parent * (AbsolutePanel) and child widget are both visible and attached to the DOM
diff --git a/user/src/com/google/gwt/view/client/AbstractDataProvider.java b/user/src/com/google/gwt/view/client/AbstractDataProvider.java index f824a86..635317c 100644 --- a/user/src/com/google/gwt/view/client/AbstractDataProvider.java +++ b/user/src/com/google/gwt/view/client/AbstractDataProvider.java
@@ -63,6 +63,8 @@ /** * Construct an AbstractDataProvider with a given key provider. + * + * @param keyProvider a {@link ProvidesKey} object */ protected AbstractDataProvider(ProvidesKey<T> keyProvider) { this.keyProvider = keyProvider; @@ -149,6 +151,8 @@ /** * Remove the given data display. * + * @param display a {@link HasData} instance + * * @throws IllegalStateException if the display is not present */ public void removeDataDisplay(HasData<T> display) {
diff --git a/user/src/com/google/gwt/view/client/DefaultSelectionModel.java b/user/src/com/google/gwt/view/client/DefaultSelectionModel.java index 23a5f45..086810e 100644 --- a/user/src/com/google/gwt/view/client/DefaultSelectionModel.java +++ b/user/src/com/google/gwt/view/client/DefaultSelectionModel.java
@@ -63,6 +63,9 @@ /** * Returns true if the given object should be selected by default. Subclasses * implement this method in order to define the default selection behavior. + * + * @param object an object of this {@link SelectionModel}'s type + * @return true if the object should be selected by default */ public abstract boolean isDefaultSelected(T object);
diff --git a/user/src/com/google/gwt/view/client/HasData.java b/user/src/com/google/gwt/view/client/HasData.java index c26558a..31ec457 100644 --- a/user/src/com/google/gwt/view/client/HasData.java +++ b/user/src/com/google/gwt/view/client/HasData.java
@@ -28,6 +28,8 @@ * Get the {@link SelectionModel} used by this {@link HasData}. * * @return the {@link SelectionModel} + * + * @see #setSelectionModel(SelectionModel) */ SelectionModel<? super T> getSelectionModel(); @@ -37,12 +39,14 @@ * @param start the start index of the data * @param values the values within the range */ - void setRowData(int start, List<T> values); + void setRowData(int start, List<? extends T> values); /** * Set the {@link SelectionModel} used by this {@link HasData}. * * @param selectionModel the {@link SelectionModel} + * + * @see #getSelectionModel() */ void setSelectionModel(SelectionModel<? super T> selectionModel);
diff --git a/user/src/com/google/gwt/view/client/HasRows.java b/user/src/com/google/gwt/view/client/HasRows.java index 5e4e3f5..fb63c99 100644 --- a/user/src/com/google/gwt/view/client/HasRows.java +++ b/user/src/com/google/gwt/view/client/HasRows.java
@@ -44,6 +44,8 @@ * Get the total count of all rows. * * @return the total row count + * + * @see #setRowCount(int) */ int getRowCount(); @@ -51,6 +53,9 @@ * Get the range of visible rows. * * @return the visible range + * + * @see #setVisibleRange(Range) + * @see #setVisibleRange(int, int) */ Range getVisibleRange(); @@ -66,6 +71,8 @@ * {@link #setRowCount(int, boolean)}. * * @param count the exact total count + * + * @see #getRowCount() */ void setRowCount(int count); @@ -75,6 +82,7 @@ * * @param count the total count * @param isExact true if the count is exact, false if an estimate + * @see #getRowCount() */ void setRowCount(int count, boolean isExact); @@ -84,6 +92,8 @@ * * @param start the start index * @param length the length + * + * @see #getVisibleRange() */ // TODO(jlabanca): Should we include setPageStart/Size as shortcut methods? void setVisibleRange(int start, int length); @@ -92,6 +102,8 @@ * Set the visible range or rows. * * @param range the visible range + * + * @see #getVisibleRange() */ void setVisibleRange(Range range); }
diff --git a/user/src/com/google/gwt/view/client/ListDataProvider.java b/user/src/com/google/gwt/view/client/ListDataProvider.java index 2bd2c7e..30b64d2 100644 --- a/user/src/com/google/gwt/view/client/ListDataProvider.java +++ b/user/src/com/google/gwt/view/client/ListDataProvider.java
@@ -444,6 +444,8 @@ * Creates a list model that wraps the given list. Changes to the * wrapped list must be made via this model in order to be correctly applied * to displays. + * + * @param listToWrap the List to be wrapped */ public ListDataProvider(List<T> listToWrap) { this(listToWrap, null); @@ -463,7 +465,8 @@ * Creates a list model that wraps the given list. Changes to the * wrapped list must be made via this model in order to be correctly applied * to displays. - * + * + * @param listToWrap the List to be wrapped * @param keyProvider an instance of ProvidesKey<T>, or null if the record * object should act as its own key */ @@ -489,6 +492,8 @@ * in the model. * * @return the list + * + * @see #setList(List) */ public List<T> getList() { return listWrapper; @@ -505,6 +510,8 @@ * Replace this model's list. * * @param listToWrap the model's new list + * + * @see #getList() */ public void setList(List<T> listToWrap) { listWrapper = new ListWrapper(listToWrap);
diff --git a/user/src/com/google/gwt/view/client/RowCountChangeEvent.java b/user/src/com/google/gwt/view/client/RowCountChangeEvent.java index c166d3e..9b64150 100644 --- a/user/src/com/google/gwt/view/client/RowCountChangeEvent.java +++ b/user/src/com/google/gwt/view/client/RowCountChangeEvent.java
@@ -47,6 +47,7 @@ * * @param source the source of the handlers * @param rowCount the new rowCount + * @param isExact true if rowCount is an exact count */ public static void fire(HasRows source, int rowCount, boolean isExact) { if (TYPE != null) {
diff --git a/user/src/com/google/gwt/view/client/SelectionModel.java b/user/src/com/google/gwt/view/client/SelectionModel.java index 54a2f77..7019e8c 100644 --- a/user/src/com/google/gwt/view/client/SelectionModel.java +++ b/user/src/com/google/gwt/view/client/SelectionModel.java
@@ -75,7 +75,10 @@ } /** - * Returns a ProvidesKey instance that simply returns the input data item. + * Returns a {@link ProvidesKey} instance that simply returns the input data + * item. + * + * @return the key provider, which may be null */ public ProvidesKey<T> getKeyProvider() { return keyProvider; @@ -93,6 +96,8 @@ /** * Return true if the next scheduled event should be canceled. + * + * @return true if the event is canceled */ protected boolean isEventCancelled() { return isEventCancelled; @@ -100,6 +105,8 @@ /** * Return true if an event is scheduled to be fired. + * + * @return true if the event is scheduled */ protected boolean isEventScheduled() { return isEventScheduled; @@ -128,6 +135,8 @@ /** * Set whether the next scheduled event should be canceled. + * + * @param isEventCancelled if true, cancel the event */ protected void setEventCancelled(boolean isEventCancelled) { this.isEventCancelled = isEventCancelled; @@ -135,6 +144,8 @@ /** * Set whether an event is scheduled to be fired. + * + * @param isEventScheduled if true, schedule the event */ protected void setEventScheduled(boolean isEventScheduled) { this.isEventScheduled = isEventScheduled;
diff --git a/user/src/com/google/gwt/view/client/SingleSelectionModel.java b/user/src/com/google/gwt/view/client/SingleSelectionModel.java index dcb22fa..c5a6982 100644 --- a/user/src/com/google/gwt/view/client/SingleSelectionModel.java +++ b/user/src/com/google/gwt/view/client/SingleSelectionModel.java
@@ -51,6 +51,8 @@ /** * Gets the currently-selected object. + * + * @return the selected object */ public T getSelectedObject() { resolveChanges();
diff --git a/user/src/com/google/gwt/view/client/TreeViewModel.java b/user/src/com/google/gwt/view/client/TreeViewModel.java index d0b558f..68ef100 100644 --- a/user/src/com/google/gwt/view/client/TreeViewModel.java +++ b/user/src/com/google/gwt/view/client/TreeViewModel.java
@@ -52,6 +52,7 @@ * child values * @param cell the {@link Cell} used to render the child values update when * the selection changes + * @param selectionModel the {@link SelectionModel} used for selection * @param valueUpdater the {@link ValueUpdater} */ public DefaultNodeInfo(AbstractDataProvider<T> dataProvider,
diff --git a/user/src/com/google/gwt/view/client/package.html b/user/src/com/google/gwt/view/client/package.html index dd5dbde..461c296 100644 --- a/user/src/com/google/gwt/view/client/package.html +++ b/user/src/com/google/gwt/view/client/package.html
@@ -1,39 +1,9 @@ <html> <body> <p>Classes and interfaces used by the -{@link com.google.gwt.user.cellview.client cellview} widget set. The package -includes: -<ul> -<li>{@link com.google.gwt.view.client.ListView ListView} - interface for all views that display a list of data items -within a {@link com.google.gwt.view.client.Range Range}</li> - <ul> - <li>{@link com.google.gwt.view.client.PagingListView PagingListView} - a ListView that may be controlled by a - {@link com.google.gwt.view.client.PagingListView.Pager Pager}</li> - </ul> -<li>{@link com.google.gwt.view.client.AbstractListViewAdapter AbstractListViewAdapter} - a basic data source implementation</li> - <ul> - <li>{@link com.google.gwt.view.client.ListViewAdapter ListViewAdapter} - an implementation of AbstractListViewAdapter - that is backed by an in-memory list</li> -<li>{@link com.google.gwt.view.client.AsyncListViewAdapter AsyncListViewAdapter} - an asynchronous data source -implementation</li> - </ul> -<li>{@link com.google.gwt.view.client.SelectionModel SelectionModel} - an interface for selection of items within a -view</li> - <ul> - <li>{@link com.google.gwt.view.client.DefaultSelectionModel DefaultSelectionModel} - a SelectionModel that allows both - rule-based and explicit selection and deselection of items</li> - <li>{@link com.google.gwt.view.client.SingleSelectionModel SingleSelectionModel} - a SelectionModel that allows a single item - to be selected</li> - <li>{@link com.google.gwt.view.client.MultiSelectionModel MultiSelectionModel} - a SelectionModel that allows multiple items - to be selected</li> - <ul> -<li>{@link com.google.gwt.view.client.HasViewData HasViewData} - an interface to retrieve view data for an item</li> -<li>{@link com.google.gwt.view.client.ProvidesKey ProvidesKey} - an interface to provide a unique key value for an -item</li> -<li>{@link com.google.gwt.view.client.TreeViewModel TreeViewModel} - interfaces used to manage nodes in a -{@link com.google.gwt.user.cellview.client.CellTree CellTree} or -{@link com.google.gwt.user.cellview.client.CellBrowser CellBrowser}</li> -</ul> +{@link com.google.gwt.user.cellview.client cellview} widget set. + +@since GWT 2.1 </p> </body> </html>
diff --git a/user/super/com/google/gwt/emul/java/math/BitLevel.java b/user/super/com/google/gwt/emul/java/math/BitLevel.java index b539637..82e88c9 100644 --- a/user/super/com/google/gwt/emul/java/math/BitLevel.java +++ b/user/super/com/google/gwt/emul/java/math/BitLevel.java
@@ -227,8 +227,8 @@ } /** - * Abstractly shifts left an array of integers in little endian (i.e. shift it - * right). Total shift distance in bits is intCount * 32 + count + * Abstractly shifts left an array of integers in little endian (i.e., + * shift it right). Total shift distance in bits is intCount * 32 + count * * @param result the destination array * @param source the source array
diff --git a/user/test/com/google/gwt/requestfactory/RequestFactorySuite.java b/user/test/com/google/gwt/requestfactory/RequestFactorySuite.java index 44de728..d4ec7e4 100644 --- a/user/test/com/google/gwt/requestfactory/RequestFactorySuite.java +++ b/user/test/com/google/gwt/requestfactory/RequestFactorySuite.java
@@ -18,6 +18,7 @@ import com.google.gwt.junit.tools.GWTTestSuite; import com.google.gwt.requestfactory.client.FindServiceTest; import com.google.gwt.requestfactory.client.RequestFactoryExceptionHandlerTest; +import com.google.gwt.requestfactory.client.RequestFactoryPolymorphicTest; import com.google.gwt.requestfactory.client.RequestFactoryStringTest; import com.google.gwt.requestfactory.client.RequestFactoryTest; import com.google.gwt.requestfactory.client.ui.EditorTest; @@ -35,6 +36,7 @@ suite.addTestSuite(RequestFactoryTest.class); suite.addTestSuite(RequestFactoryStringTest.class); suite.addTestSuite(RequestFactoryExceptionHandlerTest.class); + suite.addTestSuite(RequestFactoryPolymorphicTest.class); suite.addTestSuite(FindServiceTest.class); return suite; }
diff --git a/user/test/com/google/gwt/view/client/MockHasData.java b/user/test/com/google/gwt/view/client/MockHasData.java index 444a12f..a7eb19c 100644 --- a/user/test/com/google/gwt/view/client/MockHasData.java +++ b/user/test/com/google/gwt/view/client/MockHasData.java
@@ -81,7 +81,7 @@ private final HandlerManager handlerManager = new HandlerManager(this); private Range lastRange; - private List<T> lastRowData; + private List<? extends T> lastRowData; private int pageStart; private int pageSize = DEFAULT_PAGE_SIZE; @@ -117,7 +117,7 @@ * * @return the last data set */ - public List<T> getLastRowData() { + public List<? extends T> getLastRowData() { return lastRowData; } @@ -146,7 +146,7 @@ return rowCountExact; } - public void setRowData(int start, List<T> values) { + public void setRowData(int start, List<? extends T> values) { lastRange = new Range(start, values.size()); lastRowData = values; }