|
Lines 20-29
Link Here
|
| 20 |
import org.eclipse.jface.dialogs.IDialogSettings; |
20 |
import org.eclipse.jface.dialogs.IDialogSettings; |
| 21 |
import org.eclipse.jface.dialogs.MessageDialog; |
21 |
import org.eclipse.jface.dialogs.MessageDialog; |
| 22 |
import org.eclipse.jface.operation.IRunnableWithProgress; |
22 |
import org.eclipse.jface.operation.IRunnableWithProgress; |
|
|
23 |
import org.eclipse.jface.window.Window; |
| 23 |
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin; |
24 |
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin; |
| 24 |
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryQuery; |
25 |
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryQuery; |
| 25 |
import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants; |
26 |
import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants; |
| 26 |
import org.eclipse.mylyn.internal.bugzilla.ui.BugzillaUiPlugin; |
27 |
import org.eclipse.mylyn.internal.bugzilla.ui.BugzillaUiPlugin; |
|
|
28 |
import org.eclipse.mylyn.internal.bugzilla.ui.editor.KeywordsDialog; |
| 27 |
import org.eclipse.mylyn.monitor.core.StatusHandler; |
29 |
import org.eclipse.mylyn.monitor.core.StatusHandler; |
| 28 |
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; |
30 |
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; |
| 29 |
import org.eclipse.mylyn.tasks.core.TaskRepository; |
31 |
import org.eclipse.mylyn.tasks.core.TaskRepository; |
|
Lines 31-36
Link Here
|
| 31 |
import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; |
33 |
import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; |
| 32 |
import org.eclipse.mylyn.tasks.ui.search.AbstractRepositoryQueryPage; |
34 |
import org.eclipse.mylyn.tasks.ui.search.AbstractRepositoryQueryPage; |
| 33 |
import org.eclipse.swt.SWT; |
35 |
import org.eclipse.swt.SWT; |
|
|
36 |
import org.eclipse.swt.custom.SashForm; |
| 34 |
import org.eclipse.swt.events.ModifyEvent; |
37 |
import org.eclipse.swt.events.ModifyEvent; |
| 35 |
import org.eclipse.swt.events.ModifyListener; |
38 |
import org.eclipse.swt.events.ModifyListener; |
| 36 |
import org.eclipse.swt.events.SelectionAdapter; |
39 |
import org.eclipse.swt.events.SelectionAdapter; |
|
Lines 63-71
Link Here
|
| 63 |
|
66 |
|
| 64 |
private static final String TITLE_BUGZILLA_QUERY = "Bugzilla Query"; |
67 |
private static final String TITLE_BUGZILLA_QUERY = "Bugzilla Query"; |
| 65 |
|
68 |
|
| 66 |
private static final int HEIGHT_ATTRIBUTE_COMBO = 60; |
69 |
private static final int HEIGHT_ATTRIBUTE_COMBO = 70; |
| 67 |
|
|
|
| 68 |
protected Combo summaryPattern = null; |
| 69 |
|
70 |
|
| 70 |
// protected Combo repositoryCombo = null; |
71 |
// protected Combo repositoryCombo = null; |
| 71 |
|
72 |
|
|
Lines 75-80
Link Here
|
| 75 |
|
76 |
|
| 76 |
private static ArrayList<BugzillaSearchData> previousCommentPatterns = new ArrayList<BugzillaSearchData>(20); |
77 |
private static ArrayList<BugzillaSearchData> previousCommentPatterns = new ArrayList<BugzillaSearchData>(20); |
| 77 |
|
78 |
|
|
|
79 |
private static ArrayList<BugzillaSearchData> previousKeywords = new ArrayList<BugzillaSearchData>(20); |
| 80 |
|
| 78 |
private boolean firstTime = true; |
81 |
private boolean firstTime = true; |
| 79 |
|
82 |
|
| 80 |
private IDialogSettings fDialogSettings; |
83 |
private IDialogSettings fDialogSettings; |
|
Lines 87-97
Link Here
|
| 87 |
|
90 |
|
| 88 |
private static final String[] emailOperationValues = { "substring", "exact", "regexp" }; |
91 |
private static final String[] emailOperationValues = { "substring", "exact", "regexp" }; |
| 89 |
|
92 |
|
|
|
93 |
private static final String[] keywordOperationText = { "all", "any", "none" }; |
| 94 |
|
| 95 |
private static final String[] keywordOperationValues = { "allwords", "anywords", "nowords" }; |
| 96 |
|
| 90 |
private static final String[] emailRoleValues = { "emailassigned_to1", "emailreporter1", "emailcc1", |
97 |
private static final String[] emailRoleValues = { "emailassigned_to1", "emailreporter1", "emailcc1", |
| 91 |
"emaillongdesc1" }; |
98 |
"emaillongdesc1" }; |
| 92 |
|
99 |
|
| 93 |
// protected IPreferenceStore prefs = |
100 |
// protected IPreferenceStore prefs = BugzillaUiPlugin.getDefault().getPreferenceStore(); |
| 94 |
// BugzillaUiPlugin.getDefault().getPreferenceStore(); |
|
|
| 95 |
|
101 |
|
| 96 |
private BugzillaRepositoryQuery originalQuery = null; |
102 |
private BugzillaRepositoryQuery originalQuery = null; |
| 97 |
|
103 |
|
|
Lines 110-115
Link Here
|
| 110 |
|
116 |
|
| 111 |
// private TaskRepository selectedRepository = null; |
117 |
// private TaskRepository selectedRepository = null; |
| 112 |
|
118 |
|
|
|
119 |
private final class ModifyListenerImplementation implements ModifyListener { |
| 120 |
public void modifyText(ModifyEvent e) { |
| 121 |
if (scontainer != null) { |
| 122 |
scontainer.setPerformActionEnabled(canQuery()); |
| 123 |
} |
| 124 |
} |
| 125 |
} |
| 126 |
|
| 113 |
private static class BugzillaSearchData { |
127 |
private static class BugzillaSearchData { |
| 114 |
/** Pattern to match on */ |
128 |
/** Pattern to match on */ |
| 115 |
String pattern; |
129 |
String pattern; |
|
Lines 154-357
Link Here
|
| 154 |
readConfiguration(); |
168 |
readConfiguration(); |
| 155 |
|
169 |
|
| 156 |
Composite control = new Composite(parent, SWT.NONE); |
170 |
Composite control = new Composite(parent, SWT.NONE); |
| 157 |
GridLayout layout = new GridLayout(2, false); |
171 |
GridLayout layout = new GridLayout(1, false); |
| 158 |
layout.marginHeight = 0; |
172 |
layout.marginHeight = 0; |
| 159 |
layout.marginWidth = 0; |
|
|
| 160 |
control.setLayout(layout); |
173 |
control.setLayout(layout); |
| 161 |
GridData gd = new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL); |
174 |
control.setLayoutData(new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL)); |
| 162 |
control.setLayoutData(gd); |
|
|
| 163 |
|
175 |
|
| 164 |
if (scontainer == null) { |
176 |
// if (scontainer == null) { |
| 165 |
// Not presenting in search pane so want query title |
177 |
// Not presenting in search pane so want query title |
| 166 |
super.createControl(control); |
178 |
// super.createControl(control); |
| 167 |
} |
179 |
// Label lblName = new Label(control, SWT.NONE); |
|
|
180 |
// final GridData gridData = new GridData(); |
| 181 |
// lblName.setLayoutData(gridData); |
| 182 |
// lblName.setText("Query Title:"); |
| 183 |
// |
| 184 |
// title = new Text(control, SWT.BORDER); |
| 185 |
// title.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1)); |
| 186 |
// title.addModifyListener(new ModifyListener() { |
| 187 |
// public void modifyText(ModifyEvent e) { |
| 188 |
// setPageComplete(isPageComplete()); |
| 189 |
// } |
| 190 |
// }); |
| 191 |
// } |
| 192 |
|
| 168 |
// else { |
193 |
// else { |
| 169 |
// // if (repository == null) { |
194 |
// // if (repository == null) { |
| 170 |
// // search pane so add repository selection |
195 |
// // search pane so add repository selection |
| 171 |
// createRepositoryGroup(control); |
196 |
// createRepositoryGroup(control); |
| 172 |
// } |
197 |
// } |
| 173 |
createSearchGroup(control); |
|
|
| 174 |
createOptionsGroup(control); |
198 |
createOptionsGroup(control); |
| 175 |
|
199 |
createSearchGroup(control); |
| 176 |
createEmail(control); |
|
|
| 177 |
createLastDays(control); |
| 178 |
|
200 |
|
| 179 |
// createSaveQuery(control); |
201 |
// createSaveQuery(control); |
| 180 |
// createMaxHits(control); |
202 |
// createMaxHits(control); |
| 181 |
// input = new |
203 |
// input = new SavedQueryFile(BugzillaPlugin.getDefault().getStateLocation().toString(), "/queries"); |
| 182 |
// SavedQueryFile(BugzillaPlugin.getDefault().getStateLocation().toString(), |
|
|
| 183 |
// "/queries"); |
| 184 |
// createUpdate(control); |
204 |
// createUpdate(control); |
| 185 |
// if (originalQuery != null) { |
205 |
// if (originalQuery != null) { |
| 186 |
// try { |
206 |
// try { |
| 187 |
// updateDefaults(originalQuery.getQueryUrl(), |
207 |
// updateDefaults(originalQuery.getQueryUrl(), String.valueOf(originalQuery.getMaxHits())); |
| 188 |
// String.valueOf(originalQuery.getMaxHits())); |
|
|
| 189 |
// } catch (UnsupportedEncodingException e) { |
208 |
// } catch (UnsupportedEncodingException e) { |
| 190 |
// // ignore |
209 |
// // ignore |
| 191 |
// } |
210 |
// } |
| 192 |
// } |
211 |
// } |
| 193 |
setControl(control); |
212 |
setControl(control); |
| 194 |
WorkbenchHelpSystem.getInstance().setHelp(control, BugzillaUiPlugin.SEARCH_PAGE_CONTEXT); |
213 |
WorkbenchHelpSystem.getInstance().setHelp(control, BugzillaUiPlugin.SEARCH_PAGE_CONTEXT); |
| 195 |
} |
214 |
} |
| 196 |
|
215 |
|
| 197 |
private void createSearchGroup(Composite control) { |
216 |
protected void createOptionsGroup(Composite control) { |
| 198 |
Group group = new Group(control, SWT.NONE); |
217 |
GridLayout sashFormLayout = new GridLayout(); |
| 199 |
GridLayout layout = new GridLayout(); |
218 |
sashFormLayout.numColumns = 4; |
| 200 |
layout.numColumns = 1; |
219 |
sashFormLayout.marginHeight = 5; |
| 201 |
group.setLayout(layout); |
220 |
sashFormLayout.marginWidth = 5; |
| 202 |
GridData gd = new GridData(GridData.FILL_HORIZONTAL); |
221 |
sashFormLayout.horizontalSpacing = 5; |
| 203 |
gd.horizontalSpan = 5; |
222 |
|
| 204 |
group.setLayoutData(gd); |
223 |
final Composite composite = new Composite(control, SWT.NONE); |
| 205 |
|
224 |
composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false)); |
| 206 |
createTextSearchComposite(group); |
225 |
final GridLayout gridLayout = new GridLayout(); |
| 207 |
createComment(group); |
226 |
gridLayout.marginBottom = 8; |
| 208 |
} |
227 |
gridLayout.marginHeight = 0; |
| 209 |
|
228 |
gridLayout.marginWidth = 0; |
| 210 |
protected Control createTextSearchComposite(Composite control) { |
229 |
gridLayout.numColumns = 3; |
| 211 |
GridData gd; |
230 |
composite.setLayout(gridLayout); |
| 212 |
Label label; |
231 |
|
| 213 |
|
232 |
if (!inSearchContainer()) { |
| 214 |
Composite group = new Composite(control, SWT.NONE); |
233 |
final Label queryTitleLabel = new Label(composite, SWT.NONE); |
| 215 |
GridLayout layout = new GridLayout(3, false); |
234 |
queryTitleLabel.setText("Query Title:"); |
| 216 |
group.setLayout(layout); |
235 |
|
| 217 |
group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
236 |
Text queryTitle = new Text(composite, SWT.BORDER); |
| 218 |
|
237 |
queryTitle.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1)); |
| 219 |
gd = new GridData(GridData.BEGINNING | GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL); |
238 |
queryTitle.addModifyListener(new ModifyListener() { |
| 220 |
gd.horizontalSpan = 2; |
239 |
public void modifyText(ModifyEvent e) { |
| 221 |
group.setLayoutData(gd); |
240 |
setPageComplete(isPageComplete()); |
| 222 |
|
241 |
} |
|
|
242 |
}); |
| 243 |
if (originalQuery != null) { |
| 244 |
queryTitle.setText(originalQuery.getSummary()); |
| 245 |
} |
| 246 |
title = queryTitle; |
| 247 |
title.setFocus(); |
| 248 |
} |
| 249 |
|
| 250 |
final Label label = new Label(composite, SWT.NONE); |
| 251 |
final GridData gd_label = new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1); |
| 252 |
gd_label.heightHint = 3; |
| 253 |
label.setLayoutData(gd_label); |
| 254 |
|
| 223 |
// Info text |
255 |
// Info text |
| 224 |
label = new Label(group, SWT.LEFT); |
256 |
Label labelSummary = new Label(composite, SWT.LEFT); |
| 225 |
label.setText("Summary: "); |
257 |
labelSummary.setText("Summary: "); |
| 226 |
gd = new GridData(GridData.BEGINNING); |
|
|
| 227 |
gd.horizontalSpan = 1; |
| 228 |
label.setLayoutData(gd); |
| 229 |
|
258 |
|
| 230 |
// Pattern combo |
259 |
// Pattern combo |
| 231 |
summaryPattern = new Combo(group, SWT.SINGLE | SWT.BORDER); |
260 |
summaryPattern = new Combo(composite, SWT.SINGLE | SWT.BORDER); |
| 232 |
summaryPattern.addModifyListener(new ModifyListener() { |
261 |
summaryPattern.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); |
| 233 |
public void modifyText(ModifyEvent e) { |
262 |
summaryPattern.addModifyListener(new ModifyListenerImplementation()); |
| 234 |
if (scontainer != null) { |
|
|
| 235 |
scontainer.setPerformActionEnabled(canQuery()); |
| 236 |
} |
| 237 |
} |
| 238 |
}); |
| 239 |
summaryPattern.addSelectionListener(new SelectionAdapter() { |
263 |
summaryPattern.addSelectionListener(new SelectionAdapter() { |
| 240 |
|
|
|
| 241 |
@Override |
264 |
@Override |
| 242 |
public void widgetSelected(SelectionEvent e) { |
265 |
public void widgetSelected(SelectionEvent e) { |
| 243 |
handleWidgetSelected(summaryPattern, summaryOperation, previousSummaryPatterns); |
266 |
handleWidgetSelected(summaryPattern, summaryOperation, previousSummaryPatterns); |
| 244 |
} |
267 |
} |
| 245 |
}); |
268 |
}); |
| 246 |
gd = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL); |
|
|
| 247 |
summaryPattern.setLayoutData(gd); |
| 248 |
|
269 |
|
| 249 |
summaryOperation = new Combo(group, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER); |
270 |
summaryOperation = new Combo(composite, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER); |
| 250 |
summaryOperation.setItems(patternOperationText); |
271 |
summaryOperation.setItems(patternOperationText); |
| 251 |
summaryOperation.setText(patternOperationText[0]); |
272 |
summaryOperation.setText(patternOperationText[0]); |
| 252 |
summaryOperation.select(0); |
273 |
summaryOperation.select(0); |
| 253 |
|
274 |
|
| 254 |
return group; |
|
|
| 255 |
} |
| 256 |
|
| 257 |
private Control createComment(Composite control) { |
| 258 |
GridData gd; |
| 259 |
Label label; |
| 260 |
|
| 261 |
Composite group = new Composite(control, SWT.NONE); |
| 262 |
GridLayout layout = new GridLayout(3, false); |
| 263 |
group.setLayout(layout); |
| 264 |
group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
| 265 |
|
| 266 |
gd = new GridData(GridData.BEGINNING | GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL); |
| 267 |
gd.horizontalSpan = 2; |
| 268 |
group.setLayoutData(gd); |
| 269 |
|
| 270 |
// Info text |
275 |
// Info text |
| 271 |
label = new Label(group, SWT.LEFT); |
276 |
Label labelComment = new Label(composite, SWT.LEFT); |
| 272 |
label.setText("Comment: "); |
277 |
labelComment.setText("Comment: "); |
| 273 |
gd = new GridData(GridData.BEGINNING); |
|
|
| 274 |
label.setLayoutData(gd); |
| 275 |
|
278 |
|
| 276 |
// Comment pattern combo |
279 |
// Comment pattern combo |
| 277 |
commentPattern = new Combo(group, SWT.SINGLE | SWT.BORDER); |
280 |
commentPattern = new Combo(composite, SWT.SINGLE | SWT.BORDER); |
| 278 |
commentPattern.addModifyListener(new ModifyListener() { |
281 |
commentPattern.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false)); |
| 279 |
public void modifyText(ModifyEvent e) { |
282 |
commentPattern.addModifyListener(new ModifyListenerImplementation()); |
| 280 |
if (scontainer != null) { |
|
|
| 281 |
scontainer.setPerformActionEnabled(canQuery()); |
| 282 |
} |
| 283 |
} |
| 284 |
}); |
| 285 |
commentPattern.addSelectionListener(new SelectionAdapter() { |
283 |
commentPattern.addSelectionListener(new SelectionAdapter() { |
| 286 |
|
|
|
| 287 |
@Override |
284 |
@Override |
| 288 |
public void widgetSelected(SelectionEvent e) { |
285 |
public void widgetSelected(SelectionEvent e) { |
| 289 |
handleWidgetSelected(commentPattern, commentOperation, previousCommentPatterns); |
286 |
handleWidgetSelected(commentPattern, commentOperation, previousCommentPatterns); |
| 290 |
} |
287 |
} |
| 291 |
}); |
288 |
}); |
| 292 |
gd = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL); |
|
|
| 293 |
commentPattern.setLayoutData(gd); |
| 294 |
|
289 |
|
| 295 |
commentOperation = new Combo(group, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER); |
290 |
commentOperation = new Combo(composite, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER); |
| 296 |
commentOperation.setItems(patternOperationText); |
291 |
commentOperation.setItems(patternOperationText); |
| 297 |
commentOperation.setText(patternOperationText[0]); |
292 |
commentOperation.setText(patternOperationText[0]); |
| 298 |
commentOperation.select(0); |
293 |
commentOperation.select(0); |
| 299 |
|
294 |
|
| 300 |
return group; |
295 |
Label labelEmail = new Label(composite, SWT.LEFT); |
| 301 |
} |
296 |
labelEmail.setText("Email: "); |
| 302 |
|
297 |
|
| 303 |
protected Control createOptionsGroup(Composite control) { |
298 |
// pattern combo |
| 304 |
Group group = new Group(control, SWT.NONE); |
299 |
emailPattern = new Combo(composite, SWT.SINGLE | SWT.BORDER); |
| 305 |
// group.setText("Bug Attributes"); |
300 |
emailPattern.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false)); |
| 306 |
GridLayout layout = new GridLayout(); |
301 |
emailPattern.addModifyListener(new ModifyListenerImplementation()); |
| 307 |
layout.numColumns = 1; |
302 |
emailPattern.addSelectionListener(new SelectionAdapter() { |
| 308 |
group.setLayout(layout); |
303 |
@Override |
| 309 |
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true); |
304 |
public void widgetSelected(SelectionEvent e) { |
| 310 |
gd.horizontalSpan = 5; |
305 |
handleWidgetSelected(emailPattern, emailOperation, previousEmailPatterns); |
| 311 |
group.setLayoutData(gd); |
306 |
} |
|
|
307 |
}); |
| 312 |
|
308 |
|
| 313 |
createProductAttributes(group); |
309 |
// operation combo |
| 314 |
createLists(group); |
310 |
emailOperation = new Combo(composite, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER); |
| 315 |
createUpdate(group); |
311 |
emailOperation.setItems(emailOperationText); |
|
|
312 |
emailOperation.setText(emailOperationText[0]); |
| 313 |
emailOperation.select(0); |
| 314 |
new Label(composite, SWT.NONE); |
| 316 |
|
315 |
|
| 317 |
return group; |
316 |
Composite emailComposite = new Composite(composite, SWT.NONE); |
| 318 |
} |
317 |
emailComposite.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1)); |
|
|
318 |
GridLayout emailLayout = new GridLayout(); |
| 319 |
emailLayout.marginWidth = 0; |
| 320 |
emailLayout.marginHeight = 0; |
| 321 |
emailLayout.numColumns = 4; |
| 322 |
emailComposite.setLayout(emailLayout); |
| 319 |
|
323 |
|
| 320 |
/** |
324 |
// Composite buttons = new Composite(group, SWT.NONE); |
| 321 |
* Creates the area for selection on product/component/version. |
325 |
// layout = new GridLayout(4, false); |
| 322 |
*/ |
326 |
// buttons.setLayout(layout); |
| 323 |
protected Control createProductAttributes(Composite control) { |
327 |
// buttons.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
|
|
328 |
// gd = new GridData(GridData.BEGINNING); |
| 329 |
// gd.horizontalSpan = 3; |
| 330 |
// buttons.setLayoutData(gd); |
| 324 |
|
331 |
|
| 325 |
GridData gd; |
332 |
Button button0 = new Button(emailComposite, SWT.CHECK); |
| 326 |
GridLayout layout; |
333 |
button0.setText("bug owner"); |
| 327 |
|
334 |
|
| 328 |
// Search expression |
335 |
Button button1 = new Button(emailComposite, SWT.CHECK); |
| 329 |
Composite group = new Composite(control, SWT.NONE); |
336 |
button1.setText("reporter"); |
| 330 |
layout = new GridLayout(); |
337 |
|
| 331 |
layout.numColumns = 4; |
338 |
Button button2 = new Button(emailComposite, SWT.CHECK); |
| 332 |
group.setLayout(layout); |
339 |
button2.setText("CC list"); |
| 333 |
gd = new GridData(SWT.FILL, SWT.FILL, true, true); |
340 |
|
| 334 |
gd.horizontalSpan = 5; |
341 |
Button button3 = new Button(emailComposite, SWT.CHECK); |
| 335 |
group.setLayoutData(gd); |
342 |
button3.setText("commenter"); |
|
|
343 |
|
| 344 |
emailButtons = new Button[] { button0, button1, button2, button3 }; |
| 345 |
|
| 346 |
Label labelKeywords = new Label(composite, SWT.NONE); |
| 347 |
labelKeywords.setText("Keywords:"); |
| 348 |
|
| 349 |
Composite keywordsComposite = new Composite(composite, SWT.NONE); |
| 350 |
keywordsComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1)); |
| 351 |
GridLayout keywordsLayout = new GridLayout(); |
| 352 |
keywordsLayout.marginWidth = 0; |
| 353 |
keywordsLayout.marginHeight = 0; |
| 354 |
keywordsLayout.numColumns = 3; |
| 355 |
keywordsComposite.setLayout(keywordsLayout); |
| 356 |
|
| 357 |
keywordsOperation = new Combo(keywordsComposite, SWT.READ_ONLY); |
| 358 |
keywordsOperation.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false)); |
| 359 |
keywordsOperation.setItems(keywordOperationText); |
| 360 |
keywordsOperation.setText(keywordOperationText[0]); |
| 361 |
keywordsOperation.select(0); |
| 362 |
|
| 363 |
keywords = new Combo(keywordsComposite, SWT.NONE); |
| 364 |
keywords.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); |
| 365 |
keywords.addModifyListener(new ModifyListenerImplementation()); |
| 366 |
keywords.addSelectionListener(new SelectionAdapter() { |
| 367 |
@Override |
| 368 |
public void widgetSelected(SelectionEvent e) { |
| 369 |
handleWidgetSelected(keywords, keywordsOperation, previousKeywords); |
| 370 |
} |
| 371 |
}); |
| 336 |
|
372 |
|
| 337 |
// Labels |
373 |
Button keywordsSelectButton = new Button(keywordsComposite, SWT.NONE); |
| 338 |
Label label = new Label(group, SWT.LEFT); |
374 |
keywordsSelectButton.addSelectionListener(new SelectionAdapter() { |
| 339 |
label.setText("Product"); |
375 |
public void widgetSelected(SelectionEvent e) { |
| 340 |
|
376 |
KeywordsDialog dialog = new KeywordsDialog(getShell(), keywords.getText(), // |
| 341 |
label = new Label(group, SWT.LEFT); |
377 |
Arrays.asList(BugzillaUiPlugin.getQueryOptions(IBugzillaConstants.VALUES_KEYWORDS, // |
| 342 |
label.setText("Component"); |
378 |
null, repository.getUrl()))); |
| 343 |
|
379 |
if (dialog.open() == Window.OK) { |
| 344 |
label = new Label(group, SWT.LEFT); |
380 |
keywords.setText(dialog.getSelectedKeywordsString()); |
| 345 |
label.setText("Version"); |
381 |
} |
| 346 |
|
382 |
} |
| 347 |
label = new Label(group, SWT.LEFT); |
383 |
}); |
| 348 |
label.setText("Milestone"); |
384 |
keywordsSelectButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false)); |
| 349 |
|
385 |
keywordsSelectButton.setText("Select..."); |
| 350 |
// Lists |
386 |
SashForm sashForm = new SashForm(control, SWT.VERTICAL); |
| 351 |
product = new List(group, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER); |
387 |
sashForm.setLayout(sashFormLayout); |
| 352 |
gd = new GridData(SWT.FILL, SWT.FILL, true, true); |
388 |
final GridData gd_sashForm = new GridData(SWT.FILL, SWT.FILL, true, true); |
| 353 |
gd.heightHint = HEIGHT_ATTRIBUTE_COMBO; |
389 |
gd_sashForm.widthHint = 500; |
| 354 |
product.setLayoutData(gd); |
390 |
sashForm.setLayoutData(gd_sashForm); |
|
|
391 |
|
| 392 |
GridLayout topLayout = new GridLayout(); |
| 393 |
topLayout.numColumns = 4; |
| 394 |
SashForm topForm = new SashForm(sashForm, SWT.NONE); |
| 395 |
GridData topLayoutData = new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1); |
| 396 |
topLayoutData.widthHint = 500; |
| 397 |
topForm.setLayoutData(topLayoutData); |
| 398 |
topForm.setLayout(topLayout); |
| 399 |
|
| 400 |
GridLayout productLayout = new GridLayout(); |
| 401 |
productLayout.marginWidth = 0; |
| 402 |
productLayout.marginHeight = 0; |
| 403 |
productLayout.horizontalSpacing = 0; |
| 404 |
Composite productComposite = new Composite(topForm, SWT.NONE); |
| 405 |
productComposite.setLayout(productLayout); |
| 406 |
|
| 407 |
Label productLabel = new Label(productComposite, SWT.LEFT); |
| 408 |
productLabel.setText("Product"); |
| 409 |
|
| 410 |
GridData productLayoutData = new GridData(SWT.FILL, SWT.FILL, true, true); |
| 411 |
productLayoutData.heightHint = HEIGHT_ATTRIBUTE_COMBO; |
| 412 |
product = new List(productComposite, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER); |
| 413 |
product.setLayoutData(productLayoutData); |
| 355 |
product.addSelectionListener(new SelectionAdapter() { |
414 |
product.addSelectionListener(new SelectionAdapter() { |
| 356 |
@Override |
415 |
@Override |
| 357 |
public void widgetSelected(SelectionEvent e) { |
416 |
public void widgetSelected(SelectionEvent e) { |
|
Lines 371-560
Link Here
|
| 371 |
} |
430 |
} |
| 372 |
}); |
431 |
}); |
| 373 |
|
432 |
|
| 374 |
component = new List(group, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER); |
433 |
GridLayout componentLayout = new GridLayout(); |
| 375 |
gd = new GridData(SWT.FILL, SWT.FILL, true, true); |
434 |
componentLayout.marginWidth = 0; |
| 376 |
gd.heightHint = HEIGHT_ATTRIBUTE_COMBO; |
435 |
componentLayout.marginHeight = 0; |
| 377 |
component.setLayoutData(gd); |
436 |
componentLayout.horizontalSpacing = 0; |
|
|
437 |
Composite componentComposite = new Composite(topForm, SWT.NONE); |
| 438 |
componentComposite.setLayout(componentLayout); |
| 439 |
|
| 440 |
Label componentLabel = new Label(componentComposite, SWT.LEFT); |
| 441 |
componentLabel.setText("Component"); |
| 442 |
|
| 443 |
component = new List(componentComposite, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER); |
| 444 |
GridData componentLayoutData = new GridData(SWT.FILL, SWT.FILL, true, true); |
| 445 |
componentLayoutData.heightHint = HEIGHT_ATTRIBUTE_COMBO; |
| 446 |
component.setLayoutData(componentLayoutData); |
| 378 |
component.addSelectionListener(updateActionSelectionAdapter); |
447 |
component.addSelectionListener(updateActionSelectionAdapter); |
| 379 |
|
448 |
|
| 380 |
version = new List(group, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER); |
449 |
Composite versionComposite = new Composite(topForm, SWT.NONE); |
| 381 |
gd = new GridData(SWT.FILL, SWT.FILL, true, true); |
450 |
GridLayout versionLayout = new GridLayout(); |
| 382 |
gd.heightHint = HEIGHT_ATTRIBUTE_COMBO; |
451 |
versionLayout.marginWidth = 0; |
| 383 |
version.setLayoutData(gd); |
452 |
versionLayout.marginHeight = 0; |
|
|
453 |
versionLayout.horizontalSpacing = 0; |
| 454 |
versionComposite.setLayout(versionLayout); |
| 455 |
|
| 456 |
Label versionLabel = new Label(versionComposite, SWT.LEFT); |
| 457 |
versionLabel.setText("Version"); |
| 458 |
|
| 459 |
version = new List(versionComposite, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER); |
| 460 |
GridData versionLayoutData = new GridData(SWT.FILL, SWT.FILL, true, true); |
| 461 |
versionLayoutData.heightHint = HEIGHT_ATTRIBUTE_COMBO; |
| 462 |
version.setLayoutData(versionLayoutData); |
| 384 |
version.addSelectionListener(updateActionSelectionAdapter); |
463 |
version.addSelectionListener(updateActionSelectionAdapter); |
| 385 |
|
464 |
|
| 386 |
target = new List(group, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER); |
465 |
Composite milestoneComposite = new Composite(topForm, SWT.NONE); |
| 387 |
gd = new GridData(SWT.FILL, SWT.FILL, true, true); |
466 |
GridLayout milestoneLayout = new GridLayout(); |
| 388 |
gd.heightHint = HEIGHT_ATTRIBUTE_COMBO; |
467 |
milestoneLayout.marginWidth = 0; |
| 389 |
target.setLayoutData(gd); |
468 |
milestoneLayout.marginHeight = 0; |
|
|
469 |
milestoneLayout.horizontalSpacing = 0; |
| 470 |
milestoneComposite.setLayout(milestoneLayout); |
| 471 |
|
| 472 |
Label milestoneLabel = new Label(milestoneComposite, SWT.LEFT); |
| 473 |
milestoneLabel.setText("Milestone"); |
| 474 |
|
| 475 |
target = new List(milestoneComposite, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER); |
| 476 |
GridData targetLayoutData = new GridData(SWT.FILL, SWT.FILL, true, true); |
| 477 |
targetLayoutData.heightHint = HEIGHT_ATTRIBUTE_COMBO; |
| 478 |
target.setLayoutData(targetLayoutData); |
| 390 |
target.addSelectionListener(updateActionSelectionAdapter); |
479 |
target.addSelectionListener(updateActionSelectionAdapter); |
| 391 |
|
480 |
|
| 392 |
return group; |
481 |
SashForm bottomForm = new SashForm(sashForm, SWT.NONE); |
| 393 |
} |
482 |
GridLayout bottomLayout = new GridLayout(); |
| 394 |
|
483 |
bottomLayout.numColumns = 6; |
| 395 |
/** |
484 |
bottomForm.setLayout(bottomLayout); |
| 396 |
* Creates the area for selection of bug attributes (status, etc.) |
485 |
GridData bottomLayoutData = new GridData(SWT.FILL, SWT.FILL, true, true, 4, 1); |
| 397 |
*/ |
486 |
bottomLayoutData.heightHint = 119; |
| 398 |
protected Control createLists(Composite control) { |
487 |
bottomLayoutData.widthHint = 400; |
| 399 |
GridData gd; |
488 |
bottomForm.setLayoutData(bottomLayoutData); |
| 400 |
GridLayout layout; |
489 |
|
| 401 |
|
490 |
Composite statusComposite = new Composite(bottomForm, SWT.NONE); |
| 402 |
// Search expression |
491 |
GridLayout statusLayout = new GridLayout(); |
| 403 |
Composite group = new Composite(control, SWT.NONE); |
492 |
statusLayout.marginTop = 7; |
| 404 |
layout = new GridLayout(); |
493 |
statusLayout.marginWidth = 0; |
| 405 |
layout.numColumns = 6; |
494 |
statusLayout.horizontalSpacing = 0; |
| 406 |
group.setLayout(layout); |
495 |
statusLayout.marginHeight = 0; |
| 407 |
gd = new GridData(SWT.FILL, SWT.FILL, true, true); |
496 |
statusComposite.setLayout(statusLayout); |
| 408 |
gd.horizontalSpan = 5; |
497 |
|
| 409 |
group.setLayoutData(gd); |
498 |
Label statusLabel = new Label(statusComposite, SWT.LEFT); |
| 410 |
|
499 |
statusLabel.setText("Status"); |
| 411 |
// Labels |
500 |
|
| 412 |
Label label = new Label(group, SWT.LEFT); |
501 |
status = new List(statusComposite, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER); |
| 413 |
label.setText("Status"); |
502 |
final GridData gd_status = new GridData(SWT.FILL, SWT.FILL, true, true); |
| 414 |
|
503 |
gd_status.heightHint = 60; |
| 415 |
label = new Label(group, SWT.LEFT); |
504 |
status.setLayoutData(gd_status); |
| 416 |
label.setText("Resolution"); |
|
|
| 417 |
|
| 418 |
label = new Label(group, SWT.LEFT); |
| 419 |
label.setText("Severity"); |
| 420 |
|
| 421 |
label = new Label(group, SWT.LEFT); |
| 422 |
label.setText("Priority"); |
| 423 |
|
| 424 |
label = new Label(group, SWT.LEFT); |
| 425 |
label.setText("Hardware"); |
| 426 |
|
| 427 |
label = new Label(group, SWT.LEFT); |
| 428 |
label.setText("OS"); |
| 429 |
|
| 430 |
// Lists |
| 431 |
status = new List(group, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER); |
| 432 |
gd = new GridData(SWT.FILL, SWT.FILL, true, true); |
| 433 |
gd.heightHint = 40; |
| 434 |
status.setLayoutData(gd); |
| 435 |
status.addSelectionListener(updateActionSelectionAdapter); |
505 |
status.addSelectionListener(updateActionSelectionAdapter); |
| 436 |
|
506 |
|
| 437 |
resolution = new List(group, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER); |
507 |
Composite resolutionComposite = new Composite(bottomForm, SWT.NONE); |
| 438 |
gd = new GridData(SWT.FILL, SWT.FILL, true, true); |
508 |
GridLayout resolutionLayout = new GridLayout(); |
| 439 |
gd.heightHint = 40; |
509 |
resolutionLayout.marginTop = 7; |
| 440 |
resolution.setLayoutData(gd); |
510 |
resolutionLayout.marginWidth = 0; |
|
|
511 |
resolutionLayout.marginHeight = 0; |
| 512 |
resolutionLayout.horizontalSpacing = 0; |
| 513 |
resolutionComposite.setLayout(resolutionLayout); |
| 514 |
|
| 515 |
Label resolutionLabel = new Label(resolutionComposite, SWT.LEFT); |
| 516 |
resolutionLabel.setText("Resolution"); |
| 517 |
|
| 518 |
resolution = new List(resolutionComposite, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER); |
| 519 |
final GridData gd_resolution = new GridData(SWT.FILL, SWT.FILL, true, true); |
| 520 |
gd_resolution.heightHint = 60; |
| 521 |
resolution.setLayoutData(gd_resolution); |
| 441 |
resolution.addSelectionListener(updateActionSelectionAdapter); |
522 |
resolution.addSelectionListener(updateActionSelectionAdapter); |
| 442 |
|
523 |
|
| 443 |
severity = new List(group, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER); |
524 |
Composite priorityComposite = new Composite(bottomForm, SWT.NONE); |
| 444 |
gd = new GridData(SWT.FILL, SWT.FILL, true, true); |
525 |
GridLayout priorityLayout = new GridLayout(); |
| 445 |
gd.heightHint = 40; |
526 |
priorityLayout.marginTop = 7; |
| 446 |
severity.setLayoutData(gd); |
527 |
priorityLayout.marginWidth = 0; |
| 447 |
severity.addSelectionListener(updateActionSelectionAdapter); |
528 |
priorityLayout.marginHeight = 0; |
| 448 |
|
529 |
priorityLayout.horizontalSpacing = 0; |
| 449 |
priority = new List(group, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER); |
530 |
priorityComposite.setLayout(priorityLayout); |
| 450 |
gd = new GridData(SWT.FILL, SWT.FILL, true, true); |
531 |
|
| 451 |
gd.heightHint = 40; |
532 |
Label priorityLabel = new Label(priorityComposite, SWT.LEFT); |
| 452 |
priority.setLayoutData(gd); |
533 |
priorityLabel.setText("Priority"); |
|
|
534 |
|
| 535 |
priority = new List(priorityComposite, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER); |
| 536 |
final GridData gd_priority = new GridData(SWT.FILL, SWT.FILL, true, true); |
| 537 |
gd_priority.heightHint = 60; |
| 538 |
priority.setLayoutData(gd_priority); |
| 453 |
priority.addSelectionListener(updateActionSelectionAdapter); |
539 |
priority.addSelectionListener(updateActionSelectionAdapter); |
| 454 |
|
540 |
|
| 455 |
hardware = new List(group, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER); |
541 |
Composite severityComposite = new Composite(bottomForm, SWT.NONE); |
| 456 |
gd = new GridData(SWT.FILL, SWT.FILL, true, true); |
542 |
GridLayout severityLayout = new GridLayout(); |
| 457 |
gd.heightHint = 40; |
543 |
severityLayout.marginTop = 7; |
| 458 |
hardware.setLayoutData(gd); |
544 |
severityLayout.marginWidth = 0; |
|
|
545 |
severityLayout.marginHeight = 0; |
| 546 |
severityLayout.horizontalSpacing = 0; |
| 547 |
severityComposite.setLayout(severityLayout); |
| 548 |
|
| 549 |
Label severityLabel = new Label(severityComposite, SWT.LEFT); |
| 550 |
severityLabel.setText("Severity"); |
| 551 |
|
| 552 |
severity = new List(severityComposite, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER); |
| 553 |
final GridData gd_severity = new GridData(SWT.FILL, SWT.FILL, true, true); |
| 554 |
gd_severity.heightHint = 60; |
| 555 |
severity.setLayoutData(gd_severity); |
| 556 |
severity.addSelectionListener(updateActionSelectionAdapter); |
| 557 |
|
| 558 |
Composite hardwareComposite = new Composite(bottomForm, SWT.NONE); |
| 559 |
GridLayout hardwareLayout = new GridLayout(); |
| 560 |
hardwareLayout.marginTop = 7; |
| 561 |
hardwareLayout.marginWidth = 0; |
| 562 |
hardwareLayout.marginHeight = 0; |
| 563 |
hardwareLayout.horizontalSpacing = 0; |
| 564 |
hardwareComposite.setLayout(hardwareLayout); |
| 565 |
|
| 566 |
Label hardwareLabel = new Label(hardwareComposite, SWT.LEFT); |
| 567 |
hardwareLabel.setText("Hardware"); |
| 568 |
|
| 569 |
hardware = new List(hardwareComposite, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER); |
| 570 |
final GridData gd_hardware = new GridData(SWT.FILL, SWT.FILL, true, true); |
| 571 |
gd_hardware.heightHint = 60; |
| 572 |
hardware.setLayoutData(gd_hardware); |
| 459 |
hardware.addSelectionListener(updateActionSelectionAdapter); |
573 |
hardware.addSelectionListener(updateActionSelectionAdapter); |
| 460 |
|
574 |
|
| 461 |
os = new List(group, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER); |
575 |
Composite osComposite = new Composite(bottomForm, SWT.NONE); |
| 462 |
gd = new GridData(SWT.FILL, SWT.FILL, true, true); |
576 |
GridLayout osLayout = new GridLayout(); |
| 463 |
gd.heightHint = 40; |
577 |
osLayout.marginTop = 7; |
| 464 |
os.setLayoutData(gd); |
578 |
osLayout.marginWidth = 0; |
|
|
579 |
osLayout.marginHeight = 0; |
| 580 |
osLayout.horizontalSpacing = 0; |
| 581 |
osComposite.setLayout(osLayout); |
| 582 |
|
| 583 |
Label osLabel = new Label(osComposite, SWT.LEFT); |
| 584 |
osLabel.setText("OS"); |
| 585 |
|
| 586 |
os = new List(osComposite, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER); |
| 587 |
final GridData gd_os = new GridData(SWT.FILL, SWT.FILL, true, true); |
| 588 |
gd_os.heightHint = 60; |
| 589 |
os.setLayoutData(gd_os); |
| 465 |
os.addSelectionListener(updateActionSelectionAdapter); |
590 |
os.addSelectionListener(updateActionSelectionAdapter); |
| 466 |
|
591 |
bottomForm.setWeights(new int[] { 88, 90, 50, 77, 88, 85 }); |
| 467 |
return group; |
|
|
| 468 |
} |
592 |
} |
| 469 |
|
593 |
|
| 470 |
protected Text daysText; |
594 |
private void createSearchGroup(Composite control) { |
| 471 |
|
595 |
Composite composite = new Composite(control, SWT.NONE); |
| 472 |
protected Control createLastDays(Composite control) { |
596 |
composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); |
| 473 |
GridLayout layout; |
597 |
GridLayout gridLayout = new GridLayout(); |
| 474 |
GridData gd; |
598 |
gridLayout.marginTop = 7; |
| 475 |
|
599 |
gridLayout.marginHeight = 0; |
| 476 |
Group group = new Group(control, SWT.NONE); |
600 |
gridLayout.marginWidth = 0; |
| 477 |
layout = new GridLayout(6, false); |
601 |
gridLayout.numColumns = 2; |
| 478 |
group.setLayout(layout); |
602 |
composite.setLayout(gridLayout); |
| 479 |
group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
603 |
|
| 480 |
gd = new GridData(GridData.BEGINNING | GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL); |
604 |
Label changedInTheLabel = new Label(composite, SWT.LEFT); |
| 481 |
gd.horizontalSpan = 2; |
605 |
changedInTheLabel.setLayoutData(new GridData()); |
| 482 |
group.setLayoutData(gd); |
606 |
changedInTheLabel.setText("Changed in:"); |
| 483 |
|
607 |
|
| 484 |
Label label = new Label(group, SWT.LEFT); |
608 |
Composite updateComposite = new Composite(composite, SWT.NONE); |
| 485 |
label.setText("Only bugs changed in the last "); |
609 |
updateComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); |
|
|
610 |
GridLayout updateLayout = new GridLayout(3, false); |
| 611 |
updateLayout.marginWidth = 0; |
| 612 |
updateLayout.horizontalSpacing = 0; |
| 613 |
updateLayout.marginHeight = 0; |
| 614 |
updateComposite.setLayout(updateLayout); |
| 486 |
|
615 |
|
| 487 |
// operation combo |
616 |
daysText = new Text(updateComposite, SWT.BORDER); |
| 488 |
daysText = new Text(group, SWT.BORDER); |
617 |
daysText.setLayoutData(new GridData(40, SWT.DEFAULT)); |
| 489 |
daysText.setTextLimit(5); |
618 |
daysText.setTextLimit(5); |
| 490 |
GridData daysLayoutData = new GridData(); |
|
|
| 491 |
daysLayoutData.widthHint = 30; |
| 492 |
daysText.setLayoutData(daysLayoutData); |
| 493 |
daysText.addListener(SWT.Modify, this); |
619 |
daysText.addListener(SWT.Modify, this); |
| 494 |
label = new Label(group, SWT.LEFT); |
|
|
| 495 |
label.setText(" days."); |
| 496 |
return group; |
| 497 |
} |
| 498 |
|
| 499 |
private static final String[] emailText = { "bug owner", "reporter", "CC list", "commenter" }; |
| 500 |
|
| 501 |
protected Control createEmail(Composite control) { |
| 502 |
GridLayout layout; |
| 503 |
GridData gd; |
| 504 |
|
| 505 |
Group group = new Group(control, SWT.NONE); |
| 506 |
layout = new GridLayout(7, false); |
| 507 |
group.setLayout(layout); |
| 508 |
group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
| 509 |
gd = new GridData(GridData.BEGINNING | GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL); |
| 510 |
gd.horizontalSpan = 2; |
| 511 |
group.setLayoutData(gd); |
| 512 |
|
620 |
|
| 513 |
Label label = new Label(group, SWT.LEFT); |
621 |
Label label = new Label(updateComposite, SWT.LEFT); |
| 514 |
label.setText("Email: "); |
622 |
label.setText(" days."); |
| 515 |
|
|
|
| 516 |
// pattern combo |
| 517 |
emailPattern = new Combo(group, SWT.SINGLE | SWT.BORDER); |
| 518 |
emailPattern.addModifyListener(new ModifyListener() { |
| 519 |
public void modifyText(ModifyEvent e) { |
| 520 |
if (scontainer != null) { |
| 521 |
scontainer.setPerformActionEnabled(canQuery()); |
| 522 |
} |
| 523 |
} |
| 524 |
}); |
| 525 |
emailPattern.addSelectionListener(new SelectionAdapter() { |
| 526 |
|
623 |
|
|
|
624 |
Button updateButton = new Button(updateComposite, SWT.PUSH); |
| 625 |
updateButton.setText("Update Attributes from Repository"); |
| 626 |
updateButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false)); |
| 627 |
updateButton.addSelectionListener(new SelectionAdapter() { |
| 527 |
@Override |
628 |
@Override |
| 528 |
public void widgetSelected(SelectionEvent e) { |
629 |
public void widgetSelected(SelectionEvent e) { |
| 529 |
handleWidgetSelected(emailPattern, emailOperation, previousEmailPatterns); |
630 |
if (repository != null) { |
|
|
631 |
updateAttributesFromRepository(repository.getUrl(), null, true); |
| 632 |
} else { |
| 633 |
MessageDialog.openInformation(Display.getCurrent().getActiveShell(), |
| 634 |
IBugzillaConstants.TITLE_MESSAGE_DIALOG, TaskRepositoryManager.MESSAGE_NO_REPOSITORY); |
| 635 |
} |
| 530 |
} |
636 |
} |
| 531 |
}); |
637 |
}); |
| 532 |
gd = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL); |
|
|
| 533 |
gd.widthHint = 110; |
| 534 |
emailPattern.setLayoutData(gd); |
| 535 |
|
| 536 |
// operation combo |
| 537 |
emailOperation = new Combo(group, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER); |
| 538 |
emailOperation.setItems(emailOperationText); |
| 539 |
emailOperation.setText(emailOperationText[0]); |
| 540 |
emailOperation.select(0); |
| 541 |
|
| 542 |
// Composite buttons = new Composite(group, SWT.NONE); |
| 543 |
// layout = new GridLayout(4, false); |
| 544 |
// buttons.setLayout(layout); |
| 545 |
// buttons.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
| 546 |
// gd = new GridData(GridData.BEGINNING); |
| 547 |
// gd.horizontalSpan = 3; |
| 548 |
// buttons.setLayoutData(gd); |
| 549 |
|
| 550 |
emailButtons = new Button[emailText.length]; |
| 551 |
for (int i = 0; i < emailButtons.length; i++) { |
| 552 |
Button button = new Button(group, SWT.CHECK); |
| 553 |
button.setText(emailText[i]); |
| 554 |
emailButtons[i] = button; |
| 555 |
} |
| 556 |
|
| 557 |
return group; |
| 558 |
} |
638 |
} |
| 559 |
|
639 |
|
| 560 |
/** |
640 |
/** |
|
Lines 592-599
Link Here
|
| 592 |
// } |
672 |
// } |
| 593 |
// }); |
673 |
// }); |
| 594 |
// loadButton.setEnabled(true); |
674 |
// loadButton.setEnabled(true); |
| 595 |
// loadButton.setLayoutData(new |
675 |
// loadButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING)); |
| 596 |
// GridData(GridData.HORIZONTAL_ALIGN_BEGINNING)); |
|
|
| 597 |
// |
676 |
// |
| 598 |
// saveButton = new Button(group, SWT.PUSH | SWT.LEFT); |
677 |
// saveButton = new Button(group, SWT.PUSH | SWT.LEFT); |
| 599 |
// saveButton.setText("Remember..."); |
678 |
// saveButton.setText("Remember..."); |
|
Lines 601-614
Link Here
|
| 601 |
// |
680 |
// |
| 602 |
// @Override |
681 |
// @Override |
| 603 |
// public void widgetSelected(SelectionEvent event) { |
682 |
// public void widgetSelected(SelectionEvent event) { |
| 604 |
// SaveQueryDialog qd = new SaveQueryDialog(getShell(), "Remember |
683 |
// SaveQueryDialog qd = new SaveQueryDialog(getShell(), "Remember Query"); |
| 605 |
// Query"); |
|
|
| 606 |
// if (qd.open() == InputDialog.OK) { |
684 |
// if (qd.open() == InputDialog.OK) { |
| 607 |
// String qName = qd.getText(); |
685 |
// String qName = qd.getText(); |
| 608 |
// if (qName != null && qName.compareTo("") != 0) { |
686 |
// if (qName != null && qName.compareTo("") != 0) { |
| 609 |
// try { |
687 |
// try { |
| 610 |
// input.add(getQueryParameters().toString(), qName, |
688 |
// input.add(getQueryParameters().toString(), qName, summaryPattern.getText()); |
| 611 |
// summaryPattern.getText()); |
|
|
| 612 |
// } catch (UnsupportedEncodingException e) { |
689 |
// } catch (UnsupportedEncodingException e) { |
| 613 |
// /* |
690 |
// /* |
| 614 |
// * Do nothing. Every implementation of the Java |
691 |
// * Do nothing. Every implementation of the Java |
|
Lines 621-628
Link Here
|
| 621 |
// } |
698 |
// } |
| 622 |
// }); |
699 |
// }); |
| 623 |
// saveButton.setEnabled(true); |
700 |
// saveButton.setEnabled(true); |
| 624 |
// saveButton.setLayoutData(new |
701 |
// saveButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING)); |
| 625 |
// GridData(GridData.HORIZONTAL_ALIGN_BEGINNING)); |
|
|
| 626 |
|
702 |
|
| 627 |
return group; |
703 |
return group; |
| 628 |
} |
704 |
} |
|
Lines 631-676
Link Here
|
| 631 |
// return input; |
707 |
// return input; |
| 632 |
// } |
708 |
// } |
| 633 |
|
709 |
|
| 634 |
protected Control createUpdate(final Composite control) { |
|
|
| 635 |
GridData gd; |
| 636 |
// Label label; |
| 637 |
|
| 638 |
Composite group = new Composite(control, SWT.NONE); |
| 639 |
GridLayout layout = new GridLayout(2, false); |
| 640 |
group.setLayout(layout); |
| 641 |
group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
| 642 |
|
| 643 |
gd = new GridData(GridData.BEGINNING); |
| 644 |
gd.horizontalSpan = 2; |
| 645 |
group.setLayoutData(gd); |
| 646 |
|
| 647 |
// Info text |
| 648 |
// label = new Label(group, SWT.LEFT); |
| 649 |
// label.setText("Update search options from server:"); |
| 650 |
// gd = new GridData(GridData.BEGINNING); |
| 651 |
// label.setLayoutData(gd); |
| 652 |
|
| 653 |
updateButton = new Button(group, SWT.PUSH); |
| 654 |
updateButton.setText("Update Attributes from Repository"); |
| 655 |
|
| 656 |
updateButton.setLayoutData(new GridData()); |
| 657 |
|
| 658 |
updateButton.addSelectionListener(new SelectionAdapter() { |
| 659 |
|
| 660 |
@Override |
| 661 |
public void widgetSelected(SelectionEvent e) { |
| 662 |
if (repository != null) { |
| 663 |
updateAttributesFromRepository(repository.getUrl(), null, true); |
| 664 |
} else { |
| 665 |
MessageDialog.openInformation(Display.getCurrent().getActiveShell(), |
| 666 |
IBugzillaConstants.TITLE_MESSAGE_DIALOG, TaskRepositoryManager.MESSAGE_NO_REPOSITORY); |
| 667 |
} |
| 668 |
} |
| 669 |
}); |
| 670 |
|
| 671 |
return group; |
| 672 |
} |
| 673 |
|
| 674 |
private void handleWidgetSelected(Combo widget, Combo operation, ArrayList<BugzillaSearchData> history) { |
710 |
private void handleWidgetSelected(Combo widget, Combo operation, ArrayList<BugzillaSearchData> history) { |
| 675 |
if (widget.getSelectionIndex() < 0) |
711 |
if (widget.getSelectionIndex() < 0) |
| 676 |
return; |
712 |
return; |
|
Lines 690-696
Link Here
|
| 690 |
|
726 |
|
| 691 |
getPatternData(summaryPattern, summaryOperation, previousSummaryPatterns); |
727 |
getPatternData(summaryPattern, summaryOperation, previousSummaryPatterns); |
| 692 |
getPatternData(commentPattern, commentOperation, previousCommentPatterns); |
728 |
getPatternData(commentPattern, commentOperation, previousCommentPatterns); |
| 693 |
getPatternData(this.emailPattern, emailOperation, previousEmailPatterns); |
729 |
getPatternData(emailPattern, emailOperation, previousEmailPatterns); |
|
|
730 |
getPatternData(keywords, keywordsOperation, previousKeywords); |
| 694 |
|
731 |
|
| 695 |
String summaryText = summaryPattern.getText(); |
732 |
String summaryText = summaryPattern.getText(); |
| 696 |
BugzillaUiPlugin.getDefault().getPreferenceStore().setValue(IBugzillaConstants.MOST_RECENT_QUERY, summaryText); |
733 |
BugzillaUiPlugin.getDefault().getPreferenceStore().setValue(IBugzillaConstants.MOST_RECENT_QUERY, summaryText); |
|
Lines 706-719
Link Here
|
| 706 |
repository = TasksUiPlugin.getRepositoryManager().getDefaultRepository( |
743 |
repository = TasksUiPlugin.getRepositoryManager().getDefaultRepository( |
| 707 |
BugzillaCorePlugin.REPOSITORY_KIND); |
744 |
BugzillaCorePlugin.REPOSITORY_KIND); |
| 708 |
} |
745 |
} |
| 709 |
// Set<TaskRepository> repositories = |
746 |
// Set<TaskRepository> repositories = TasksUiPlugin.getRepositoryManager().getRepositories(BugzillaCorePlugin.REPOSITORY_KIND); |
| 710 |
// TasksUiPlugin.getRepositoryManager().getRepositories( |
|
|
| 711 |
// BugzillaCorePlugin.REPOSITORY_KIND); |
| 712 |
// String[] repositoryUrls = new String[repositories.size()]; |
747 |
// String[] repositoryUrls = new String[repositories.size()]; |
| 713 |
// int i = 0; |
748 |
// int i = 0; |
| 714 |
// int indexToSelect = 0; |
749 |
// int indexToSelect = 0; |
| 715 |
// for (Iterator<TaskRepository> iter = repositories.iterator(); |
750 |
// for (Iterator<TaskRepository> iter = repositories.iterator(); iter.hasNext();) { |
| 716 |
// iter.hasNext();) { |
|
|
| 717 |
// TaskRepository currRepsitory = iter.next(); |
751 |
// TaskRepository currRepsitory = iter.next(); |
| 718 |
// // if (i == 0 && repository == null) { |
752 |
// // if (i == 0 && repository == null) { |
| 719 |
// // repository = currRepsitory; |
753 |
// // repository = currRepsitory; |
|
Lines 730-757
Link Here
|
| 730 |
// if (repositoryCombo != null) { |
764 |
// if (repositoryCombo != null) { |
| 731 |
// repositoryCombo.setItems(repositoryUrls); |
765 |
// repositoryCombo.setItems(repositoryUrls); |
| 732 |
// if (repositoryUrls.length == 0) { |
766 |
// if (repositoryUrls.length == 0) { |
| 733 |
// MessageDialog.openInformation(Display.getCurrent().getActiveShell(), |
767 |
// MessageDialog.openInformation(Display.getCurrent().getActiveShell(), IBugzillaConstants.TITLE_MESSAGE_DIALOG, |
| 734 |
// IBugzillaConstants.TITLE_MESSAGE_DIALOG, |
|
|
| 735 |
// TaskRepositoryManager.MESSAGE_NO_REPOSITORY); |
768 |
// TaskRepositoryManager.MESSAGE_NO_REPOSITORY); |
| 736 |
// } else { |
769 |
// } else { |
| 737 |
// String selectRepo = settings.get(STORE_REPO_ID); |
770 |
// String selectRepo = settings.get(STORE_REPO_ID); |
| 738 |
// if (selectRepo != null && repositoryCombo.indexOf(selectRepo) |
771 |
// if (selectRepo != null && repositoryCombo.indexOf(selectRepo) > -1) { |
| 739 |
// > -1) { |
|
|
| 740 |
// repositoryCombo.setText(selectRepo); |
772 |
// repositoryCombo.setText(selectRepo); |
| 741 |
// repository = |
773 |
// repository = TasksUiPlugin.getRepositoryManager().getRepository( |
| 742 |
// TasksUiPlugin.getRepositoryManager().getRepository( |
774 |
// BugzillaCorePlugin.REPOSITORY_KIND, repositoryCombo.getText()); |
| 743 |
// BugzillaCorePlugin.REPOSITORY_KIND, |
|
|
| 744 |
// repositoryCombo.getText()); |
| 745 |
// if (repository == null) { |
775 |
// if (repository == null) { |
| 746 |
// repository = |
776 |
// repository = TasksUiPlugin.getRepositoryManager().getDefaultRepository( BugzillaCorePlugin.REPOSITORY_KIND); |
| 747 |
// TasksUiPlugin.getRepositoryManager().getDefaultRepository( |
|
|
| 748 |
// BugzillaCorePlugin.REPOSITORY_KIND); |
| 749 |
// } |
777 |
// } |
| 750 |
// } else { |
778 |
// } else { |
| 751 |
// repositoryCombo.select(indexToSelect); |
779 |
// repositoryCombo.select(indexToSelect); |
| 752 |
// } |
780 |
// } |
| 753 |
// updateAttributesFromRepository(repositoryCombo.getText(), |
781 |
// updateAttributesFromRepository(repositoryCombo.getText(), null, false); |
| 754 |
// null, false); |
|
|
| 755 |
// } |
782 |
// } |
| 756 |
// } |
783 |
// } |
| 757 |
|
784 |
|
|
Lines 769-774
Link Here
|
| 769 |
emailPattern.add(email); |
796 |
emailPattern.add(email); |
| 770 |
} |
797 |
} |
| 771 |
// emailPattern.setItems(getPreviousPatterns(previousEmailPatterns)); |
798 |
// emailPattern.setItems(getPreviousPatterns(previousEmailPatterns)); |
|
|
799 |
for (String keyword : getPreviousPatterns(previousKeywords)) { |
| 800 |
keywords.add(keyword); |
| 801 |
} |
| 772 |
|
802 |
|
| 773 |
// TODO: update status, resolution, severity etc if possible... |
803 |
// TODO: update status, resolution, severity etc if possible... |
| 774 |
if (repository != null) { |
804 |
if (repository != null) { |
|
Lines 824-830
Link Here
|
| 824 |
|| resolution.getSelectionCount() > 0 || severity.getSelectionCount() > 0 |
854 |
|| resolution.getSelectionCount() > 0 || severity.getSelectionCount() > 0 |
| 825 |
|| priority.getSelectionCount() > 0 || hardware.getSelectionCount() > 0 || os.getSelectionCount() > 0 |
855 |
|| priority.getSelectionCount() > 0 || hardware.getSelectionCount() > 0 || os.getSelectionCount() > 0 |
| 826 |
|| summaryPattern.getText().length() > 0 || commentPattern.getText().length() > 0 |
856 |
|| summaryPattern.getText().length() > 0 || commentPattern.getText().length() > 0 |
| 827 |
|| emailPattern.getText().length() > 0; |
857 |
|| emailPattern.getText().length() > 0 || keywords.getText().length() > 0; |
| 828 |
} |
858 |
} |
| 829 |
|
859 |
|
| 830 |
/** |
860 |
/** |
|
Lines 871-878
Link Here
|
| 871 |
public String getSearchURL(TaskRepository repository) { |
901 |
public String getSearchURL(TaskRepository repository) { |
| 872 |
try { |
902 |
try { |
| 873 |
// if (rememberedQuery) { |
903 |
// if (rememberedQuery) { |
| 874 |
// return getQueryURL(repository, new |
904 |
// return getQueryURL(repository, new StringBuffer(input.getQueryParameters(selIndex))); |
| 875 |
// StringBuffer(input.getQueryParameters(selIndex))); |
|
|
| 876 |
// } else { |
905 |
// } else { |
| 877 |
return getQueryURL(repository, getQueryParameters()); |
906 |
return getQueryURL(repository, getQueryParameters()); |
| 878 |
// } |
907 |
// } |
|
Lines 1023-1028
Link Here
|
| 1023 |
} |
1052 |
} |
| 1024 |
} |
1053 |
} |
| 1025 |
|
1054 |
|
|
|
1055 |
if (keywords.getText() != null && !keywords.getText().trim().equals("")) { |
| 1056 |
sb.append("&keywords_type="); |
| 1057 |
sb.append(keywordOperationValues[keywordsOperation.getSelectionIndex()]); |
| 1058 |
sb.append("&keywords="); |
| 1059 |
sb.append(URLEncoder.encode(keywords.getText().replace(',', ' '), repository.getCharacterEncoding())); |
| 1060 |
} |
| 1061 |
|
| 1026 |
return sb; |
1062 |
return sb; |
| 1027 |
} |
1063 |
} |
| 1028 |
|
1064 |
|
|
Lines 1065-1072
Link Here
|
| 1065 |
|
1101 |
|
| 1066 |
private static final String STORE_EMAILADDRESS_ID = PAGE_NAME + ".EMAILADDRESS"; |
1102 |
private static final String STORE_EMAILADDRESS_ID = PAGE_NAME + ".EMAILADDRESS"; |
| 1067 |
|
1103 |
|
|
|
1104 |
private static final String STORE_KEYWORDS_ID = PAGE_NAME + ".KEYWORDS"; |
| 1105 |
|
| 1106 |
private static final String STORE_KEYWORDSMATCH_ID = PAGE_NAME + ".KEYWORDSMATCH"; |
| 1107 |
|
| 1068 |
// private static final String STORE_REPO_ID = PAGE_NAME + ".REPO"; |
1108 |
// private static final String STORE_REPO_ID = PAGE_NAME + ".REPO"; |
| 1069 |
|
1109 |
|
|
|
1110 |
protected Combo summaryPattern; |
| 1111 |
|
| 1070 |
protected Combo summaryOperation; |
1112 |
protected Combo summaryOperation; |
| 1071 |
|
1113 |
|
| 1072 |
protected List product; |
1114 |
protected List product; |
|
Lines 1099-1104
Link Here
|
| 1099 |
|
1141 |
|
| 1100 |
protected Button[] emailButtons; |
1142 |
protected Button[] emailButtons; |
| 1101 |
|
1143 |
|
|
|
1144 |
private Combo keywords; |
| 1145 |
|
| 1146 |
private Combo keywordsOperation; |
| 1147 |
|
| 1148 |
protected Text daysText; |
| 1149 |
|
| 1102 |
// /** File containing saved queries */ |
1150 |
// /** File containing saved queries */ |
| 1103 |
// protected static SavedQueryFile input; |
1151 |
// protected static SavedQueryFile input; |
| 1104 |
|
1152 |
|
|
Lines 1114-1121
Link Here
|
| 1114 |
/** Index of the saved query to run */ |
1162 |
/** Index of the saved query to run */ |
| 1115 |
protected int selIndex; |
1163 |
protected int selIndex; |
| 1116 |
|
1164 |
|
| 1117 |
protected Button updateButton; |
|
|
| 1118 |
|
| 1119 |
public IDialogSettings getDialogSettings() { |
1165 |
public IDialogSettings getDialogSettings() { |
| 1120 |
IDialogSettings settings = BugzillaUiPlugin.getDefault().getDialogSettings(); |
1166 |
IDialogSettings settings = BugzillaUiPlugin.getDefault().getDialogSettings(); |
| 1121 |
fDialogSettings = settings.getSection(PAGE_NAME); |
1167 |
fDialogSettings = settings.getSection(PAGE_NAME); |
|
Lines 1422-1427
Link Here
|
| 1422 |
emailPattern.setText(value); |
1468 |
emailPattern.setText(value); |
| 1423 |
} else if (key.equals("changedin")) { |
1469 |
} else if (key.equals("changedin")) { |
| 1424 |
daysText.setText(value); |
1470 |
daysText.setText(value); |
|
|
1471 |
} else if (key.equals("keywords")) { |
| 1472 |
keywords.setText(value.replace(' ', ',')); |
| 1473 |
} else if (key.equals("keywords_type")) { |
| 1474 |
int index = 0; |
| 1475 |
for (String item : keywordOperationValues) { |
| 1476 |
if (item.equals(value)) { |
| 1477 |
keywordsOperation.select(index); |
| 1478 |
break; |
| 1479 |
} |
| 1480 |
index++; |
| 1481 |
} |
| 1425 |
} |
1482 |
} |
| 1426 |
} |
1483 |
} |
| 1427 |
} |
1484 |
} |
|
Lines 1483-1488
Link Here
|
| 1483 |
summaryPattern.setText(settings.get(STORE_SUMMARYTEXT_ID + repoId)); |
1540 |
summaryPattern.setText(settings.get(STORE_SUMMARYTEXT_ID + repoId)); |
| 1484 |
commentPattern.setText(settings.get(STORE_COMMENTTEXT_ID + repoId)); |
1541 |
commentPattern.setText(settings.get(STORE_COMMENTTEXT_ID + repoId)); |
| 1485 |
emailPattern.setText(settings.get(STORE_EMAILADDRESS_ID + repoId)); |
1542 |
emailPattern.setText(settings.get(STORE_EMAILADDRESS_ID + repoId)); |
|
|
1543 |
keywords.setText(settings.get(STORE_KEYWORDS_ID + repoId)); |
| 1544 |
keywordsOperation.select(settings.getInt(STORE_KEYWORDSMATCH_ID + repoId)); |
| 1486 |
} |
1545 |
} |
| 1487 |
|
1546 |
|
| 1488 |
public void saveState() { |
1547 |
public void saveState() { |
|
Lines 1507-1512
Link Here
|
| 1507 |
settings.put(STORE_SUMMARYTEXT_ID + repoId, summaryPattern.getText()); |
1566 |
settings.put(STORE_SUMMARYTEXT_ID + repoId, summaryPattern.getText()); |
| 1508 |
settings.put(STORE_COMMENTTEXT_ID + repoId, commentPattern.getText()); |
1567 |
settings.put(STORE_COMMENTTEXT_ID + repoId, commentPattern.getText()); |
| 1509 |
settings.put(STORE_EMAILADDRESS_ID + repoId, emailPattern.getText()); |
1568 |
settings.put(STORE_EMAILADDRESS_ID + repoId, emailPattern.getText()); |
|
|
1569 |
settings.put(STORE_KEYWORDS_ID + repoId, keywords.getText()); |
| 1570 |
settings.put(STORE_KEYWORDSMATCH_ID + repoId, keywordsOperation.getSelectionIndex()); |
| 1510 |
// settings.put(STORE_REPO_ID, repositoryCombo.getText()); |
1571 |
// settings.put(STORE_REPO_ID, repositoryCombo.getText()); |
| 1511 |
} |
1572 |
} |
| 1512 |
|
1573 |
|