Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
ViewDelegate |
|
| 1.0;1 |
1 | package org.jtheque.core.managers.view.able; | |
2 | ||
3 | /* | |
4 | * This file is part of JTheque. | |
5 | * | |
6 | * JTheque is free software: you can redistribute it and/or modify | |
7 | * it under the terms of the GNU General Public License as published by | |
8 | * the Free Software Foundation, either version 3 of the License. | |
9 | * | |
10 | * JTheque is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | * GNU General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU General Public License | |
16 | * along with JTheque. If not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | import org.jtheque.core.managers.error.JThequeError; | |
20 | import org.jtheque.core.managers.view.impl.WindowConfiguration; | |
21 | import org.jtheque.utils.io.SimpleFilter; | |
22 | ||
23 | /** | |
24 | * @author Baptiste Wicht | |
25 | */ | |
26 | public interface ViewDelegate { | |
27 | /** | |
28 | * Ask the user for a yes or no answer. | |
29 | * | |
30 | * @param text The question. | |
31 | * @param title The question title. | |
32 | * @return true if the user has answered yes else false. | |
33 | */ | |
34 | boolean askYesOrNo(String text, String title); | |
35 | ||
36 | /** | |
37 | * Display an error. | |
38 | * | |
39 | * @param error The error to display. | |
40 | */ | |
41 | void displayError(JThequeError error); | |
42 | ||
43 | /** | |
44 | * Display the text. | |
45 | * | |
46 | * @param text The text to display. | |
47 | */ | |
48 | void displayText(String text); | |
49 | ||
50 | /** | |
51 | * Choose a file. | |
52 | * | |
53 | * @param filter The filter. | |
54 | * @return The chosen file. | |
55 | */ | |
56 | String chooseFile(SimpleFilter filter); | |
57 | ||
58 | /** | |
59 | * Choose a directory. | |
60 | * | |
61 | * @return The chosen directory. | |
62 | */ | |
63 | String chooseDirectory(); | |
64 | ||
65 | /** | |
66 | * Run the runnable in the view. | |
67 | * | |
68 | * @param runnable The runnable to run in the view. | |
69 | */ | |
70 | void run(Runnable runnable); | |
71 | ||
72 | /** | |
73 | * Refresh the object. | |
74 | * | |
75 | * @param c The object to refresh. | |
76 | */ | |
77 | void refresh(Object c); | |
78 | ||
79 | /** | |
80 | * Apply the glass pane. | |
81 | * | |
82 | * @param glassPane The glass pane. | |
83 | */ | |
84 | void applyGlassPane(Object glassPane); | |
85 | ||
86 | /** | |
87 | * Set size of the view considering the configuration of the view. | |
88 | * | |
89 | * @param view The view to configure. ̀ | |
90 | * @param defaultWidth The default width of the view. | |
91 | * @param defaultHeight The default height of the view. | |
92 | */ | |
93 | void setSize(IView view, int defaultWidth, int defaultHeight); | |
94 | ||
95 | /** | |
96 | * Fill the configuration with the view informations. | |
97 | * | |
98 | * @param configuration The configuration to fill. | |
99 | * @param view The view to fill the configuration with. | |
100 | */ | |
101 | void fill(WindowConfiguration configuration, IView view); | |
102 | ||
103 | /** | |
104 | * Configure the view with the window configuration. | |
105 | * | |
106 | * @param configuration The window configuration. | |
107 | * @param view The view to configure. | |
108 | */ | |
109 | void configure(WindowConfiguration configuration, IView view); | |
110 | ||
111 | /** | |
112 | * Ask the user for text. | |
113 | * | |
114 | * @param title The question to ask to the user. | |
115 | * @return The text of the user. | |
116 | */ | |
117 | String askText(String title); | |
118 | } |