Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 139314 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/mylar/internal/jira/ui/wizards/FilterSummaryPage.java (-63 / +87 lines)
Lines 15-21 Link Here
15
import java.util.Iterator;
15
import java.util.Iterator;
16
import java.util.List;
16
import java.util.List;
17
17
18
import org.eclipse.jface.resource.ImageDescriptor;
19
import org.eclipse.jface.viewers.IColorProvider;
18
import org.eclipse.jface.viewers.IColorProvider;
20
import org.eclipse.jface.viewers.ILabelProvider;
19
import org.eclipse.jface.viewers.ILabelProvider;
21
import org.eclipse.jface.viewers.ILabelProviderListener;
20
import org.eclipse.jface.viewers.ILabelProviderListener;
Lines 35-40 Link Here
35
import org.eclipse.mylar.provisional.tasklist.MylarTaskListPlugin;
34
import org.eclipse.mylar.provisional.tasklist.MylarTaskListPlugin;
36
import org.eclipse.mylar.provisional.tasklist.TaskRepository;
35
import org.eclipse.mylar.provisional.tasklist.TaskRepository;
37
import org.eclipse.swt.SWT;
36
import org.eclipse.swt.SWT;
37
import org.eclipse.swt.custom.SashForm;
38
import org.eclipse.swt.events.FocusAdapter;
38
import org.eclipse.swt.events.FocusAdapter;
39
import org.eclipse.swt.events.FocusEvent;
39
import org.eclipse.swt.events.FocusEvent;
40
import org.eclipse.swt.events.ModifyEvent;
40
import org.eclipse.swt.events.ModifyEvent;
Lines 119-127 Link Here
119
	 * @param title
119
	 * @param title
120
	 * @param titleImage
120
	 * @param titleImage
121
	 */
121
	 */
122
	protected FilterSummaryPage(TaskRepository repository, String pageName, String title, ImageDescriptor titleImage,
122
	protected FilterSummaryPage(TaskRepository repository, FilterDefinition workingCopy, boolean isNew) {
123
			FilterDefinition workingCopy, boolean isNew) {
123
		super("summaryPage", "Filter Summary", null);
124
		super(pageName, title, titleImage);
125
		this.repository = repository;
124
		this.repository = repository;
126
125
127
		this.server = JiraServerFacade.getDefault().getJiraServer(repository);
126
		this.server = JiraServerFacade.getDefault().getJiraServer(repository);
Lines 132-140 Link Here
132
	}
131
	}
133
132
134
	public void createControl(Composite parent) {
133
	public void createControl(Composite parent) {
135
		GridData gd;
136
		Composite c = new Composite(parent, SWT.NONE);
134
		Composite c = new Composite(parent, SWT.NONE);
137
		c.setLayout(new GridLayout(3, false));
135
		c.setLayout(new GridLayout(5, false));
138
136
139
		Label lblName = new Label(c, SWT.NONE);
137
		Label lblName = new Label(c, SWT.NONE);
140
		final GridData gridData = new GridData();
138
		final GridData gridData = new GridData();
Lines 142-148 Link Here
142
		lblName.setText("Name:");
140
		lblName.setText("Name:");
143
141
144
		name = new Text(c, SWT.BORDER);
142
		name = new Text(c, SWT.BORDER);
145
		name.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
143
		name.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 4, 1));
146
		name.addModifyListener(new ModifyListener() {
144
		name.addModifyListener(new ModifyListener() {
147
145
148
			public void modifyText(ModifyEvent e) {
146
			public void modifyText(ModifyEvent e) {
Lines 160-166 Link Here
160
		lblDescription.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false));
158
		lblDescription.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false));
161
159
162
		description = new Text(c, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
160
		description = new Text(c, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
163
		gd = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
161
		GridData gd = new GridData(SWT.FILL, SWT.FILL, false, false, 4, 1);
164
		gd.heightHint = 40;
162
		gd.heightHint = 40;
165
		description.setLayoutData(gd);
163
		description.setLayoutData(gd);
166
		description.addFocusListener(new FocusAdapter() {
164
		description.addFocusListener(new FocusAdapter() {
Lines 172-209 Link Here
172
		});
170
		});
173
171
174
		{
172
		{
175
			Composite cc = new Composite(c, SWT.NONE);
173
			SashForm cc = new SashForm(c, SWT.HORIZONTAL);
176
			final GridData gridData_1 = new GridData(SWT.FILL, SWT.FILL, false, true, 3, 1);
174
			cc.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true, 5, 1));
177
			cc.setLayoutData(gridData_1);
178
			cc.setLayout(new GridLayout(4, false));
179
180
			Label lblProject = new Label(cc, SWT.NONE);
181
			lblProject.setText("Project:");
182
183
			Label lblFixFor = new Label(cc, SWT.NONE);
184
			lblFixFor.setText("Fix For:");
185
			lblFixFor.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false));
186
187
			Label lblComponent = new Label(cc, SWT.NONE);
188
			lblComponent.setText("In Components:");
189
			lblComponent.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false));
190
191
			Label lblReportedIn = new Label(cc, SWT.NONE);
192
			lblReportedIn.setText("Reported In:");
193
			lblReportedIn.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false));
194
195
			createProjectsViewer(cc);
196
			createFixForViewer(cc);
197
			createComponentsViewer(cc);
198
			createReportedInViewer(cc);
199
175
176
			{
177
				Composite comp = new Composite(cc, SWT.NONE);
178
				GridLayout gridLayout = new GridLayout(1, false);
179
				gridLayout.marginWidth = 0;
180
				gridLayout.marginHeight = 0;
181
				comp.setLayout(gridLayout);
182
				
183
				Label label = new Label(comp, SWT.NONE);
184
				label.setText("Project:");
185
				createProjectsViewer(comp);
186
			}
187
188
			{
189
				Composite comp = new Composite(cc, SWT.NONE);
190
				GridLayout gridLayout = new GridLayout(1, false);
191
				gridLayout.marginWidth = 0;
192
				gridLayout.marginHeight = 0;
193
				comp.setLayout(gridLayout);
194
				
195
				new Label(comp, SWT.NONE).setText("Fix For:");
196
				createFixForViewer(comp);
197
			}
198
199
			{
200
				Composite comp = new Composite(cc, SWT.NONE);
201
				GridLayout gridLayout = new GridLayout(1, false);
202
				gridLayout.marginWidth = 0;
203
				gridLayout.marginHeight = 0;
204
				comp.setLayout(gridLayout);
205
				
206
				new Label(comp, SWT.NONE).setText("In Components:");
207
				createComponentsViewer(comp);
208
			}
209
210
			{
211
				Composite comp = new Composite(cc, SWT.NONE);
212
				GridLayout gridLayout = new GridLayout(1, false);
213
				gridLayout.marginWidth = 0;
214
				gridLayout.marginHeight = 0;
215
				comp.setLayout(gridLayout);
216
217
				Label label = new Label(comp, SWT.NONE);
218
				label.setText("Reported In:");
219
				createReportedInViewer(comp);
220
			}
221
			// cc.setWeights(new int[] {1,1,1,1});
200
		}
222
		}
201
223
202
		Label lblQuery = new Label(c, SWT.NONE);
224
		Label lblQuery = new Label(c, SWT.NONE);
203
		lblQuery.setLayoutData(new GridData());
225
		lblQuery.setLayoutData(new GridData());
204
		lblQuery.setText("Query:");
226
		lblQuery.setText("Query:");
205
		queryString = new Text(c, SWT.BORDER);
227
		queryString = new Text(c, SWT.BORDER);
206
		queryString.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
228
		queryString.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 4, 1));
207
		// TODO put content assist here and a label describing what is available
229
		// TODO put content assist here and a label describing what is available
208
230
209
		queryString.addFocusListener(new FocusAdapter() {
231
		queryString.addFocusListener(new FocusAdapter() {
Lines 239-254 Link Here
239
			}
261
			}
240
262
241
		});
263
		});
242
		new Label(c, SWT.NONE);
243
244
		// Need to turn off validation here
245
		if (isNew) {
246
			loadFromDefaults();
247
		} else {
248
			loadFromWorkingCopy();
249
		}
250
251
		setControl(c);
252
264
253
		searchComments = new Button(c, SWT.CHECK);
265
		searchComments = new Button(c, SWT.CHECK);
254
		searchComments.setLayoutData(new GridData());
266
		searchComments.setLayoutData(new GridData());
Lines 262-268 Link Here
262
		});
274
		});
263
275
264
		searchEnvironment = new Button(c, SWT.CHECK);
276
		searchEnvironment = new Button(c, SWT.CHECK);
265
		searchEnvironment.setLayoutData(new GridData());
277
		searchEnvironment.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false));
266
		searchEnvironment.setText("Environment");
278
		searchEnvironment.setText("Environment");
267
		searchEnvironment.addSelectionListener(new SelectionAdapter() {
279
		searchEnvironment.addSelectionListener(new SelectionAdapter() {
268
280
Lines 271-282 Link Here
271
			}
283
			}
272
284
273
		});
285
		});
286
		
287
		// Need to turn off validation here
288
		if (isNew) {
289
			loadFromDefaults();
290
		} else {
291
			loadFromWorkingCopy();
292
		}
293
		
294
		setControl(c);
274
	}
295
	}
275
296
276
	public IWizardPage getNextPage() {
297
	public IWizardPage getNextPage() {
277
		if (issueAttributesPage == null) {
298
		if (issueAttributesPage == null) {
278
			issueAttributesPage = new IssueAttributesPage(repository, "issueAttributes", "Issue Attributes", null,
299
			issueAttributesPage = new IssueAttributesPage(repository, workingCopy, isNew);
279
					workingCopy, isNew);
280
			issueAttributesPage.setWizard(getWizard());
300
			issueAttributesPage.setWizard(getWizard());
281
		}
301
		}
282
302
Lines 284-294 Link Here
284
	}
304
	}
285
305
286
	private void createReportedInViewer(Composite c) {
306
	private void createReportedInViewer(Composite c) {
287
		GridData gd;
307
		reportedIn = new ListViewer(c, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.H_SCROLL);
288
		reportedIn = new ListViewer(c, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL);
308
		GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
289
		gd = new GridData(SWT.FILL, SWT.FILL, true, true);
309
		gridData.heightHint = 200;
290
		gd.heightHint = 40;
310
		gridData.widthHint = 80;
291
		reportedIn.getControl().setLayoutData(gd);
311
		reportedIn.getControl().setLayoutData(gridData);
292
312
293
		reportedIn.setContentProvider(new IStructuredContentProvider() {
313
		reportedIn.setContentProvider(new IStructuredContentProvider() {
294
			private Project project;
314
			private Project project;
Lines 327-337 Link Here
327
	}
347
	}
328
348
329
	private void createComponentsViewer(Composite c) {
349
	private void createComponentsViewer(Composite c) {
330
		GridData gd;
350
		components = new ListViewer(c, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.H_SCROLL);
331
		components = new ListViewer(c, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL);
351
		GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
332
		gd = new GridData(SWT.FILL, SWT.FILL, true, true);
352
		gridData.heightHint = 200;
333
		gd.heightHint = 40;
353
		gridData.widthHint = 80;
334
		components.getControl().setLayoutData(gd);
354
		components.getControl().setLayoutData(gridData);
335
355
336
		components.setContentProvider(new IStructuredContentProvider() {
356
		components.setContentProvider(new IStructuredContentProvider() {
337
			private Project project;
357
			private Project project;
Lines 362-372 Link Here
362
	}
382
	}
363
383
364
	private void createFixForViewer(Composite c) {
384
	private void createFixForViewer(Composite c) {
365
		GridData gd;
385
		fixFor = new ListViewer(c, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.H_SCROLL);
366
		fixFor = new ListViewer(c, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL);
386
		GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
367
		gd = new GridData(SWT.FILL, SWT.FILL, true, true);
387
		gridData.heightHint = 200;
368
		gd.heightHint = 40;
388
		gridData.widthHint = 80;
369
		fixFor.getControl().setLayoutData(gd);
389
		fixFor.getControl().setLayoutData(gridData);
370
390
371
		fixFor.setContentProvider(new IStructuredContentProvider() {
391
		fixFor.setContentProvider(new IStructuredContentProvider() {
372
			private Project project;
392
			private Project project;
Lines 405-412 Link Here
405
	}
425
	}
406
426
407
	private void createProjectsViewer(Composite c) {
427
	private void createProjectsViewer(Composite c) {
408
		project = new ListViewer(c, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER);
428
		project = new ListViewer(c, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.H_SCROLL);
409
		project.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
429
		GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
430
		gridData.heightHint = 200;
431
		gridData.widthHint = 120;
432
		project.getControl().setLayoutData(gridData);
433
		
410
		project.setContentProvider(new IStructuredContentProvider() {
434
		project.setContentProvider(new IStructuredContentProvider() {
411
435
412
			public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
436
			public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
(-)src/org/eclipse/mylar/internal/jira/ui/wizards/EditJiraQueryWizard.java (+1 lines)
Lines 27-32 Link Here
27
27
28
	public EditJiraQueryWizard(TaskRepository repository, AbstractRepositoryQuery query) {
28
	public EditJiraQueryWizard(TaskRepository repository, AbstractRepositoryQuery query) {
29
		super(repository, query);
29
		super(repository, query);
30
		setForcePreviousAndNextButtons(true);
30
//		this.repository = repository;
31
//		this.repository = repository;
31
//		this.query = query;
32
//		this.query = query;
32
//		setNeedsProgressMonitor(true);
33
//		setNeedsProgressMonitor(true);
(-)src/org/eclipse/mylar/internal/jira/ui/wizards/IssueAttributesPage.java (-9 / +2 lines)
Lines 15-21 Link Here
15
import java.util.Iterator;
15
import java.util.Iterator;
16
import java.util.List;
16
import java.util.List;
17
17
18
import org.eclipse.jface.resource.ImageDescriptor;
19
import org.eclipse.jface.viewers.ComboViewer;
18
import org.eclipse.jface.viewers.ComboViewer;
20
import org.eclipse.jface.viewers.ISelectionChangedListener;
19
import org.eclipse.jface.viewers.ISelectionChangedListener;
21
import org.eclipse.jface.viewers.IStructuredContentProvider;
20
import org.eclipse.jface.viewers.IStructuredContentProvider;
Lines 118-127 Link Here
118
	 * @param titleImage
117
	 * @param titleImage
119
	 * @param server
118
	 * @param server
120
	 */
119
	 */
121
	protected IssueAttributesPage(TaskRepository repository, String pageName, String title, ImageDescriptor titleImage,
120
	protected IssueAttributesPage(TaskRepository repository, FilterDefinition workingCopy, boolean isNew) {
122
			FilterDefinition workingCopy, boolean isNew) {
121
		super("issueAttributes", "Issue Attributes", null);
123
		super(pageName, title, titleImage);
124
//		this.repository = repository;
125
		this.jiraServer = JiraServerFacade.getDefault().getJiraServer(repository);
122
		this.jiraServer = JiraServerFacade.getDefault().getJiraServer(repository);
126
		this.workingCopy = workingCopy;
123
		this.workingCopy = workingCopy;
127
		this.isNew = isNew;
124
		this.isNew = isNew;
Lines 277-295 Link Here
277
274
278
			Label lblIssueType = new Label(c, SWT.NONE);
275
			Label lblIssueType = new Label(c, SWT.NONE);
279
			lblIssueType.setText("Type:");
276
			lblIssueType.setText("Type:");
280
			lblIssueType.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
281
277
282
			Label lblStatus = new Label(c, SWT.NONE);
278
			Label lblStatus = new Label(c, SWT.NONE);
283
			lblStatus.setText("Status:");
279
			lblStatus.setText("Status:");
284
			lblStatus.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
285
280
286
			Label lblResolution = new Label(c, SWT.NONE);
281
			Label lblResolution = new Label(c, SWT.NONE);
287
			lblResolution.setText("Resolution:");
282
			lblResolution.setText("Resolution:");
288
			lblResolution.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
289
283
290
			Label lblPriority = new Label(c, SWT.NONE);
284
			Label lblPriority = new Label(c, SWT.NONE);
291
			lblPriority.setText("Priority:");
285
			lblPriority.setText("Priority:");
292
			lblPriority.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
293
			
286
			
294
			issueType = new ListViewer(c, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL);
287
			issueType = new ListViewer(c, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL);
295
			gd = new GridData(SWT.FILL, SWT.FILL, true, true);
288
			gd = new GridData(SWT.FILL, SWT.FILL, true, true);
(-)src/org/eclipse/mylar/internal/jira/ui/wizards/JiraQueryWizardPage.java (-9 / +12 lines)
Lines 76-86 Link Here
76
	private AbstractRepositoryQuery query;
76
	private AbstractRepositoryQuery query;
77
77
78
	public JiraQueryWizardPage(TaskRepository repository) {
78
	public JiraQueryWizardPage(TaskRepository repository) {
79
		super(TITLE);
79
		this(repository, null);
80
		this.repository = repository;
81
		setTitle(TITLE);
82
		setDescription(DESCRIPTION);
83
		setPageComplete(false);
84
	}
80
	}
85
81
86
	public JiraQueryWizardPage(TaskRepository repository, AbstractRepositoryQuery query) {
82
	public JiraQueryWizardPage(TaskRepository repository, AbstractRepositoryQuery query) {
Lines 157-167 Link Here
157
			return null;
153
			return null;
158
		}
154
		}
159
		if (filterSummaryPage == null) {
155
		if (filterSummaryPage == null) {
160
			FilterDefinition workingCopy = new FilterDefinition();
156
			FilterDefinition workingCopy;
161
			boolean isAdd = true;
157
			boolean isNew;
158
			if(query instanceof JiraCustomQuery) {
159
				workingCopy = ((JiraCustomQuery) query).getFilterDefinition();
160
				isNew = false;
161
			} else {
162
				workingCopy = new FilterDefinition();
163
				isNew = true;
164
			}
162
165
163
			filterSummaryPage = new FilterSummaryPage(repository, "summaryPage", "Filter Summary", null, workingCopy,
166
			filterSummaryPage = new FilterSummaryPage(repository, workingCopy, isNew);
164
					isAdd);
165
			filterSummaryPage.setWizard(getWizard());
167
			filterSummaryPage.setWizard(getWizard());
166
		}
168
		}
167
		return filterSummaryPage;
169
		return filterSummaryPage;
Lines 220-225 Link Here
220
		}
222
		}
221
223
222
		filterCombo.select(n);
224
		filterCombo.select(n);
225
		filterCombo.showSelection();
223
		setPageComplete(true);
226
		setPageComplete(true);
224
	}
227
	}
225
228

Return to bug 139314