You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by sm...@apache.org on 2014/06/18 18:37:25 UTC

svn commit: r1603514 - in /pivot/branches/2.0.x/tutorials/src/org/apache/pivot/tutorials: explorer/form.bxml layout/Forms.java layout/forms.bxml

Author: smartini
Date: Wed Jun 18 16:37:23 2014
New Revision: 1603514

URL: http://svn.apache.org/r1603514
Log:
add a ListButton in the sample Form, just to show its usage inside a Form, and to show what happens when a form containing different type of components is put in not enabled status using Component Explorer

Modified:
    pivot/branches/2.0.x/tutorials/src/org/apache/pivot/tutorials/explorer/form.bxml
    pivot/branches/2.0.x/tutorials/src/org/apache/pivot/tutorials/layout/Forms.java
    pivot/branches/2.0.x/tutorials/src/org/apache/pivot/tutorials/layout/forms.bxml

Modified: pivot/branches/2.0.x/tutorials/src/org/apache/pivot/tutorials/explorer/form.bxml
URL: http://svn.apache.org/viewvc/pivot/branches/2.0.x/tutorials/src/org/apache/pivot/tutorials/explorer/form.bxml?rev=1603514&r1=1603513&r2=1603514&view=diff
==============================================================================
--- pivot/branches/2.0.x/tutorials/src/org/apache/pivot/tutorials/explorer/form.bxml (original)
+++ pivot/branches/2.0.x/tutorials/src/org/apache/pivot/tutorials/explorer/form.bxml Wed Jun 18 16:37:23 2014
@@ -19,6 +19,9 @@ limitations under the License.
 <Form xmlns:bxml="http://pivot.apache.org/bxml"
     xmlns="org.apache.pivot.wtk">
     <Form.Section heading="Personal Information">
+        <BoxPane bxml:id="titleBoxPane" Form.label="Title">
+            <ListButton bxml:id="titleListButton" listData="['', 'Mr.', 'Mrs.']"/>
+        </BoxPane>
         <BoxPane bxml:id="nameBoxPane" Form.label="Name">
             <TextInput bxml:id="lastNameTextInput" prompt="Last"/>
             <TextInput bxml:id="firstNameTextInput" prompt="First"/>

Modified: pivot/branches/2.0.x/tutorials/src/org/apache/pivot/tutorials/layout/Forms.java
URL: http://svn.apache.org/viewvc/pivot/branches/2.0.x/tutorials/src/org/apache/pivot/tutorials/layout/Forms.java?rev=1603514&r1=1603513&r2=1603514&view=diff
==============================================================================
--- pivot/branches/2.0.x/tutorials/src/org/apache/pivot/tutorials/layout/Forms.java (original)
+++ pivot/branches/2.0.x/tutorials/src/org/apache/pivot/tutorials/layout/Forms.java Wed Jun 18 16:37:23 2014
@@ -21,11 +21,12 @@ import java.net.URL;
 import org.apache.pivot.beans.Bindable;
 import org.apache.pivot.collections.Map;
 import org.apache.pivot.util.Resources;
+import org.apache.pivot.wtk.BoxPane;
 import org.apache.pivot.wtk.Button;
 import org.apache.pivot.wtk.ButtonPressListener;
-import org.apache.pivot.wtk.BoxPane;
 import org.apache.pivot.wtk.Form;
 import org.apache.pivot.wtk.Label;
+import org.apache.pivot.wtk.ListButton;
 import org.apache.pivot.wtk.MessageType;
 import org.apache.pivot.wtk.Prompt;
 import org.apache.pivot.wtk.PushButton;
@@ -33,6 +34,7 @@ import org.apache.pivot.wtk.TextInput;
 import org.apache.pivot.wtk.Window;
 
 public class Forms extends Window implements Bindable {
+    private ListButton titleListButton = null;
     private BoxPane nameBoxPane = null;
     private TextInput lastNameTextInput = null;
     private TextInput firstNameTextInput = null;
@@ -41,6 +43,7 @@ public class Forms extends Window implem
 
     @Override
     public void initialize(Map<String, Object> namespace, URL location, Resources resources) {
+        titleListButton = (ListButton)namespace.get("titleListButton");
         nameBoxPane = (BoxPane)namespace.get("nameBoxPane");
         lastNameTextInput = (TextInput)namespace.get("lastNameTextInput");
         firstNameTextInput = (TextInput)namespace.get("firstNameTextInput");
@@ -50,6 +53,9 @@ public class Forms extends Window implem
         submitButton.getButtonPressListeners().add(new ButtonPressListener() {
             @Override
             public void buttonPressed(Button button) {
+                String titleOfPerson = (String) titleListButton.getButtonData();
+                System.out.println("The title of the person is: \"" + titleOfPerson + "\"");
+
                 String lastName = lastNameTextInput.getText();
                 String firstName = firstNameTextInput.getText();
 

Modified: pivot/branches/2.0.x/tutorials/src/org/apache/pivot/tutorials/layout/forms.bxml
URL: http://svn.apache.org/viewvc/pivot/branches/2.0.x/tutorials/src/org/apache/pivot/tutorials/layout/forms.bxml?rev=1603514&r1=1603513&r2=1603514&view=diff
==============================================================================
--- pivot/branches/2.0.x/tutorials/src/org/apache/pivot/tutorials/layout/forms.bxml (original)
+++ pivot/branches/2.0.x/tutorials/src/org/apache/pivot/tutorials/layout/forms.bxml Wed Jun 18 16:37:23 2014
@@ -29,6 +29,9 @@ limitations under the License.
             <TablePane.Row height="1*">
                 <Form>
                     <Form.Section>
+                        <BoxPane bxml:id="titleBoxPane" Form.label="Title">
+                            <ListButton bxml:id="titleListButton" listData="['', 'Mr.', 'Mrs.']"/>
+                        </BoxPane>
                         <BoxPane bxml:id="nameBoxPane" Form.label="Name">
                             <TextInput bxml:id="lastNameTextInput" prompt="Last"/>
                             <TextInput bxml:id="firstNameTextInput" prompt="First"/>