]> Dogcows Code - chaz/vimcoder/commitdiff
cleaned up the preferences dialog
authorCharles McGarvey <chazmcgarvey@brokenzipper.com>
Tue, 16 Nov 2010 23:01:52 +0000 (16:01 -0700)
committerCharles McGarvey <chazmcgarvey@brokenzipper.com>
Tue, 16 Nov 2010 23:01:52 +0000 (16:01 -0700)
src/com/dogcows/Editor.java
src/com/dogcows/VimCoder.java

index 564e74ff00cdf7b699fef18a9c66be37e552a74f..fa8a535ecf0f34fa2a975de10bfaf058ac258711 100644 (file)
@@ -241,8 +241,7 @@ public class Editor
          * get the return code from the child if we can.  The workaround here is
          * to stall the thread for a little while or until we know the child
          * does exit.  If the child never exits before the timeout, we will
-         * assume it is not backgrounding and that everything worked.  This all
-         * works very well in practice, but perhaps there's a better way... */
+         * assume it is not backgrounding and that everything worked. */
         long expire = System.currentTimeMillis() + 250;
         while (System.currentTimeMillis() < expire)
         {
index e684746d9db73be189573310995694269c06ec4b..a38bb2153f7eca4c053970707c6bd8daf79854b3 100644 (file)
@@ -249,54 +249,54 @@ public class VimCoder
         pane.setBackground(Common.WPB_COLOR);
         GridBagConstraints c = new GridBagConstraints();
         
-        JLabel vimCommandLabel = new JLabel("Vim Command:");
-        vimCommandLabel.setForeground(Common.FG_COLOR);
-        vimCommandLabel.setAlignmentX(1.0f);
+        JLabel rootDirLabel = new JLabel("Storage Directory:", SwingConstants.RIGHT);
+        rootDirLabel.setForeground(Common.FG_COLOR);
         c.fill = GridBagConstraints.HORIZONTAL;
-        c.gridx = 0;
-        c.gridy = 0;
         c.insets = new Insets(5, 5, 5, 5);
-        pane.add(vimCommandLabel, c);
-        
-        final JTextField vimCommandField = new JTextField(vimCommand, 25);
-        c.gridx = 1;
-        c.gridy = 0;
-        c.gridwidth = 3;
-        pane.add(vimCommandField, c);
-        
-        JLabel rootDirLabel = new JLabel("Storage Directory:");
-        rootDirLabel.setForeground(Common.FG_COLOR);
         c.gridx = 0;
-        c.gridy = 1;
+        c.gridy = 0;
         c.gridwidth = 1;
         pane.add(rootDirLabel, c);
         
         final JTextField rootDirField = new JTextField(rootDir.getPath(), 25);
         c.gridx = 1;
-        c.gridy = 1;
-        c.gridwidth = 2;
+        c.gridy = 0;
         pane.add(rootDirField, c);
         
         JButton browseButton = new JButton("Browse");
-        c.fill = GridBagConstraints.NONE;
-        c.gridx = 3;
-        c.gridy = 1;
-        c.gridwidth = 1;
+        c.gridx = 2;
+        c.gridy = 0;
         c.anchor = GridBagConstraints.BASELINE_LEADING;
         pane.add(browseButton, c);
         
-        JButton closeButton = new JButton("Close");
+        JLabel vimCommandLabel = new JLabel("Vim Command:", SwingConstants.RIGHT);
+        vimCommandLabel.setForeground(Common.FG_COLOR);
         c.fill = GridBagConstraints.HORIZONTAL;
+        c.gridx = 0;
+        c.gridy = 1;
+        pane.add(vimCommandLabel, c);
+        
+        final JTextField vimCommandField = new JTextField(vimCommand, 25);
+        c.gridx = 1;
+        c.gridy = 1;
+        c.gridwidth = 2;
+        pane.add(vimCommandField, c);
+        
+        JButton closeButton = new JButton("Cancel");
+        c.fill = GridBagConstraints.NONE;
         c.gridx = 1;
         c.gridy = 2;
-        c.anchor = GridBagConstraints.PAGE_END;
+        c.gridwidth = 1;
+        c.anchor = GridBagConstraints.EAST;
         pane.add(closeButton, c);
         
         JButton saveButton = new JButton("Save");
+        c.fill = GridBagConstraints.HORIZONTAL;
         c.gridx = 2;
         c.gridy = 2;
-        c.gridwidth = 2;
+        c.anchor = GridBagConstraints.EAST;
         pane.add(saveButton, c);
+        configDialog.getRootPane().setDefaultButton(saveButton);
         
         browseButton.addActionListener(new ActionListener()
         {
@@ -388,16 +388,7 @@ public class VimCoder
     {
         log(" INFO: " + what + System.getProperty("line.separator"));
     }
-    
-    /**
-     * Output potentially important messages to the log.
-     * @param what The text of the message.
-     */
-    private void logWarning(String what)
-    {
-        log(" WARN: " + what + System.getProperty("line.separator"));
-    }
-    
+
     /**
      * Output critical messages and errors to the log.
      * @param what The text of the message.
This page took 0.022101 seconds and 4 git commands to generate.