Made fix for Find Dialog closing correctly on Solaris

a=ashuk
r=geetha.vaidyanaathan@sun.com
Bug=35514

_Ashu


git-svn-id: svn://10.0.0.236/trunk@65726 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
ashuk%eng.sun.com
2000-04-12 18:06:21 +00:00
parent b4284415c8
commit 93dcc0b67f

View File

@@ -50,7 +50,7 @@ import org.mozilla.util.Assert;
* This is a test application for using the BrowserControl.
*
* @version $Id: EMWindow.java,v 1.2 2000-04-06 17:33:29 ashuk%eng.sun.com Exp $
* @version $Id: EMWindow.java,v 1.3 2000-04-12 18:06:21 ashuk%eng.sun.com Exp $
*
* @see org.mozilla.webclient.BrowserControlFactory
@@ -76,7 +76,7 @@ public class EMWindow extends Frame implements DialogClient, ActionListener, Doc
private MenuBar menuBar;
private EmbeddedMozilla creator;
private boolean viewMode = true;
public static void main(String [] arg)
{
@@ -102,6 +102,7 @@ public class EMWindow extends Frame implements DialogClient, ActionListener, Doc
MenuItem closeItem = new MenuItem("Close");
MenuItem findItem = new MenuItem("Find");
MenuItem findNextItem = new MenuItem("Find Next");
MenuItem sourceItem = new MenuItem("View Page Source");
menuBar.add(fileMenu);
menuBar.add(viewMenu);
menuBar.add(searchMenu);
@@ -113,6 +114,8 @@ public class EMWindow extends Frame implements DialogClient, ActionListener, Doc
findItem.addActionListener(this);
searchMenu.add(findNextItem);
findNextItem.addActionListener(this);
viewMenu.add(sourceItem);
sourceItem.addActionListener(this);
// Create the URL field
urlField = new TextField("", 30);
@@ -301,7 +304,7 @@ public void delete()
if (null == findDialog) {
Frame f = new Frame();
f.setSize(350,150);
findDialog = new FindDialog(f, this,
findDialog = new FindDialog(this, this,
"Find in Page", "Find ",
"", 20, false);
findDialog.setModal(false);
@@ -312,6 +315,10 @@ public void delete()
else if (command.equals("Find Next")) {
currentPage.findNextInPage(false);
}
else if (command.equals("View Page Source")) {
currentPage.getSourceBytes(viewMode);
viewMode = !viewMode;
}
}
else if(command.equals("Stop")) {
@@ -352,15 +359,15 @@ public void delete()
public void dialogDismissed(Dialog d) {
if(findDialog.wasClosed()) {
System.out.println("Find Dialog Closed");
try {
CurrentPage currentPage = (CurrentPage)
browserControl.queryInterface(BrowserControl.CURRENT_PAGE_NAME);
currentPage.resetFind();
}
catch (Exception e) {
System.out.println(e.getMessage());
}
System.out.println("Find Dialog Closed");
try {
CurrentPage currentPage = (CurrentPage)
browserControl.queryInterface(BrowserControl.CURRENT_PAGE_NAME);
currentPage.resetFind();
}
catch (Exception e) {
System.out.println(e.getMessage());
}
}
else {
String searchString = findDialog.getTextField().getText();
@@ -387,14 +394,14 @@ public void dialogDismissed(Dialog d) {
}
public void dialogCancelled(Dialog d) {
System.out.println("Find Dialog Closed");
try {
CurrentPage currentPage = (CurrentPage)
browserControl.queryInterface(BrowserControl.CURRENT_PAGE_NAME);
currentPage.resetFind();
}
catch (Exception e) {
System.out.println(e.getMessage());
System.out.println("Find Dialog Closed");
try {
CurrentPage currentPage = (CurrentPage)
browserControl.queryInterface(BrowserControl.CURRENT_PAGE_NAME);
currentPage.resetFind();
}
catch (Exception e) {
System.out.println(e.getMessage());
}
}