Allow web UI plugins to auto-register
Change-Id: Ic41a4381be9ad746e3ff394cfd6b25c2ed5e7d2f
This commit is contained in:
parent
1a1cf9ed2e
commit
36e093f22d
@ -14,15 +14,30 @@
|
||||
|
||||
package com.google.gerrit.extensions.webui;
|
||||
|
||||
import com.google.gerrit.extensions.annotations.ExtensionPoint;
|
||||
import com.google.gerrit.extensions.annotations.PluginName;
|
||||
import com.google.inject.Inject;
|
||||
|
||||
/**
|
||||
* 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 JavaScriptPlugin
|
||||
*/
|
||||
@ExtensionPoint
|
||||
public abstract class WebUiPlugin {
|
||||
public static final GwtPlugin gwt(String moduleName) {
|
||||
return new GwtPlugin(moduleName);
|
||||
|
Loading…
Reference in New Issue
Block a user