| |   |
| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | |
| 3 | <Form version="1.3" maxVersion="1.6" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> |
| 4 | <AuxValues> |
| 5 | <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> |
| 6 | <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> |
| 7 | <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> |
| 8 | <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> |
| 9 | <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/> |
| 10 | <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> |
| 11 | <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> |
| 12 | <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> |
| 13 | </AuxValues> |
| 14 | |
| 15 | <Layout> |
| 16 | <DimensionLayout dim="0"> |
| 17 | <Group type="103" groupAlignment="0" attributes="0"> |
| 18 | <Group type="102" alignment="0" attributes="0"> |
| 19 | <EmptySpace max="-2" attributes="0"/> |
| 20 | <Group type="103" groupAlignment="1" attributes="0"> |
| 21 | <Component id="jLabel5" alignment="1" min="-2" max="-2" attributes="0"/> |
| 22 | <Component id="jLabel4" alignment="1" min="-2" max="-2" attributes="0"/> |
| 23 | <Component id="jLabel3" alignment="1" min="-2" max="-2" attributes="0"/> |
| 24 | <Component id="jLabel2" alignment="1" min="-2" max="-2" attributes="0"/> |
| 25 | <Component id="jLabel1" alignment="1" min="-2" max="-2" attributes="0"/> |
| 26 | </Group> |
| 27 | <EmptySpace type="separate" max="-2" attributes="0"/> |
| 28 | <Group type="103" groupAlignment="0" attributes="0"> |
| 29 | <Component id="state_combo_box" min="-2" max="-2" attributes="0"/> |
| 30 | <Component id="street_address1_text_field" alignment="0" pref="150" max="32767" attributes="0"/> |
| 31 | <Component id="street_address2_text_field" alignment="0" pref="150" max="32767" attributes="0"/> |
| 32 | <Component id="city_text_field" alignment="0" pref="150" max="32767" attributes="0"/> |
| 33 | <Component id="zip_code_text_field" alignment="0" pref="150" max="32767" attributes="0"/> |
| 34 | </Group> |
| 35 | <EmptySpace max="-2" attributes="0"/> |
| 36 | </Group> |
| 37 | </Group> |
| 38 | </DimensionLayout> |
| 39 | <DimensionLayout dim="1"> |
| 40 | <Group type="103" groupAlignment="0" attributes="0"> |
| 41 | <Group type="102" alignment="0" attributes="0"> |
| 42 | <EmptySpace max="-2" attributes="0"/> |
| 43 | <Group type="103" groupAlignment="3" attributes="0"> |
| 44 | <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/> |
| 45 | <Component id="street_address1_text_field" alignment="3" min="-2" max="-2" attributes="0"/> |
| 46 | </Group> |
| 47 | <EmptySpace max="-2" attributes="0"/> |
| 48 | <Group type="103" groupAlignment="3" attributes="0"> |
| 49 | <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> |
| 50 | <Component id="street_address2_text_field" alignment="3" min="-2" max="-2" attributes="0"/> |
| 51 | </Group> |
| 52 | <EmptySpace max="-2" attributes="0"/> |
| 53 | <Group type="103" groupAlignment="3" attributes="0"> |
| 54 | <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/> |
| 55 | <Component id="city_text_field" alignment="3" min="-2" max="-2" attributes="0"/> |
| 56 | </Group> |
| 57 | <EmptySpace max="-2" attributes="0"/> |
| 58 | <Group type="103" groupAlignment="3" attributes="0"> |
| 59 | <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/> |
| 60 | <Component id="state_combo_box" alignment="3" min="-2" max="-2" attributes="0"/> |
| 61 | </Group> |
| 62 | <EmptySpace max="-2" attributes="0"/> |
| 63 | <Group type="103" groupAlignment="3" attributes="0"> |
| 64 | <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/> |
| 65 | <Component id="zip_code_text_field" alignment="3" min="-2" max="-2" attributes="0"/> |
| 66 | </Group> |
| 67 | <EmptySpace max="32767" attributes="0"/> |
| 68 | </Group> |
| 69 | </Group> |
| 70 | </DimensionLayout> |
| 71 | </Layout> |
| 72 | <SubComponents> |
| 73 | <Component class="javax.swing.JLabel" name="jLabel1"> |
| 74 | <Properties> |
| 75 | <Property name="text" type="java.lang.String" value="Street address 1"/> |
| 76 | </Properties> |
| 77 | </Component> |
| 78 | <Component class="javax.swing.JLabel" name="jLabel2"> |
| 79 | <Properties> |
| 80 | <Property name="text" type="java.lang.String" value="Street address 2"/> |
| 81 | </Properties> |
| 82 | </Component> |
| 83 | <Component class="javax.swing.JLabel" name="jLabel3"> |
| 84 | <Properties> |
| 85 | <Property name="text" type="java.lang.String" value="City"/> |
| 86 | </Properties> |
| 87 | </Component> |
| 88 | <Component class="javax.swing.JLabel" name="jLabel4"> |
| 89 | <Properties> |
| 90 | <Property name="text" type="java.lang.String" value="State"/> |
| 91 | </Properties> |
| 92 | </Component> |
| 93 | <Component class="javax.swing.JLabel" name="jLabel5"> |
| 94 | <Properties> |
| 95 | <Property name="text" type="java.lang.String" value="Zip code"/> |
| 96 | </Properties> |
| 97 | </Component> |
| 98 | <Component class="javax.swing.JTextField" name="street_address1_text_field"> |
| 99 | <Properties> |
| 100 | <Property name="text" type="java.lang.String" value="4643 E. Thomas Rd."/> |
| 101 | </Properties> |
| 102 | </Component> |
| 103 | <Component class="javax.swing.JTextField" name="street_address2_text_field"> |
| 104 | <Properties> |
| 105 | <Property name="text" type="java.lang.String" value="#3"/> |
| 106 | </Properties> |
| 107 | </Component> |
| 108 | <Component class="javax.swing.JTextField" name="city_text_field"> |
| 109 | <Properties> |
| 110 | <Property name="text" type="java.lang.String" value="Phoenix"/> |
| 111 | </Properties> |
| 112 | </Component> |
| 113 | <Component class="javax.swing.JTextField" name="zip_code_text_field"> |
| 114 | <Properties> |
| 115 | <Property name="text" type="java.lang.String" value="85018"/> |
| 116 | </Properties> |
| 117 | </Component> |
| 118 | <Component class="javax.swing.JComboBox" name="state_combo_box"> |
| 119 | <Properties> |
| 120 | <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> |
| 121 | <StringArray count="4"> |
| 122 | <StringItem index="0" value="AK"/> |
| 123 | <StringItem index="1" value="AL"/> |
| 124 | <StringItem index="2" value="AZ"/> |
| 125 | <StringItem index="3" value="etc"/> |
| 126 | </StringArray> |
| 127 | </Property> |
| 128 | </Properties> |
| 129 | </Component> |
| 130 | </SubComponents> |
| 131 | </Form> |
| toggle raw diff |
--- /dev/null
+++ b/examples/Nested-DropIn/src/address/AddressPanel.form
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.3" maxVersion="1.6" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
+ <AuxValues>
+ <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
+ <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
+ </AuxValues>
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="0" attributes="0">
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="1" attributes="0">
+ <Component id="jLabel5" alignment="1" min="-2" max="-2" attributes="0"/>
+ <Component id="jLabel4" alignment="1" min="-2" max="-2" attributes="0"/>
+ <Component id="jLabel3" alignment="1" min="-2" max="-2" attributes="0"/>
+ <Component id="jLabel2" alignment="1" min="-2" max="-2" attributes="0"/>
+ <Component id="jLabel1" alignment="1" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace type="separate" max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Component id="state_combo_box" min="-2" max="-2" attributes="0"/>
+ <Component id="street_address1_text_field" alignment="0" pref="150" max="32767" attributes="0"/>
+ <Component id="street_address2_text_field" alignment="0" pref="150" max="32767" attributes="0"/>
+ <Component id="city_text_field" alignment="0" pref="150" max="32767" attributes="0"/>
+ <Component id="zip_code_text_field" alignment="0" pref="150" max="32767" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="0" attributes="0">
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="street_address1_text_field" alignment="3" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="street_address2_text_field" alignment="3" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="city_text_field" alignment="3" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="state_combo_box" alignment="3" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="zip_code_text_field" alignment="3" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="32767" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ <SubComponents>
+ <Component class="javax.swing.JLabel" name="jLabel1">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Street address 1"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabel2">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Street address 2"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabel3">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="City"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabel4">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="State"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabel5">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Zip code"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField" name="street_address1_text_field">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="4643 E. Thomas Rd."/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField" name="street_address2_text_field">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="#3"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField" name="city_text_field">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Phoenix"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField" name="zip_code_text_field">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="85018"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JComboBox" name="state_combo_box">
+ <Properties>
+ <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
+ <StringArray count="4">
+ <StringItem index="0" value="AK"/>
+ <StringItem index="1" value="AL"/>
+ <StringItem index="2" value="AZ"/>
+ <StringItem index="3" value="etc"/>
+ </StringArray>
+ </Property>
+ </Properties>
+ </Component>
+ </SubComponents>
+</Form> |
| |   |
| 1 | /* |
| 2 | * AddressPanel.java |
| 3 | * |
| 4 | * Created on June 7, 2008, 10:04 PM |
| 5 | */ |
| 6 | |
| 7 | package address; |
| 8 | |
| 9 | /** |
| 10 | * |
| 11 | * @author logan |
| 12 | */ |
| 13 | public class AddressPanel extends javax.swing.JPanel { |
| 14 | |
| 15 | /** Creates new form AddressPanel */ |
| 16 | public AddressPanel() { |
| 17 | initComponents(); |
| 18 | } |
| 19 | |
| 20 | /** This method is called from within the constructor to |
| 21 | * initialize the form. |
| 22 | * WARNING: Do NOT modify this code. The content of this method is |
| 23 | * always regenerated by the Form Editor. |
| 24 | */ |
| 25 | @SuppressWarnings("unchecked") |
| 26 | // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents |
| 27 | private void initComponents() { |
| 28 | |
| 29 | jLabel1 = new javax.swing.JLabel(); |
| 30 | jLabel2 = new javax.swing.JLabel(); |
| 31 | jLabel3 = new javax.swing.JLabel(); |
| 32 | jLabel4 = new javax.swing.JLabel(); |
| 33 | jLabel5 = new javax.swing.JLabel(); |
| 34 | street_address1_text_field = new javax.swing.JTextField(); |
| 35 | street_address2_text_field = new javax.swing.JTextField(); |
| 36 | city_text_field = new javax.swing.JTextField(); |
| 37 | zip_code_text_field = new javax.swing.JTextField(); |
| 38 | state_combo_box = new javax.swing.JComboBox(); |
| 39 | |
| 40 | jLabel1.setText("Street address 1"); |
| 41 | |
| 42 | jLabel2.setText("Street address 2"); |
| 43 | |
| 44 | jLabel3.setText("City"); |
| 45 | |
| 46 | jLabel4.setText("State"); |
| 47 | |
| 48 | jLabel5.setText("Zip code"); |
| 49 | |
| 50 | street_address1_text_field.setText("4643 E. Thomas Rd."); |
| 51 | |
| 52 | street_address2_text_field.setText("#3"); |
| 53 | |
| 54 | city_text_field.setText("Phoenix"); |
| 55 | |
| 56 | zip_code_text_field.setText("85018"); |
| 57 | |
| 58 | state_combo_box.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "AK", "AL", "AZ", "etc" })); |
| 59 | |
| 60 | org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); |
| 61 | this.setLayout(layout); |
| 62 | layout.setHorizontalGroup( |
| 63 | layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
| 64 | .add(layout.createSequentialGroup() |
| 65 | .addContainerGap() |
| 66 | .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) |
| 67 | .add(jLabel5) |
| 68 | .add(jLabel4) |
| 69 | .add(jLabel3) |
| 70 | .add(jLabel2) |
| 71 | .add(jLabel1)) |
| 72 | .add(18, 18, 18) |
| 73 | .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
| 74 | .add(state_combo_box, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
| 75 | .add(street_address1_text_field, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE) |
| 76 | .add(street_address2_text_field, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE) |
| 77 | .add(city_text_field, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE) |
| 78 | .add(zip_code_text_field, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE)) |
| 79 | .addContainerGap()) |
| 80 | ); |
| 81 | layout.setVerticalGroup( |
| 82 | layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
| 83 | .add(layout.createSequentialGroup() |
| 84 | .addContainerGap() |
| 85 | .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
| 86 | .add(jLabel1) |
| 87 | .add(street_address1_text_field, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
| 88 | .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
| 89 | .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
| 90 | .add(jLabel2) |
| 91 | .add(street_address2_text_field, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
| 92 | .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
| 93 | .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
| 94 | .add(jLabel3) |
| 95 | .add(city_text_field, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
| 96 | .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
| 97 | .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
| 98 | .add(jLabel4) |
| 99 | .add(state_combo_box, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
| 100 | .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
| 101 | .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
| 102 | .add(jLabel5) |
| 103 | .add(zip_code_text_field, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
| 104 | .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) |
| 105 | ); |
| 106 | }// </editor-fold>//GEN-END:initComponents |
| 107 | |
| 108 | |
| 109 | // Variables declaration - do not modify//GEN-BEGIN:variables |
| 110 | private javax.swing.JTextField city_text_field; |
| 111 | private javax.swing.JLabel jLabel1; |
| 112 | private javax.swing.JLabel jLabel2; |
| 113 | private javax.swing.JLabel jLabel3; |
| 114 | private javax.swing.JLabel jLabel4; |
| 115 | private javax.swing.JLabel jLabel5; |
| 116 | private javax.swing.JComboBox state_combo_box; |
| 117 | private javax.swing.JTextField street_address1_text_field; |
| 118 | private javax.swing.JTextField street_address2_text_field; |
| 119 | private javax.swing.JTextField zip_code_text_field; |
| 120 | // End of variables declaration//GEN-END:variables |
| 121 | |
| 122 | } |
| toggle raw diff |
--- /dev/null
+++ b/examples/Nested-DropIn/src/address/AddressPanel.java
@@ -0,0 +1,122 @@
+/*
+ * AddressPanel.java
+ *
+ * Created on June 7, 2008, 10:04 PM
+ */
+
+package address;
+
+/**
+ *
+ * @author logan
+ */
+public class AddressPanel extends javax.swing.JPanel {
+
+ /** Creates new form AddressPanel */
+ public AddressPanel() {
+ initComponents();
+ }
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ jLabel1 = new javax.swing.JLabel();
+ jLabel2 = new javax.swing.JLabel();
+ jLabel3 = new javax.swing.JLabel();
+ jLabel4 = new javax.swing.JLabel();
+ jLabel5 = new javax.swing.JLabel();
+ street_address1_text_field = new javax.swing.JTextField();
+ street_address2_text_field = new javax.swing.JTextField();
+ city_text_field = new javax.swing.JTextField();
+ zip_code_text_field = new javax.swing.JTextField();
+ state_combo_box = new javax.swing.JComboBox();
+
+ jLabel1.setText("Street address 1");
+
+ jLabel2.setText("Street address 2");
+
+ jLabel3.setText("City");
+
+ jLabel4.setText("State");
+
+ jLabel5.setText("Zip code");
+
+ street_address1_text_field.setText("4643 E. Thomas Rd.");
+
+ street_address2_text_field.setText("#3");
+
+ city_text_field.setText("Phoenix");
+
+ zip_code_text_field.setText("85018");
+
+ state_combo_box.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "AK", "AL", "AZ", "etc" }));
+
+ org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
+ this.setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(layout.createSequentialGroup()
+ .addContainerGap()
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
+ .add(jLabel5)
+ .add(jLabel4)
+ .add(jLabel3)
+ .add(jLabel2)
+ .add(jLabel1))
+ .add(18, 18, 18)
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(state_combo_box, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(street_address1_text_field, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE)
+ .add(street_address2_text_field, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE)
+ .add(city_text_field, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE)
+ .add(zip_code_text_field, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE))
+ .addContainerGap())
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(layout.createSequentialGroup()
+ .addContainerGap()
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+ .add(jLabel1)
+ .add(street_address1_text_field, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+ .add(jLabel2)
+ .add(street_address2_text_field, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+ .add(jLabel3)
+ .add(city_text_field, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+ .add(jLabel4)
+ .add(state_combo_box, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+ .add(jLabel5)
+ .add(zip_code_text_field, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ );
+ }// </editor-fold>//GEN-END:initComponents
+
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JTextField city_text_field;
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JLabel jLabel2;
+ private javax.swing.JLabel jLabel3;
+ private javax.swing.JLabel jLabel4;
+ private javax.swing.JLabel jLabel5;
+ private javax.swing.JComboBox state_combo_box;
+ private javax.swing.JTextField street_address1_text_field;
+ private javax.swing.JTextField street_address2_text_field;
+ private javax.swing.JTextField zip_code_text_field;
+ // End of variables declaration//GEN-END:variables
+
+} |
| |   |
| 1 | class AddressView < ApplicationView |
| 2 | set_java_class 'address.AddressPanel' |
| 3 | |
| 4 | map :view => 'street_address1_text_field.text', :model => :street_address1 |
| 5 | map :view => 'street_address2_text_field.text', :model => :street_address2 |
| 6 | map :view => 'city_text_field.text', :model => :city |
| 7 | map :view => 'state_combo_box.selected_item', :model => :state |
| 8 | map :view => 'zip_code_text_field.text', :model => :zip_code |
| 9 | |
| 10 | define_signal :name => :allow_editing, :handler => :enable_fields |
| 11 | define_signal :name => :deny_editing, :handler => :disable_fields |
| 12 | |
| 13 | def enable_fields(model, transfer) |
| 14 | set_editable_fields(true) |
| 15 | end |
| 16 | |
| 17 | def disable_fields(model, transfer) |
| 18 | set_editable_fields(false) |
| 19 | end |
| 20 | |
| 21 | def set_editable_fields(state) |
| 22 | street_address1_text_field.enabled = state |
| 23 | street_address2_text_field.enabled = state |
| 24 | city_text_field.enabled = state |
| 25 | state_combo_box.enabled = state |
| 26 | zip_code_text_field.enabled = state |
| 27 | end |
| 28 | end |
| toggle raw diff |
--- /dev/null
+++ b/examples/Nested-DropIn/src/address/address_view.rb
@@ -0,0 +1,28 @@
+class AddressView < ApplicationView
+ set_java_class 'address.AddressPanel'
+
+ map :view => 'street_address1_text_field.text', :model => :street_address1
+ map :view => 'street_address2_text_field.text', :model => :street_address2
+ map :view => 'city_text_field.text', :model => :city
+ map :view => 'state_combo_box.selected_item', :model => :state
+ map :view => 'zip_code_text_field.text', :model => :zip_code
+
+ define_signal :name => :allow_editing, :handler => :enable_fields
+ define_signal :name => :deny_editing, :handler => :disable_fields
+
+ def enable_fields(model, transfer)
+ set_editable_fields(true)
+ end
+
+ def disable_fields(model, transfer)
+ set_editable_fields(false)
+ end
+
+ def set_editable_fields(state)
+ street_address1_text_field.enabled = state
+ street_address2_text_field.enabled = state
+ city_text_field.enabled = state
+ state_combo_box.enabled = state
+ zip_code_text_field.enabled = state
+ end
+end |
| |   |
| 1 | #=============================================================================== |
| 2 | # Much of the platform specific code should be called before Swing is touched. |
| 3 | # The useScreenMenuBar is an example of this. |
| 4 | require 'rbconfig' |
| 5 | |
| 6 | #=============================================================================== |
| 7 | # Platform specific operations, feel free to remove or override any of these |
| 8 | # that don't work for your platform/application |
| 9 | |
| 10 | case Config::CONFIG["host_os"] |
| 11 | when /darwin/i # OSX specific code |
| 12 | java.lang.System.set_property("apple.laf.useScreenMenuBar", "true") |
| 13 | when /^win/i # Windows specific code |
| 14 | when /linux/i # Linux specific code |
| 15 | end |
| 16 | |
| 17 | # End of platform specific code |
| 18 | #=============================================================================== |
| 19 | |
| 20 | $LOAD_PATH.unshift File.dirname(__FILE__) |
| 21 | Dir.glob(File.expand_path(File.dirname(__FILE__) + "/**")).each do |directory| |
| 22 | $LOAD_PATH << directory unless directory =~ /\.\w+$/ #File.directory? is broken in current JRuby for dirs inside jars |
| 23 | end |
| 24 | |
| 25 | require 'manifest' |
| 26 | |
| 27 | |
| 28 | require 'payment_controller' |
| 29 | |
| 30 | PaymentController.instance.open |
| toggle raw diff |
--- /dev/null
+++ b/examples/Nested-DropIn/src/main.rb
@@ -0,0 +1,30 @@
+#===============================================================================
+# Much of the platform specific code should be called before Swing is touched.
+# The useScreenMenuBar is an example of this.
+require 'rbconfig'
+
+#===============================================================================
+# Platform specific operations, feel free to remove or override any of these
+# that don't work for your platform/application
+
+case Config::CONFIG["host_os"]
+when /darwin/i # OSX specific code
+ java.lang.System.set_property("apple.laf.useScreenMenuBar", "true")
+when /^win/i # Windows specific code
+when /linux/i # Linux specific code
+end
+
+# End of platform specific code
+#===============================================================================
+
+$LOAD_PATH.unshift File.dirname(__FILE__)
+Dir.glob(File.expand_path(File.dirname(__FILE__) + "/**")).each do |directory|
+ $LOAD_PATH << directory unless directory =~ /\.\w+$/ #File.directory? is broken in current JRuby for dirs inside jars
+end
+
+require 'manifest'
+
+
+require 'payment_controller'
+
+PaymentController.instance.open
\ No newline at end of file |
| |   |
| 1 | #=============================================================================== |
| 2 | # Monkeybars requires, this pulls in the requisite libraries needed for |
| 3 | # Monkeybars to operate. |
| 4 | |
| 5 | require 'java' |
| 6 | require 'resolver' |
| 7 | |
| 8 | case Monkeybars::Resolver.run_location |
| 9 | when Monkeybars::Resolver::IN_FILE_SYSTEM |
| 10 | $CLASSPATH << File.expand_path(File.dirname(__FILE__) + '/../lib/monkeybars-0.6.1.jar') |
| 11 | end |
| 12 | |
| 13 | require 'monkeybars' |
| 14 | require 'application_controller' |
| 15 | require 'application_view' |
| 16 | |
| 17 | # End of Monkeybars requires |
| 18 | #=============================================================================== |
| 19 | # |
| 20 | # Add your own application-wide libraries below. To include jars, append to |
| 21 | # $CLASSPATH, or use add_to_classpath, for example: |
| 22 | # |
| 23 | # $CLASSPATH << File.expand_path(File.dirname(__FILE__) + "/../lib/swing-layout-1.0.3.jar") |
| 24 | # |
| 25 | # is equivalent to |
| 26 | # |
| 27 | # add_to_classpath "../lib/swing-layout-1.0.3.jar" |
| 28 | |
| 29 | case Monkeybars::Resolver.run_location |
| 30 | when Monkeybars::Resolver::IN_FILE_SYSTEM |
| 31 | # Files to be added only when running from the file system go here |
| 32 | when Monkeybars::Resolver::IN_JAR_FILE |
| 33 | # Files to be added only when run from inside a jar file |
| 34 | end |
| 35 | |
| 36 | $LOAD_PATH.unshift "src/address" |
| 37 | $LOAD_PATH.unshift "src/payment" |
| toggle raw diff |
--- /dev/null
+++ b/examples/Nested-DropIn/src/manifest.rb
@@ -0,0 +1,37 @@
+#===============================================================================
+# Monkeybars requires, this pulls in the requisite libraries needed for
+# Monkeybars to operate.
+
+require 'java'
+require 'resolver'
+
+case Monkeybars::Resolver.run_location
+when Monkeybars::Resolver::IN_FILE_SYSTEM
+ $CLASSPATH << File.expand_path(File.dirname(__FILE__) + '/../lib/monkeybars-0.6.1.jar')
+end
+
+require 'monkeybars'
+require 'application_controller'
+require 'application_view'
+
+# End of Monkeybars requires
+#===============================================================================
+#
+# Add your own application-wide libraries below. To include jars, append to
+# $CLASSPATH, or use add_to_classpath, for example:
+#
+# $CLASSPATH << File.expand_path(File.dirname(__FILE__) + "/../lib/swing-layout-1.0.3.jar")
+#
+# is equivalent to
+#
+# add_to_classpath "../lib/swing-layout-1.0.3.jar"
+
+case Monkeybars::Resolver.run_location
+when Monkeybars::Resolver::IN_FILE_SYSTEM
+ # Files to be added only when running from the file system go here
+when Monkeybars::Resolver::IN_JAR_FILE
+ # Files to be added only when run from inside a jar file
+end
+
+$LOAD_PATH.unshift "src/address"
+$LOAD_PATH.unshift "src/payment"
\ No newline at end of file |
| |   |
| 1 | package org.rubyforge.rawr; |
| 2 | |
| 3 | import java.io.BufferedReader; |
| 4 | import java.io.InputStreamReader; |
| 5 | import java.io.InputStream; |
| 6 | import java.io.IOException; |
| 7 | import java.net.URL; |
| 8 | |
| 9 | |
| 10 | import java.util.ArrayList; |
| 11 | import org.jruby.Ruby; |
| 12 | import org.jruby.javasupport.JavaEmbedUtils; |
| 13 | |
| 14 | |
| 15 | public class Main |
| 16 | { |
| 17 | public static void main(String[] args) throws Exception |
| 18 | { |
| 19 | Ruby runtime = JavaEmbedUtils.initialize(new ArrayList(0)); |
| 20 | String config_yaml = ""; |
| 21 | try{ |
| 22 | java.io.InputStream ins = Main.class.getClassLoader().getResourceAsStream("run_configuration"); |
| 23 | if (ins == null ) { |
| 24 | System.err.println( "InputStream ins is null!"); |
| 25 | } |
| 26 | else { |
| 27 | config_yaml = grabConfigFileContents(ins); |
| 28 | } |
| 29 | } |
| 30 | catch(IOException e) |
| 31 | { |
| 32 | System.err.println("Error loading run configuration file 'run_configuration', using configuration defaults: " + e); |
| 33 | config_yaml = ""; |
| 34 | } |
| 35 | catch(java.lang.NullPointerException ee) |
| 36 | { |
| 37 | System.err.println("Error loading run configuration file 'run_configuration', using configuration defaults: " + ee ); |
| 38 | config_yaml = ""; |
| 39 | } |
| 40 | |
| 41 | String bootRuby = "require 'java'\n" + |
| 42 | "require 'yaml'\n" + |
| 43 | "$: << 'src'\n" + |
| 44 | "yaml = '" + config_yaml + "' \n" + |
| 45 | "begin\n" + |
| 46 | " raise 'No YAML!' if yaml.strip.empty?\n" + |
| 47 | " config_hash = YAML.load( \"" + config_yaml + "\" )\n" + |
| 48 | " $:.unshift( config_hash['ruby_source_dir'] )\n" + |
| 49 | " require config_hash[ 'ruby_source_dir' ] + '/' + config_hash[ 'main_ruby_file' ]\n" + |
| 50 | "rescue Exception \n" + |
| 51 | " STDERR.puts \"Error loading config file: \" + $! + \"\nUsing default values.\"\n" + |
| 52 | " begin\n" + |
| 53 | " require 'src/main'\n" + |
| 54 | " rescue LoadError => e\n" + |
| 55 | " warn 'Error starting the application'\n" + |
| 56 | " warn \"#{e}\\n#{e.backtrace.join(\"\\n\")}\"\n" + |
| 57 | " end\n" + |
| 58 | "end\n"; |
| 59 | runtime.evalScriptlet( bootRuby ); |
| 60 | } |
| 61 |