package edu.colorado.csdms.wmt.client.data;

import java.util.Vector;

import com.google.gwt.core.client.JavaScriptObject;

/**
 * A GWT JavaScript overlay (JSO) type that describes ports that a WMT component
 * model provides and uses, with "id" and "required" attributes. Declares JSNI
 * methods to access these attributes from a JSON and modify them in memory.
 * 
 * @see <a
 *      href="http://www.gwtproject.org/doc/latest/DevGuideCodingBasicsOverlay.html">http://www.gwtproject.org/doc/latest/DevGuideCodingBasicsOverlay.html</a>
 * @author Mark Piper (mark.piper@colorado.edu)
 */
public class PortJSO extends JavaScriptObject {

  // Overlay types have protected, no-arg, constructors.
  protected PortJSO() {
  }

  /**
   * JSNI method to get the "id" attribute of a Port. If no port is present,
   * null is returned.
   */
  public final native String getId() /*-{
		return (typeof this.id == 'undefined') ? null : this.id;
  }-*/;

  /**
   * JSNI method to get the "required" attribute of a Port. If this attribute is
   * not present, false is returned. Note that the return is a JS boolean, not a
   * J Boolean.
   */
  public final native boolean isRequired() /*-{
		return (typeof this.required == 'undefined') ? false : this.required;
  }-*/;

  /**
   * A non-JSNI method for stringifying the attributes of a Port. Must be final.
   */
  public final Vector<String> toStringVector() {

    Vector<String> retVal = new Vector<String>();
    Boolean isRequired = isRequired();
    retVal.add("id: " + getId());
    retVal.add("required: " + isRequired.toString());
    return retVal;
  }
}

@@ -765,33 +765,33 @@
  attribute of a 
-P
+p
 ort. If no port 
@@ -933,32 +933,217 @@
 is.id;%0A  %7D-*/;%0A%0A
+  /**%0A   * A JSNI method to set the %22id%22 of a port.%0A   * %0A   * @param id the port identifier, a String%0A   */%0A  public final native void setId(String id) /*-%7B%0A%09%09this.id = id;%0A  %7D-*/;%0A  %0A
   /**%0A   * JSNI 
@@ -1182,25 +1182,25 @@
 ribute of a 
-P
+p
 ort. If this
@@ -1435,32 +1435,258 @@
 equired;%0A  %7D-*/;
+%0A  %0A  /**%0A   * A JSNI method to set the %22required%22 attribute of a port.%0A   * %0A   * @param required true if port is required%0A   */%0A  public final native void isRequired(Boolean required) /*-%7B%0A%09%09this.required = required;%0A  %7D-*/;
 %0A%0A  /**%0A   * A n
@@ -1737,17 +1737,17 @@
 es of a 
-P
+p
 ort. Mus

Add mutators to PortJSO