Source code: javax/ide/view/IDEDialogs.java
1 package javax.ide.view;
2
3 import java.net.URI;
4
5 import javax.ide.command.Context;
6 import javax.ide.view.GUIPanel;
7
8 /**
9 * The IDEDialogs provides the interface through which extension writers
10 * can invoke standard IDE dialogs, such as: information, warning, error,
11 * file and directory selection dialogs.
12 */
13 public interface IDEDialogs
14 {
15 /**
16 * Button id for an "Ok" button.
17 */
18 public int OK_ID = 0;
19
20 /**
21 * Button id for a "Yes" button.
22 */
23 public int YES_ID = 1;
24
25 /**
26 * Button id for a "No" button.
27 */
28 public int NO_ID = 2;
29
30 /**
31 * Button id for a "Cancel" button.
32 */
33 public int CANCEL_ID = 3;
34
35 /**
36 * Requests an option dialog with a OK and Cancel buttons.
37 */
38 public int OK_CANCEL_OPTION = 0;
39
40 /**
41 * Requests an option dialog with a Yes and No buttons.
42 */
43 public int YES_NO_OPTION = 1;
44
45 /**
46 * Requests an option dialog with a Yes, No, and Cancel buttons.
47 */
48 public int YES_NO_CANCEL_OPTION = 2;
49
50 /**
51 * Creates a "file selection" dialog.
52 * @param title The dialog title.
53 * @param location The default starting directory or pre-selected file.
54 * @param context The current {@link Context}.
55 * @param parent The parent window handle {@link GUIPanel}
56 * @return The newly created {@link URISelectionDialog} class
57 */
58 URISelectionDialog getFileSelectionDialog( String title,
59 URI location,
60 Context context,
61 GUIPanel parent );
62
63
64 /**
65 * Creates a "directory selection" dialog.
66 * @param title The dialog title.
67 * @param location The default starting directory or pre-selected file.
68 * @param context The current {@link Context}.
69 * @param parent The parent window handle {@link GUIPanel}
70 * @return The newly created {@link URISelectionDialog} class
71 */
72 URISelectionDialog getDirectorySelectionDialog( String title,
73 URI location,
74 Context context,
75 GUIPanel parent );
76
77 //-----------------------------------------------------------------
78 // Convience methods to show information dialogs
79 //-----------------------------------------------------------------
80
81 /**
82 * Show an error message box with title and message as specified
83 * @param title The title of the error dialog
84 * @param message The error message.
85 * @param parent The parent window handle {@link GUIPanel}
86 */
87 void showErrorDialog( String title, String message, GUIPanel parent );
88
89 /**
90 * Show an informational message box with title and message as specified.
91 * @param title The message box title
92 * @param message The message text.
93 * @param parent The parent window handle {@link GUIPanel}
94 */
95 void showInformationDialog( String title, String message, GUIPanel parent );
96
97 /**
98 * Show a warning type dialog with title and message as specified.
99 * @param title The title of the warning dialog
100 * @param message The message text
101 * @param parent The parent window handle {@link GUIPanel}
102 */
103 void showWarningDialog( String title, String message, GUIPanel parent );
104
105 /**
106 * Show an options dialog with title and message as specified. An option
107 * dialog can have OK, Cancel buttons; Yes, No buttons; and Yes, No, Cancel
108 * buttons. The button option is controlled by the constants:
109 * OK_CANCEL_OPTION, YES_NO_OPTION, and YES_NO_CANCEL_OPTION.
110 * @param title The question title
111 * @param message The question text
112 * @param option Button options. Can be one of the following constants:
113 * OK_CANCEL_OPTION, YES_NO_OPTION, and YES_NO_CANCEL_OPTION.
114 * @param parent The parent window handle {@link GUIPanel}
115 * @return One of the following constants: OK_ID or YES_ID, NO_ID, CANCEL_ID.
116 */
117 int showOptionDialog( String title,
118 String message,
119 int option,
120 GUIPanel parent );
121
122 }
123