Package com.dubture.getcomposer.core.collection

Examples of com.dubture.getcomposer.core.collection.JsonArray


      diag.setHandler(text);
      diag.setEventEnabled(false);
      if (diag.open() == Dialog.OK) {
        String handler = diag.getHandler();
        if (!handler.equalsIgnoreCase(text)) {
          JsonArray events = composerPackage.getScripts().getAsArray(event);
          events.replace(text, handler);
        }
      }
    }
  }
View Full Code Here


          MessageDialog.WARNING,
          new String[] {"Yes", "No"},
          0);
     
      if (diag.open() == Dialog.OK) {
        JsonArray events = composerPackage.getScripts().getAsArray(event);
        events.remove(text);
      }
    }
  }
View Full Code Here

  @Override
  public String convert(Object fromObject) {
    if (fromObject == null) {
      return "";
    }
    JsonArray keywords = (JsonArray)fromObject;
    return StringUtils.join((String[])keywords.toArray(new String[]{}), ", ");
  }
View Full Code Here

  }
 
  @SuppressWarnings("rawtypes")
  private void parseScripts(LinkedHashMap json, String property) {
    if (json.containsKey(property)) {
      JsonArray values;
      Object value = json.get(property);
     
      if (value instanceof LinkedList) {
        values = new JsonArray(value);
      } else {
        values = new JsonArray();
        values.add(value);
      }
     
      set(property, values);
      json.remove(property);
    }
View Full Code Here

   *            the property
   * @return the value
   */
  public JsonArray getAsArray(String property) {
    if (!super.has(property)) {
      super.set(property, new JsonValue(new JsonArray()), false);
    }
    return get(property).getAsArray();
  }
View Full Code Here

  protected void parseValue(JSONObject json, String property) {
    Object value = null;
    if (json.containsKey(property)) {
      value = json.get(property);
      if (value instanceof JSONArray) {
        value = new JsonArray(value);
      } else if (value instanceof JSONObject) {
        value = new JsonObject(value);
      }
    }
    set(property, value);
View Full Code Here

    return list;
  }
 
  private void parseScripts(JSONObject json, String property) {
    if (json.containsKey(property)) {
      JsonArray values;
      Object value = json.get(property);
     
      if (value instanceof JSONArray) {
        values = new JsonArray(value);
      } else {
        values = new JsonArray();
        values.add(value);
      }
     
      set(property, values);
      json.remove(property);
    }
View Full Code Here

   *            the property
   * @return the value
   */
  public JsonArray getAsArray(String property) {
    if (!has(property)) {
      super.set(property, new JsonValue(new JsonArray()), false);
    }
    return get(property).getAsArray();
  }
View Full Code Here

   * <code>["git", "https", "http"]</code> is returned.
   *
   * @return the <code>github-protocols</code> property
   */
  public JsonArray getGithubProtocols() {
    JsonArray protocols = getAsArray("github-protocols");
    if (protocols == null) {
      protocols = new JsonArray();
      protocols.add("git");
      protocols.add("https");
      protocols.add("http");
    }
    return protocols;
  }
View Full Code Here

   *
   * @return the value
   */
  public JsonArray getAsArray() {
    if (!(value instanceof JsonArray)) {
      JsonArray val = new JsonArray();
      val.add(value);
      value = val;
    }
    return (JsonArray)value;
  }
View Full Code Here

TOP

Related Classes of com.dubture.getcomposer.core.collection.JsonArray

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.