Allow plugins to add custom settings screens

Plugins can now add custom screens which are integrated into the
Gerrit user settings menu. A new entry in the user settings menu loads
and displays the settings screen from the plugin. The user settings
menu on the left side is automatically included into the custom
settings screens.

Plugins must register settings screen early at plugin module load. The
way how settings screens are registered is similar to how plugins can
add normal custom screens.

An example settings screen was implemented in the cookbook plugin.

Change-Id: I4a88e4975ff436a5cdb125ebbde276dfab280ce2
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin
2015-07-08 13:28:40 +02:00
parent 2a8c515a27
commit 70e1112c0d
10 changed files with 222 additions and 1 deletions

View File

@@ -93,6 +93,19 @@ public final class Plugin extends JavaScriptObject {
private final native void screenRegex(String p, JavaScriptObject e)
/*-{ this.screen(new $wnd.RegExp(p), e) }-*/;
/**
* Register a settings screen displayed at {@code /#/settings/x/plugin/token}.
*
* @param token literal anchor token appearing after the plugin name.
* @param entry callback function invoked to create the settings screen widgets.
*/
public final void settingsScreen(String token, String menu, Screen.EntryPoint entry) {
settingsScreen(token, menu, wrap(entry));
}
private final native void settingsScreen(String t, String m, JavaScriptObject e)
/*-{ this.settingsScreen(t, m, e) }-*/;
/**
* Register a panel for a UI extension point.
*