Merge "Allow web UI plugins to auto-register"
This commit is contained in:
@@ -14,15 +14,30 @@
|
|||||||
|
|
||||||
package com.google.gerrit.extensions.webui;
|
package com.google.gerrit.extensions.webui;
|
||||||
|
|
||||||
|
import com.google.gerrit.extensions.annotations.ExtensionPoint;
|
||||||
import com.google.gerrit.extensions.annotations.PluginName;
|
import com.google.gerrit.extensions.annotations.PluginName;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specifies JavaScript to dynamically load into the web UI.
|
* Specifies JavaScript to dynamically load into the web UI.
|
||||||
|
* <p>
|
||||||
|
* To automatically register (instead of writing a Guice module), declare the
|
||||||
|
* intention with {@code @Listen}, extend the correct class and define a
|
||||||
|
* constructor to configure the correct resource:
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* @Listen
|
||||||
|
* class MyJs extends JavaScriptPlugin {
|
||||||
|
* MyJs() {
|
||||||
|
* super("hello.js");
|
||||||
|
* }
|
||||||
|
* }
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* @see GwtPlugin
|
* @see GwtPlugin
|
||||||
* @see JavaScriptPlugin
|
* @see JavaScriptPlugin
|
||||||
*/
|
*/
|
||||||
|
@ExtensionPoint
|
||||||
public abstract class WebUiPlugin {
|
public abstract class WebUiPlugin {
|
||||||
public static final GwtPlugin gwt(String moduleName) {
|
public static final GwtPlugin gwt(String moduleName) {
|
||||||
return new GwtPlugin(moduleName);
|
return new GwtPlugin(moduleName);
|
||||||
|
|||||||
Reference in New Issue
Block a user