Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(78)

Unified Diff: test/com/google/gwt/inject/client/binding/FruitGinModule.java

Issue 90085: Fixed enum binding support (issue #49) (Closed) SVN Base: http://google-gin.googlecode.com/svn/trunk/
Patch Set: Using getEnclosingClass Created 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side by-side-diff with in-line comments
Download patch
Index: test/com/google/gwt/inject/client/binding/FruitGinModule.java
===================================================================
--- test/com/google/gwt/inject/client/binding/FruitGinModule.java (revision 108)
+++ test/com/google/gwt/inject/client/binding/FruitGinModule.java (working copy)
@@ -33,6 +33,8 @@
public static final short LEAVES = 2;
public static final String NAME = "Apple";
public static final Color COLOR = Color.Red;
+ public static final Color ALTERNATIVE_COLOR = Color.Yellow;
+ public static final Fruit.Family FAMILY = Fruit.Family.Rosaceae;
protected void configure() {
bindConstant().annotatedWith(Names.named("eaten")).to(EATEN);
@@ -45,5 +47,9 @@
bindConstant().annotatedWith(Names.named("leaves")).to(LEAVES);
bindConstant().annotatedWith(Names.named("name")).to(NAME);
bindConstant().annotatedWith(Names.named("color")).to(COLOR);
+
+ // Bind enum with custom implementation.
+ bindConstant().annotatedWith(Names.named("alternativeColor")).to(ALTERNATIVE_COLOR);
+ bindConstant().annotatedWith(Names.named("family")).to(FAMILY);
}
}

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld r497