Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
follow the generators to the changes in rails-gwt and other changes i…
…n dependent gems
- Loading branch information
Showing
30 changed files
with
421 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
resty-generators/lib/generators/resty/setup/templates/Application.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package <%= models_package %>; | ||
|
||
import org.codehaus.jackson.annotate.JsonCreator; | ||
import org.codehaus.jackson.annotate.JsonProperty; | ||
|
||
import org.fusesource.restygwt.client.Json; | ||
import org.fusesource.restygwt.client.Json.Style; | ||
|
||
@Json(style = Style.RAILS) | ||
public class Application { | ||
|
||
private final String name; | ||
|
||
private final String url; | ||
|
||
@JsonCreator | ||
public Application(@JsonProperty("name") String name, | ||
@JsonProperty("url") String url){ | ||
this.url = url; | ||
this.name = name; | ||
} | ||
|
||
public String getName(){ | ||
return name; | ||
} | ||
|
||
public String getUrl(){ | ||
return url; | ||
} | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
resty-generators/lib/generators/resty/setup/templates/ApplicationLinksPanel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package <%= base_package %>; | ||
|
||
import javax.inject.Singleton; | ||
|
||
import <%= models_package %>.Application; | ||
import <%= models_package %>.User; | ||
import com.google.inject.Inject; | ||
|
||
import de.mkristian.gwt.rails.session.SessionManager; | ||
import de.mkristian.gwt.rails.views.LinksPanel; | ||
|
||
@Singleton | ||
public class ApplicationLinksPanel extends LinksPanel<User> { | ||
|
||
@Inject | ||
ApplicationLinksPanel(SessionManager<User> sessionManager) { | ||
super(sessionManager); | ||
} | ||
|
||
@Override | ||
protected void initUser(User user) { | ||
for(Application app: user.applications){ | ||
addLink(app.getName().equals("THIS") ? | ||
"users" : | ||
app.getName(), app.getUrl()); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.