Revision: 14085
http://jedit.svn.sourceforge.net/jedit/?rev=14085&view=rev
Author: keeleyt83
Date: 2008-11-20 06:22:31 +0000 (Thu, 20 Nov 2008)
Log Message:
-----------
Changes to search dialog.
Modified Paths:
--------------
plugins/FindFile/trunk/FindFile.props
plugins/FindFile/trunk/TODO
plugins/FindFile/trunk/src/findfile/FindFileDialog.java
Modified: plugins/FindFile/trunk/FindFile.props
===================================================================
--- plugins/FindFile/trunk/FindFile.props 2008-11-19 20:12:48 UTC (rev 14084)
+++ plugins/FindFile/trunk/FindFile.props 2008-11-20 06:22:31 UTC (rev 14085)
@@ -1,5 +1,6 @@
# FindFile Plugin properties
# $Id: FindFile.props 13885 Thu Oct 16 15:59:08 CDT 2008 keeleyt83 $
+
plugin.findfile.FindFilePlugin.name=FindFile
plugin.findfile.FindFilePlugin.author=Nicholas O'Leary, Anthony Keeley
plugin.findfile.FindFilePlugin.version=1.2
@@ -10,7 +11,6 @@
plugin.findfile.FindFilePlugin.docs=docs/about.html
plugin.findfile.FindFilePlugin.option-pane=FindFilePlugin-options
plugin.findfile.FindFilePlugin.description=This plugin allows you to search within a filesystem for any files that match a given filter.
-
plugin.findfile.FindFilePlugin.actions.newSearch.label=Search For Files...
options.FindFilePlugin-options.label=FindFile
@@ -20,7 +20,6 @@
FindFilePlugin.label=FindFile
FindFilePlugin.title=FindFile Results
-FindFilePlugin.find-dialog.title=Find Files
FindFilePlugin.action-labels.open=Open
FindFilePlugin.action-labels.openAs=Open as...
FindFilePlugin.action-labels.close=Close
@@ -45,6 +44,12 @@
FindFilePlugin.action-labels.toggleMultple=Toggle Multiple Results
FindFilePlugin.action-labels.redoSearch=Redo Search
+FindFilePlugin.search-dialog.title=Find Files
+FindFilePlugin.search-dialog.labels.directory=Directory:
+FindFilePlugin.search-dialog.labels.filter=Filter:
+FindFilePlugin.search-dialog.buttons.find=Find
+FindFilePlugin.search-dialog.buttons.close=Close
+
FindFilePlugin.option-pane-labels.multipleResults=Show multiple results
FindFilePlugin.option-pane-labels.hidePath=Hide path details
FindFilePlugin.option-pane-labels.defaultSettings=Default search options
@@ -55,7 +60,6 @@
FindFilePlugin.option-pane-labels.openAllResults=Open all results
FindFilePlugin.option-pane-labels.archiveFilter=Filter to identify archives:
FindFilePlugin.option-pane-labels.sortBy=Result sort order
-
FindFilePlugin.option-pane-defaults.archiveFilter=*.{zip,tar,tgz,jar}
FindFilePlugin.status-message.started=Searching...
@@ -75,12 +79,12 @@
FindFilePlugin.failed-to-open.title=Failed to open
FindFilePlugin.failed-to-open.message=Failed to open: {0} \
- as no suitable edit mode was detected.
+ as no suitable edit mode was detected.
FindFilePlugin.failed-to-open-some.title=Failed to open some files
FindFilePlugin.failed-to-open-some.message=Failed to open some files as\n\
- no suitable edit modes were detected.\n\
- See the Activity Log for more information.
+ no suitable edit modes were detected.\n\
+ See the Activity Log for more information.
FindFilePlugin.archive-not-installed.title=Archive plugin not installed
FindFilePlugin.archive-not-installed.message=Browsing an archive requires the Archive plugin to be installed.
Modified: plugins/FindFile/trunk/TODO
===================================================================
--- plugins/FindFile/trunk/TODO 2008-11-19 20:12:48 UTC (rev 14084)
+++ plugins/FindFile/trunk/TODO 2008-11-20 06:22:31 UTC (rev 14085)
@@ -2,6 +2,7 @@
Anthony Keeley
Sat Aug 16 19:02:38 CDT 2008
+- Clean up props file
- Clean up xlint warnings.
- Delete files?
- Open in new view, new plain view?
Modified: plugins/FindFile/trunk/src/findfile/FindFileDialog.java
===================================================================
--- plugins/FindFile/trunk/src/findfile/FindFileDialog.java 2008-11-19 20:12:48 UTC (rev 14084)
+++ plugins/FindFile/trunk/src/findfile/FindFileDialog.java 2008-11-20 06:22:31 UTC (rev 14085)
@@ -22,10 +22,14 @@
public class FindFileDialog extends EnhancedDialog implements ActionListener {
//{{{ Private members
- private HistoryTextField pathField;
+ private HistoryTextField directoryField;
private HistoryTextField filterField;
- private JCheckBox recursiveBox;
+ private JCheckBox recursive;
private JCheckBox openAllResults;
+ private JCheckBox keepDialog;
+ private JCheckBox ignoreCase;
+ private JCheckBox skipBinaryFiles;
+ private JCheckBox skipHiddenBackups;
private View view;
//}}}
@@ -44,88 +48,187 @@
* @param view The active View.
* @param path The initial search path.
*/
+ // TODO: This is gross.
public FindFileDialog(View view, String path) {
- super(view,jEdit.getProperty("FindFilePlugin.find-dialog.title"),true);
+ super(view,jEdit.getProperty("FindFilePlugin.search-dialog.title"),false);
this.setResizable(false);
GUIUtilities.loadGeometry(this,"FindFilePlugin");
this.view = view;
+
+ JLabel directoryLabel, filterLabel;
+ JButton findButton, closeButton;
+
JPanel content = new JPanel(new BorderLayout());
content.setBorder(new EmptyBorder(12,12,12,12));
setContentPane(content);
+
+ JPanel innerContent = new JPanel(new GridBagLayout());
+ innerContent.setBorder(new EmptyBorder(0,0,10,0));
+
+ GridBagConstraints gbc = new GridBagConstraints();
+ gbc.anchor = GridBagConstraints.NORTHWEST;
+ gbc.gridx = 0;
+ gbc.gridy = 0;
+
if (path == null) {
String userHome = System.getProperty("user.home");
String defaultPath = jEdit.getProperty("vfs.browser.defaultPath");
if (defaultPath.equals("home")) {
path = userHome;
- } else{
- if (defaultPath.equals("working")) {
- path = System.getProperty("user.dir");
- } else{
- if (defaultPath.equals("buffer")) {
- if (view != null) {
- Buffer buffer = view.getBuffer();
- path = buffer.getDirectory();
+ } else {
+ if (defaultPath.equals("working")) {
+ path = System.getProperty("user.dir");
} else {
- path = userHome;
+ if (defaultPath.equals("buffer")) {
+ if (view != null) {
+ Buffer buffer = view.getBuffer();
+ path = buffer.getDirectory();
+ } else {
+ path = userHome;
+ }
+ } else {
+ path = userHome;
+ }
}
- } else {
- path = userHome;
- }
}
- }
+ }
- }
- pathField = new HistoryTextField("FindFilePlugin.path");
- pathField.setColumns(25);
- pathField.setText(path);
- pathField.addActionListener(this);
+ // Initialize filter objects and add them to panel.
+ filterLabel = new JLabel(jEdit.getProperty("FindFilePlugin.search-dialog.labels.filter"));
+ filterLabel.setBorder(new EmptyBorder(0,0,0,12));
filterField = new HistoryTextField("FindFilePlugin.filter");
- filterField.setColumns(25);
+ filterField.setColumns(15);
filterField.setText("*.*");
filterField.addActionListener(this);
- JPanel innerContent = new JPanel(new GridBagLayout());
- innerContent.setBorder(new EmptyBorder(0,0,10,0));
- GridBagConstraints gbc = new GridBagConstraints();
- gbc.anchor = GridBagConstraints.NORTHWEST;
- gbc.gridx = 0; gbc.gridy = 0;
- JLabel pathLabel = new JLabel("Path:");
- pathLabel.setBorder(new EmptyBorder(0,0,0,12));
- innerContent.add(pathLabel,gbc);
+
+ innerContent.add(filterLabel, gbc);
gbc.gridx = 1;
- innerContent.add(pathField,gbc);
- gbc.gridx = 0; gbc.gridy = 1;
- JLabel filterLabel = new JLabel("Filter:");
- filterLabel.setBorder(new EmptyBorder(0,0,0,12));
- innerContent.add(filterLabel,gbc);
+ innerContent.add(filterField, gbc);
+ gbc.gridx = 0;
+ gbc.gridy = 1;
+
+ // Initialize directory objects and add them to panel.
+ directoryLabel = new JLabel(jEdit.getProperty("FindFilePlugin.search-dialog.labels.directory"));
+ directoryLabel.setBorder(new EmptyBorder(0,0,0,12));
+ directoryField = new HistoryTextField("FindFilePlugin.path");
+ directoryField.setColumns(50);
+ directoryField.setText(path);
+ directoryField.addActionListener(this);
+
+ innerContent.add(directoryLabel,gbc);
gbc.gridx = 1;
- innerContent.add(filterField,gbc);
- gbc.gridx = 0; gbc.gridy = 2; gbc.gridwidth = GridBagConstraints.REMAINDER;
- recursiveBox = new JCheckBox(jEdit.getProperty("FindFilePlugin.option-pane-labels.recursiveSearch"));
- recursiveBox.setSelected(jEdit.getProperty("options.FindFilePlugin.recursiveSearch","false").equals("true"));
+ innerContent.add(directoryField,gbc);
+ gbc.gridx = 0;
+ gbc.gridy = 2;
+ gbc.gridwidth = GridBagConstraints.REMAINDER;
- innerContent.add(recursiveBox,gbc);
+ // Initialize checkboxs and add to panel.
+ // TODO: remember previous settings. Add other checkboxes.
+ recursive = new JCheckBox(jEdit.getProperty("FindFilePlugin.option-pane-labels.recursiveSearch"));
+ recursive.setSelected(jEdit.getProperty("options.FindFilePlugin.recursiveSearch","false").equals("true"));
- gbc.gridx = 0; gbc.gridy = 3; gbc.gridwidth = GridBagConstraints.REMAINDER;
+ innerContent.add(recursive,gbc);
+ gbc.gridx = 0;
+ gbc.gridy = 3;
+ gbc.gridwidth = GridBagConstraints.REMAINDER;
+
openAllResults = new JCheckBox(jEdit.getProperty("FindFilePlugin.option-pane-labels.openAllResults"));
openAllResults.setSelected(jEdit.getProperty("options.FindFilePlugin.openAllResults","false").equals("true"));
innerContent.add(openAllResults,gbc);
+ // Initialize buttons and add to panel.
content.add(BorderLayout.CENTER, innerContent);
Box buttons = Box.createHorizontalBox();
+
buttons.add(Box.createHorizontalGlue());
- JButton searchButton = new JButton("Search");
- searchButton.addActionListener(this);
- buttons.add(searchButton);
+ findButton = new JButton(jEdit.getProperty("FindFilePlugin.search-dialog.buttons.find"));
+ findButton.addActionListener(this);
+ this.getRootPane().setDefaultButton(findButton);
+ buttons.add(findButton);
buttons.add(Box.createHorizontalStrut(10));
- JButton cancelButton = new JButton("Cancel");
- cancelButton.addActionListener(this);
- buttons.add(cancelButton);
+
+ closeButton = new JButton(jEdit.getProperty("FindFilePlugin.search-dialog.buttons.close"));
+ closeButton.addActionListener(this);
+ buttons.add(closeButton);
buttons.add(Box.createHorizontalStrut(10));
content.add(BorderLayout.SOUTH,buttons);
+
pack();
}//}}}
+// private JPanel createCriteriaPanel(String p) {
+//
+// JLabel filterLabel;
+// JLabel directoryLabel;
+// JPanel criteriaPanel = new JPanel(new GridBagLayout());
+// criteriaPanel.setBorder(new EmptyBorder(0,0,12,12));
+//
+// GridBagConstraints cons = new GridBagConstraints();
+// cons.fill = GridBagConstraints.BOTH;
+// cons.gridy = 0;
+// cons.gridwidth = 2;
+//
+// // TODO: change this to remember.
+// if (p == null) {
+// String userHome = System.getProperty("user.home");
+// String defaultPath = jEdit.getProperty("vfs.browser.defaultPath");
+// if (defaultPath.equals("home")) {
+// p = userHome;
+// } else {
+// if (defaultPath.equals("working")) {
+// p = System.getProperty("user.dir");
+// } else {
+// if (defaultPath.equals("buffer")) {
+// if (view != null) {
+// Buffer buffer = view.getBuffer();
+// p = buffer.getDirectory();
+// } else {
+// p = userHome;
+// }
+// } else {
+// p = userHome;
+// }
+// }
+// }
+// }
+//
+// filterLabel = new JLabel("Filter:");
+//
+// filterField = new HistoryTextField("FindFilePlugin.filter");
+// filterField.setColumns(20);
+// filterField.setText("*.*"); //TODO: make this remember things.
+// filterField.addActionListener(this);
+//
+// directoryLabel = new JLabel("Directory:");
+//
+// directoryField = new HistoryTextField("FindFilePlugin.path");
+// directoryField.setColumns(75);
+// directoryField.setText(p);
+// directoryField.addActionListener(this);
+//
+//
+//
+// return criteriaPanel;
+//
+// }
+//
+// private JPanel createSettingsPanel() {
+//
+// JPanel settingsPanel = new JPanel(new GridBagLayout());
+//
+// return settingsPanel;
+//
+// }
+//
+// private JPanel createButtonsPanel() {
+//
+// JPanel buttonsPanel = new JPanel(new GridBagLayout());
+//
+// return buttonsPanel;
+//
+// }
+
//{{{ ok
/**
* Called when the dialog is confirmed.
@@ -140,14 +243,14 @@
}
results.searchStarted();
SearchOptions options = new SearchOptions();
- options.path = pathField.getText();
+ options.path = directoryField.getText();
options.filter = filterField.getText();
- options.recursive = recursiveBox.isSelected();
+ options.recursive = recursive.isSelected();
options.openResults = openAllResults.isSelected();
FindFileRequest request = new FindFileRequest(view,results,options);
VFSManager.runInWorkThread(request);
GUIUtilities.saveGeometry(this,"FindFilePlugin");
- pathField.addCurrentToHistory();
+ directoryField.addCurrentToHistory();
filterField.addCurrentToHistory();
setVisible(false);
}
@@ -168,10 +271,10 @@
*/
public void actionPerformed(ActionEvent e) {
String s = e.getActionCommand();
- if (s.equals("Cancel")) {
+ if (s.equals(jEdit.getProperty("FindFilePlugin.search-dialog.buttons.find"))) {
+ ok();
+ } else {
cancel();
- } else {
- ok();
}
}//}}}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|