X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fcom%2Fdogcows%2FVimCoder.java;h=a12846174651fe88062d54c0b399ebd19e3eeac2;hb=fa9550f56a6590946b840241b7e9be0220d8ee08;hp=89da76e3757aea92c8b662dbd5f6f6494259e65c;hpb=d5c3685fc4d454fee9b42436c56c2fd18b17a029;p=chaz%2Fvimcoder diff --git a/src/com/dogcows/VimCoder.java b/src/com/dogcows/VimCoder.java index 89da76e..a128461 100644 --- a/src/com/dogcows/VimCoder.java +++ b/src/com/dogcows/VimCoder.java @@ -28,7 +28,7 @@ public class VimCoder /** * The name and version of this plugin. */ - public final static String version = "VimCoder 0.1"; + public final static String version = "VimCoder 0.3"; /** * The website of the plugin project. @@ -44,7 +44,16 @@ public class VimCoder /** * The path to the main VimCoder directory. */ - private static File rootDir = new File("~/.vimcoder"); + private static File rootDir; + static + { + if (System.getProperty("os.name").toLowerCase().equals("win")) + { + vimCommand = "C:\\WINDOWS\\gvim.bat"; + } + rootDir = new File(System.getProperty("user.home") + + System.getProperty("file.separator") + ".vimcoder"); + } /** @@ -240,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() { @@ -379,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.