Search in sources :

Example 16 with CallbackGroup

use of com.google.gerrit.client.rpc.CallbackGroup in project gerrit by GerritCodeReview.

the class ProjectInfoScreen method onLoad.

@Override
protected void onLoad() {
    super.onLoad();
    Project.NameKey project = getProjectKey();
    CallbackGroup cbg = new CallbackGroup();
    AccessMap.get(project, cbg.add(new GerritCallback<ProjectAccessInfo>() {

        @Override
        public void onSuccess(ProjectAccessInfo result) {
            isOwner = result.isOwner();
            configVisible = result.configVisible();
            enableForm();
            saveProject.setVisible(isOwner);
        }
    }));
    ProjectApi.getConfig(project, cbg.addFinal(new ScreenLoadCallback<ConfigInfo>(this) {

        @Override
        public void preDisplay(ConfigInfo result) {
            display(result);
        }
    }));
    savedPanel = INFO;
}
Also used : Project(com.google.gerrit.reviewdb.client.Project) GerritCallback(com.google.gerrit.client.rpc.GerritCallback) ProjectAccessInfo(com.google.gerrit.client.access.ProjectAccessInfo) CallbackGroup(com.google.gerrit.client.rpc.CallbackGroup) ScreenLoadCallback(com.google.gerrit.client.rpc.ScreenLoadCallback) ConfigInfo(com.google.gerrit.client.projects.ConfigInfo)

Aggregations

CallbackGroup (com.google.gerrit.client.rpc.CallbackGroup)16 GerritCallback (com.google.gerrit.client.rpc.GerritCallback)8 AsyncCallback (com.google.gwt.user.client.rpc.AsyncCallback)5 ChangeInfo (com.google.gerrit.client.info.ChangeInfo)3 RevisionInfo (com.google.gerrit.client.info.ChangeInfo.RevisionInfo)3 UiHandler (com.google.gwt.uibinder.client.UiHandler)3 AccountInfo (com.google.gerrit.client.info.AccountInfo)2 EditInfo (com.google.gerrit.client.info.ChangeInfo.EditInfo)2 NativeMap (com.google.gerrit.client.rpc.NativeMap)2 NativeString (com.google.gerrit.client.rpc.NativeString)2 RestApi (com.google.gerrit.client.rpc.RestApi)2 ScreenLoadCallback (com.google.gerrit.client.rpc.ScreenLoadCallback)2 JsArray (com.google.gwt.core.client.JsArray)2 NotFoundScreen (com.google.gerrit.client.NotFoundScreen)1 ProjectAccessInfo (com.google.gerrit.client.access.ProjectAccessInfo)1 EditPreferences (com.google.gerrit.client.account.EditPreferences)1 ChangeScreen (com.google.gerrit.client.change.ChangeScreen)1 ChangeList (com.google.gerrit.client.changes.ChangeList)1 CommentInfo (com.google.gerrit.client.changes.CommentInfo)1 CapabilityInfo (com.google.gerrit.client.config.CapabilityInfo)1