From 9abe435ba3562aa0694ab693739170eff0940072 Mon Sep 17 00:00:00 2001 From: Dariusz Luksza Date: Tue, 30 Oct 2012 16:48:14 +0100 Subject: [PATCH] Update plugin-js-archetype to match current implementation Use auto registering mechanism using @Listen annotation instead of binding in main Module. Change-Id: I3ece0066fb52cfae4e5913782b1cf43e71f1dc07 Signed-off-by: Dariusz Luksza --- .../src/main/resources/archetype-resources/pom.xml | 2 -- .../src/main/java/{Module.java => MyJsExtension.java} | 11 +++++------ 2 files changed, 5 insertions(+), 8 deletions(-) rename gerrit-plugin-js-archetype/src/main/resources/archetype-resources/src/main/java/{Module.java => MyJsExtension.java} (72%) diff --git a/gerrit-plugin-js-archetype/src/main/resources/archetype-resources/pom.xml b/gerrit-plugin-js-archetype/src/main/resources/archetype-resources/pom.xml index 6f0638aa1a..2a8b469aa0 100644 --- a/gerrit-plugin-js-archetype/src/main/resources/archetype-resources/pom.xml +++ b/gerrit-plugin-js-archetype/src/main/resources/archetype-resources/pom.xml @@ -42,8 +42,6 @@ limitations under the License. - ${package}.Module - ${Implementation-Vendor} ${Implementation-Url} diff --git a/gerrit-plugin-js-archetype/src/main/resources/archetype-resources/src/main/java/Module.java b/gerrit-plugin-js-archetype/src/main/resources/archetype-resources/src/main/java/MyJsExtension.java similarity index 72% rename from gerrit-plugin-js-archetype/src/main/resources/archetype-resources/src/main/java/Module.java rename to gerrit-plugin-js-archetype/src/main/resources/archetype-resources/src/main/java/MyJsExtension.java index 056afebefe..bec914dde7 100644 --- a/gerrit-plugin-js-archetype/src/main/resources/archetype-resources/src/main/java/Module.java +++ b/gerrit-plugin-js-archetype/src/main/resources/archetype-resources/src/main/java/MyJsExtension.java @@ -14,13 +14,12 @@ package ${package}; -import com.google.inject.AbstractModule; -import com.google.gerrit.extensions.webui.WebUiPlugin; +import com.google.gerrit.extensions.annotations.Listen; import com.google.gerrit.extensions.webui.JavaScriptPlugin; -class Module extends AbstractModule { - @Override - protected void configure() { - bind(WebUiPlugin.class).toInstance(new JavaScriptPlugin("hello-js-plugins.js")); +@Listen +public class MyJsExtension extends JavaScriptPlugin { + public MyJsExtension() { + super("hello-js-plugins.js"); } }