Create new changes from the UI as drafts

When creating a new change from the UI, the initial patch set is empty
and the change remains empty until the user adds files and publishes an
edit via the inline editor. However the change is visible to reviewers,
which is not ideal because usually the owner will not want the change to
be reviewed until the content is added.

Change the behavior of the project screen's "Create Change" button and
the change screen's "Follow Up" button to always create new changes as
draft.

With this change, the new change is created as draft and any subsequent
patch sets created via the inline editor are also created as draft. This
means that the change owner can publish as many edits as necessary to get
the change in shape before publishing it for review.

Change-Id: I33a3cccb0c872d69aa6f61d0eb22d3f4fe068834
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/CreateChangeAction.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/CreateChangeAction.java
index 652e5eb..30e2e3d 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/CreateChangeAction.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/CreateChangeAction.java
@@ -35,7 +35,7 @@
 
       @Override
       public void onSend() {
-        ChangeApi.createChange(project, getDestinationBranch(),
+        ChangeApi.createDraftChange(project, getDestinationBranch(),
           message.getText(), null,
           new GerritCallback<ChangeInfo>() {
             @Override
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/FollowUpAction.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/FollowUpAction.java
index 5a7df72..1f5c516 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/FollowUpAction.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/FollowUpAction.java
@@ -35,7 +35,7 @@
 
   @Override
   void send(String message) {
-    ChangeApi.createChange(project, branch, message, base,
+    ChangeApi.createDraftChange(project, branch, message, base,
         new GerritCallback<ChangeInfo>() {
           @Override
           public void onSuccess(ChangeInfo result) {
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeApi.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeApi.java
index c3bbe18..0078ed3 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeApi.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeApi.java
@@ -20,6 +20,7 @@
 import com.google.gerrit.client.rpc.CallbackGroup.Callback;
 import com.google.gerrit.client.rpc.NativeString;
 import com.google.gerrit.client.rpc.RestApi;
+import com.google.gerrit.reviewdb.client.Change;
 import com.google.gerrit.reviewdb.client.PatchSet;
 import com.google.gwt.core.client.JavaScriptObject;
 import com.google.gwt.user.client.rpc.AsyncCallback;
@@ -36,14 +37,15 @@
     call(id, "abandon").post(input, cb);
   }
 
-  /** Create a new change. */
-  public static void createChange(String project, String branch,
+  /** Create a draft change. */
+  public static void createDraftChange(String project, String branch,
       String subject, String base, AsyncCallback<ChangeInfo> cb) {
     CreateChangeInput input = CreateChangeInput.create();
     input.project(emptyToNull(project));
     input.branch(emptyToNull(branch));
     input.subject(emptyToNull(subject));
     input.base_change(emptyToNull(base));
+    input.status(Change.Status.DRAFT.toString());
 
     new RestApi("/changes/").post(input, cb);
   }
@@ -224,6 +226,7 @@
     public final native void project(String p) /*-{ if(p)this.project=p; }-*/;
     public final native void subject(String s) /*-{ if(s)this.subject=s; }-*/;
     public final native void base_change(String b) /*-{ if(b)this.base_change=b; }-*/;
+    public final native void status(String s)  /*-{ if(s)this.status=s; }-*/;
 
     protected CreateChangeInput() {
     }