|
Lines 12-20
Link Here
|
| 12 |
package org.eclipse.mylar.internal.jira.ui.wizards; |
12 |
package org.eclipse.mylar.internal.jira.ui.wizards; |
| 13 |
|
13 |
|
| 14 |
import java.util.ArrayList; |
14 |
import java.util.ArrayList; |
|
|
15 |
import java.util.Calendar; |
| 15 |
import java.util.Iterator; |
16 |
import java.util.Iterator; |
| 16 |
import java.util.List; |
17 |
import java.util.List; |
| 17 |
|
18 |
|
|
|
19 |
import org.eclipse.jface.viewers.ComboViewer; |
| 18 |
import org.eclipse.jface.viewers.IColorProvider; |
20 |
import org.eclipse.jface.viewers.IColorProvider; |
| 19 |
import org.eclipse.jface.viewers.ILabelProvider; |
21 |
import org.eclipse.jface.viewers.ILabelProvider; |
| 20 |
import org.eclipse.jface.viewers.ILabelProviderListener; |
22 |
import org.eclipse.jface.viewers.ILabelProviderListener; |
|
Lines 26-35
Link Here
|
| 26 |
import org.eclipse.jface.viewers.SelectionChangedEvent; |
28 |
import org.eclipse.jface.viewers.SelectionChangedEvent; |
| 27 |
import org.eclipse.jface.viewers.StructuredSelection; |
29 |
import org.eclipse.jface.viewers.StructuredSelection; |
| 28 |
import org.eclipse.jface.viewers.Viewer; |
30 |
import org.eclipse.jface.viewers.Viewer; |
| 29 |
import org.eclipse.jface.wizard.IWizardPage; |
|
|
| 30 |
import org.eclipse.jface.wizard.WizardPage; |
31 |
import org.eclipse.jface.wizard.WizardPage; |
| 31 |
import org.eclipse.mylar.internal.jira.JiraCustomQuery; |
32 |
import org.eclipse.mylar.internal.jira.JiraCustomQuery; |
| 32 |
import org.eclipse.mylar.internal.jira.JiraServerFacade; |
33 |
import org.eclipse.mylar.internal.jira.JiraServerFacade; |
|
|
34 |
import org.eclipse.mylar.internal.tasks.ui.views.DatePicker; |
| 33 |
import org.eclipse.mylar.tasks.core.AbstractRepositoryQuery; |
35 |
import org.eclipse.mylar.tasks.core.AbstractRepositoryQuery; |
| 34 |
import org.eclipse.mylar.tasks.core.TaskRepository; |
36 |
import org.eclipse.mylar.tasks.core.TaskRepository; |
| 35 |
import org.eclipse.mylar.tasks.ui.TasksUiPlugin; |
37 |
import org.eclipse.mylar.tasks.ui.TasksUiPlugin; |
|
Lines 43-48
Link Here
|
| 43 |
import org.eclipse.swt.events.SelectionEvent; |
45 |
import org.eclipse.swt.events.SelectionEvent; |
| 44 |
import org.eclipse.swt.graphics.Color; |
46 |
import org.eclipse.swt.graphics.Color; |
| 45 |
import org.eclipse.swt.graphics.Image; |
47 |
import org.eclipse.swt.graphics.Image; |
|
|
48 |
import org.eclipse.swt.layout.FillLayout; |
| 46 |
import org.eclipse.swt.layout.GridData; |
49 |
import org.eclipse.swt.layout.GridData; |
| 47 |
import org.eclipse.swt.layout.GridLayout; |
50 |
import org.eclipse.swt.layout.GridLayout; |
| 48 |
import org.eclipse.swt.widgets.Button; |
51 |
import org.eclipse.swt.widgets.Button; |
|
Lines 51-62
Link Here
|
| 51 |
import org.eclipse.swt.widgets.Label; |
54 |
import org.eclipse.swt.widgets.Label; |
| 52 |
import org.eclipse.swt.widgets.Text; |
55 |
import org.eclipse.swt.widgets.Text; |
| 53 |
import org.tigris.jira.core.model.Component; |
56 |
import org.tigris.jira.core.model.Component; |
|
|
57 |
import org.tigris.jira.core.model.IssueType; |
| 58 |
import org.tigris.jira.core.model.Priority; |
| 54 |
import org.tigris.jira.core.model.Project; |
59 |
import org.tigris.jira.core.model.Project; |
|
|
60 |
import org.tigris.jira.core.model.Resolution; |
| 61 |
import org.tigris.jira.core.model.Status; |
| 55 |
import org.tigris.jira.core.model.Version; |
62 |
import org.tigris.jira.core.model.Version; |
| 56 |
import org.tigris.jira.core.model.filter.ComponentFilter; |
63 |
import org.tigris.jira.core.model.filter.ComponentFilter; |
| 57 |
import org.tigris.jira.core.model.filter.ContentFilter; |
64 |
import org.tigris.jira.core.model.filter.ContentFilter; |
|
|
65 |
import org.tigris.jira.core.model.filter.CurrentUserFilter; |
| 66 |
import org.tigris.jira.core.model.filter.DateFilter; |
| 67 |
import org.tigris.jira.core.model.filter.DateRangeFilter; |
| 58 |
import org.tigris.jira.core.model.filter.FilterDefinition; |
68 |
import org.tigris.jira.core.model.filter.FilterDefinition; |
|
|
69 |
import org.tigris.jira.core.model.filter.IssueTypeFilter; |
| 70 |
import org.tigris.jira.core.model.filter.NobodyFilter; |
| 71 |
import org.tigris.jira.core.model.filter.PriorityFilter; |
| 59 |
import org.tigris.jira.core.model.filter.ProjectFilter; |
72 |
import org.tigris.jira.core.model.filter.ProjectFilter; |
|
|
73 |
import org.tigris.jira.core.model.filter.ResolutionFilter; |
| 74 |
import org.tigris.jira.core.model.filter.SpecificUserFilter; |
| 75 |
import org.tigris.jira.core.model.filter.StatusFilter; |
| 76 |
import org.tigris.jira.core.model.filter.UserFilter; |
| 77 |
import org.tigris.jira.core.model.filter.UserInGroupFilter; |
| 60 |
import org.tigris.jira.core.model.filter.VersionFilter; |
78 |
import org.tigris.jira.core.model.filter.VersionFilter; |
| 61 |
import org.tigris.jira.core.service.JiraServer; |
79 |
import org.tigris.jira.core.service.JiraServer; |
| 62 |
|
80 |
|
|
Lines 65-71
Link Here
|
| 65 |
* @author Eugene Kuleshov (layout and other improvements) |
83 |
* @author Eugene Kuleshov (layout and other improvements) |
| 66 |
*/ |
84 |
*/ |
| 67 |
public class FilterSummaryPage extends WizardPage { |
85 |
public class FilterSummaryPage extends WizardPage { |
| 68 |
|
86 |
|
| 69 |
final Placeholder ANY_FIX_VERSION = new Placeholder("Any"); |
87 |
final Placeholder ANY_FIX_VERSION = new Placeholder("Any"); |
| 70 |
|
88 |
|
| 71 |
final Placeholder NO_FIX_VERSION = new Placeholder("No Fix Version"); |
89 |
final Placeholder NO_FIX_VERSION = new Placeholder("No Fix Version"); |
|
Lines 82-89
Link Here
|
| 82 |
|
100 |
|
| 83 |
final Placeholder NO_COMPONENT = new Placeholder("No Component"); |
101 |
final Placeholder NO_COMPONENT = new Placeholder("No Component"); |
| 84 |
|
102 |
|
|
|
103 |
// attributes |
| 104 |
|
| 105 |
final Placeholder ANY_ISSUE_TYPE = new Placeholder("Any"); |
| 106 |
|
| 107 |
final Placeholder ANY_RESOLUTION = new Placeholder("Any"); |
| 108 |
|
| 109 |
final Placeholder UNRESOLVED = new Placeholder("Unresolved"); |
| 110 |
|
| 111 |
final Placeholder UNASSIGNED = new Placeholder("Unassigned"); |
| 112 |
|
| 113 |
final Placeholder ANY_REPORTER = new Placeholder("Any"); |
| 114 |
|
| 115 |
final Placeholder NO_REPORTER = new Placeholder("No Reporter"); |
| 116 |
|
| 117 |
final Placeholder CURRENT_USER_REPORTER = new Placeholder("Current User"); |
| 118 |
|
| 119 |
final Placeholder SPECIFIC_USER_REPORTER = new Placeholder("Specified User"); |
| 120 |
|
| 121 |
final Placeholder SPECIFIC_GROUP_REPORTER = new Placeholder("Specified Group"); |
| 122 |
|
| 123 |
final Placeholder ANY_ASSIGNEE = new Placeholder("Any"); |
| 124 |
|
| 125 |
final Placeholder CURRENT_USER_ASSIGNEE = new Placeholder("Current User"); |
| 126 |
|
| 127 |
final Placeholder SPECIFIC_USER_ASSIGNEE = new Placeholder("Specified User"); |
| 128 |
|
| 129 |
final Placeholder SPECIFIC_GROUP_ASSIGNEE = new Placeholder("Specified Group"); |
| 130 |
|
| 131 |
final Placeholder ANY_STATUS = new Placeholder("Any"); |
| 132 |
|
| 133 |
final Placeholder ANY_PRIORITY = new Placeholder("Any"); |
| 134 |
|
| 135 |
|
| 85 |
private final JiraServer server; |
136 |
private final JiraServer server; |
| 86 |
|
137 |
|
|
|
138 |
private Text name; |
| 139 |
|
| 87 |
private ListViewer project; |
140 |
private ListViewer project; |
| 88 |
|
141 |
|
| 89 |
private ListViewer reportedIn; |
142 |
private ListViewer reportedIn; |
|
Lines 91-102
Link Here
|
| 91 |
private ListViewer components; |
144 |
private ListViewer components; |
| 92 |
|
145 |
|
| 93 |
private ListViewer fixFor; |
146 |
private ListViewer fixFor; |
|
|
147 |
|
| 148 |
private ListViewer issueType; |
| 149 |
|
| 150 |
private ListViewer status; |
| 151 |
|
| 152 |
private ListViewer resolution; |
| 153 |
|
| 154 |
private ListViewer priority; |
| 155 |
|
| 156 |
private ComboViewer assigneeType; |
| 94 |
|
157 |
|
| 95 |
private final FilterDefinition workingCopy; |
158 |
private Text assignee; |
| 96 |
|
159 |
|
| 97 |
private Text name; |
160 |
private ComboViewer reporterType; |
| 98 |
|
161 |
|
| 99 |
private Text description; |
162 |
private Text reporter; |
| 100 |
|
163 |
|
| 101 |
private Text queryString; |
164 |
private Text queryString; |
| 102 |
|
165 |
|
|
Lines 108-119
Link Here
|
| 108 |
|
171 |
|
| 109 |
private Button searchEnvironment; |
172 |
private Button searchEnvironment; |
| 110 |
|
173 |
|
| 111 |
private final boolean isNew; |
174 |
private DatePicker dueStartDatePicker; |
|
|
175 |
|
| 176 |
private DatePicker dueEndDatePicker; |
| 177 |
|
| 178 |
private DatePicker updatedStartDatePicker; |
| 179 |
|
| 180 |
private DatePicker updatedEndDatePicker; |
| 181 |
|
| 182 |
private DatePicker createdStartDatePicker; |
| 183 |
|
| 184 |
private DatePicker createdEndDatePicker; |
| 112 |
|
185 |
|
| 113 |
private IssueAttributesPage issueAttributesPage; |
186 |
|
|
|
187 |
private final boolean isNew; |
| 114 |
|
188 |
|
| 115 |
private final TaskRepository repository; |
189 |
private final TaskRepository repository; |
| 116 |
|
190 |
|
|
|
191 |
private final FilterDefinition workingCopy; |
| 192 |
|
| 193 |
|
| 194 |
|
| 117 |
/** |
195 |
/** |
| 118 |
* @param pageName |
196 |
* @param pageName |
| 119 |
* @param title |
197 |
* @param title |
|
Lines 132-138
Link Here
|
| 132 |
|
210 |
|
| 133 |
public void createControl(Composite parent) { |
211 |
public void createControl(Composite parent) { |
| 134 |
Composite c = new Composite(parent, SWT.NONE); |
212 |
Composite c = new Composite(parent, SWT.NONE); |
| 135 |
c.setLayout(new GridLayout(5, false)); |
213 |
c.setLayout(new GridLayout(3, false)); |
| 136 |
|
214 |
|
| 137 |
Label lblName = new Label(c, SWT.NONE); |
215 |
Label lblName = new Label(c, SWT.NONE); |
| 138 |
final GridData gridData = new GridData(); |
216 |
final GridData gridData = new GridData(); |
|
Lines 140-146
Link Here
|
| 140 |
lblName.setText("Name:"); |
218 |
lblName.setText("Name:"); |
| 141 |
|
219 |
|
| 142 |
name = new Text(c, SWT.BORDER); |
220 |
name = new Text(c, SWT.BORDER); |
| 143 |
name.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 4, 1)); |
221 |
name.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 2, 1)); |
| 144 |
name.addModifyListener(new ModifyListener() { |
222 |
name.addModifyListener(new ModifyListener() { |
| 145 |
|
223 |
|
| 146 |
public void modifyText(ModifyEvent e) { |
224 |
public void modifyText(ModifyEvent e) { |
|
Lines 149-185
Link Here
|
| 149 |
|
227 |
|
| 150 |
}); |
228 |
}); |
| 151 |
|
229 |
|
| 152 |
if (!isNew) { |
230 |
SashForm sashForm = new SashForm(c, SWT.VERTICAL); |
| 153 |
name.setEnabled(false); |
231 |
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 |
|
232 |
|
| 172 |
{ |
233 |
{ |
| 173 |
SashForm cc = new SashForm(c, SWT.HORIZONTAL); |
234 |
SashForm cc = new SashForm(sashForm, SWT.HORIZONTAL); |
| 174 |
cc.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true, 5, 1)); |
|
|
| 175 |
|
235 |
|
| 176 |
{ |
236 |
{ |
| 177 |
Composite comp = new Composite(cc, SWT.NONE); |
237 |
Composite comp = new Composite(cc, SWT.NONE); |
| 178 |
GridLayout gridLayout = new GridLayout(1, false); |
238 |
GridLayout gridLayout = new GridLayout(1, false); |
| 179 |
gridLayout.marginWidth = 0; |
239 |
gridLayout.marginWidth = 0; |
| 180 |
gridLayout.marginHeight = 0; |
|
|
| 181 |
comp.setLayout(gridLayout); |
240 |
comp.setLayout(gridLayout); |
| 182 |
|
241 |
|
| 183 |
Label label = new Label(comp, SWT.NONE); |
242 |
Label label = new Label(comp, SWT.NONE); |
| 184 |
label.setText("Project:"); |
243 |
label.setText("Project:"); |
| 185 |
createProjectsViewer(comp); |
244 |
createProjectsViewer(comp); |
|
Lines 189-197
Link Here
|
| 189 |
Composite comp = new Composite(cc, SWT.NONE); |
248 |
Composite comp = new Composite(cc, SWT.NONE); |
| 190 |
GridLayout gridLayout = new GridLayout(1, false); |
249 |
GridLayout gridLayout = new GridLayout(1, false); |
| 191 |
gridLayout.marginWidth = 0; |
250 |
gridLayout.marginWidth = 0; |
| 192 |
gridLayout.marginHeight = 0; |
|
|
| 193 |
comp.setLayout(gridLayout); |
251 |
comp.setLayout(gridLayout); |
| 194 |
|
252 |
|
| 195 |
new Label(comp, SWT.NONE).setText("Fix For:"); |
253 |
new Label(comp, SWT.NONE).setText("Fix For:"); |
| 196 |
createFixForViewer(comp); |
254 |
createFixForViewer(comp); |
| 197 |
} |
255 |
} |
|
Lines 200-208
Link Here
|
| 200 |
Composite comp = new Composite(cc, SWT.NONE); |
258 |
Composite comp = new Composite(cc, SWT.NONE); |
| 201 |
GridLayout gridLayout = new GridLayout(1, false); |
259 |
GridLayout gridLayout = new GridLayout(1, false); |
| 202 |
gridLayout.marginWidth = 0; |
260 |
gridLayout.marginWidth = 0; |
| 203 |
gridLayout.marginHeight = 0; |
|
|
| 204 |
comp.setLayout(gridLayout); |
261 |
comp.setLayout(gridLayout); |
| 205 |
|
262 |
|
| 206 |
new Label(comp, SWT.NONE).setText("In Components:"); |
263 |
new Label(comp, SWT.NONE).setText("In Components:"); |
| 207 |
createComponentsViewer(comp); |
264 |
createComponentsViewer(comp); |
| 208 |
} |
265 |
} |
|
Lines 211-231
Link Here
|
| 211 |
Composite comp = new Composite(cc, SWT.NONE); |
268 |
Composite comp = new Composite(cc, SWT.NONE); |
| 212 |
GridLayout gridLayout = new GridLayout(1, false); |
269 |
GridLayout gridLayout = new GridLayout(1, false); |
| 213 |
gridLayout.marginWidth = 0; |
270 |
gridLayout.marginWidth = 0; |
| 214 |
gridLayout.marginHeight = 0; |
|
|
| 215 |
comp.setLayout(gridLayout); |
271 |
comp.setLayout(gridLayout); |
| 216 |
|
272 |
|
| 217 |
Label label = new Label(comp, SWT.NONE); |
273 |
Label label = new Label(comp, SWT.NONE); |
| 218 |
label.setText("Reported In:"); |
274 |
label.setText("Reported In:"); |
| 219 |
createReportedInViewer(comp); |
275 |
createReportedInViewer(comp); |
| 220 |
} |
276 |
} |
| 221 |
// cc.setWeights(new int[] {1,1,1,1}); |
277 |
cc.setWeights(new int[] {1,1,1,1}); |
|
|
278 |
} |
| 279 |
|
| 280 |
{ |
| 281 |
SashForm cc = new SashForm(sashForm, SWT.NONE); |
| 282 |
|
| 283 |
ISelectionChangedListener selectionChangeListener = new ISelectionChangedListener() { |
| 284 |
public void selectionChanged(SelectionChangedEvent event) { |
| 285 |
validatePage(); |
| 286 |
} |
| 287 |
}; |
| 288 |
|
| 289 |
{ |
| 290 |
Composite comp = new Composite(cc, SWT.NONE); |
| 291 |
GridLayout gridLayout = new GridLayout(); |
| 292 |
gridLayout.marginWidth = 0; |
| 293 |
comp.setLayout(gridLayout); |
| 294 |
|
| 295 |
Label typeLabel = new Label(comp, SWT.NONE); |
| 296 |
typeLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false)); |
| 297 |
typeLabel.setText("Type:"); |
| 298 |
|
| 299 |
issueType = new ListViewer(comp, SWT.BORDER); |
| 300 |
issueType.getList().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); |
| 301 |
|
| 302 |
issueType.setContentProvider(new IStructuredContentProvider() { |
| 303 |
|
| 304 |
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { |
| 305 |
} |
| 306 |
|
| 307 |
public void dispose() { |
| 308 |
} |
| 309 |
|
| 310 |
public Object[] getElements(Object inputElement) { |
| 311 |
JiraServer server = (JiraServer) inputElement; |
| 312 |
Object[] elements = new Object[server.getIssueTypes().length + 1]; |
| 313 |
elements[0] = ANY_ISSUE_TYPE; |
| 314 |
System.arraycopy(server.getIssueTypes(), 0, elements, 1, server.getIssueTypes().length); |
| 315 |
|
| 316 |
return elements; |
| 317 |
} |
| 318 |
}); |
| 319 |
|
| 320 |
issueType.setLabelProvider(new LabelProvider() { |
| 321 |
|
| 322 |
public String getText(Object element) { |
| 323 |
if (element instanceof Placeholder) { |
| 324 |
return ((Placeholder) element).getText(); |
| 325 |
} |
| 326 |
|
| 327 |
return ((IssueType) element).getName(); |
| 328 |
} |
| 329 |
|
| 330 |
}); |
| 331 |
|
| 332 |
issueType.addSelectionChangedListener(selectionChangeListener); |
| 333 |
|
| 334 |
issueType.setInput(server); |
| 335 |
} |
| 336 |
|
| 337 |
{ |
| 338 |
Composite comp = new Composite(cc, SWT.NONE); |
| 339 |
GridLayout gridLayout = new GridLayout(); |
| 340 |
gridLayout.marginWidth = 0; |
| 341 |
comp.setLayout(gridLayout); |
| 342 |
|
| 343 |
Label statusLabel = new Label(comp, SWT.NONE); |
| 344 |
statusLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false)); |
| 345 |
statusLabel.setText("Status:"); |
| 346 |
|
| 347 |
status = new ListViewer(comp, SWT.BORDER); |
| 348 |
status.getList().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); |
| 349 |
|
| 350 |
status.setContentProvider(new IStructuredContentProvider() { |
| 351 |
|
| 352 |
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { |
| 353 |
} |
| 354 |
|
| 355 |
public void dispose() { |
| 356 |
} |
| 357 |
|
| 358 |
public Object[] getElements(Object inputElement) { |
| 359 |
JiraServer server = (JiraServer) inputElement; |
| 360 |
Object[] elements = new Object[server.getStatuses().length + 1]; |
| 361 |
elements[0] = ANY_STATUS; |
| 362 |
System.arraycopy(server.getStatuses(), 0, elements, 1, server.getStatuses().length); |
| 363 |
|
| 364 |
return elements; |
| 365 |
} |
| 366 |
}); |
| 367 |
|
| 368 |
status.setLabelProvider(new LabelProvider() { |
| 369 |
|
| 370 |
public String getText(Object element) { |
| 371 |
if (element instanceof Placeholder) { |
| 372 |
return ((Placeholder) element).getText(); |
| 373 |
} |
| 374 |
|
| 375 |
return ((Status) element).getName(); |
| 376 |
} |
| 377 |
|
| 378 |
}); |
| 379 |
|
| 380 |
status.addSelectionChangedListener(selectionChangeListener); |
| 381 |
status.setInput(server); |
| 382 |
} |
| 383 |
|
| 384 |
{ |
| 385 |
Composite comp = new Composite(cc, SWT.NONE); |
| 386 |
GridLayout gridLayout = new GridLayout(); |
| 387 |
gridLayout.marginWidth = 0; |
| 388 |
comp.setLayout(gridLayout); |
| 389 |
|
| 390 |
Label resolutionLabel = new Label(comp, SWT.NONE); |
| 391 |
resolutionLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false)); |
| 392 |
resolutionLabel.setText("Resolution:"); |
| 393 |
|
| 394 |
resolution = new ListViewer(comp, SWT.BORDER); |
| 395 |
resolution.getList().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); |
| 396 |
|
| 397 |
resolution.setContentProvider(new IStructuredContentProvider() { |
| 398 |
|
| 399 |
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { |
| 400 |
} |
| 401 |
|
| 402 |
public void dispose() { |
| 403 |
} |
| 404 |
|
| 405 |
public Object[] getElements(Object inputElement) { |
| 406 |
JiraServer server = (JiraServer) inputElement; |
| 407 |
Object[] elements = new Object[server.getResolutions().length + 2]; |
| 408 |
elements[0] = ANY_RESOLUTION; |
| 409 |
elements[1] = UNRESOLVED; |
| 410 |
System.arraycopy(server.getResolutions(), 0, elements, 2, server.getResolutions().length); |
| 411 |
|
| 412 |
return elements; |
| 413 |
} |
| 414 |
}); |
| 415 |
|
| 416 |
resolution.setLabelProvider(new LabelProvider() { |
| 417 |
|
| 418 |
public String getText(Object element) { |
| 419 |
if (element instanceof Placeholder) { |
| 420 |
return ((Placeholder) element).getText(); |
| 421 |
} |
| 422 |
|
| 423 |
return ((Resolution) element).getName(); |
| 424 |
} |
| 425 |
|
| 426 |
}); |
| 427 |
|
| 428 |
resolution.addSelectionChangedListener(selectionChangeListener); |
| 429 |
resolution.setInput(server); |
| 430 |
} |
| 431 |
|
| 432 |
{ |
| 433 |
Composite comp = new Composite(cc, SWT.NONE); |
| 434 |
GridLayout gridLayout = new GridLayout(); |
| 435 |
gridLayout.marginWidth = 0; |
| 436 |
comp.setLayout(gridLayout); |
| 437 |
|
| 438 |
Label priorityLabel = new Label(comp, SWT.NONE); |
| 439 |
priorityLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false)); |
| 440 |
priorityLabel.setText("Priority:"); |
| 441 |
|
| 442 |
priority = new ListViewer(comp, SWT.BORDER); |
| 443 |
priority.getList().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); |
| 444 |
|
| 445 |
priority.setContentProvider(new IStructuredContentProvider() { |
| 446 |
|
| 447 |
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { |
| 448 |
} |
| 449 |
|
| 450 |
public void dispose() { |
| 451 |
} |
| 452 |
|
| 453 |
public Object[] getElements(Object inputElement) { |
| 454 |
JiraServer server = (JiraServer) inputElement; |
| 455 |
Object[] elements = new Object[server.getPriorities().length + 1]; |
| 456 |
elements[0] = ANY_PRIORITY; |
| 457 |
System.arraycopy(server.getPriorities(), 0, elements, 1, server.getPriorities().length); |
| 458 |
|
| 459 |
return elements; |
| 460 |
} |
| 461 |
}); |
| 462 |
|
| 463 |
priority.setLabelProvider(new LabelProvider() { |
| 464 |
|
| 465 |
public String getText(Object element) { |
| 466 |
if (element instanceof Placeholder) { |
| 467 |
return ((Placeholder) element).getText(); |
| 468 |
} |
| 469 |
|
| 470 |
return ((Priority) element).getName(); |
| 471 |
} |
| 472 |
|
| 473 |
}); |
| 474 |
priority.addSelectionChangedListener(selectionChangeListener); |
| 475 |
priority.setInput(server); |
| 476 |
} |
| 477 |
|
| 478 |
cc.setWeights(new int[] {1, 1, 1, 1 }); |
| 222 |
} |
479 |
} |
|
|
480 |
sashForm.setWeights(new int[] {1, 1 }); |
| 223 |
|
481 |
|
| 224 |
Label lblQuery = new Label(c, SWT.NONE); |
482 |
Label lblQuery = new Label(c, SWT.NONE); |
| 225 |
lblQuery.setLayoutData(new GridData()); |
483 |
lblQuery.setLayoutData(new GridData()); |
| 226 |
lblQuery.setText("Query:"); |
484 |
lblQuery.setText("Query:"); |
| 227 |
queryString = new Text(c, SWT.BORDER); |
485 |
queryString = new Text(c, SWT.BORDER); |
| 228 |
queryString.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 4, 1)); |
486 |
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 |
487 |
// TODO put content assist here and a label describing what is available |
| 230 |
|
488 |
|
| 231 |
queryString.addFocusListener(new FocusAdapter() { |
489 |
queryString.addFocusListener(new FocusAdapter() { |
|
Lines 238-313
Link Here
|
| 238 |
|
496 |
|
| 239 |
Label lblFields = new Label(c, SWT.NONE); |
497 |
Label lblFields = new Label(c, SWT.NONE); |
| 240 |
lblFields.setText("Fields:"); |
498 |
lblFields.setText("Fields:"); |
| 241 |
lblFields.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false)); |
499 |
lblFields.setLayoutData(new GridData()); |
| 242 |
|
500 |
|
| 243 |
searchSummary = new Button(c, SWT.CHECK); |
501 |
{ |
| 244 |
searchSummary.setLayoutData(new GridData()); |
502 |
SelectionAdapter selectionAdapter = new SelectionAdapter() { |
| 245 |
searchSummary.setText("Summary"); |
503 |
public void widgetSelected(SelectionEvent e) { |
| 246 |
searchSummary.addSelectionListener(new SelectionAdapter() { |
504 |
validatePage(); |
|
|
505 |
} |
| 506 |
}; |
| 247 |
|
507 |
|
| 248 |
public void widgetSelected(SelectionEvent e) { |
508 |
Composite comp = new Composite(c, SWT.NONE); |
| 249 |
validatePage(); |
509 |
comp.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1)); |
| 250 |
} |
510 |
comp.setLayout(new FillLayout()); |
|
|
511 |
|
| 512 |
searchSummary = new Button(comp, SWT.CHECK); |
| 513 |
searchSummary.setText("Summary"); |
| 514 |
searchSummary.addSelectionListener(selectionAdapter); |
| 515 |
|
| 516 |
searchDescription = new Button(comp, SWT.CHECK); |
| 517 |
searchDescription.setText("Description"); |
| 518 |
searchDescription.addSelectionListener(selectionAdapter); |
| 519 |
|
| 520 |
searchComments = new Button(comp, SWT.CHECK); |
| 521 |
searchComments.setText("Comments"); |
| 522 |
searchComments.addSelectionListener(selectionAdapter); |
| 523 |
|
| 524 |
searchEnvironment = new Button(comp, SWT.CHECK); |
| 525 |
searchEnvironment.setText("Environment"); |
| 526 |
searchEnvironment.addSelectionListener(selectionAdapter); |
| 527 |
} |
| 528 |
|
| 529 |
{ |
| 530 |
Label reportedByLabel = new Label(c, SWT.NONE); |
| 531 |
reportedByLabel.setText("Reported By:"); |
| 251 |
|
532 |
|
| 252 |
}); |
533 |
reporterType = new ComboViewer(c, SWT.BORDER | SWT.READ_ONLY); |
|
|
534 |
GridData gridData_1 = new GridData(SWT.FILL, SWT.CENTER, false, false); |
| 535 |
gridData_1.widthHint = 133; |
| 536 |
reporterType.getControl().setLayoutData(gridData_1); |
| 537 |
|
| 538 |
reporterType.setContentProvider(new IStructuredContentProvider() { |
| 539 |
|
| 540 |
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { |
| 541 |
} |
| 542 |
|
| 543 |
public void dispose() { |
| 544 |
} |
| 545 |
|
| 546 |
public Object[] getElements(Object inputElement) { |
| 547 |
return new Object[] { ANY_REPORTER, NO_REPORTER, CURRENT_USER_REPORTER, SPECIFIC_USER_REPORTER, |
| 548 |
SPECIFIC_GROUP_REPORTER }; |
| 549 |
} |
| 550 |
|
| 551 |
}); |
| 552 |
|
| 553 |
reporterType.setLabelProvider(new LabelProvider() { |
| 554 |
public String getText(Object element) { |
| 555 |
return ((Placeholder) element).getText(); |
| 556 |
} |
| 557 |
}); |
| 558 |
|
| 559 |
reporterType.setInput(server); |
| 560 |
|
| 561 |
reporter = new Text(c, SWT.BORDER); |
| 562 |
reporter.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); |
| 563 |
reporter.setEnabled(false); |
| 564 |
|
| 565 |
reporter.addModifyListener(new ModifyListener() { |
| 253 |
|
566 |
|
| 254 |
searchDescription = new Button(c, SWT.CHECK); |
567 |
public void modifyText(ModifyEvent e) { |
| 255 |
searchDescription.setLayoutData(new GridData()); |
568 |
validatePage(); |
| 256 |
searchDescription.setText("Description"); |
569 |
} |
| 257 |
searchDescription.addSelectionListener(new SelectionAdapter() { |
|
|
| 258 |
|
570 |
|
| 259 |
public void widgetSelected(SelectionEvent e) { |
571 |
}); |
| 260 |
validatePage(); |
572 |
} |
| 261 |
} |
|
|
| 262 |
|
573 |
|
| 263 |
}); |
574 |
{ |
|
|
575 |
Label assignedToLabel = new Label(c, SWT.NONE); |
| 576 |
assignedToLabel.setText("Assigned To:"); |
| 577 |
|
| 578 |
assigneeType = new ComboViewer(c, SWT.BORDER | SWT.READ_ONLY); |
| 579 |
GridData gridData_2 = new GridData(SWT.FILL, SWT.CENTER, false, false); |
| 580 |
gridData_2.widthHint = 133; |
| 581 |
assigneeType.getCombo().setLayoutData(gridData_2); |
| 582 |
|
| 583 |
assigneeType.setContentProvider(new IStructuredContentProvider() { |
| 264 |
|
584 |
|
| 265 |
searchComments = new Button(c, SWT.CHECK); |
585 |
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { |
| 266 |
searchComments.setLayoutData(new GridData()); |
586 |
} |
| 267 |
searchComments.setText("Comments"); |
|
|
| 268 |
searchComments.addSelectionListener(new SelectionAdapter() { |
| 269 |
|
587 |
|
| 270 |
public void widgetSelected(SelectionEvent e) { |
588 |
public void dispose() { |
| 271 |
validatePage(); |
589 |
} |
| 272 |
} |
|
|
| 273 |
|
590 |
|
| 274 |
}); |
591 |
public Object[] getElements(Object inputElement) { |
|
|
592 |
return new Object[] { ANY_ASSIGNEE, UNASSIGNED, CURRENT_USER_ASSIGNEE, SPECIFIC_USER_ASSIGNEE, |
| 593 |
SPECIFIC_GROUP_ASSIGNEE }; |
| 594 |
} |
| 275 |
|
595 |
|
| 276 |
searchEnvironment = new Button(c, SWT.CHECK); |
596 |
}); |
| 277 |
searchEnvironment.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false)); |
|
|
| 278 |
searchEnvironment.setText("Environment"); |
| 279 |
searchEnvironment.addSelectionListener(new SelectionAdapter() { |
| 280 |
|
597 |
|
| 281 |
public void widgetSelected(SelectionEvent e) { |
598 |
assigneeType.setLabelProvider(new LabelProvider() { |
| 282 |
validatePage(); |
|
|
| 283 |
} |
| 284 |
|
599 |
|
| 285 |
}); |
600 |
public String getText(Object element) { |
|
|
601 |
return ((Placeholder) element).getText(); |
| 602 |
} |
| 603 |
|
| 604 |
}); |
| 605 |
|
| 606 |
assigneeType.addSelectionChangedListener(new ISelectionChangedListener() { |
| 607 |
|
| 608 |
public void selectionChanged(SelectionChangedEvent event) { |
| 609 |
Object selection = ((IStructuredSelection) event.getSelection()).getFirstElement(); |
| 610 |
if (SPECIFIC_USER_ASSIGNEE.equals(selection) || SPECIFIC_GROUP_ASSIGNEE.equals(selection)) { |
| 611 |
assignee.setEnabled(true); |
| 612 |
} else { |
| 613 |
assignee.setEnabled(false); |
| 614 |
assignee.setText(""); //$NON-NLS-1$ |
| 615 |
} |
| 616 |
validatePage(); |
| 617 |
} |
| 618 |
|
| 619 |
}); |
| 620 |
|
| 621 |
assigneeType.setInput(server); |
| 622 |
|
| 623 |
assignee = new Text(c, SWT.BORDER); |
| 624 |
assignee.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); |
| 625 |
assignee.setEnabled(false); |
| 626 |
assignee.addModifyListener(new ModifyListener() { |
| 627 |
|
| 628 |
public void modifyText(ModifyEvent e) { |
| 629 |
validatePage(); |
| 630 |
} |
| 631 |
|
| 632 |
}); |
| 633 |
} |
| 634 |
|
| 635 |
{ |
| 636 |
Label createdLabel = new Label(c, SWT.NONE); |
| 637 |
createdLabel.setText("Created:"); |
| 638 |
|
| 639 |
Composite composite = new Composite(c, SWT.NONE); |
| 640 |
FillLayout fillLayout = new FillLayout(); |
| 641 |
fillLayout.spacing = 5; |
| 642 |
composite.setLayout(fillLayout); |
| 643 |
composite.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1)); |
| 644 |
|
| 645 |
createdStartDatePicker = new DatePicker(composite, SWT.BORDER, "<start date>"); |
| 646 |
createdEndDatePicker = new DatePicker(composite, SWT.BORDER, "<end date>"); |
| 647 |
} |
| 648 |
|
| 649 |
{ |
| 650 |
Label updatedLabel = new Label(c, SWT.NONE); |
| 651 |
updatedLabel.setText("Updated:"); |
| 652 |
|
| 653 |
Composite composite = new Composite(c, SWT.NONE); |
| 654 |
FillLayout fillLayout = new FillLayout(); |
| 655 |
fillLayout.spacing = 5; |
| 656 |
composite.setLayout(fillLayout); |
| 657 |
composite.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1)); |
| 658 |
|
| 659 |
updatedStartDatePicker = new DatePicker(composite, SWT.BORDER, "<start date>"); |
| 660 |
updatedEndDatePicker = new DatePicker(composite, SWT.BORDER, "<end date>"); |
| 661 |
} |
| 286 |
|
662 |
|
| 287 |
// Need to turn off validation here |
663 |
{ |
|
|
664 |
Label dueDateLabel = new Label(c, SWT.NONE); |
| 665 |
dueDateLabel.setText("Due Date:"); |
| 666 |
|
| 667 |
Composite composite = new Composite(c, SWT.NONE); |
| 668 |
FillLayout fillLayout = new FillLayout(); |
| 669 |
fillLayout.spacing = 5; |
| 670 |
composite.setLayout(fillLayout); |
| 671 |
composite.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1)); |
| 672 |
|
| 673 |
dueStartDatePicker = new DatePicker(composite, SWT.BORDER, "<start date>"); |
| 674 |
dueEndDatePicker = new DatePicker(composite, SWT.BORDER, "<end date>"); |
| 675 |
} |
| 676 |
|
| 677 |
//new FillLayout()f validation here |
| 288 |
if (isNew) { |
678 |
if (isNew) { |
| 289 |
loadFromDefaults(); |
679 |
loadFromDefaults(); |
| 290 |
} else { |
680 |
} else { |
| 291 |
loadFromWorkingCopy(); |
681 |
loadFromWorkingCopy(); |
| 292 |
} |
682 |
} |
| 293 |
|
683 |
|
| 294 |
setControl(c); |
684 |
setControl(c); |
| 295 |
} |
685 |
} |
| 296 |
|
686 |
|
| 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) { |
687 |
private void createReportedInViewer(Composite c) { |
| 307 |
reportedIn = new ListViewer(c, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.H_SCROLL); |
688 |
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); |
689 |
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true); |
| 309 |
gridData.heightHint = 200; |
690 |
gridData.heightHint = 55; |
| 310 |
gridData.widthHint = 80; |
691 |
gridData.widthHint = 90; |
| 311 |
reportedIn.getControl().setLayoutData(gridData); |
692 |
reportedIn.getControl().setLayoutData(gridData); |
| 312 |
|
693 |
|
| 313 |
reportedIn.setContentProvider(new IStructuredContentProvider() { |
694 |
reportedIn.setContentProvider(new IStructuredContentProvider() { |
|
Lines 349-356
Link Here
|
| 349 |
private void createComponentsViewer(Composite c) { |
730 |
private void createComponentsViewer(Composite c) { |
| 350 |
components = new ListViewer(c, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.H_SCROLL); |
731 |
components = new ListViewer(c, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.H_SCROLL); |
| 351 |
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true); |
732 |
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true); |
| 352 |
gridData.heightHint = 200; |
733 |
gridData.heightHint = 63; |
| 353 |
gridData.widthHint = 80; |
734 |
gridData.widthHint = 90; |
| 354 |
components.getControl().setLayoutData(gridData); |
735 |
components.getControl().setLayoutData(gridData); |
| 355 |
|
736 |
|
| 356 |
components.setContentProvider(new IStructuredContentProvider() { |
737 |
components.setContentProvider(new IStructuredContentProvider() { |
|
Lines 384-391
Link Here
|
| 384 |
private void createFixForViewer(Composite c) { |
765 |
private void createFixForViewer(Composite c) { |
| 385 |
fixFor = new ListViewer(c, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.H_SCROLL); |
766 |
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); |
767 |
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true); |
| 387 |
gridData.heightHint = 200; |
768 |
gridData.heightHint = 57; |
| 388 |
gridData.widthHint = 80; |
769 |
gridData.widthHint = 90; |
| 389 |
fixFor.getControl().setLayoutData(gridData); |
770 |
fixFor.getControl().setLayoutData(gridData); |
| 390 |
|
771 |
|
| 391 |
fixFor.setContentProvider(new IStructuredContentProvider() { |
772 |
fixFor.setContentProvider(new IStructuredContentProvider() { |
|
Lines 427-436
Link Here
|
| 427 |
private void createProjectsViewer(Composite c) { |
808 |
private void createProjectsViewer(Composite c) { |
| 428 |
project = new ListViewer(c, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.H_SCROLL); |
809 |
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); |
810 |
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true); |
| 430 |
gridData.heightHint = 200; |
811 |
gridData.heightHint = 59; |
| 431 |
gridData.widthHint = 120; |
812 |
gridData.widthHint = 90; |
| 432 |
project.getControl().setLayoutData(gridData); |
813 |
project.getControl().setLayoutData(gridData); |
| 433 |
|
814 |
|
| 434 |
project.setContentProvider(new IStructuredContentProvider() { |
815 |
project.setContentProvider(new IStructuredContentProvider() { |
| 435 |
|
816 |
|
| 436 |
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { |
817 |
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { |
|
Lines 501-506
Link Here
|
| 501 |
project.setSelection(new StructuredSelection(new Placeholder("All Projects"))); |
882 |
project.setSelection(new StructuredSelection(new Placeholder("All Projects"))); |
| 502 |
searchSummary.setSelection(true); |
883 |
searchSummary.setSelection(true); |
| 503 |
searchDescription.setSelection(true); |
884 |
searchDescription.setSelection(true); |
|
|
885 |
|
| 886 |
issueType.setSelection(new StructuredSelection(ANY_ISSUE_TYPE)); |
| 887 |
reporterType.setSelection(new StructuredSelection(ANY_REPORTER)); |
| 888 |
assigneeType.setSelection(new StructuredSelection(ANY_ASSIGNEE)); |
| 889 |
status.setSelection(new StructuredSelection(ANY_STATUS)); |
| 890 |
resolution.setSelection(new StructuredSelection(ANY_RESOLUTION)); |
| 891 |
priority.setSelection(new StructuredSelection(ANY_PRIORITY)); |
| 504 |
} |
892 |
} |
| 505 |
|
893 |
|
| 506 |
private void loadFromWorkingCopy() { |
894 |
private void loadFromWorkingCopy() { |
|
Lines 509-515
Link Here
|
| 509 |
} |
897 |
} |
| 510 |
|
898 |
|
| 511 |
if (workingCopy.getDescription() != null) { |
899 |
if (workingCopy.getDescription() != null) { |
| 512 |
description.setText(workingCopy.getDescription()); |
|
|
| 513 |
} |
900 |
} |
| 514 |
|
901 |
|
| 515 |
if (workingCopy.getProjectFilter() != null) { |
902 |
if (workingCopy.getProjectFilter() != null) { |
|
Lines 570-580
Link Here
|
| 570 |
} else { |
957 |
} else { |
| 571 |
components.setSelection(new StructuredSelection(ANY_COMPONENT)); |
958 |
components.setSelection(new StructuredSelection(ANY_COMPONENT)); |
| 572 |
} |
959 |
} |
|
|
960 |
|
| 961 |
// attributes |
| 962 |
|
| 963 |
if (workingCopy.getIssueTypeFilter() != null) { |
| 964 |
issueType.setSelection(new StructuredSelection(workingCopy.getIssueTypeFilter().getIsueTypes())); |
| 965 |
} else { |
| 966 |
issueType.setSelection(new StructuredSelection(ANY_ISSUE_TYPE)); |
| 967 |
} |
| 968 |
|
| 969 |
if (workingCopy.getReportedByFilter() != null) { |
| 970 |
UserFilter reportedByFilter = workingCopy.getReportedByFilter(); |
| 971 |
if (reportedByFilter instanceof NobodyFilter) { |
| 972 |
reporterType.setSelection(new StructuredSelection(NO_REPORTER)); |
| 973 |
} else if (reportedByFilter instanceof CurrentUserFilter) { |
| 974 |
reporterType.setSelection(new StructuredSelection(CURRENT_USER_REPORTER)); |
| 975 |
} else if (reportedByFilter instanceof SpecificUserFilter) { |
| 976 |
reporterType.setSelection(new StructuredSelection(SPECIFIC_USER_REPORTER)); |
| 977 |
reporter.setText(((SpecificUserFilter) reportedByFilter).getUser()); |
| 978 |
} else if (reportedByFilter instanceof UserInGroupFilter) { |
| 979 |
reporterType.setSelection(new StructuredSelection(SPECIFIC_GROUP_REPORTER)); |
| 980 |
reporter.setText(((UserInGroupFilter) reportedByFilter).getGroup()); |
| 981 |
} |
| 982 |
} else { |
| 983 |
reporterType.setSelection(new StructuredSelection(ANY_REPORTER)); |
| 984 |
} |
| 985 |
|
| 986 |
if (workingCopy.getAssignedToFilter() != null) { |
| 987 |
UserFilter assignedToFilter = workingCopy.getAssignedToFilter(); |
| 988 |
if (assignedToFilter instanceof NobodyFilter) { |
| 989 |
assigneeType.setSelection(new StructuredSelection(UNASSIGNED)); |
| 990 |
} else if (assignedToFilter instanceof CurrentUserFilter) { |
| 991 |
assigneeType.setSelection(new StructuredSelection(CURRENT_USER_ASSIGNEE)); |
| 992 |
} else if (assignedToFilter instanceof SpecificUserFilter) { |
| 993 |
assigneeType.setSelection(new StructuredSelection(SPECIFIC_USER_ASSIGNEE)); |
| 994 |
assignee.setText(((SpecificUserFilter) assignedToFilter).getUser()); |
| 995 |
} else if (assignedToFilter instanceof UserInGroupFilter) { |
| 996 |
assigneeType.setSelection(new StructuredSelection(SPECIFIC_GROUP_ASSIGNEE)); |
| 997 |
assignee.setText(((UserInGroupFilter) assignedToFilter).getGroup()); |
| 998 |
} |
| 999 |
} else { |
| 1000 |
assigneeType.setSelection(new StructuredSelection(ANY_ASSIGNEE)); |
| 1001 |
} |
| 1002 |
|
| 1003 |
if (workingCopy.getStatusFilter() != null) { |
| 1004 |
status.setSelection(new StructuredSelection(workingCopy.getStatusFilter().getStatuses())); |
| 1005 |
} else { |
| 1006 |
status.setSelection(new StructuredSelection(ANY_STATUS)); |
| 1007 |
} |
| 1008 |
|
| 1009 |
if (workingCopy.getResolutionFilter() != null) { |
| 1010 |
Resolution[] resolutions = workingCopy.getResolutionFilter().getResolutions(); |
| 1011 |
if(resolutions.length==0) { |
| 1012 |
resolution.setSelection(new StructuredSelection(UNRESOLVED)); |
| 1013 |
} else { |
| 1014 |
resolution.setSelection(new StructuredSelection(resolutions)); |
| 1015 |
} |
| 1016 |
} else { |
| 1017 |
resolution.setSelection(new StructuredSelection(ANY_RESOLUTION)); |
| 1018 |
} |
| 1019 |
|
| 1020 |
if (workingCopy.getPriorityFilter() != null) { |
| 1021 |
priority.setSelection(new StructuredSelection(workingCopy.getPriorityFilter().getPriorities())); |
| 1022 |
} else { |
| 1023 |
priority.setSelection(new StructuredSelection(ANY_PRIORITY)); |
| 1024 |
} |
| 1025 |
|
| 1026 |
setDateRange(workingCopy.getCreatedDateFilter(), createdStartDatePicker, createdEndDatePicker); |
| 1027 |
setDateRange(workingCopy.getUpdatedDateFilter(), updatedStartDatePicker, updatedEndDatePicker); |
| 1028 |
setDateRange(workingCopy.getDueDateFilter(), dueStartDatePicker, dueEndDatePicker); |
| 1029 |
} |
| 1030 |
|
| 1031 |
private void setDateRange(DateFilter dateFilter, DatePicker startDatePicker, DatePicker endDatePicker) { |
| 1032 |
if(dateFilter instanceof DateRangeFilter) { |
| 1033 |
DateRangeFilter rangeFilter = (DateRangeFilter) dateFilter; |
| 1034 |
Calendar c1 = Calendar.getInstance(); |
| 1035 |
c1.setTime(rangeFilter.getFromDate()); |
| 1036 |
startDatePicker.setDate(c1); |
| 1037 |
|
| 1038 |
Calendar c2 = Calendar.getInstance(); |
| 1039 |
c2.setTime(rangeFilter.getToDate()); |
| 1040 |
endDatePicker.setDate(c2); |
| 1041 |
} |
| 573 |
} |
1042 |
} |
| 574 |
|
1043 |
|
| 575 |
/* default */void applyChanges() { |
1044 |
/* default */void applyChanges() { |
| 576 |
workingCopy.setName(this.name.getText()); |
1045 |
workingCopy.setName(this.name.getText()); |
| 577 |
workingCopy.setDescription(this.description.getText()); |
|
|
| 578 |
if (this.queryString.getText().length() > 0 || this.searchSummary.getSelection() |
1046 |
if (this.queryString.getText().length() > 0 || this.searchSummary.getSelection() |
| 579 |
|| this.searchDescription.getSelection() || this.searchEnvironment.getSelection() |
1047 |
|| this.searchDescription.getSelection() || this.searchEnvironment.getSelection() |
| 580 |
|| this.searchComments.getSelection()) { |
1048 |
|| this.searchComments.getSelection()) { |
|
Lines 705-710
Link Here
|
| 705 |
workingCopy.setComponentFilter(null); |
1173 |
workingCopy.setComponentFilter(null); |
| 706 |
} |
1174 |
} |
| 707 |
} |
1175 |
} |
|
|
1176 |
|
| 1177 |
// attributes |
| 1178 |
|
| 1179 |
// TODO support standard and subtask issue types |
| 1180 |
IStructuredSelection issueTypeSelection = (IStructuredSelection) issueType.getSelection(); |
| 1181 |
if (issueTypeSelection.isEmpty()) { |
| 1182 |
workingCopy.setIssueTypeFilter(null); |
| 1183 |
} else { |
| 1184 |
boolean isAnyIssueTypeSelected = false; |
| 1185 |
|
| 1186 |
List<IssueType> selectedIssueTypes = new ArrayList<IssueType>(); |
| 1187 |
|
| 1188 |
for (Iterator i = issueTypeSelection.iterator(); i.hasNext();) { |
| 1189 |
Object selection = i.next(); |
| 1190 |
if (ANY_ISSUE_TYPE.equals(selection)) { |
| 1191 |
isAnyIssueTypeSelected = true; |
| 1192 |
} else if (selection instanceof IssueType) { |
| 1193 |
selectedIssueTypes.add((IssueType) selection); |
| 1194 |
} |
| 1195 |
} |
| 1196 |
|
| 1197 |
if (isAnyIssueTypeSelected) { |
| 1198 |
workingCopy.setIssueTypeFilter(null); |
| 1199 |
} else { |
| 1200 |
workingCopy.setIssueTypeFilter( |
| 1201 |
new IssueTypeFilter(selectedIssueTypes.toArray(new IssueType[selectedIssueTypes.size()]))); |
| 1202 |
} |
| 1203 |
} |
| 1204 |
|
| 1205 |
IStructuredSelection reporterSelection = (IStructuredSelection) reporterType.getSelection(); |
| 1206 |
if (reporterSelection.isEmpty()) { |
| 1207 |
workingCopy.setReportedByFilter(null); |
| 1208 |
} else { |
| 1209 |
if (ANY_REPORTER.equals(reporterSelection.getFirstElement())) { |
| 1210 |
workingCopy.setReportedByFilter(null); |
| 1211 |
} else if (NO_REPORTER.equals(reporterSelection.getFirstElement())) { |
| 1212 |
workingCopy.setReportedByFilter(new NobodyFilter()); |
| 1213 |
} else if (CURRENT_USER_REPORTER.equals(reporterSelection.getFirstElement())) { |
| 1214 |
workingCopy.setReportedByFilter(new CurrentUserFilter()); |
| 1215 |
} else if (SPECIFIC_GROUP_REPORTER.equals(reporterSelection.getFirstElement())) { |
| 1216 |
workingCopy.setReportedByFilter(new UserInGroupFilter(reporter.getText())); |
| 1217 |
} else if (SPECIFIC_USER_REPORTER.equals(reporterSelection.getFirstElement())) { |
| 1218 |
workingCopy.setReportedByFilter(new SpecificUserFilter(reporter.getText())); |
| 1219 |
} else { |
| 1220 |
workingCopy.setReportedByFilter(null); |
| 1221 |
} |
| 1222 |
} |
| 1223 |
|
| 1224 |
IStructuredSelection assigneeSelection = (IStructuredSelection) assigneeType.getSelection(); |
| 1225 |
if (assigneeSelection.isEmpty()) { |
| 1226 |
workingCopy.setAssignedToFilter(null); |
| 1227 |
} else { |
| 1228 |
if (ANY_REPORTER.equals(assigneeSelection.getFirstElement())) { |
| 1229 |
workingCopy.setAssignedToFilter(null); |
| 1230 |
} else if (UNASSIGNED.equals(assigneeSelection.getFirstElement())) { |
| 1231 |
workingCopy.setAssignedToFilter(new NobodyFilter()); |
| 1232 |
} else if (CURRENT_USER_REPORTER.equals(assigneeSelection.getFirstElement())) { |
| 1233 |
workingCopy.setAssignedToFilter(new CurrentUserFilter()); |
| 1234 |
} else if (SPECIFIC_GROUP_REPORTER.equals(assigneeSelection.getFirstElement())) { |
| 1235 |
workingCopy.setAssignedToFilter(new UserInGroupFilter(assignee.getText())); |
| 1236 |
} else if (SPECIFIC_USER_REPORTER.equals(assigneeSelection.getFirstElement())) { |
| 1237 |
workingCopy.setAssignedToFilter(new SpecificUserFilter(assignee.getText())); |
| 1238 |
} else { |
| 1239 |
workingCopy.setAssignedToFilter(null); |
| 1240 |
} |
| 1241 |
} |
| 1242 |
|
| 1243 |
IStructuredSelection statusSelection = (IStructuredSelection) status.getSelection(); |
| 1244 |
if (statusSelection.isEmpty()) { |
| 1245 |
workingCopy.setStatusFilter(null); |
| 1246 |
} else { |
| 1247 |
boolean isAnyStatusSelected = false; |
| 1248 |
|
| 1249 |
List<Status> selectedStatuses = new ArrayList<Status>(); |
| 1250 |
|
| 1251 |
for (Iterator i = statusSelection.iterator(); i.hasNext();) { |
| 1252 |
Object selection = i.next(); |
| 1253 |
if (ANY_STATUS.equals(selection)) { |
| 1254 |
isAnyStatusSelected = true; |
| 1255 |
} else if (selection instanceof Status) { |
| 1256 |
selectedStatuses.add((Status) selection); |
| 1257 |
} |
| 1258 |
} |
| 1259 |
|
| 1260 |
if (isAnyStatusSelected) { |
| 1261 |
workingCopy.setStatusFilter(null); |
| 1262 |
} else { |
| 1263 |
workingCopy.setStatusFilter( |
| 1264 |
new StatusFilter(selectedStatuses.toArray(new Status[selectedStatuses.size()]))); |
| 1265 |
} |
| 1266 |
} |
| 1267 |
|
| 1268 |
IStructuredSelection resolutionSelection = (IStructuredSelection) resolution.getSelection(); |
| 1269 |
if (resolutionSelection.isEmpty()) { |
| 1270 |
workingCopy.setResolutionFilter(null); |
| 1271 |
} else { |
| 1272 |
boolean isAnyResolutionSelected = false; |
| 1273 |
|
| 1274 |
List<Resolution> selectedResolutions = new ArrayList<Resolution>(); |
| 1275 |
|
| 1276 |
for (Iterator i = resolutionSelection.iterator(); i.hasNext();) { |
| 1277 |
Object selection = i.next(); |
| 1278 |
if (ANY_RESOLUTION.equals(selection)) { |
| 1279 |
isAnyResolutionSelected = true; |
| 1280 |
} else if (selection instanceof Resolution) { |
| 1281 |
selectedResolutions.add((Resolution) selection); |
| 1282 |
} |
| 1283 |
} |
| 1284 |
|
| 1285 |
if (isAnyResolutionSelected) { |
| 1286 |
workingCopy.setResolutionFilter(null); |
| 1287 |
} else { |
| 1288 |
workingCopy.setResolutionFilter( |
| 1289 |
new ResolutionFilter(selectedResolutions.toArray(new Resolution[selectedResolutions.size()]))); |
| 1290 |
} |
| 1291 |
} |
| 1292 |
|
| 1293 |
IStructuredSelection prioritySelection = (IStructuredSelection) priority.getSelection(); |
| 1294 |
if (prioritySelection.isEmpty()) { |
| 1295 |
workingCopy.setPriorityFilter(null); |
| 1296 |
} else { |
| 1297 |
boolean isAnyPrioritiesSelected = false; |
| 1298 |
|
| 1299 |
List<Priority> selectedPriorities = new ArrayList<Priority>(); |
| 1300 |
|
| 1301 |
for (Iterator i = prioritySelection.iterator(); i.hasNext();) { |
| 1302 |
Object selection = i.next(); |
| 1303 |
if (ANY_PRIORITY.equals(selection)) { |
| 1304 |
isAnyPrioritiesSelected = true; |
| 1305 |
} else if (selection instanceof Priority) { |
| 1306 |
selectedPriorities.add((Priority) selection); |
| 1307 |
} |
| 1308 |
} |
| 1309 |
|
| 1310 |
if (isAnyPrioritiesSelected) { |
| 1311 |
workingCopy.setPriorityFilter(null); |
| 1312 |
} else { |
| 1313 |
workingCopy.setPriorityFilter( |
| 1314 |
new PriorityFilter(selectedPriorities.toArray(new Priority[selectedPriorities.size()]))); |
| 1315 |
} |
| 1316 |
} |
| 1317 |
|
| 1318 |
workingCopy.setDueDateFilter(getRangeFilter(dueStartDatePicker, dueEndDatePicker)); |
| 1319 |
|
| 1320 |
workingCopy.setCreatedDateFilter(getRangeFilter(createdStartDatePicker, createdEndDatePicker)); |
| 1321 |
|
| 1322 |
workingCopy.setUpdatedDateFilter(getRangeFilter(updatedStartDatePicker, updatedEndDatePicker)); |
| 1323 |
} |
| 1324 |
|
| 1325 |
private DateRangeFilter getRangeFilter(DatePicker startDatePicker, DatePicker endDatePicker) { |
| 1326 |
Calendar startDate = startDatePicker.getDate(); |
| 1327 |
Calendar endDate = endDatePicker.getDate(); |
| 1328 |
if(startDate!=null && endDate!=null) { |
| 1329 |
return new DateRangeFilter(startDate.getTime(), endDate.getTime()); |
| 1330 |
} |
| 1331 |
return null; |
| 708 |
} |
1332 |
} |
| 709 |
|
1333 |
|
| 710 |
final static class ComponentLabelProvider implements ILabelProvider { |
1334 |
final static class ComponentLabelProvider implements ILabelProvider { |
|
Lines 740-746
Link Here
|
| 740 |
public Image getImage(Object element) { |
1364 |
public Image getImage(Object element) { |
| 741 |
return null; |
1365 |
return null; |
| 742 |
} |
1366 |
} |
| 743 |
|
1367 |
|
| 744 |
public String getText(Object element) { |
1368 |
public String getText(Object element) { |
| 745 |
if (element instanceof Placeholder) { |
1369 |
if (element instanceof Placeholder) { |
| 746 |
return ((Placeholder) element).getText(); |
1370 |
return ((Placeholder) element).getText(); |
|
Lines 775-783
Link Here
|
| 775 |
|
1399 |
|
| 776 |
} |
1400 |
} |
| 777 |
|
1401 |
|
|
|
1402 |
private final class Placeholder { |
| 1403 |
private final String text; |
| 1404 |
|
| 1405 |
public Placeholder(String text) { |
| 1406 |
this.text = text; |
| 1407 |
} |
| 1408 |
|
| 1409 |
/* |
| 1410 |
* (non-Javadoc) |
| 1411 |
* |
| 1412 |
* @see java.lang.Object#equals(java.lang.Object) |
| 1413 |
*/ |
| 1414 |
public boolean equals(Object obj) { |
| 1415 |
if (obj == null) |
| 1416 |
return false; |
| 1417 |
if (!(obj instanceof Placeholder)) |
| 1418 |
return false; |
| 1419 |
|
| 1420 |
Placeholder that = (Placeholder) obj; |
| 1421 |
return this.text.equals(that.text); |
| 1422 |
} |
| 1423 |
|
| 1424 |
public String getText() { |
| 1425 |
return this.text; |
| 1426 |
} |
| 1427 |
} |
| 1428 |
|
| 778 |
public AbstractRepositoryQuery getQuery() { |
1429 |
public AbstractRepositoryQuery getQuery() { |
| 779 |
this.applyChanges(); |
1430 |
this.applyChanges(); |
| 780 |
issueAttributesPage.applyChanges(); |
|
|
| 781 |
if (isNew) { |
1431 |
if (isNew) { |
| 782 |
server.addLocalFilter(workingCopy); |
1432 |
server.addLocalFilter(workingCopy); |
| 783 |
} |
1433 |
} |