// Copyright (C) 2013 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.gerrit.extensions.common;

import com.google.gerrit.extensions.webui.UiAction;

public class ActionInfo {
  public String method;
  public String label;
  public String title;
  public Boolean enabled;

  public ActionInfo(UiAction.Description d) {
    method = d.getMethod();
    label = d.getLabel();
    title = d.getTitle();
    enabled = d.isEnabled() ? true : null;
  }
}

@@ -705,103 +705,1107 @@
 n;%0A%0A
-public class ActionInfo %7B%0A  public String method;%0A  public String label;%0A  public String title;
+/**%0A * Representation of an action in the REST API.%0A *%0A * %3Cp%3EThis class determines the JSON format of actions in the REST API.%0A *%0A * %3Cp%3EAn action describes a REST API call the client can make to manipulate a resource. These are%0A * frequently implemented by plugins and may be discovered at runtime.%0A */%0Apublic class ActionInfo %7B%0A  /**%0A   * HTTP method to use with the action. Most actions use %7B@code POST%7D, %7B@code PUT%7D or %7B@code%0A   * DELETE%7D to cause state changes.%0A   */%0A  public String method;%0A%0A  /**%0A   * Short title to display to a user describing the action. In the Gerrit web interface the label%0A   * is used as the text on the button that is presented in the UI.%0A   */%0A  public String label;%0A%0A  /**%0A   * Longer text to display describing the action. In a web UI this should be the title attribute of%0A   * the element, displaying when the user hovers the mouse.%0A   */%0A  public String title;%0A%0A  /**%0A   * If %7B@code true%7D the action is permitted at this time and the caller is likely allowed to%0A   * execute it. This may change if state is updated at the server or permissions are modified.%0A   */
 %0A  p

Document ActionInfo class