Commit | Line | Data |
---|---|---|
6dd70280 JL |
1 | package com.swabunga.spell.swing;\r\r |
2 | \r\r | |
3 | import com.swabunga.spell.event.*;\r\r | |
4 | import javax.swing.*;\r\r | |
5 | import javax.swing.text.*;\r\r | |
6 | import java.io.File;\r\r | |
7 | import java.awt.*;\r\r | |
8 | import java.awt.event.*;\r\r | |
9 | \r\r | |
10 | /** Implementation of a spell check dialog.\r\r | |
11 | *\r\r | |
12 | * @author Jason Height (jheight@chariot.net.au)\r\r | |
13 | */\r\r | |
14 | public class JSpellDialog extends JDialog implements ActionListener, WindowListener {\r\r | |
15 | private JSpellForm form = new JSpellForm();\r\r | |
16 | private SpellCheckEvent event = null;\r\r | |
17 | \r\r | |
18 | public JSpellDialog(Frame owner, String title, boolean modal) {\r\r | |
19 | super(owner, title, modal);\r\r | |
20 | initialiseDialog();\r\r | |
21 | }\r\r | |
22 | \r\r | |
23 | public JSpellDialog(Dialog owner, String title, boolean modal) {\r\r | |
24 | super(owner, title, modal);\r\r | |
25 | initialiseDialog();\r\r | |
26 | }\r\r | |
27 | \r\r | |
28 | private void initialiseDialog() {\r\r | |
29 | getContentPane().add(form);\r\r | |
30 | form.addActionListener(this);\r\r | |
31 | addWindowListener(this);\r\r | |
32 | //setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE);\r\r | |
33 | pack();\r\r | |
34 | }\r\r | |
35 | \r\r | |
36 | \r\r | |
37 | public void show(SpellCheckEvent e) {\r\r | |
38 | // System.out.println("Show");\r\r | |
39 | this.event = e;\r\r | |
40 | form.setSpellEvent(e);\r\r | |
41 | show();\r\r | |
42 | }\r\r | |
43 | \r\r | |
44 | public void actionPerformed(ActionEvent e) {\r\r | |
45 | hide();\r\r | |
46 | }\r\r | |
47 | \r\r | |
48 | public void windowOpened(WindowEvent e) {\r\r | |
49 | }\r\r | |
50 | /** Cancel the event if the Dialog Close button is pressed*/\r\r | |
51 | public void windowClosing(WindowEvent e) {\r\r | |
52 | if (event != null)\r\r | |
53 | event.cancel();\r\r | |
54 | }\r\r | |
55 | public void windowClosed(WindowEvent e) {\r\r | |
56 | }\r\r | |
57 | public void windowIconified(WindowEvent e) {\r\r | |
58 | }\r\r | |
59 | public void windowDeiconified(WindowEvent e) {\r\r | |
60 | }\r\r | |
61 | public void windowActivated(WindowEvent e) {\r\r | |
62 | }\r\r | |
63 | public void windowDeactivated(WindowEvent e) {\r\r | |
64 | }\r\r | |
65 | }\r\r |