Find in text error: fixed
Olivier POTONNIEE <[email protected]> Mon, 09 Feb 2004 17:20:44 +0100
| Newsgroups | gmane.editors.pollo.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello
I fixed (see below) a small bug in the Find in text action, which caused a null pointer exception. Although it had no real consequence, I don't like to have this kind of exceptions uncaught... I took this opportunity to also keep in memory the last search pattern so that you don't have to retype it when you do multiple searches (it's frequent). Next improvement would be to add a "Find next" action...
Cheers
--
Olivier
PS: Bruno, I also made a first working version of the FileDialog abstraction layer to make easy the selection between awt and swing file dialogs. Tell me if you'd like to have it.
---------------------------------------------------------------------------
diff U3B pollo-0.4-src\src.orig\org\outerj\pollo\texteditor\action\FindAction.java pollo-0.4-src\src\org\outerj\pollo\texteditor\action\FindAction.java
--- pollo-0.4-src\src.orig\org\outerj\pollo\texteditor\action\FindAction.java Thu Jan 23 15:24:28 2003
+++ pollo-0.4-src\src\org\outerj\pollo\texteditor\action\FindAction.java Mon Feb 09 17:06:02 2004
@@ -10,6 +10,7 @@
{
protected XmlTextEditor xmlTextEditor;
protected static final ResourceManager resourceManager = ResourceManager.getManager(FindAction.class);
+ protected String searchString;
public FindAction(XmlTextEditor xmlTextEditor)
{
@@ -19,8 +20,10 @@
public void actionPerformed(ActionEvent e)
{
- String searchString=javax.swing.JOptionPane.showInputDialog(xmlTextEditor, "Find...");
- xmlTextEditor.find(searchString);
+ searchString=javax.swing.JOptionPane.showInputDialog(xmlTextEditor, "Find...", searchString);
+ if (searchString != null) {
+ xmlTextEditor.find(searchString);
+ }
}
}
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn