|
Lines 14-19
Link Here
|
| 14 |
import java.util.ArrayList; |
14 |
import java.util.ArrayList; |
| 15 |
import java.util.Iterator; |
15 |
import java.util.Iterator; |
| 16 |
import java.util.List; |
16 |
import java.util.List; |
|
|
17 |
import org.eclipse.jface.viewers.ComboViewer; |
| 17 |
|
18 |
|
| 18 |
import org.eclipse.jface.viewers.IColorProvider; |
19 |
import org.eclipse.jface.viewers.IColorProvider; |
| 19 |
import org.eclipse.jface.viewers.ILabelProvider; |
20 |
import org.eclipse.jface.viewers.ILabelProvider; |
|
Lines 26-32
Link Here
|
| 26 |
import org.eclipse.jface.viewers.SelectionChangedEvent; |
27 |
import org.eclipse.jface.viewers.SelectionChangedEvent; |
| 27 |
import org.eclipse.jface.viewers.StructuredSelection; |
28 |
import org.eclipse.jface.viewers.StructuredSelection; |
| 28 |
import org.eclipse.jface.viewers.Viewer; |
29 |
import org.eclipse.jface.viewers.Viewer; |
| 29 |
import org.eclipse.jface.wizard.IWizardPage; |
|
|
| 30 |
import org.eclipse.jface.wizard.WizardPage; |
30 |
import org.eclipse.jface.wizard.WizardPage; |
| 31 |
import org.eclipse.mylar.internal.jira.JiraCustomQuery; |
31 |
import org.eclipse.mylar.internal.jira.JiraCustomQuery; |
| 32 |
import org.eclipse.mylar.internal.jira.JiraServerFacade; |
32 |
import org.eclipse.mylar.internal.jira.JiraServerFacade; |
|
Lines 43-48
Link Here
|
| 43 |
import org.eclipse.swt.events.SelectionEvent; |
43 |
import org.eclipse.swt.events.SelectionEvent; |
| 44 |
import org.eclipse.swt.graphics.Color; |
44 |
import org.eclipse.swt.graphics.Color; |
| 45 |
import org.eclipse.swt.graphics.Image; |
45 |
import org.eclipse.swt.graphics.Image; |
|
|
46 |
import org.eclipse.swt.layout.FillLayout; |
| 46 |
import org.eclipse.swt.layout.GridData; |
47 |
import org.eclipse.swt.layout.GridData; |
| 47 |
import org.eclipse.swt.layout.GridLayout; |
48 |
import org.eclipse.swt.layout.GridLayout; |
| 48 |
import org.eclipse.swt.widgets.Button; |
49 |
import org.eclipse.swt.widgets.Button; |
|
Lines 51-62
Link Here
|
| 51 |
import org.eclipse.swt.widgets.Label; |
52 |
import org.eclipse.swt.widgets.Label; |
| 52 |
import org.eclipse.swt.widgets.Text; |
53 |
import org.eclipse.swt.widgets.Text; |
| 53 |
import org.tigris.jira.core.model.Component; |
54 |
import org.tigris.jira.core.model.Component; |
|
|
55 |
import org.tigris.jira.core.model.IssueType; |
| 56 |
import org.tigris.jira.core.model.Priority; |
| 54 |
import org.tigris.jira.core.model.Project; |
57 |
import org.tigris.jira.core.model.Project; |
|
|
58 |
import org.tigris.jira.core.model.Resolution; |
| 59 |
import org.tigris.jira.core.model.Status; |
| 55 |
import org.tigris.jira.core.model.Version; |
60 |
import org.tigris.jira.core.model.Version; |
| 56 |
import org.tigris.jira.core.model.filter.ComponentFilter; |
61 |
import org.tigris.jira.core.model.filter.ComponentFilter; |
| 57 |
import org.tigris.jira.core.model.filter.ContentFilter; |
62 |
import org.tigris.jira.core.model.filter.ContentFilter; |
|
|
63 |
import org.tigris.jira.core.model.filter.CurrentUserFilter; |
| 58 |
import org.tigris.jira.core.model.filter.FilterDefinition; |
64 |
import org.tigris.jira.core.model.filter.FilterDefinition; |
|
|
65 |
import org.tigris.jira.core.model.filter.IssueTypeFilter; |
| 66 |
import org.tigris.jira.core.model.filter.NobodyFilter; |
| 67 |
import org.tigris.jira.core.model.filter.PriorityFilter; |
| 59 |
import org.tigris.jira.core.model.filter.ProjectFilter; |
68 |
import org.tigris.jira.core.model.filter.ProjectFilter; |
|
|
69 |
import org.tigris.jira.core.model.filter.ResolutionFilter; |
| 70 |
import org.tigris.jira.core.model.filter.SpecificUserFilter; |
| 71 |
import org.tigris.jira.core.model.filter.StatusFilter; |
| 72 |
import org.tigris.jira.core.model.filter.UserFilter; |
| 73 |
import org.tigris.jira.core.model.filter.UserInGroupFilter; |
| 60 |
import org.tigris.jira.core.model.filter.VersionFilter; |
74 |
import org.tigris.jira.core.model.filter.VersionFilter; |
| 61 |
import org.tigris.jira.core.service.JiraServer; |
75 |
import org.tigris.jira.core.service.JiraServer; |
| 62 |
|
76 |
|
|
Lines 82-102
Link Here
|
| 82 |
|
96 |
|
| 83 |
final Placeholder NO_COMPONENT = new Placeholder("No Component"); |
97 |
final Placeholder NO_COMPONENT = new Placeholder("No Component"); |
| 84 |
|
98 |
|
|
|
99 |
// attributes |
| 100 |
|
| 101 |
final Placeholder ANY_ISSUE_TYPE = new Placeholder("Any"); |
| 102 |
|
| 103 |
final Placeholder ANY_RESOLUTION = new Placeholder("Any"); |
| 104 |
|
| 105 |
final Placeholder UNRESOLVED = new Placeholder("Unresolved"); |
| 106 |
|
| 107 |
final Placeholder UNASSIGNED = new Placeholder("Unassigned"); |
| 108 |
|
| 109 |
final Placeholder ANY_REPORTER = new Placeholder("Any"); |
| 110 |
|
| 111 |
final Placeholder NO_REPORTER = new Placeholder("No Reporter"); |
| 112 |
|
| 113 |
final Placeholder CURRENT_USER_REPORTER = new Placeholder("Current User"); |
| 114 |
|
| 115 |
final Placeholder SPECIFIC_USER_REPORTER = new Placeholder("Specified User"); |
| 116 |
|
| 117 |
final Placeholder SPECIFIC_GROUP_REPORTER = new Placeholder("Specified Group"); |
| 118 |
|
| 119 |
final Placeholder ANY_ASSIGNEE = new Placeholder("Any"); |
| 120 |
|
| 121 |
final Placeholder CURRENT_USER_ASSIGNEE = new Placeholder("Current User"); |
| 122 |
|
| 123 |
final Placeholder SPECIFIC_USER_ASSIGNEE = new Placeholder("Specified User"); |
| 124 |
|
| 125 |
final Placeholder SPECIFIC_GROUP_ASSIGNEE = new Placeholder("Specified Group"); |
| 126 |
|
| 127 |
final Placeholder ANY_STATUS = new Placeholder("Any"); |
| 128 |
|
| 129 |
final Placeholder ANY_PRIORITY = new Placeholder("Any"); |
| 130 |
|
| 131 |
|
| 85 |
private final JiraServer server; |
132 |
private final JiraServer server; |
| 86 |
|
133 |
|
|
|
134 |
private Text name; |
| 135 |
|
| 87 |
private ListViewer project; |
136 |
private ListViewer project; |
| 88 |
|
137 |
|
| 89 |
private ListViewer reportedIn; |
138 |
private ListViewer reportedIn; |
| 90 |
|
139 |
|
| 91 |
private ListViewer components; |
140 |
private ListViewer listViewer; |
| 92 |
|
141 |
|
| 93 |
private ListViewer fixFor; |
142 |
private ListViewer fixFor; |
|
|
143 |
|
| 144 |
private ListViewer issueType; |
| 145 |
|
| 146 |
private ListViewer status; |
| 147 |
|
| 148 |
private ListViewer resolution; |
| 149 |
|
| 150 |
private ListViewer priority; |
| 151 |
|
| 152 |
private ComboViewer assigneeType; |
| 94 |
|
153 |
|
| 95 |
private final FilterDefinition workingCopy; |
154 |
private Text assignee; |
| 96 |
|
155 |
|
| 97 |
private Text name; |
156 |
private ComboViewer reporterType; |
| 98 |
|
157 |
|
| 99 |
private Text description; |
158 |
private Text reporter; |
| 100 |
|
159 |
|
| 101 |
private Text queryString; |
160 |
private Text queryString; |
| 102 |
|
161 |
|
|
Lines 110-119
Link Here
|
| 110 |
|
169 |
|
| 111 |
private final boolean isNew; |
170 |
private final boolean isNew; |
| 112 |
|
171 |
|
| 113 |
private IssueAttributesPage issueAttributesPage; |
|
|
| 114 |
|
| 115 |
private final TaskRepository repository; |
172 |
private final TaskRepository repository; |
| 116 |
|
173 |
|
|
|
174 |
private final FilterDefinition workingCopy; |
| 175 |
|
| 176 |
|
| 177 |
|
| 117 |
/** |
178 |
/** |
| 118 |
* @param pageName |
179 |
* @param pageName |
| 119 |
* @param title |
180 |
* @param title |
|
Lines 132-138
Link Here
|
| 132 |
|
193 |
|
| 133 |
public void createControl(Composite parent) { |
194 |
public void createControl(Composite parent) { |
| 134 |
Composite c = new Composite(parent, SWT.NONE); |
195 |
Composite c = new Composite(parent, SWT.NONE); |
| 135 |
c.setLayout(new GridLayout(5, false)); |
196 |
c.setLayout(new GridLayout(3, false)); |
| 136 |
|
197 |
|
| 137 |
Label lblName = new Label(c, SWT.NONE); |
198 |
Label lblName = new Label(c, SWT.NONE); |
| 138 |
final GridData gridData = new GridData(); |
199 |
final GridData gridData = new GridData(); |
|
Lines 140-146
Link Here
|
| 140 |
lblName.setText("Name:"); |
201 |
lblName.setText("Name:"); |
| 141 |
|
202 |
|
| 142 |
name = new Text(c, SWT.BORDER); |
203 |
name = new Text(c, SWT.BORDER); |
| 143 |
name.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 4, 1)); |
204 |
name.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 2, 1)); |
| 144 |
name.addModifyListener(new ModifyListener() { |
205 |
name.addModifyListener(new ModifyListener() { |
| 145 |
|
206 |
|
| 146 |
public void modifyText(ModifyEvent e) { |
207 |
public void modifyText(ModifyEvent e) { |
|
Lines 149-183
Link Here
|
| 149 |
|
210 |
|
| 150 |
}); |
211 |
}); |
| 151 |
|
212 |
|
| 152 |
if (!isNew) { |
213 |
SashForm sashForm = new SashForm(c, SWT.VERTICAL); |
| 153 |
name.setEnabled(false); |
214 |
sashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true, 3, 1)); |
| 154 |
} |
|
|
| 155 |
|
| 156 |
Label lblDescription = new Label(c, SWT.NONE); |
| 157 |
lblDescription.setText("Description:"); |
| 158 |
lblDescription.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false)); |
| 159 |
|
| 160 |
description = new Text(c, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL); |
| 161 |
GridData gd = new GridData(SWT.FILL, SWT.FILL, false, false, 4, 1); |
| 162 |
gd.heightHint = 40; |
| 163 |
description.setLayoutData(gd); |
| 164 |
description.addFocusListener(new FocusAdapter() { |
| 165 |
|
| 166 |
public void focusLost(FocusEvent e) { |
| 167 |
validatePage(); |
| 168 |
} |
| 169 |
|
| 170 |
}); |
| 171 |
|
215 |
|
| 172 |
{ |
216 |
{ |
| 173 |
SashForm cc = new SashForm(c, SWT.HORIZONTAL); |
217 |
SashForm cc = new SashForm(sashForm, SWT.HORIZONTAL); |
| 174 |
cc.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true, 5, 1)); |
|
|
| 175 |
|
218 |
|
| 176 |
{ |
219 |
{ |
| 177 |
Composite comp = new Composite(cc, SWT.NONE); |
220 |
Composite comp = new Composite(cc, SWT.NONE); |
| 178 |
GridLayout gridLayout = new GridLayout(1, false); |
221 |
GridLayout gridLayout = new GridLayout(1, false); |
| 179 |
gridLayout.marginWidth = 0; |
222 |
gridLayout.marginWidth = 0; |
| 180 |
gridLayout.marginHeight = 0; |
|
|
| 181 |
comp.setLayout(gridLayout); |
223 |
comp.setLayout(gridLayout); |
| 182 |
|
224 |
|
| 183 |
Label label = new Label(comp, SWT.NONE); |
225 |
Label label = new Label(comp, SWT.NONE); |
|
Lines 189-195
Link Here
|
| 189 |
Composite comp = new Composite(cc, SWT.NONE); |
231 |
Composite comp = new Composite(cc, SWT.NONE); |
| 190 |
GridLayout gridLayout = new GridLayout(1, false); |
232 |
GridLayout gridLayout = new GridLayout(1, false); |
| 191 |
gridLayout.marginWidth = 0; |
233 |
gridLayout.marginWidth = 0; |
| 192 |
gridLayout.marginHeight = 0; |
|
|
| 193 |
comp.setLayout(gridLayout); |
234 |
comp.setLayout(gridLayout); |
| 194 |
|
235 |
|
| 195 |
new Label(comp, SWT.NONE).setText("Fix For:"); |
236 |
new Label(comp, SWT.NONE).setText("Fix For:"); |
|
Lines 200-206
Link Here
|
| 200 |
Composite comp = new Composite(cc, SWT.NONE); |
241 |
Composite comp = new Composite(cc, SWT.NONE); |
| 201 |
GridLayout gridLayout = new GridLayout(1, false); |
242 |
GridLayout gridLayout = new GridLayout(1, false); |
| 202 |
gridLayout.marginWidth = 0; |
243 |
gridLayout.marginWidth = 0; |
| 203 |
gridLayout.marginHeight = 0; |
|
|
| 204 |
comp.setLayout(gridLayout); |
244 |
comp.setLayout(gridLayout); |
| 205 |
|
245 |
|
| 206 |
new Label(comp, SWT.NONE).setText("In Components:"); |
246 |
new Label(comp, SWT.NONE).setText("In Components:"); |
|
Lines 211-231
Link Here
|
| 211 |
Composite comp = new Composite(cc, SWT.NONE); |
251 |
Composite comp = new Composite(cc, SWT.NONE); |
| 212 |
GridLayout gridLayout = new GridLayout(1, false); |
252 |
GridLayout gridLayout = new GridLayout(1, false); |
| 213 |
gridLayout.marginWidth = 0; |
253 |
gridLayout.marginWidth = 0; |
| 214 |
gridLayout.marginHeight = 0; |
|
|
| 215 |
comp.setLayout(gridLayout); |
254 |
comp.setLayout(gridLayout); |
| 216 |
|
255 |
|
| 217 |
Label label = new Label(comp, SWT.NONE); |
256 |
Label label = new Label(comp, SWT.NONE); |
| 218 |
label.setText("Reported In:"); |
257 |
label.setText("Reported In:"); |
| 219 |
createReportedInViewer(comp); |
258 |
createReportedInViewer(comp); |
| 220 |
} |
259 |
} |
| 221 |
// cc.setWeights(new int[] {1,1,1,1}); |
260 |
cc.setWeights(new int[] {1,1,1,1}); |
| 222 |
} |
261 |
} |
| 223 |
|
262 |
|
|
|
263 |
{ |
| 264 |
SashForm cc = new SashForm(sashForm, SWT.NONE); |
| 265 |
|
| 266 |
ISelectionChangedListener selectionChangeListener = new ISelectionChangedListener() { |
| 267 |
public void selectionChanged(SelectionChangedEvent event) { |
| 268 |
validatePage(); |
| 269 |
} |
| 270 |
}; |
| 271 |
|
| 272 |
{ |
| 273 |
Composite comp = new Composite(cc, SWT.NONE); |
| 274 |
GridLayout gridLayout = new GridLayout(); |
| 275 |
gridLayout.marginWidth = 0; |
| 276 |
comp.setLayout(gridLayout); |
| 277 |
|
| 278 |
Label typeLabel = new Label(comp, SWT.NONE); |
| 279 |
typeLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false)); |
| 280 |
typeLabel.setText("Type:"); |
| 281 |
|
| 282 |
issueType = new ListViewer(comp, SWT.BORDER); |
| 283 |
issueType.getList().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); |
| 284 |
|
| 285 |
issueType.setContentProvider(new IStructuredContentProvider() { |
| 286 |
|
| 287 |
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { |
| 288 |
} |
| 289 |
|
| 290 |
public void dispose() { |
| 291 |
} |
| 292 |
|
| 293 |
public Object[] getElements(Object inputElement) { |
| 294 |
JiraServer server = (JiraServer) inputElement; |
| 295 |
Object[] elements = new Object[server.getIssueTypes().length + 1]; |
| 296 |
elements[0] = ANY_ISSUE_TYPE; |
| 297 |
System.arraycopy(server.getIssueTypes(), 0, elements, 1, server.getIssueTypes().length); |
| 298 |
|
| 299 |
return elements; |
| 300 |
} |
| 301 |
}); |
| 302 |
|
| 303 |
issueType.setLabelProvider(new LabelProvider() { |
| 304 |
|
| 305 |
public String getText(Object element) { |
| 306 |
if (element instanceof Placeholder) { |
| 307 |
return ((Placeholder) element).getText(); |
| 308 |
} |
| 309 |
|
| 310 |
return ((IssueType) element).getName(); |
| 311 |
} |
| 312 |
|
| 313 |
}); |
| 314 |
|
| 315 |
issueType.addSelectionChangedListener(selectionChangeListener); |
| 316 |
|
| 317 |
issueType.setInput(server); |
| 318 |
} |
| 319 |
|
| 320 |
{ |
| 321 |
Composite comp = new Composite(cc, SWT.NONE); |
| 322 |
GridLayout gridLayout = new GridLayout(); |
| 323 |
gridLayout.marginWidth = 0; |
| 324 |
comp.setLayout(gridLayout); |
| 325 |
|
| 326 |
Label statusLabel = new Label(comp, SWT.NONE); |
| 327 |
statusLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false)); |
| 328 |
statusLabel.setText("Status:"); |
| 329 |
|
| 330 |
status = new ListViewer(comp, SWT.BORDER); |
| 331 |
status.getList().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); |
| 332 |
|
| 333 |
status.setContentProvider(new IStructuredContentProvider() { |
| 334 |
|
| 335 |
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { |
| 336 |
} |
| 337 |
|
| 338 |
public void dispose() { |
| 339 |
} |
| 340 |
|
| 341 |
public Object[] getElements(Object inputElement) { |
| 342 |
JiraServer server = (JiraServer) inputElement; |
| 343 |
Object[] elements = new Object[server.getStatuses().length + 1]; |
| 344 |
elements[0] = ANY_STATUS; |
| 345 |
System.arraycopy(server.getStatuses(), 0, elements, 1, server.getStatuses().length); |
| 346 |
|
| 347 |
return elements; |
| 348 |
} |
| 349 |
}); |
| 350 |
|
| 351 |
status.setLabelProvider(new LabelProvider() { |
| 352 |
|
| 353 |
public String getText(Object element) { |
| 354 |
if (element instanceof Placeholder) { |
| 355 |
return ((Placeholder) element).getText(); |
| 356 |
} |
| 357 |
|
| 358 |
return ((Status) element).getName(); |
| 359 |
} |
| 360 |
|
| 361 |
}); |
| 362 |
|
| 363 |
status.addSelectionChangedListener(selectionChangeListener); |
| 364 |
status.setInput(server); |
| 365 |
} |
| 366 |
|
| 367 |
{ |
| 368 |
Composite comp = new Composite(cc, SWT.NONE); |
| 369 |
GridLayout gridLayout = new GridLayout(); |
| 370 |
gridLayout.marginWidth = 0; |
| 371 |
comp.setLayout(gridLayout); |
| 372 |
|
| 373 |
Label resolutionLabel = new Label(comp, SWT.NONE); |
| 374 |
resolutionLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false)); |
| 375 |
resolutionLabel.setText("Resolution:"); |
| 376 |
|
| 377 |
resolution = new ListViewer(comp, SWT.BORDER); |
| 378 |
resolution.getList().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); |
| 379 |
|
| 380 |
resolution.setContentProvider(new IStructuredContentProvider() { |
| 381 |
|
| 382 |
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { |
| 383 |
} |
| 384 |
|
| 385 |
public void dispose() { |
| 386 |
} |
| 387 |
|
| 388 |
public Object[] getElements(Object inputElement) { |
| 389 |
JiraServer server = (JiraServer) inputElement; |
| 390 |
Object[] elements = new Object[server.getResolutions().length + 2]; |
| 391 |
elements[0] = ANY_RESOLUTION; |
| 392 |
elements[1] = UNRESOLVED; |
| 393 |
System.arraycopy(server.getResolutions(), 0, elements, 2, server.getResolutions().length); |
| 394 |
|
| 395 |
return elements; |
| 396 |
} |
| 397 |
}); |
| 398 |
|
| 399 |
resolution.setLabelProvider(new LabelProvider() { |
| 400 |
|
| 401 |
public String getText(Object element) { |
| 402 |
if (element instanceof Placeholder) { |
| 403 |
return ((Placeholder) element).getText(); |
| 404 |
} |
| 405 |
|
| 406 |
return ((Resolution) element).getName(); |
| 407 |
} |
| 408 |
|
| 409 |
}); |
| 410 |
|
| 411 |
resolution.addSelectionChangedListener(selectionChangeListener); |
| 412 |
resolution.setInput(server); |
| 413 |
} |
| 414 |
|
| 415 |
{ |
| 416 |
Composite comp = new Composite(cc, SWT.NONE); |
| 417 |
GridLayout gridLayout = new GridLayout(); |
| 418 |
gridLayout.marginWidth = 0; |
| 419 |
comp.setLayout(gridLayout); |
| 420 |
|
| 421 |
Label priorityLabel = new Label(comp, SWT.NONE); |
| 422 |
priorityLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false)); |
| 423 |
priorityLabel.setText("Priority:"); |
| 424 |
|
| 425 |
priority = new ListViewer(comp, SWT.BORDER); |
| 426 |
priority.getList().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); |
| 427 |
|
| 428 |
priority.setContentProvider(new IStructuredContentProvider() { |
| 429 |
|
| 430 |
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { |
| 431 |
} |
| 432 |
|
| 433 |
public void dispose() { |
| 434 |
} |
| 435 |
|
| 436 |
public Object[] getElements(Object inputElement) { |
| 437 |
JiraServer server = (JiraServer) inputElement; |
| 438 |
Object[] elements = new Object[server.getPriorities().length + 1]; |
| 439 |
elements[0] = ANY_PRIORITY; |
| 440 |
System.arraycopy(server.getPriorities(), 0, elements, 1, server.getPriorities().length); |
| 441 |
|
| 442 |
return elements; |
| 443 |
} |
| 444 |
}); |
| 445 |
|
| 446 |
priority.setLabelProvider(new LabelProvider() { |
| 447 |
|
| 448 |
public String getText(Object element) { |
| 449 |
if (element instanceof Placeholder) { |
| 450 |
return ((Placeholder) element).getText(); |
| 451 |
} |
| 452 |
|
| 453 |
return ((Priority) element).getName(); |
| 454 |
} |
| 455 |
|
| 456 |
}); |
| 457 |
priority.addSelectionChangedListener(selectionChangeListener); |
| 458 |
priority.setInput(server); |
| 459 |
} |
| 460 |
|
| 461 |
cc.setWeights(new int[] {1, 1, 1, 1 }); |
| 462 |
} |
| 463 |
sashForm.setWeights(new int[] {1, 1 }); |
| 464 |
|
| 224 |
Label lblQuery = new Label(c, SWT.NONE); |
465 |
Label lblQuery = new Label(c, SWT.NONE); |
| 225 |
lblQuery.setLayoutData(new GridData()); |
466 |
lblQuery.setLayoutData(new GridData()); |
| 226 |
lblQuery.setText("Query:"); |
467 |
lblQuery.setText("Query:"); |
| 227 |
queryString = new Text(c, SWT.BORDER); |
468 |
queryString = new Text(c, SWT.BORDER); |
| 228 |
queryString.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 4, 1)); |
469 |
queryString.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 2, 1)); |
| 229 |
// TODO put content assist here and a label describing what is available |
470 |
// TODO put content assist here and a label describing what is available |
| 230 |
|
471 |
|
| 231 |
queryString.addFocusListener(new FocusAdapter() { |
472 |
queryString.addFocusListener(new FocusAdapter() { |
|
Lines 238-288
Link Here
|
| 238 |
|
479 |
|
| 239 |
Label lblFields = new Label(c, SWT.NONE); |
480 |
Label lblFields = new Label(c, SWT.NONE); |
| 240 |
lblFields.setText("Fields:"); |
481 |
lblFields.setText("Fields:"); |
| 241 |
lblFields.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false)); |
482 |
lblFields.setLayoutData(new GridData()); |
| 242 |
|
483 |
|
| 243 |
searchSummary = new Button(c, SWT.CHECK); |
484 |
{ |
| 244 |
searchSummary.setLayoutData(new GridData()); |
485 |
SelectionAdapter selectionAdapter = new SelectionAdapter() { |
| 245 |
searchSummary.setText("Summary"); |
486 |
public void widgetSelected(SelectionEvent e) { |
| 246 |
searchSummary.addSelectionListener(new SelectionAdapter() { |
487 |
validatePage(); |
|
|
488 |
} |
| 489 |
}; |
| 247 |
|
490 |
|
| 248 |
public void widgetSelected(SelectionEvent e) { |
491 |
Composite comp = new Composite(c, SWT.NONE); |
| 249 |
validatePage(); |
492 |
comp.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1)); |
| 250 |
} |
493 |
comp.setLayout(new FillLayout()); |
|
|
494 |
|
| 495 |
searchSummary = new Button(comp, SWT.CHECK); |
| 496 |
searchSummary.setText("Summary"); |
| 497 |
searchSummary.addSelectionListener(selectionAdapter); |
| 498 |
|
| 499 |
searchDescription = new Button(comp, SWT.CHECK); |
| 500 |
searchDescription.setText("Description"); |
| 501 |
searchDescription.addSelectionListener(selectionAdapter); |
| 502 |
|
| 503 |
searchComments = new Button(comp, SWT.CHECK); |
| 504 |
searchComments.setText("Comments"); |
| 505 |
searchComments.addSelectionListener(selectionAdapter); |
| 506 |
|
| 507 |
searchEnvironment = new Button(comp, SWT.CHECK); |
| 508 |
searchEnvironment.setText("Environment"); |
| 509 |
searchEnvironment.addSelectionListener(selectionAdapter); |
| 510 |
} |
| 511 |
|
| 512 |
{ |
| 513 |
Label reportedByLabel = new Label(c, SWT.NONE); |
| 514 |
reportedByLabel.setText("Reported By:"); |
| 251 |
|
515 |
|
| 252 |
}); |
516 |
reporterType = new ComboViewer(c, SWT.BORDER | SWT.READ_ONLY); |
|
|
517 |
GridData gridData_1 = new GridData(SWT.FILL, SWT.CENTER, false, false); |
| 518 |
gridData_1.widthHint = 133; |
| 519 |
reporterType.getControl().setLayoutData(gridData_1); |
| 520 |
|
| 521 |
reporterType.setContentProvider(new IStructuredContentProvider() { |
| 522 |
|
| 523 |
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { |
| 524 |
} |
| 525 |
|
| 526 |
public void dispose() { |
| 527 |
} |
| 528 |
|
| 529 |
public Object[] getElements(Object inputElement) { |
| 530 |
return new Object[] { ANY_REPORTER, NO_REPORTER, CURRENT_USER_REPORTER, SPECIFIC_USER_REPORTER, |
| 531 |
SPECIFIC_GROUP_REPORTER }; |
| 532 |
} |
| 533 |
|
| 534 |
}); |
| 535 |
|
| 536 |
reporterType.setLabelProvider(new LabelProvider() { |
| 537 |
public String getText(Object element) { |
| 538 |
return ((Placeholder) element).getText(); |
| 539 |
} |
| 540 |
}); |
| 541 |
|
| 542 |
reporterType.setInput(server); |
| 543 |
|
| 544 |
reporter = new Text(c, SWT.BORDER); |
| 545 |
reporter.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); |
| 546 |
reporter.setEnabled(false); |
| 547 |
|
| 548 |
reporter.addModifyListener(new ModifyListener() { |
| 253 |
|
549 |
|
| 254 |
searchDescription = new Button(c, SWT.CHECK); |
550 |
public void modifyText(ModifyEvent e) { |
| 255 |
searchDescription.setLayoutData(new GridData()); |
551 |
validatePage(); |
| 256 |
searchDescription.setText("Description"); |
552 |
} |
| 257 |
searchDescription.addSelectionListener(new SelectionAdapter() { |
|
|
| 258 |
|
553 |
|
| 259 |
public void widgetSelected(SelectionEvent e) { |
554 |
}); |
| 260 |
validatePage(); |
555 |
} |
| 261 |
} |
|
|
| 262 |
|
556 |
|
| 263 |
}); |
557 |
{ |
|
|
558 |
Label assignedToLabel = new Label(c, SWT.NONE); |
| 559 |
assignedToLabel.setText("Assigned To:"); |
| 560 |
|
| 561 |
assigneeType = new ComboViewer(c, SWT.BORDER | SWT.READ_ONLY); |
| 562 |
GridData gridData_2 = new GridData(SWT.FILL, SWT.CENTER, false, false); |
| 563 |
gridData_2.widthHint = 133; |
| 564 |
assigneeType.getCombo().setLayoutData(gridData_2); |
| 565 |
|
| 566 |
assigneeType.setContentProvider(new IStructuredContentProvider() { |
| 264 |
|
567 |
|
| 265 |
searchComments = new Button(c, SWT.CHECK); |
568 |
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { |
| 266 |
searchComments.setLayoutData(new GridData()); |
569 |
} |
| 267 |
searchComments.setText("Comments"); |
|
|
| 268 |
searchComments.addSelectionListener(new SelectionAdapter() { |
| 269 |
|
570 |
|
| 270 |
public void widgetSelected(SelectionEvent e) { |
571 |
public void dispose() { |
| 271 |
validatePage(); |
572 |
} |
| 272 |
} |
|
|
| 273 |
|
573 |
|
| 274 |
}); |
574 |
public Object[] getElements(Object inputElement) { |
|
|
575 |
return new Object[] { ANY_ASSIGNEE, UNASSIGNED, CURRENT_USER_ASSIGNEE, SPECIFIC_USER_ASSIGNEE, |
| 576 |
SPECIFIC_GROUP_ASSIGNEE }; |
| 577 |
} |
| 275 |
|
578 |
|
| 276 |
searchEnvironment = new Button(c, SWT.CHECK); |
579 |
}); |
| 277 |
searchEnvironment.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false)); |
|
|
| 278 |
searchEnvironment.setText("Environment"); |
| 279 |
searchEnvironment.addSelectionListener(new SelectionAdapter() { |
| 280 |
|
580 |
|
| 281 |
public void widgetSelected(SelectionEvent e) { |
581 |
assigneeType.setLabelProvider(new LabelProvider() { |
| 282 |
validatePage(); |
|
|
| 283 |
} |
| 284 |
|
582 |
|
| 285 |
}); |
583 |
public String getText(Object element) { |
|
|
584 |
return ((Placeholder) element).getText(); |
| 585 |
} |
| 586 |
|
| 587 |
}); |
| 588 |
|
| 589 |
assigneeType.addSelectionChangedListener(new ISelectionChangedListener() { |
| 590 |
|
| 591 |
public void selectionChanged(SelectionChangedEvent event) { |
| 592 |
Object selection = ((IStructuredSelection) event.getSelection()).getFirstElement(); |
| 593 |
if (SPECIFIC_USER_ASSIGNEE.equals(selection) || SPECIFIC_GROUP_ASSIGNEE.equals(selection)) { |
| 594 |
assignee.setEnabled(true); |
| 595 |
} else { |
| 596 |
assignee.setEnabled(false); |
| 597 |
assignee.setText(""); //$NON-NLS-1$ |
| 598 |
} |
| 599 |
validatePage(); |
| 600 |
} |
| 601 |
|
| 602 |
}); |
| 603 |
|
| 604 |
assigneeType.setInput(server); |
| 605 |
|
| 606 |
assignee = new Text(c, SWT.BORDER); |
| 607 |
assignee.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); |
| 608 |
assignee.setEnabled(false); |
| 609 |
assignee.addModifyListener(new ModifyListener() { |
| 610 |
|
| 611 |
public void modifyText(ModifyEvent e) { |
| 612 |
validatePage(); |
| 613 |
} |
| 614 |
|
| 615 |
}); |
| 616 |
} |
| 286 |
|
617 |
|
| 287 |
// Need to turn off validation here |
618 |
// Need to turn off validation here |
| 288 |
if (isNew) { |
619 |
if (isNew) { |
|
Lines 294-313
Link Here
|
| 294 |
setControl(c); |
625 |
setControl(c); |
| 295 |
} |
626 |
} |
| 296 |
|
627 |
|
| 297 |
public IWizardPage getNextPage() { |
|
|
| 298 |
if (issueAttributesPage == null) { |
| 299 |
issueAttributesPage = new IssueAttributesPage(repository, workingCopy, isNew); |
| 300 |
issueAttributesPage.setWizard(getWizard()); |
| 301 |
} |
| 302 |
|
| 303 |
return issueAttributesPage; |
| 304 |
} |
| 305 |
|
| 306 |
private void createReportedInViewer(Composite c) { |
628 |
private void createReportedInViewer(Composite c) { |
| 307 |
reportedIn = new ListViewer(c, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.H_SCROLL); |
629 |
reportedIn = new ListViewer(c, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.H_SCROLL); |
| 308 |
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true); |
630 |
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true); |
| 309 |
gridData.heightHint = 200; |
631 |
gridData.heightHint = 60; |
| 310 |
gridData.widthHint = 80; |
632 |
gridData.widthHint = 90; |
| 311 |
reportedIn.getControl().setLayoutData(gridData); |
633 |
reportedIn.getControl().setLayoutData(gridData); |
| 312 |
|
634 |
|
| 313 |
reportedIn.setContentProvider(new IStructuredContentProvider() { |
635 |
reportedIn.setContentProvider(new IStructuredContentProvider() { |
|
Lines 347-359
Link Here
|
| 347 |
} |
669 |
} |
| 348 |
|
670 |
|
| 349 |
private void createComponentsViewer(Composite c) { |
671 |
private void createComponentsViewer(Composite c) { |
| 350 |
components = new ListViewer(c, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.H_SCROLL); |
672 |
listViewer = new ListViewer(c, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.H_SCROLL); |
| 351 |
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true); |
673 |
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true); |
| 352 |
gridData.heightHint = 200; |
674 |
gridData.heightHint = 60; |
| 353 |
gridData.widthHint = 80; |
675 |
gridData.widthHint = 90; |
| 354 |
components.getControl().setLayoutData(gridData); |
676 |
listViewer.getControl().setLayoutData(gridData); |
| 355 |
|
677 |
|
| 356 |
components.setContentProvider(new IStructuredContentProvider() { |
678 |
listViewer.setContentProvider(new IStructuredContentProvider() { |
| 357 |
private Project project; |
679 |
private Project project; |
| 358 |
|
680 |
|
| 359 |
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { |
681 |
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { |
|
Lines 377-391
Link Here
|
| 377 |
} |
699 |
} |
| 378 |
|
700 |
|
| 379 |
}); |
701 |
}); |
| 380 |
components.setLabelProvider(new ComponentLabelProvider()); |
702 |
listViewer.setLabelProvider(new ComponentLabelProvider()); |
| 381 |
components.setInput(null); |
703 |
listViewer.setInput(null); |
| 382 |
} |
704 |
} |
| 383 |
|
705 |
|
| 384 |
private void createFixForViewer(Composite c) { |
706 |
private void createFixForViewer(Composite c) { |
| 385 |
fixFor = new ListViewer(c, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.H_SCROLL); |
707 |
fixFor = new ListViewer(c, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.H_SCROLL); |
| 386 |
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true); |
708 |
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true); |
| 387 |
gridData.heightHint = 200; |
709 |
gridData.heightHint = 60; |
| 388 |
gridData.widthHint = 80; |
710 |
gridData.widthHint = 90; |
| 389 |
fixFor.getControl().setLayoutData(gridData); |
711 |
fixFor.getControl().setLayoutData(gridData); |
| 390 |
|
712 |
|
| 391 |
fixFor.setContentProvider(new IStructuredContentProvider() { |
713 |
fixFor.setContentProvider(new IStructuredContentProvider() { |
|
Lines 427-434
Link Here
|
| 427 |
private void createProjectsViewer(Composite c) { |
749 |
private void createProjectsViewer(Composite c) { |
| 428 |
project = new ListViewer(c, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.H_SCROLL); |
750 |
project = new ListViewer(c, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.H_SCROLL); |
| 429 |
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true); |
751 |
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true); |
| 430 |
gridData.heightHint = 200; |
752 |
gridData.heightHint = 60; |
| 431 |
gridData.widthHint = 120; |
753 |
gridData.widthHint = 90; |
| 432 |
project.getControl().setLayoutData(gridData); |
754 |
project.getControl().setLayoutData(gridData); |
| 433 |
|
755 |
|
| 434 |
project.setContentProvider(new IStructuredContentProvider() { |
756 |
project.setContentProvider(new IStructuredContentProvider() { |
|
Lines 481-487
Link Here
|
| 481 |
|
803 |
|
| 482 |
void updateCurrentProject(Project project) { |
804 |
void updateCurrentProject(Project project) { |
| 483 |
this.fixFor.setInput(project); |
805 |
this.fixFor.setInput(project); |
| 484 |
this.components.setInput(project); |
806 |
this.listViewer.setInput(project); |
| 485 |
this.reportedIn.setInput(project); |
807 |
this.reportedIn.setInput(project); |
| 486 |
|
808 |
|
| 487 |
} |
809 |
} |
|
Lines 501-506
Link Here
|
| 501 |
project.setSelection(new StructuredSelection(new Placeholder("All Projects"))); |
823 |
project.setSelection(new StructuredSelection(new Placeholder("All Projects"))); |
| 502 |
searchSummary.setSelection(true); |
824 |
searchSummary.setSelection(true); |
| 503 |
searchDescription.setSelection(true); |
825 |
searchDescription.setSelection(true); |
|
|
826 |
|
| 827 |
issueType.setSelection(new StructuredSelection(ANY_ISSUE_TYPE)); |
| 828 |
reporterType.setSelection(new StructuredSelection(ANY_REPORTER)); |
| 829 |
assigneeType.setSelection(new StructuredSelection(ANY_ASSIGNEE)); |
| 830 |
status.setSelection(new StructuredSelection(ANY_STATUS)); |
| 831 |
resolution.setSelection(new StructuredSelection(ANY_RESOLUTION)); |
| 832 |
priority.setSelection(new StructuredSelection(ANY_PRIORITY)); |
| 833 |
|
| 504 |
} |
834 |
} |
| 505 |
|
835 |
|
| 506 |
private void loadFromWorkingCopy() { |
836 |
private void loadFromWorkingCopy() { |
|
Lines 509-515
Link Here
|
| 509 |
} |
839 |
} |
| 510 |
|
840 |
|
| 511 |
if (workingCopy.getDescription() != null) { |
841 |
if (workingCopy.getDescription() != null) { |
| 512 |
description.setText(workingCopy.getDescription()); |
|
|
| 513 |
} |
842 |
} |
| 514 |
|
843 |
|
| 515 |
if (workingCopy.getProjectFilter() != null) { |
844 |
if (workingCopy.getProjectFilter() != null) { |
|
Lines 563-580
Link Here
|
| 563 |
|
892 |
|
| 564 |
if (workingCopy.getComponentFilter() != null) { |
893 |
if (workingCopy.getComponentFilter() != null) { |
| 565 |
if (workingCopy.getComponentFilter().hasNoComponent()) { |
894 |
if (workingCopy.getComponentFilter().hasNoComponent()) { |
| 566 |
components.setSelection(new StructuredSelection(NO_COMPONENT)); |
895 |
listViewer.setSelection(new StructuredSelection(NO_COMPONENT)); |
| 567 |
} else { |
896 |
} else { |
| 568 |
components.setSelection(new StructuredSelection(workingCopy.getComponentFilter().getComponents())); |
897 |
listViewer.setSelection(new StructuredSelection(workingCopy.getComponentFilter().getComponents())); |
| 569 |
} |
898 |
} |
| 570 |
} else { |
899 |
} else { |
| 571 |
components.setSelection(new StructuredSelection(ANY_COMPONENT)); |
900 |
listViewer.setSelection(new StructuredSelection(ANY_COMPONENT)); |
| 572 |
} |
901 |
} |
|
|
902 |
|
| 903 |
// attributes |
| 904 |
|
| 905 |
if (workingCopy.getIssueTypeFilter() != null) { |
| 906 |
issueType.setSelection(new StructuredSelection(workingCopy.getIssueTypeFilter().getIsueTypes())); |
| 907 |
} else { |
| 908 |
issueType.setSelection(new StructuredSelection(ANY_ISSUE_TYPE)); |
| 909 |
} |
| 910 |
|
| 911 |
if (workingCopy.getReportedByFilter() != null) { |
| 912 |
UserFilter reportedByFilter = workingCopy.getReportedByFilter(); |
| 913 |
if (reportedByFilter instanceof NobodyFilter) { |
| 914 |
reporterType.setSelection(new StructuredSelection(NO_REPORTER)); |
| 915 |
} else if (reportedByFilter instanceof CurrentUserFilter) { |
| 916 |
reporterType.setSelection(new StructuredSelection(CURRENT_USER_REPORTER)); |
| 917 |
} else if (reportedByFilter instanceof SpecificUserFilter) { |
| 918 |
reporterType.setSelection(new StructuredSelection(SPECIFIC_USER_REPORTER)); |
| 919 |
reporter.setText(((SpecificUserFilter) reportedByFilter).getUser()); |
| 920 |
} else if (reportedByFilter instanceof UserInGroupFilter) { |
| 921 |
reporterType.setSelection(new StructuredSelection(SPECIFIC_GROUP_REPORTER)); |
| 922 |
reporter.setText(((UserInGroupFilter) reportedByFilter).getGroup()); |
| 923 |
} |
| 924 |
} else { |
| 925 |
reporterType.setSelection(new StructuredSelection(ANY_REPORTER)); |
| 926 |
} |
| 927 |
|
| 928 |
if (workingCopy.getAssignedToFilter() != null) { |
| 929 |
UserFilter assignedToFilter = workingCopy.getAssignedToFilter(); |
| 930 |
if (assignedToFilter instanceof NobodyFilter) { |
| 931 |
assigneeType.setSelection(new StructuredSelection(UNASSIGNED)); |
| 932 |
} else if (assignedToFilter instanceof CurrentUserFilter) { |
| 933 |
assigneeType.setSelection(new StructuredSelection(CURRENT_USER_ASSIGNEE)); |
| 934 |
} else if (assignedToFilter instanceof SpecificUserFilter) { |
| 935 |
assigneeType.setSelection(new StructuredSelection(SPECIFIC_USER_ASSIGNEE)); |
| 936 |
assignee.setText(((SpecificUserFilter) assignedToFilter).getUser()); |
| 937 |
} else if (assignedToFilter instanceof UserInGroupFilter) { |
| 938 |
assigneeType.setSelection(new StructuredSelection(SPECIFIC_GROUP_ASSIGNEE)); |
| 939 |
assignee.setText(((UserInGroupFilter) assignedToFilter).getGroup()); |
| 940 |
} |
| 941 |
} else { |
| 942 |
assigneeType.setSelection(new StructuredSelection(ANY_ASSIGNEE)); |
| 943 |
} |
| 944 |
|
| 945 |
if (workingCopy.getStatusFilter() != null) { |
| 946 |
status.setSelection(new StructuredSelection(workingCopy.getStatusFilter().getStatuses())); |
| 947 |
} else { |
| 948 |
status.setSelection(new StructuredSelection(ANY_STATUS)); |
| 949 |
} |
| 950 |
|
| 951 |
if (workingCopy.getResolutionFilter() != null) { |
| 952 |
Resolution[] resolutions = workingCopy.getResolutionFilter().getResolutions(); |
| 953 |
if(resolutions.length==0) { |
| 954 |
resolution.setSelection(new StructuredSelection(UNRESOLVED)); |
| 955 |
} else { |
| 956 |
resolution.setSelection(new StructuredSelection(resolutions)); |
| 957 |
} |
| 958 |
} else { |
| 959 |
resolution.setSelection(new StructuredSelection(ANY_RESOLUTION)); |
| 960 |
} |
| 961 |
|
| 962 |
if (workingCopy.getPriorityFilter() != null) { |
| 963 |
priority.setSelection(new StructuredSelection(workingCopy.getPriorityFilter().getPriorities())); |
| 964 |
} else { |
| 965 |
priority.setSelection(new StructuredSelection(ANY_PRIORITY)); |
| 966 |
} |
| 967 |
|
| 573 |
} |
968 |
} |
| 574 |
|
969 |
|
| 575 |
/* default */void applyChanges() { |
970 |
/* default */void applyChanges() { |
| 576 |
workingCopy.setName(this.name.getText()); |
971 |
workingCopy.setName(this.name.getText()); |
| 577 |
workingCopy.setDescription(this.description.getText()); |
|
|
| 578 |
if (this.queryString.getText().length() > 0 || this.searchSummary.getSelection() |
972 |
if (this.queryString.getText().length() > 0 || this.searchSummary.getSelection() |
| 579 |
|| this.searchDescription.getSelection() || this.searchEnvironment.getSelection() |
973 |
|| this.searchDescription.getSelection() || this.searchEnvironment.getSelection() |
| 580 |
|| this.searchComments.getSelection()) { |
974 |
|| this.searchComments.getSelection()) { |
|
Lines 674-680
Link Here
|
| 674 |
} |
1068 |
} |
| 675 |
} |
1069 |
} |
| 676 |
|
1070 |
|
| 677 |
IStructuredSelection componentsSelection = (IStructuredSelection) components.getSelection(); |
1071 |
IStructuredSelection componentsSelection = (IStructuredSelection) listViewer.getSelection(); |
| 678 |
if (componentsSelection.isEmpty()) { |
1072 |
if (componentsSelection.isEmpty()) { |
| 679 |
workingCopy.setComponentFilter(null); |
1073 |
workingCopy.setComponentFilter(null); |
| 680 |
} else { |
1074 |
} else { |
|
Lines 705-710
Link Here
|
| 705 |
workingCopy.setComponentFilter(null); |
1099 |
workingCopy.setComponentFilter(null); |
| 706 |
} |
1100 |
} |
| 707 |
} |
1101 |
} |
|
|
1102 |
|
| 1103 |
// attributes |
| 1104 |
|
| 1105 |
// TODO support standard and subtask issue types |
| 1106 |
IStructuredSelection issueTypeSelection = (IStructuredSelection) issueType.getSelection(); |
| 1107 |
if (issueTypeSelection.isEmpty()) { |
| 1108 |
workingCopy.setIssueTypeFilter(null); |
| 1109 |
} else { |
| 1110 |
boolean isAnyIssueTypeSelected = false; |
| 1111 |
|
| 1112 |
List<IssueType> selectedIssueTypes = new ArrayList<IssueType>(); |
| 1113 |
|
| 1114 |
for (Iterator i = issueTypeSelection.iterator(); i.hasNext();) { |
| 1115 |
Object selection = i.next(); |
| 1116 |
if (ANY_ISSUE_TYPE.equals(selection)) { |
| 1117 |
isAnyIssueTypeSelected = true; |
| 1118 |
} else if (selection instanceof IssueType) { |
| 1119 |
selectedIssueTypes.add((IssueType) selection); |
| 1120 |
} |
| 1121 |
} |
| 1122 |
|
| 1123 |
if (isAnyIssueTypeSelected) { |
| 1124 |
workingCopy.setIssueTypeFilter(null); |
| 1125 |
} else { |
| 1126 |
workingCopy.setIssueTypeFilter( |
| 1127 |
new IssueTypeFilter(selectedIssueTypes.toArray(new IssueType[selectedIssueTypes.size()]))); |
| 1128 |
} |
| 1129 |
} |
| 1130 |
|
| 1131 |
IStructuredSelection reporterSelection = (IStructuredSelection) reporterType.getSelection(); |
| 1132 |
if (reporterSelection.isEmpty()) { |
| 1133 |
workingCopy.setReportedByFilter(null); |
| 1134 |
} else { |
| 1135 |
if (ANY_REPORTER.equals(reporterSelection.getFirstElement())) { |
| 1136 |
workingCopy.setReportedByFilter(null); |
| 1137 |
} else if (NO_REPORTER.equals(reporterSelection.getFirstElement())) { |
| 1138 |
workingCopy.setReportedByFilter(new NobodyFilter()); |
| 1139 |
} else if (CURRENT_USER_REPORTER.equals(reporterSelection.getFirstElement())) { |
| 1140 |
workingCopy.setReportedByFilter(new CurrentUserFilter()); |
| 1141 |
} else if (SPECIFIC_GROUP_REPORTER.equals(reporterSelection.getFirstElement())) { |
| 1142 |
workingCopy.setReportedByFilter(new UserInGroupFilter(reporter.getText())); |
| 1143 |
} else if (SPECIFIC_USER_REPORTER.equals(reporterSelection.getFirstElement())) { |
| 1144 |
workingCopy.setReportedByFilter(new SpecificUserFilter(reporter.getText())); |
| 1145 |
} else { |
| 1146 |
workingCopy.setReportedByFilter(null); |
| 1147 |
} |
| 1148 |
} |
| 1149 |
|
| 1150 |
IStructuredSelection assigneeSelection = (IStructuredSelection) assigneeType.getSelection(); |
| 1151 |
if (assigneeSelection.isEmpty()) { |
| 1152 |
workingCopy.setAssignedToFilter(null); |
| 1153 |
} else { |
| 1154 |
if (ANY_REPORTER.equals(assigneeSelection.getFirstElement())) { |
| 1155 |
workingCopy.setAssignedToFilter(null); |
| 1156 |
} else if (UNASSIGNED.equals(assigneeSelection.getFirstElement())) { |
| 1157 |
workingCopy.setAssignedToFilter(new NobodyFilter()); |
| 1158 |
} else if (CURRENT_USER_REPORTER.equals(assigneeSelection.getFirstElement())) { |
| 1159 |
workingCopy.setAssignedToFilter(new CurrentUserFilter()); |
| 1160 |
} else if (SPECIFIC_GROUP_REPORTER.equals(assigneeSelection.getFirstElement())) { |
| 1161 |
workingCopy.setAssignedToFilter(new UserInGroupFilter(assignee.getText())); |
| 1162 |
} else if (SPECIFIC_USER_REPORTER.equals(assigneeSelection.getFirstElement())) { |
| 1163 |
workingCopy.setAssignedToFilter(new SpecificUserFilter(assignee.getText())); |
| 1164 |
} else { |
| 1165 |
workingCopy.setAssignedToFilter(null); |
| 1166 |
} |
| 1167 |
} |
| 1168 |
|
| 1169 |
IStructuredSelection statusSelection = (IStructuredSelection) status.getSelection(); |
| 1170 |
if (statusSelection.isEmpty()) { |
| 1171 |
workingCopy.setStatusFilter(null); |
| 1172 |
} else { |
| 1173 |
boolean isAnyStatusSelected = false; |
| 1174 |
|
| 1175 |
List<Status> selectedStatuses = new ArrayList<Status>(); |
| 1176 |
|
| 1177 |
for (Iterator i = statusSelection.iterator(); i.hasNext();) { |
| 1178 |
Object selection = i.next(); |
| 1179 |
if (ANY_STATUS.equals(selection)) { |
| 1180 |
isAnyStatusSelected = true; |
| 1181 |
} else if (selection instanceof Status) { |
| 1182 |
selectedStatuses.add((Status) selection); |
| 1183 |
} |
| 1184 |
} |
| 1185 |
|
| 1186 |
if (isAnyStatusSelected) { |
| 1187 |
workingCopy.setStatusFilter(null); |
| 1188 |
} else { |
| 1189 |
workingCopy.setStatusFilter( |
| 1190 |
new StatusFilter(selectedStatuses.toArray(new Status[selectedStatuses.size()]))); |
| 1191 |
} |
| 1192 |
} |
| 1193 |
|
| 1194 |
IStructuredSelection resolutionSelection = (IStructuredSelection) resolution.getSelection(); |
| 1195 |
if (resolutionSelection.isEmpty()) { |
| 1196 |
workingCopy.setResolutionFilter(null); |
| 1197 |
} else { |
| 1198 |
boolean isAnyResolutionSelected = false; |
| 1199 |
|
| 1200 |
List<Resolution> selectedResolutions = new ArrayList<Resolution>(); |
| 1201 |
|
| 1202 |
for (Iterator i = resolutionSelection.iterator(); i.hasNext();) { |
| 1203 |
Object selection = i.next(); |
| 1204 |
if (ANY_RESOLUTION.equals(selection)) { |
| 1205 |
isAnyResolutionSelected = true; |
| 1206 |
} else if (selection instanceof Resolution) { |
| 1207 |
selectedResolutions.add((Resolution) selection); |
| 1208 |
} |
| 1209 |
} |
| 1210 |
|
| 1211 |
if (isAnyResolutionSelected) { |
| 1212 |
workingCopy.setResolutionFilter(null); |
| 1213 |
} else { |
| 1214 |
workingCopy.setResolutionFilter( |
| 1215 |
new ResolutionFilter(selectedResolutions.toArray(new Resolution[selectedResolutions.size()]))); |
| 1216 |
} |
| 1217 |
} |
| 1218 |
|
| 1219 |
IStructuredSelection prioritySelection = (IStructuredSelection) priority.getSelection(); |
| 1220 |
if (prioritySelection.isEmpty()) { |
| 1221 |
workingCopy.setPriorityFilter(null); |
| 1222 |
} else { |
| 1223 |
boolean isAnyPrioritiesSelected = false; |
| 1224 |
|
| 1225 |
List<Priority> selectedPriorities = new ArrayList<Priority>(); |
| 1226 |
|
| 1227 |
for (Iterator i = prioritySelection.iterator(); i.hasNext();) { |
| 1228 |
Object selection = i.next(); |
| 1229 |
if (ANY_PRIORITY.equals(selection)) { |
| 1230 |
isAnyPrioritiesSelected = true; |
| 1231 |
} else if (selection instanceof Priority) { |
| 1232 |
selectedPriorities.add((Priority) selection); |
| 1233 |
} |
| 1234 |
} |
| 1235 |
|
| 1236 |
if (isAnyPrioritiesSelected) { |
| 1237 |
workingCopy.setPriorityFilter(null); |
| 1238 |
} else { |
| 1239 |
workingCopy.setPriorityFilter( |
| 1240 |
new PriorityFilter(selectedPriorities.toArray(new Priority[selectedPriorities.size()]))); |
| 1241 |
} |
| 1242 |
} |
| 708 |
} |
1243 |
} |
| 709 |
|
1244 |
|
| 710 |
final class ComponentLabelProvider implements ILabelProvider { |
1245 |
final class ComponentLabelProvider implements ILabelProvider { |
|
Lines 876-882
Link Here
|
| 876 |
|
1411 |
|
| 877 |
public AbstractRepositoryQuery getQuery() { |
1412 |
public AbstractRepositoryQuery getQuery() { |
| 878 |
this.applyChanges(); |
1413 |
this.applyChanges(); |
| 879 |
issueAttributesPage.applyChanges(); |
|
|
| 880 |
if (isNew) { |
1414 |
if (isNew) { |
| 881 |
server.addLocalFilter(workingCopy); |
1415 |
server.addLocalFilter(workingCopy); |
| 882 |
} |
1416 |
} |