///////////////////////////////////////////////////////// // Module HelpDialog.java // Version 1.0 // Language Java // Author Sudhakar Chandrasekaran (thaths@netscape.com) // History // 04/17/97 House cleaning // 04/20/97 Added brief help // 01/04/97 Created // // Legalese // Copyright (C) 1996-1997 Sudhakar Chandrasekharan // // This program is free software; you can redistribute it and/or modify it // under the terms of the GNU General Public License as published by the // Free Software Foundation; either version 2 of the license, or (at your // option) any later version. // // This program is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // General Public License for more details. Writers of free software // cannot afford getting sued! // // You should have received a copy of the GNU General Public License along // with this program; if not, write to the Free Software Foundation, Inc., // 675 Mass Ave., Cambridge, MA 02139, USA. // // Sudhakar "Thaths" Chandrasekharan, 20 Apr 1997. //////////////////////////////////////////////////////// import java.awt.*; class HelpDialog extends Dialog { // Constructor HelpDialog(Frame f) { super(f, true); // Don't need that precise a layout. So BorderLayout setLayout(new BorderLayout()); String helpTextString = new String("\t\t ClientSearch v2.0 Help"); // Create the text area and add the help text TextArea helpTextArea = new TextArea(); helpTextArea.setText(helpTextString); helpTextArea.appendText("\n\n\n"); helpTextArea.appendText("* Type in a text string in the text area next to 'Search For'. eg. 'Hello World'.\n\n"); helpTextArea.appendText("* Use options to fine tune your search :\n"); helpTextArea.appendText("\tas a string - search for pages with the the phrase 'Hello World'.\n"); helpTextArea.appendText("\tOR - search for pages with the words 'Hello' or 'World'.\n"); helpTextArea.appendText("\tAND - search for pages with the words 'Hello' and 'World'.\n"); helpTextArea.appendText("searching 'as a string' is the fastest, 'OR' is slower and 'AND' is slowest.\n\n"); helpTextArea.appendText("* By default searches are case insensitive. ie. searches for 'Hello World'\n"); helpTextArea.appendText(" would match pages with 'Hello World', 'hello world' and other variations.\n"); helpTextArea.appendText(" If you want to match pages only with ''Hello World', check the box next\n"); helpTextArea.appendText(" to 'CaSe SeNsItIvE'.\n\n"); helpTextArea.appendText("* After doing the above, click on the 'Search' button to search. The cursor\n"); helpTextArea.appendText(" will turn to a wait cursor while the pages are being searched.\n\n"); helpTextArea.appendText("* The pages matching the query will be listed in the box titled 'Search Results'.\n\n"); helpTextArea.appendText("* Click on a line in the 'Search Results' box to view the page matching the\n"); helpTextArea.appendText(" query. This will open up a new window of your browser with the page.\n\n\n\n"); helpTextArea.appendText("\tFor more information on ClientSearch, visit\n"); helpTextArea.appendText("\thttp://www.aunet.org/thaths/hacks/ClientSearch/\n"); helpTextArea.setEditable(false); add("Center", helpTextArea); Panel buttonPanel = new Panel(); buttonPanel.setLayout(new FlowLayout(FlowLayout.CENTER)); buttonPanel.add(new Button("OK")); buttonPanel.validate(); add("South", buttonPanel); validate(); resize(400,500); show(); } // Event Handler // When the user has had enough, dispose the // dialog public boolean action(Event evt, Object onWhat) { if(evt.target instanceof Button) { String label = (String) onWhat; if (label.equals("OK")) { dispose(); return true; } } return super.handleEvent(evt); } }