|
1 /* |
|
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 * Interface provided to other components via TraceBuilderGlobals |
|
17 * |
|
18 */ |
|
19 package com.nokia.tracebuilder.engine; |
|
20 |
|
21 import java.util.List; |
|
22 |
|
23 /** |
|
24 * Interface provided to other components via {@link TraceBuilderGlobals}. This |
|
25 * can be used to show various query and error dialogs to the user |
|
26 * |
|
27 */ |
|
28 public interface TraceBuilderDialogs { |
|
29 |
|
30 /** |
|
31 * Parameters for a check list dialog |
|
32 * |
|
33 */ |
|
34 public class CheckListDialogParameters { |
|
35 |
|
36 /** |
|
37 * The dialog type |
|
38 */ |
|
39 public CheckListDialogType dialogType; |
|
40 |
|
41 /** |
|
42 * Root items for the dialog |
|
43 */ |
|
44 public List<CheckListDialogEntry> rootItems; |
|
45 |
|
46 /** |
|
47 * Initial expand level for dialog tree |
|
48 */ |
|
49 public int expandLevel; |
|
50 |
|
51 /** |
|
52 * Flag to show / hide the root element |
|
53 */ |
|
54 public boolean showRoot; |
|
55 |
|
56 } |
|
57 |
|
58 /** |
|
59 * Parameters for a query dialog |
|
60 * |
|
61 */ |
|
62 public class QueryDialogParameters { |
|
63 |
|
64 /** |
|
65 * The query dialog type |
|
66 */ |
|
67 public QueryDialogType dialogType; |
|
68 |
|
69 } |
|
70 |
|
71 /** |
|
72 * Query, which shows a file path but does not allow the user to change it |
|
73 * |
|
74 */ |
|
75 public class FileQueryParameters extends QueryDialogParameters { |
|
76 |
|
77 /** |
|
78 * File path |
|
79 */ |
|
80 public String path; |
|
81 |
|
82 } |
|
83 |
|
84 /** |
|
85 * Query, which allows user to select a file via file dialog |
|
86 * |
|
87 */ |
|
88 public class FileDialogQueryParameters extends FileQueryParameters { |
|
89 |
|
90 /** |
|
91 * File filter titles |
|
92 */ |
|
93 public String[] filterTitles; |
|
94 |
|
95 /** |
|
96 * File filters |
|
97 */ |
|
98 public String[] filters; |
|
99 |
|
100 } |
|
101 |
|
102 /** |
|
103 * Query, which allows user to select a directory via directory dialog |
|
104 * |
|
105 */ |
|
106 public class DirectoryDialogQueryParameters extends FileQueryParameters { |
|
107 } |
|
108 |
|
109 /** |
|
110 * Parameters for delete object query |
|
111 * |
|
112 */ |
|
113 public class DeleteObjectQueryParameters extends QueryDialogParameters { |
|
114 |
|
115 /** |
|
116 * Name of the object to be deleted |
|
117 */ |
|
118 public String objectName; |
|
119 |
|
120 /** |
|
121 * Name of the owner of the object to be deleted |
|
122 */ |
|
123 public String ownerName; |
|
124 |
|
125 } |
|
126 |
|
127 /** |
|
128 * Query with user-defined message and buttons |
|
129 * |
|
130 */ |
|
131 public class ExtendedQueryParameters extends QueryDialogParameters { |
|
132 |
|
133 /** |
|
134 * Dialog message |
|
135 */ |
|
136 public String message; |
|
137 |
|
138 /** |
|
139 * Titles for the buttons |
|
140 */ |
|
141 public String[] buttonTitles; |
|
142 |
|
143 } |
|
144 |
|
145 /** |
|
146 * Query dialog types |
|
147 * |
|
148 */ |
|
149 enum QueryDialogType { |
|
150 |
|
151 /** |
|
152 * Delete group confirmation query type |
|
153 */ |
|
154 DELETE_GROUP, |
|
155 |
|
156 /** |
|
157 * Delete trace confirmation query type |
|
158 */ |
|
159 DELETE_TRACE, |
|
160 |
|
161 /** |
|
162 * Delete parameter confirmation query type |
|
163 */ |
|
164 DELETE_PARAMETER, |
|
165 |
|
166 /** |
|
167 * Delete constant table query type |
|
168 */ |
|
169 DELETE_CONSTANT_TABLE, |
|
170 |
|
171 /** |
|
172 * Delete constant query type |
|
173 */ |
|
174 DELETE_CONSTANT, |
|
175 |
|
176 /** |
|
177 * Import project query |
|
178 */ |
|
179 IMPORT_TRACE_PROJECT, |
|
180 |
|
181 /** |
|
182 * Select environment query |
|
183 */ |
|
184 SELECT_TARGET_ENVIRONMENT, |
|
185 |
|
186 /** |
|
187 * Model update when source is not open |
|
188 */ |
|
189 UPDATE_WHEN_SOURCE_NOT_OPEN, |
|
190 |
|
191 /** |
|
192 * Replace existing file query type. This does not use the normal Yes / |
|
193 * No dialog |
|
194 */ |
|
195 REPLACE_FILE |
|
196 } |
|
197 |
|
198 /** |
|
199 * Checklist dialog type |
|
200 * |
|
201 */ |
|
202 enum CheckListDialogType { |
|
203 |
|
204 /** |
|
205 * Delete multiple traces check list type |
|
206 */ |
|
207 DELETE_TRACES, |
|
208 |
|
209 /** |
|
210 * Instrument files check list type |
|
211 */ |
|
212 INSTRUMENT_FILES |
|
213 |
|
214 } |
|
215 |
|
216 /** |
|
217 * OK result |
|
218 */ |
|
219 int OK = 0; // CodForChk_Dis_Magic |
|
220 |
|
221 /** |
|
222 * Cancel result |
|
223 */ |
|
224 int CANCEL = 1; // CodForChk_Dis_Magic |
|
225 |
|
226 /** |
|
227 * Shows an error dialog to user. This must use display.asyncExec instead of |
|
228 * showing the dialog directly |
|
229 * |
|
230 * @param message |
|
231 * the message |
|
232 */ |
|
233 public void showErrorMessage(String message); |
|
234 |
|
235 /** |
|
236 * Shows a confirmation (Yes / No) dialog to the user. This uses one of the |
|
237 * pre-defined confirmation query types. |
|
238 * |
|
239 * @param parameters |
|
240 * the parameters for the query |
|
241 * @return YES / NO |
|
242 */ |
|
243 public int showConfirmationQuery(QueryDialogParameters parameters); |
|
244 |
|
245 /** |
|
246 * Shows a dialog with list of selectable items and OK / Cancel buttons. |
|
247 * This uses one of the pre-defined check list dialog types. |
|
248 * |
|
249 * @param parameters |
|
250 * the parameters for the dialog |
|
251 * @return OK / CANCEL |
|
252 */ |
|
253 public int showCheckList(CheckListDialogParameters parameters); |
|
254 |
|
255 } |