Make ServerInfo accessible by plugins

The ServerInfo information provides information about the server
configuration that is relevant for rendering the UI. UI plugins should
be able to access it, e.g. they need the anonymous coward name to
render user names the same way as Gerrit core does (use the anonymous
coward name if the user has no full name).

Change-Id: I272bcb96b5ce888007f6c4fa12f74ef750cc9862
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin
2015-07-27 11:51:01 +02:00
parent ac34c132fb
commit 2fc17f4e52
22 changed files with 38 additions and 20 deletions

View File

@@ -17,6 +17,7 @@ package com.google.gerrit.plugin.client;
import com.google.gerrit.client.GerritUiExtensionPoint;
import com.google.gerrit.client.info.AccountInfo;
import com.google.gerrit.client.info.AccountPreferencesInfo;
import com.google.gerrit.client.info.ServerInfo;
import com.google.gerrit.plugin.client.extension.Panel;
import com.google.gerrit.plugin.client.screen.Screen;
import com.google.gwt.core.client.GWT;
@@ -66,6 +67,10 @@ public final class Plugin extends JavaScriptObject {
public final native void refreshUserPreferences()
/*-{ return this.refreshUserPreferences() }-*/;
/** @return the server info */
public final native ServerInfo getServerInfo()
/*-{ return this.getServerInfo() }-*/;
/** @return the current user */
public final native AccountInfo getCurrentUser()
/*-{ return this.getCurrentUser() }-*/;