Search in sources :

Example 6 with RestApi

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

the class AccountApi method enterAgreement.

/** Enter a contributor agreement */
public static void enterAgreement(String account, String name, AsyncCallback<NativeString> cb) {
    AgreementInput in = AgreementInput.create();
    in.name(name);
    new RestApi("/accounts/").id(account).view("agreements").put(in, cb);
}
Also used : RestApi(com.google.gerrit.client.rpc.RestApi)

Example 7 with RestApi

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

the class ProjectGlue method onAction.

public static void onAction(Project.NameKey project, BranchInfo branch, ActionInfo action, ActionButton button) {
    RestApi api = ProjectApi.project(project).view("branches").id(branch.ref()).view(action.id());
    JavaScriptObject f = branchAction(action.id());
    if (f != null) {
        ActionContext c = ActionContext.create(api);
        c.set(action);
        c.set(project);
        c.set(branch);
        c.button(button);
        ApiGlue.invoke(f, c);
    } else {
        DefaultActions.invoke(project, action, api);
    }
}
Also used : RestApi(com.google.gerrit.client.rpc.RestApi) JavaScriptObject(com.google.gwt.core.client.JavaScriptObject)

Example 8 with RestApi

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

the class ProjectGlue method onAction.

public static void onAction(Project.NameKey project, ActionInfo action, ActionButton button) {
    RestApi api = ProjectApi.project(project).view(action.id());
    JavaScriptObject f = projectAction(action.id());
    if (f != null) {
        ActionContext c = ActionContext.create(api);
        c.set(action);
        c.set(project);
        c.button(button);
        ApiGlue.invoke(f, c);
    } else {
        DefaultActions.invoke(project, action, api);
    }
}
Also used : RestApi(com.google.gerrit.client.rpc.RestApi) JavaScriptObject(com.google.gwt.core.client.JavaScriptObject)

Example 9 with RestApi

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

the class RevisionGlue method onAction.

public static void onAction(ChangeInfo change, RevisionInfo revision, ActionInfo action, ActionButton button) {
    RestApi api = ChangeApi.revision(change.legacyId().get(), revision.name()).view(action.id());
    JavaScriptObject f = get(action.id());
    if (f != null) {
        ActionContext c = ActionContext.create(api);
        c.set(action);
        c.set(change);
        c.set(revision);
        c.button(button);
        ApiGlue.invoke(f, c);
    } else {
        DefaultActions.invoke(change, action, api);
    }
}
Also used : RestApi(com.google.gerrit.client.rpc.RestApi) JavaScriptObject(com.google.gwt.core.client.JavaScriptObject)

Example 10 with RestApi

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

the class ChangeScreen method loadRevisionInfo.

void loadRevisionInfo() {
    RestApi call = ChangeApi.actions(changeId.get(), revision);
    call.background();
    call.get(new GerritCallback<NativeMap<ActionInfo>>() {

        @Override
        public void onSuccess(NativeMap<ActionInfo> actionMap) {
            actionMap.copyKeysIntoChildren("id");
            renderRevisionInfo(changeInfo, actionMap);
        }
    });
}
Also used : RestApi(com.google.gerrit.client.rpc.RestApi) ActionInfo(com.google.gerrit.client.info.ActionInfo) NativeMap(com.google.gerrit.client.rpc.NativeMap)

Aggregations

RestApi (com.google.gerrit.client.rpc.RestApi)42 JavaScriptObject (com.google.gwt.core.client.JavaScriptObject)8 ChangeInfo (com.google.gerrit.client.info.ChangeInfo)3 EditInfo (com.google.gerrit.client.info.ChangeInfo.EditInfo)2 CallbackGroup (com.google.gerrit.client.rpc.CallbackGroup)2 AsyncCallback (com.google.gwt.user.client.rpc.AsyncCallback)2 Anchor (com.google.gwt.user.client.ui.Anchor)2 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)2 InlineLabel (com.google.gwt.user.client.ui.InlineLabel)2 ArrayList (java.util.ArrayList)2 GerritUiExtensionPoint (com.google.gerrit.client.GerritUiExtensionPoint)1 ActionInfo (com.google.gerrit.client.info.ActionInfo)1 RevisionInfo (com.google.gerrit.client.info.ChangeInfo.RevisionInfo)1 GerritCallback (com.google.gerrit.client.rpc.GerritCallback)1 NativeMap (com.google.gerrit.client.rpc.NativeMap)1 NativeString (com.google.gerrit.client.rpc.NativeString)1 ListChangesOption (com.google.gerrit.extensions.client.ListChangesOption)1 Change (com.google.gerrit.reviewdb.client.Change)1 Project (com.google.gerrit.reviewdb.client.Project)1 JsArray (com.google.gwt.core.client.JsArray)1