Make user preferences accessible by plugins

Add methods to the JavaScript API that allows plugins to get and
refresh the preferences of the currently signed in user.

Change-Id: Icabaf8188ccdd19b877856a23d292493cd50a215
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin
2015-07-22 15:01:59 +02:00
parent ebbad5ecab
commit 936d1ed8d1
8 changed files with 115 additions and 74 deletions

View File

@@ -16,6 +16,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.plugin.client.extension.Panel;
import com.google.gerrit.plugin.client.screen.Screen;
import com.google.gwt.core.client.GWT;
@@ -57,6 +58,14 @@ public final class Plugin extends JavaScriptObject {
public final native void refreshMenuBar()
/*-{ return this.refreshMenuBar() }-*/;
/** @return the preferences of the currently signed in user, the default preferences if not signed in */
public final native AccountPreferencesInfo getUserPreferences()
/*-{ return this.getUserPreferences() }-*/;
/** Refresh the user preferences of the current user. */
public final native void refreshUserPreferences()
/*-{ return this.refreshUserPreferences() }-*/;
/** @return the current user */
public final native AccountInfo getCurrentUser()
/*-{ return this.getCurrentUser() }-*/;