Exemple #1
0
 @Override
 protected synchronized JSON data() {
   JSONArray r = new JSONArray();
   for (User u : modified) {
     UserInfo i = users.get(u);
     JSONObject entry =
         new JSONObject()
             .accumulate("id", u.getId())
             .accumulate("fullName", u.getFullName())
             .accumulate("url", u.getUrl())
             .accumulate(
                 "avatar",
                 i.avatar != null
                     ? i.avatar
                     : Stapler.getCurrentRequest().getContextPath()
                         + Functions.getResourcePath()
                         + "/images/"
                         + iconSize
                         + "/user.png")
             .accumulate("timeSortKey", i.getTimeSortKey())
             .accumulate("lastChangeTimeString", i.getLastChangeTimeString());
     AbstractProject<?, ?> p = i.getProject();
     if (p != null) {
       entry
           .accumulate("projectUrl", p.getUrl())
           .accumulate("projectFullDisplayName", p.getFullDisplayName());
     }
     r.add(entry);
   }
   modified.clear();
   return r;
 }
    public ContextMenu add(Action a) {
      StaplerRequest req = Stapler.getCurrentRequest();
      String text = a.getDisplayName();
      String base = Functions.getIconFilePath(a);
      if (base == null) return this;
      String icon =
          Stapler.getCurrentRequest().getContextPath()
              + (base.startsWith("images/") ? Functions.getResourcePath() : "")
              + '/'
              + base;

      String url = Functions.getActionUrl(req.findAncestor(ModelObject.class).getUrl(), a);

      return add(url, icon, text);
    }
 @Override
 public String getHelpFile() {
   return Functions.getResourcePath() + "/plugin/android-device/help-buildConfig.html";
 }
 @Override
 public String getHelpFile() {
   return Functions.getResourcePath() + "/plugin/android-emulator/help-snapshotLoad.html";
 }