use of com.google.gerrit.client.info.ActionInfo in project gerrit by GerritCodeReview.
the class Actions method initChangeActions.
private void initChangeActions(ChangeInfo info, boolean hasUser) {
NativeMap<ActionInfo> actions = info.hasActions() ? info.actions() : NativeMap.<ActionInfo>create();
actions.copyKeysIntoChildren("id");
if (hasUser) {
a2b(actions, "abandon", abandon);
a2b(actions, "/", deleteChange);
a2b(actions, "restore", restore);
a2b(actions, "revert", revert);
a2b(actions, "followup", followUp);
if (info.isPrivate()) {
a2b(actions, "private", unmarkPrivate);
} else {
a2b(actions, "private", markPrivate);
}
for (String id : filterNonCore(actions)) {
add(new ActionButton(info, actions.get(id)));
}
}
}
use of com.google.gerrit.client.info.ActionInfo in project gerrit by GerritCodeReview.
the class Actions method a2b.
private static void a2b(NativeMap<ActionInfo> actions, String a, Button b) {
if (actions.containsKey(a)) {
b.setVisible(true);
ActionInfo actionInfo = actions.get(a);
b.setTitle(actionInfo.title());
b.setEnabled(actionInfo.enabled());
}
}
Aggregations