Allow plugins to refresh Gerrit's menu bar
Change-Id: Id908ebe23a07f2ae45e131a9b8a98c24f4a9cf74 Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
@@ -872,6 +872,10 @@ Gerrit.screen(pattern, callback);
|
|||||||
=== Gerrit.refresh()
|
=== Gerrit.refresh()
|
||||||
Redisplays the current web UI view, refreshing all information.
|
Redisplays the current web UI view, refreshing all information.
|
||||||
|
|
||||||
|
[[Gerrit_refreshMenuBar]]
|
||||||
|
=== Gerrit.refreshMenuBar()
|
||||||
|
Refreshes Gerrit's menu bar.
|
||||||
|
|
||||||
[[Gerrit_url]]
|
[[Gerrit_url]]
|
||||||
=== Gerrit.url()
|
=== Gerrit.url()
|
||||||
Returns the URL of the Gerrit Code Review server. If invoked with
|
Returns the URL of the Gerrit Code Review server. If invoked with
|
||||||
|
@@ -37,6 +37,7 @@ public class ActionContext extends JavaScriptObject {
|
|||||||
Gerrit.ActionContext.prototype = {
|
Gerrit.ActionContext.prototype = {
|
||||||
go: Gerrit.go,
|
go: Gerrit.go,
|
||||||
refresh: Gerrit.refresh,
|
refresh: Gerrit.refresh,
|
||||||
|
refreshMenuBar: Gerrit.refreshMenuBar,
|
||||||
showError: Gerrit.showError,
|
showError: Gerrit.showError,
|
||||||
|
|
||||||
br: function(){return doc.createElement('br')},
|
br: function(){return doc.createElement('br')},
|
||||||
|
@@ -62,6 +62,7 @@ public class ApiGlue {
|
|||||||
|
|
||||||
go: @com.google.gerrit.client.api.ApiGlue::go(Ljava/lang/String;),
|
go: @com.google.gerrit.client.api.ApiGlue::go(Ljava/lang/String;),
|
||||||
refresh: @com.google.gerrit.client.api.ApiGlue::refresh(),
|
refresh: @com.google.gerrit.client.api.ApiGlue::refresh(),
|
||||||
|
refreshMenuBar: @com.google.gerrit.client.api.ApiGlue::refreshMenuBar(),
|
||||||
showError: @com.google.gerrit.client.api.ApiGlue::showError(Ljava/lang/String;),
|
showError: @com.google.gerrit.client.api.ApiGlue::showError(Ljava/lang/String;),
|
||||||
|
|
||||||
on: function (e,f){(this.events[e] || (this.events[e]=[])).push(f)},
|
on: function (e,f){(this.events[e] || (this.events[e]=[])).push(f)},
|
||||||
@@ -189,6 +190,10 @@ public class ApiGlue {
|
|||||||
Gerrit.display(History.getToken());
|
Gerrit.display(History.getToken());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final void refreshMenuBar() {
|
||||||
|
Gerrit.refreshMenuBar();
|
||||||
|
}
|
||||||
|
|
||||||
private static final void showError(String message) {
|
private static final void showError(String message) {
|
||||||
new ErrorDialog(message).center();
|
new ErrorDialog(message).center();
|
||||||
}
|
}
|
||||||
|
@@ -52,6 +52,7 @@ final class Plugin extends JavaScriptObject {
|
|||||||
getPluginName: function(){return this.name},
|
getPluginName: function(){return this.name},
|
||||||
go: @com.google.gerrit.client.api.ApiGlue::go(Ljava/lang/String;),
|
go: @com.google.gerrit.client.api.ApiGlue::go(Ljava/lang/String;),
|
||||||
refresh: @com.google.gerrit.client.api.ApiGlue::refresh(),
|
refresh: @com.google.gerrit.client.api.ApiGlue::refresh(),
|
||||||
|
refreshMenuBar: @com.google.gerrit.client.api.ApiGlue::refreshMenuBar(),
|
||||||
showError: @com.google.gerrit.client.api.ApiGlue::showError(Ljava/lang/String;),
|
showError: @com.google.gerrit.client.api.ApiGlue::showError(Ljava/lang/String;),
|
||||||
on: function(e,f){G.on(e,f)},
|
on: function(e,f){G.on(e,f)},
|
||||||
onAction: function(t,n,c){G._onAction(this.name,t,n,c)},
|
onAction: function(t,n,c){G._onAction(this.name,t,n,c)},
|
||||||
|
@@ -50,6 +50,10 @@ public final class Plugin extends JavaScriptObject {
|
|||||||
public final native void refresh()
|
public final native void refresh()
|
||||||
/*-{ return this.refresh() }-*/;
|
/*-{ return this.refresh() }-*/;
|
||||||
|
|
||||||
|
/** Refresh Gerrit's menu bar. */
|
||||||
|
public final native void refreshMenuBar()
|
||||||
|
/*-{ return this.refreshMenuBar() }-*/;
|
||||||
|
|
||||||
/** Show message in Gerrit's ErrorDialog. */
|
/** Show message in Gerrit's ErrorDialog. */
|
||||||
public final native void showError(String message)
|
public final native void showError(String message)
|
||||||
/*-{ return this.showError(message) }-*/;
|
/*-{ return this.showError(message) }-*/;
|
||||||
|
Reference in New Issue
Block a user