Author: jfuerth
Date: Fri Aug 29 07:57:20 2008
New Revision: 2660

Modified:
   trunk/src/ca/sqlpower/architect/swingui/ColumnEditPanel.java
   trunk/src/ca/sqlpower/architect/swingui/FormLayout.java

Log:
Changed column remarks to a multi-line text area with word wrap. This required a small modification to our old homegrown FormLayout, which I was shocked to discover we're still using in the column edit panel!

Thanks to castorp for pointing out this discrepancy between the column and table edit panels.

Modified: trunk/src/ca/sqlpower/architect/swingui/ColumnEditPanel.java
==============================================================================
--- trunk/src/ca/sqlpower/architect/swingui/ColumnEditPanel.java        
(original)
+++ trunk/src/ca/sqlpower/architect/swingui/ColumnEditPanel.java Fri Aug 29 07:57:20 2008
@@ -37,7 +37,9 @@
 import javax.swing.JLabel;
 import javax.swing.JOptionPane;
 import javax.swing.JPanel;
+import javax.swing.JScrollPane;
 import javax.swing.JSpinner;
+import javax.swing.JTextArea;
 import javax.swing.JTextField;
 import javax.swing.SpinnerNumberModel;
 import javax.swing.event.ChangeEvent;
@@ -85,7 +87,7 @@

     private JCheckBox colNullable;

-    private JTextField colRemarks;
+    private JTextArea colRemarks;

     private JTextField colDefaultValue;

@@ -200,8 +202,11 @@
         });

centerPanel.add(new JLabel(Messages.getString("ColumnEditPanel.remarks"))); //$NON-NLS-1$
-        centerPanel.add(colRemarks = new JTextField());
-
+        centerPanel.add(new JScrollPane(colRemarks = new JTextArea()));
+        colRemarks.setRows(5);
+        colRemarks.setLineWrap(true);
+        colRemarks.setWrapStyleWord(true);
+
centerPanel.add(new JLabel(Messages.getString("ColumnEditPanel.defaultValue"))); //$NON-NLS-1$
         centerPanel.add(colDefaultValue = new JTextField());
         colDefaultValue.addActionListener(this);
@@ -456,7 +461,7 @@
         return colPrec;
     }

-    public JTextField getColRemarks() {
+    public JTextArea getColRemarks() {
         return colRemarks;
     }


Modified: trunk/src/ca/sqlpower/architect/swingui/FormLayout.java
==============================================================================
--- trunk/src/ca/sqlpower/architect/swingui/FormLayout.java     (original)
+++ trunk/src/ca/sqlpower/architect/swingui/FormLayout.java Fri Aug 29 07:57:20 2008
@@ -25,6 +25,7 @@
 import java.awt.LayoutManager;

 import javax.swing.JPanel;
+import javax.swing.JScrollPane;
 import javax.swing.JTextField;

 public class FormLayout implements LayoutManager {
@@ -126,7 +127,7 @@
                        } else {
                                // right-hand column
                                int width = c.getPreferredSize().width;
-                               if (c instanceof JTextField || c instanceof 
JPanel) {
+ if (c instanceof JTextField || c instanceof JPanel || c instanceof JScrollPane) {
                                        width = rColWidth; // full width of 
this column
                                }
                                c.setBounds(lColWidth + ins.left + hgap, y, 
width, d.height);

Reply via email to