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 187602
Collapse All | Expand All

(-)src/org/eclipse/mylar/tasks/ui/editors/AbstractNewRepositoryTaskEditor.java (-62 / +102 lines)
Lines 35-40 Link Here
35
import org.eclipse.mylar.tasks.core.TaskCategory;
35
import org.eclipse.mylar.tasks.core.TaskCategory;
36
import org.eclipse.mylar.tasks.core.TaskList;
36
import org.eclipse.mylar.tasks.core.TaskList;
37
import org.eclipse.mylar.tasks.core.UncategorizedCategory;
37
import org.eclipse.mylar.tasks.core.UncategorizedCategory;
38
import org.eclipse.mylar.tasks.ui.AbstractDuplicateDetector;
38
import org.eclipse.mylar.tasks.ui.DatePicker;
39
import org.eclipse.mylar.tasks.ui.DatePicker;
39
import org.eclipse.mylar.tasks.ui.TasksUiPlugin;
40
import org.eclipse.mylar.tasks.ui.TasksUiPlugin;
40
import org.eclipse.mylar.tasks.ui.search.SearchHitCollector;
41
import org.eclipse.mylar.tasks.ui.search.SearchHitCollector;
Lines 78-89 Link Here
78
79
79
	private static final String LABEL_SEARCH_DUPS = "Search for Duplicates";
80
	private static final String LABEL_SEARCH_DUPS = "Search for Duplicates";
80
81
81
	private static final String ERROR_CREATING_BUG_REPORT = "Error creating bug report";
82
	private static final String LABEL_SELECT_DETECTOR = "Select duplicate detector:";
82
83
83
	private static final String NO_STACK_MESSAGE = "Unable to locate a stack trace in the description text.\nDuplicate search currently only supports stack trace matching.";
84
	private static final String ERROR_CREATING_BUG_REPORT = "Error creating bug report";
84
85
85
	protected Button searchForDuplicates;
86
	protected Button searchForDuplicates;
86
87
88
	protected CCombo duplicateDetectorChooser;
89
90
	protected Label duplicateDetectorLabel;
91
87
	protected DatePicker scheduledForDate;
92
	protected DatePicker scheduledForDate;
88
93
89
	protected Spinner estimatedTime;
94
	protected Spinner estimatedTime;
Lines 110-116 Link Here
110
		newSummary = taskData.getSummary();
115
		newSummary = taskData.getSummary();
111
		repository = editorInput.getRepository();
116
		repository = editorInput.getRepository();
112
		connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(repository.getKind());
117
		connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(repository.getKind());
113
		isDirty = false;		
118
		isDirty = false;
114
	}
119
	}
115
120
116
	@Override
121
	@Override
Lines 265-316 Link Here
265
		// ignore
270
		// ignore
266
	}
271
	}
267
272
268
	public String getStackTraceFromDescription() {
269
		String description = descriptionTextViewer.getTextWidget().getText().trim();
270
		String stackTrace = null;
271
272
		if (description == null) {
273
			return null;
274
		}
275
276
		String punct = "!\"#$%&'\\(\\)*+,-./:;\\<=\\>?@\\[\\]^_`\\{|\\}~\n";
277
		String lineRegex = " *at\\s+[\\w" + punct + "]+ ?\\(.*\\) *\n?";
278
		Pattern tracePattern = Pattern.compile(lineRegex);
279
		Matcher match = tracePattern.matcher(description);
280
281
		if (match.find()) {
282
			// record the index of the first stack trace line
283
			int start = match.start();
284
			int lastEnd = match.end();
285
286
			// find the last stack trace line
287
			while (match.find()) {
288
				lastEnd = match.end();
289
			}
290
291
			// make sure there's still room to find the exception
292
			if (start <= 0) {
293
				return null;
294
			}
295
296
			// count back to the line before the stack trace to find the
297
			// exception
298
			int stackStart = 0;
299
			int index = start - 1;
300
			while (index > 1 && description.charAt(index) == ' ') {
301
				index--;
302
			}
303
304
			// locate the exception line index
305
			stackStart = description.substring(0, index - 1).lastIndexOf("\n");
306
			stackStart = (stackStart == -1) ? 0 : stackStart + 1;
307
308
			stackTrace = description.substring(stackStart, lastEnd);
309
		}
310
311
		return stackTrace;
312
	}
313
314
	@Override
273
	@Override
315
	protected void updateTask() {
274
	protected void updateTask() {
316
		taskData.setSummary(newSummary);
275
		taskData.setSummary(newSummary);
Lines 324-331 Link Here
324
	protected class DescriptionListener implements Listener {
283
	protected class DescriptionListener implements Listener {
325
		public void handleEvent(Event event) {
284
		public void handleEvent(Event event) {
326
			fireSelectionChanged(new SelectionChangedEvent(selectionProvider, new StructuredSelection(
285
			fireSelectionChanged(new SelectionChangedEvent(selectionProvider, new StructuredSelection(
327
					new RepositoryTaskSelection(taskData.getId(), taskData.getRepositoryUrl(), taskData.getRepositoryKind(), "New Description",
286
					new RepositoryTaskSelection(taskData.getId(), taskData.getRepositoryUrl(), taskData
328
							false, taskData.getSummary()))));
287
							.getRepositoryKind(), "New Description", false, taskData.getSummary()))));
329
		}
288
		}
330
	}
289
	}
331
290
Lines 432-439 Link Here
432
	protected void addActionButtons(Composite buttonComposite) {
391
	protected void addActionButtons(Composite buttonComposite) {
433
		FormToolkit toolkit = new FormToolkit(buttonComposite.getDisplay());
392
		FormToolkit toolkit = new FormToolkit(buttonComposite.getDisplay());
434
393
435
		SearchHitCollector collector = getDuplicateSearchCollector("");
394
		List<AbstractDuplicateDetector> allCollectors = getDuplicateSearchCollectorsList();
436
		if (collector != null) {
395
		if (allCollectors != null) {
396
			duplicateDetectorLabel = new Label(buttonComposite, SWT.LEFT);
397
			duplicateDetectorLabel.setText(LABEL_SELECT_DETECTOR);
398
399
			duplicateDetectorChooser = new CCombo(buttonComposite, SWT.FLAT | SWT.READ_ONLY | SWT.BORDER);
400
401
			duplicateDetectorChooser.setLayoutData(GridDataFactory.swtDefaults().hint(150, SWT.DEFAULT).create());
402
			duplicateDetectorChooser.setFont(TEXT_FONT);
403
404
			Collections.sort(allCollectors, new Comparator<AbstractDuplicateDetector>() {
405
406
				public int compare(AbstractDuplicateDetector c1, AbstractDuplicateDetector c2) {
407
					return c1.getName().compareToIgnoreCase(c2.getName());
408
				}
409
410
			});
411
412
			for (AbstractDuplicateDetector detector : allCollectors) {
413
				duplicateDetectorChooser.add(detector.getName());
414
			}
415
416
			duplicateDetectorChooser.select(0);
417
			duplicateDetectorChooser.setEnabled(true);
418
			duplicateDetectorChooser.setData(allCollectors);
419
		}
420
421
		if (allCollectors != null && allCollectors.size() > 0) {
437
422
438
			searchForDuplicates = toolkit.createButton(buttonComposite, LABEL_SEARCH_DUPS, SWT.NONE);
423
			searchForDuplicates = toolkit.createButton(buttonComposite, LABEL_SEARCH_DUPS, SWT.NONE);
439
			GridData searchDuplicatesButtonData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
424
			GridData searchDuplicatesButtonData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
Lines 444-450 Link Here
444
				}
429
				}
445
			});
430
			});
446
		}
431
		}
447
		
432
433
		Label spacer = new Label(buttonComposite, SWT.NULL);
434
		spacer.setText("");
435
448
		submitButton = toolkit.createButton(buttonComposite, LABEL_CREATE, SWT.NONE);
436
		submitButton = toolkit.createButton(buttonComposite, LABEL_CREATE, SWT.NONE);
449
		GridData submitButtonData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
437
		GridData submitButtonData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
450
		submitButton.setLayoutData(submitButtonData);
438
		submitButton.setLayoutData(submitButtonData);
Lines 491-502 Link Here
491
479
492
	public boolean searchForDuplicates() {
480
	public boolean searchForDuplicates() {
493
481
494
		String stackTrace = getStackTraceFromDescription();
482
		String duplicateDetectorName = duplicateDetectorChooser.getItem(duplicateDetectorChooser.getSelectionIndex());
495
		if (stackTrace == null) {
483
496
			MessageDialog.openWarning(null, "No Stack Trace Found", NO_STACK_MESSAGE);
484
		// updatetask() needs to be called so that the description text is save before we
497
			return false;
485
		// search for duplicates
498
		}
486
		this.updateTask();
499
		SearchHitCollector collector = getDuplicateSearchCollector(stackTrace);
487
488
		SearchHitCollector collector = getDuplicateSearchCollector(duplicateDetectorName);
500
		if (collector != null) {
489
		if (collector != null) {
501
			NewSearchUI.runQueryInBackground(collector);
490
			NewSearchUI.runQueryInBackground(collector);
502
			return true;
491
			return true;
Lines 541-552 Link Here
541
		return newTask;
530
		return newTask;
542
	}
531
	}
543
532
544
	protected abstract SearchHitCollector getDuplicateSearchCollector(String description);
533
	protected abstract SearchHitCollector getDuplicateSearchCollector(String name);
534
535
	protected List<AbstractDuplicateDetector> getDuplicateSearchCollectorsList() {
536
		return TasksUiPlugin.getDefault().getDuplicateSearchCollectorsList();
537
	}
545
538
546
	@Override
539
	@Override
547
	public void doSave(IProgressMonitor monitor) {
540
	public void doSave(IProgressMonitor monitor) {
548
		new MessageDialog(null, "Operation not supported", null, "Save of un-submitted new tasks is not currently supported.\nPlease submit all new tasks.", MessageDialog.INFORMATION, new String[] { IDialogConstants.OK_LABEL }, 0).open();
541
		new MessageDialog(null, "Operation not supported", null,
542
				"Save of un-submitted new tasks is not currently supported.\nPlease submit all new tasks.",
543
				MessageDialog.INFORMATION, new String[] { IDialogConstants.OK_LABEL }, 0).open();
549
		monitor.setCanceled(true);
544
		monitor.setCanceled(true);
550
		return;
545
		return;
551
	}
546
	}
547
548
	public static String getStackTraceFromDescription(String description) {
549
		String stackTrace = null;
550
551
		if (description == null) {
552
			return null;
553
		}
554
555
		String punct = "!\"#$%&'\\(\\)*+,-./:;\\<=\\>?@\\[\\]^_`\\{|\\}~\n";
556
		String lineRegex = " *at\\s+[\\w" + punct + "]+ ?\\(.*\\) *\n?";
557
		Pattern tracePattern = Pattern.compile(lineRegex);
558
		Matcher match = tracePattern.matcher(description);
559
560
		if (match.find()) {
561
			// record the index of the first stack trace line
562
			int start = match.start();
563
			int lastEnd = match.end();
564
565
			// find the last stack trace line
566
			while (match.find()) {
567
				lastEnd = match.end();
568
			}
569
570
			// make sure there's still room to find the exception
571
			if (start <= 0) {
572
				return null;
573
			}
574
575
			// count back to the line before the stack trace to find the
576
			// exception
577
			int stackStart = 0;
578
			int index = start - 1;
579
			while (index > 1 && description.charAt(index) == ' ') {
580
				index--;
581
			}
582
583
			// locate the exception line index
584
			stackStart = description.substring(0, index - 1).lastIndexOf("\n");
585
			stackStart = (stackStart == -1) ? 0 : stackStart + 1;
586
587
			stackTrace = description.substring(stackStart, lastEnd);
588
		}
589
590
		return stackTrace;
591
	}
552
}
592
}
(-).refactorings/2007/5/21/refactorings.history (-1 / +6 lines)
Lines 1-9 Link Here
1
<?xml version="1.0" encoding="utf-8" standalone="no"?>
1
<?xml version="1.0" encoding="utf-8"?>
2
<session version="1.0">
2
<session version="1.0">
3
<refactoring comment="Rename field 'DELAY_REFRESH' in 'org.eclipse.mylar.internal.tasks.ui.views.AdaptiveRefreshPolicy' to 'refreshDelay'&#13;&#10;- Original project: 'org.eclipse.mylar.tasks.ui'&#13;&#10;- Original element: 'org.eclipse.mylar.internal.tasks.ui.views.AdaptiveRefreshPolicy.DELAY_REFRESH'&#13;&#10;- Renamed element: 'org.eclipse.mylar.internal.tasks.ui.views.AdaptiveRefreshPolicy.refreshDelay'&#13;&#10;- Update references to refactored element&#13;&#10;- Update textual occurrences in comments and strings" delegate="false" deprecate="false" description="Rename field 'DELAY_REFRESH'" flags="589826" getter="false" id="org.eclipse.jdt.ui.rename.field" input="/src&lt;org.eclipse.mylar.internal.tasks.ui.views{AdaptiveRefreshPolicy.java[AdaptiveRefreshPolicy^DELAY_REFRESH" name="refreshDelay" references="true" setter="false" stamp="1179777278867" textual="false" version="1.0"/>
3
<refactoring comment="Rename field 'DELAY_REFRESH' in 'org.eclipse.mylar.internal.tasks.ui.views.AdaptiveRefreshPolicy' to 'refreshDelay'&#13;&#10;- Original project: 'org.eclipse.mylar.tasks.ui'&#13;&#10;- Original element: 'org.eclipse.mylar.internal.tasks.ui.views.AdaptiveRefreshPolicy.DELAY_REFRESH'&#13;&#10;- Renamed element: 'org.eclipse.mylar.internal.tasks.ui.views.AdaptiveRefreshPolicy.refreshDelay'&#13;&#10;- Update references to refactored element&#13;&#10;- Update textual occurrences in comments and strings" delegate="false" deprecate="false" description="Rename field 'DELAY_REFRESH'" flags="589826" getter="false" id="org.eclipse.jdt.ui.rename.field" input="/src&lt;org.eclipse.mylar.internal.tasks.ui.views{AdaptiveRefreshPolicy.java[AdaptiveRefreshPolicy^DELAY_REFRESH" name="refreshDelay" references="true" setter="false" stamp="1179777278867" textual="false" version="1.0"/>
4
<refactoring comment="Rename field 'refreshDelay' in 'org.eclipse.mylar.internal.tasks.ui.views.AdaptiveRefreshPolicy' to 'refreshThreshold'&#13;&#10;- Original project: 'org.eclipse.mylar.tasks.ui'&#13;&#10;- Original element: 'org.eclipse.mylar.internal.tasks.ui.views.AdaptiveRefreshPolicy.refreshDelay'&#13;&#10;- Renamed element: 'org.eclipse.mylar.internal.tasks.ui.views.AdaptiveRefreshPolicy.refreshThreshold'&#13;&#10;- Update references to refactored element&#13;&#10;- Update textual occurrences in comments and strings" delegate="false" deprecate="false" description="Rename field 'refreshDelay'" flags="589826" getter="false" id="org.eclipse.jdt.ui.rename.field" input="/src&lt;org.eclipse.mylar.internal.tasks.ui.views{AdaptiveRefreshPolicy.java[AdaptiveRefreshPolicy^refreshDelay" name="refreshThreshold" references="true" setter="false" stamp="1179777303961" textual="false" version="1.0"/>
4
<refactoring comment="Rename field 'refreshDelay' in 'org.eclipse.mylar.internal.tasks.ui.views.AdaptiveRefreshPolicy' to 'refreshThreshold'&#13;&#10;- Original project: 'org.eclipse.mylar.tasks.ui'&#13;&#10;- Original element: 'org.eclipse.mylar.internal.tasks.ui.views.AdaptiveRefreshPolicy.refreshDelay'&#13;&#10;- Renamed element: 'org.eclipse.mylar.internal.tasks.ui.views.AdaptiveRefreshPolicy.refreshThreshold'&#13;&#10;- Update references to refactored element&#13;&#10;- Update textual occurrences in comments and strings" delegate="false" deprecate="false" description="Rename field 'refreshDelay'" flags="589826" getter="false" id="org.eclipse.jdt.ui.rename.field" input="/src&lt;org.eclipse.mylar.internal.tasks.ui.views{AdaptiveRefreshPolicy.java[AdaptiveRefreshPolicy^refreshDelay" name="refreshThreshold" references="true" setter="false" stamp="1179777303961" textual="false" version="1.0"/>
5
<<<<<<< refactorings.history
6
<refactoring accessors="true" comment="Delete 1 element(s) from project 'org.eclipse.mylar.tasks.ui'&#13;&#10;- Original project: 'org.eclipse.mylar.tasks.ui'&#13;&#10;- Original element: 'duplicateDetectors.exsd'" description="Delete element" element1="schema/duplicateDetectors.exsd" elements="0" flags="589830" id="org.eclipse.jdt.ui.delete" resources="1" stamp="1179853414515" subPackages="false" version="1.0"/>
7
<refactoring accessors="true" comment="Delete 1 element(s) from project 'org.eclipse.mylar.tasks.ui'&#13;&#10;- Original project: 'org.eclipse.mylar.tasks.ui'&#13;&#10;- Original element: 'org.eclipse.mylar.tasks.ui.IMylarDuplicateDetector.java'" description="Delete element" element1="/src&lt;org.eclipse.mylar.tasks.ui{IMylarDuplicateDetector.java" elements="1" flags="589830" id="org.eclipse.jdt.ui.delete" resources="0" stamp="1180119748828" subPackages="false" version="1.0"/>
8
=======
5
<refactoring comment="Move 1 elements(s) to 'ovr16'&#13;&#10;- Original project: 'org.eclipse.mylar.tasks.ui'&#13;&#10;- Destination element: 'ovr16'&#13;&#10;- Original element: 'overlay-warning.gif'" description="Move file" element1="icons/eview16/overlay-warning.gif" files="1" flags="589830" folders="0" id="org.eclipse.jdt.ui.move" policy="org.eclipse.jdt.ui.moveResources" qualified="false" references="true" stamp="1179936680240" target="/org.eclipse.mylar.tasks.ui/icons/ovr16" units="0" version="1.0"/>
9
<refactoring comment="Move 1 elements(s) to 'ovr16'&#13;&#10;- Original project: 'org.eclipse.mylar.tasks.ui'&#13;&#10;- Destination element: 'ovr16'&#13;&#10;- Original element: 'overlay-warning.gif'" description="Move file" element1="icons/eview16/overlay-warning.gif" files="1" flags="589830" folders="0" id="org.eclipse.jdt.ui.move" policy="org.eclipse.jdt.ui.moveResources" qualified="false" references="true" stamp="1179936680240" target="/org.eclipse.mylar.tasks.ui/icons/ovr16" units="0" version="1.0"/>
6
<refactoring comment="Rename type 'org.eclipse.mylar.internal.tasks.ui.views.TaskListTableLabelProvider' to 'TaskTableLabelProvider'&#13;&#10;- Original project: 'org.eclipse.mylar.tasks.ui'&#13;&#10;- Original element: 'org.eclipse.mylar.internal.tasks.ui.views.TaskListTableLabelProvider'&#13;&#10;- Renamed element: 'org.eclipse.mylar.internal.tasks.ui.views.TaskTableLabelProvider'&#13;&#10;- Update references to refactored element&#13;&#10;- Update fully qualified names in '*.xml, *.properties, *.exsd' files&#13;&#10;- Update textual occurrences in comments and strings" description="Rename type 'TaskListTableLabelProvider'" flags="589830" id="org.eclipse.jdt.ui.rename.type" input="/src&lt;org.eclipse.mylar.internal.tasks.ui.views{TaskListTableLabelProvider.java[TaskListTableLabelProvider" matchStrategy="1" name="TaskTableLabelProvider" patterns="*.xml, *.properties, *.exsd" qualified="true" references="true" similarDeclarations="false" stamp="1179936811208" textual="false" version="1.0"/>
10
<refactoring comment="Rename type 'org.eclipse.mylar.internal.tasks.ui.views.TaskListTableLabelProvider' to 'TaskTableLabelProvider'&#13;&#10;- Original project: 'org.eclipse.mylar.tasks.ui'&#13;&#10;- Original element: 'org.eclipse.mylar.internal.tasks.ui.views.TaskListTableLabelProvider'&#13;&#10;- Renamed element: 'org.eclipse.mylar.internal.tasks.ui.views.TaskTableLabelProvider'&#13;&#10;- Update references to refactored element&#13;&#10;- Update fully qualified names in '*.xml, *.properties, *.exsd' files&#13;&#10;- Update textual occurrences in comments and strings" description="Rename type 'TaskListTableLabelProvider'" flags="589830" id="org.eclipse.jdt.ui.rename.type" input="/src&lt;org.eclipse.mylar.internal.tasks.ui.views{TaskListTableLabelProvider.java[TaskListTableLabelProvider" matchStrategy="1" name="TaskTableLabelProvider" patterns="*.xml, *.properties, *.exsd" qualified="true" references="true" similarDeclarations="false" stamp="1179936811208" textual="false" version="1.0"/>
7
<refactoring comment="Rename method 'org.eclipse.mylar.tasks.ui.SynchronizeQueryJob.setSynchTasks(...)' to 'setSynchChangedTasks'&#13;&#10;- Original project: 'org.eclipse.mylar.tasks.ui'&#13;&#10;- Original element: 'org.eclipse.mylar.tasks.ui.SynchronizeQueryJob.setSynchTasks(...)'&#13;&#10;- Renamed element: 'org.eclipse.mylar.tasks.ui.SynchronizeQueryJob.setSynchChangedTasks(...)'&#13;&#10;- Update references to refactored element" delegate="false" deprecate="false" description="Rename method 'setSynchTasks'" flags="589830" id="org.eclipse.jdt.ui.rename.method" input="/src&lt;org.eclipse.mylar.tasks.ui{SynchronizeQueryJob.java[SynchronizeQueryJob~setSynchTasks~Z" name="setSynchChangedTasks" references="true" stamp="1180029019703" version="1.0"/>
11
<refactoring comment="Rename method 'org.eclipse.mylar.tasks.ui.SynchronizeQueryJob.setSynchTasks(...)' to 'setSynchChangedTasks'&#13;&#10;- Original project: 'org.eclipse.mylar.tasks.ui'&#13;&#10;- Original element: 'org.eclipse.mylar.tasks.ui.SynchronizeQueryJob.setSynchTasks(...)'&#13;&#10;- Renamed element: 'org.eclipse.mylar.tasks.ui.SynchronizeQueryJob.setSynchChangedTasks(...)'&#13;&#10;- Update references to refactored element" delegate="false" deprecate="false" description="Rename method 'setSynchTasks'" flags="589830" id="org.eclipse.jdt.ui.rename.method" input="/src&lt;org.eclipse.mylar.tasks.ui{SynchronizeQueryJob.java[SynchronizeQueryJob~setSynchTasks~Z" name="setSynchChangedTasks" references="true" stamp="1180029019703" version="1.0"/>
8
<refactoring comment="Extract method 'private void addHitsToPrime(TaskRepository repository,List&lt;AbstractQueryHit&gt; hits)' from 'org.eclipse.mylar.tasks.ui.SynchronizeQueryJob.run()' to 'org.eclipse.mylar.tasks.ui.SynchronizeQueryJob'&#13;&#10;- Original project: 'org.eclipse.mylar.tasks.ui'&#13;&#10;- Method name: 'addHitsToPrime'&#13;&#10;- Destination type: 'org.eclipse.mylar.tasks.ui.SynchronizeQueryJob'&#13;&#10;- Declared visibility: 'private'" comments="false" description="Extract method 'addHitsToPrime'" destination="0" exceptions="false" flags="786434" id="org.eclipse.jdt.ui.extract.method" input="/src&lt;org.eclipse.mylar.tasks.ui{SynchronizeQueryJob.java" name="addHitsToPrime" replace="false" selection="4879 607" stamp="1180029977125" version="1.0" visibility="2"/>
12
<refactoring comment="Extract method 'private void addHitsToPrime(TaskRepository repository,List&lt;AbstractQueryHit&gt; hits)' from 'org.eclipse.mylar.tasks.ui.SynchronizeQueryJob.run()' to 'org.eclipse.mylar.tasks.ui.SynchronizeQueryJob'&#13;&#10;- Original project: 'org.eclipse.mylar.tasks.ui'&#13;&#10;- Method name: 'addHitsToPrime'&#13;&#10;- Destination type: 'org.eclipse.mylar.tasks.ui.SynchronizeQueryJob'&#13;&#10;- Declared visibility: 'private'" comments="false" description="Extract method 'addHitsToPrime'" destination="0" exceptions="false" flags="786434" id="org.eclipse.jdt.ui.extract.method" input="/src&lt;org.eclipse.mylar.tasks.ui{SynchronizeQueryJob.java" name="addHitsToPrime" replace="false" selection="4879 607" stamp="1180029977125" version="1.0" visibility="2"/>
13
>>>>>>> 1.3
9
</session>
14
</session>
(-).refactorings/2007/5/21/refactorings.index (+5 lines)
Lines 1-6 Link Here
1
1179777278867	Rename field 'DELAY_REFRESH'
1
1179777278867	Rename field 'DELAY_REFRESH'
2
1179777303961	Rename field 'refreshDelay'
2
1179777303961	Rename field 'refreshDelay'
3
<<<<<<< refactorings.index
4
1179853414515	Delete element
5
1180119748828	Delete element
6
=======
3
1179936680240	Move file
7
1179936680240	Move file
4
1179936811208	Rename type 'TaskListTableLabelProvider'
8
1179936811208	Rename type 'TaskListTableLabelProvider'
5
1180029019703	Rename method 'setSynchTasks'
9
1180029019703	Rename method 'setSynchTasks'
6
1180029977125	Extract method 'addHitsToPrime'
10
1180029977125	Extract method 'addHitsToPrime'
11
>>>>>>> 1.3
(-)plugin.xml (-2 / +2 lines)
Lines 5-10 Link Here
5
    <extension-point id="repositories" name="Task Repositories" schema="schema/repositories.exsd"/>
5
    <extension-point id="repositories" name="Task Repositories" schema="schema/repositories.exsd"/>
6
    <extension-point id="editors" name="Task Editors" schema="schema/editors.exsd"/>
6
    <extension-point id="editors" name="Task Editors" schema="schema/editors.exsd"/>
7
    <extension-point id="projectLinkProviders" name="Linking Provider from Project to the Task Repository" schema="schema/projectLinkProviders.exsd"/>
7
    <extension-point id="projectLinkProviders" name="Linking Provider from Project to the Task Repository" schema="schema/projectLinkProviders.exsd"/>
8
    <extension-point id="duplicateDetectors" name="duplicateDetectors" schema="schema/duplicateDetectors.exsd"/>
8
9
9
	<!--
10
	<!--
10
    <extension
11
    <extension
Lines 840-847 Link Here
840
          class="org.eclipse.mylar.internal.tasks.ui.workingset.TaskElementFactory"
841
          class="org.eclipse.mylar.internal.tasks.ui.workingset.TaskElementFactory"
841
          id="org.eclipse.mylar.tasks.ui.elementFactory">
842
          id="org.eclipse.mylar.tasks.ui.elementFactory">
842
    </factory>
843
    </factory>
843
 </extension>
844
</extension>
844
   
845
</plugin>
845
</plugin>
846
846
847
   <!--
847
   <!--
(-)src/org/eclipse/mylar/tasks/ui/search/SearchHitCollector.java (+10 lines)
Lines 43-48 Link Here
43
public class SearchHitCollector extends QueryHitCollector implements ISearchQuery {
43
public class SearchHitCollector extends QueryHitCollector implements ISearchQuery {
44
44
45
	private static final String QUERYING_REPOSITORY = "Querying Repository...";
45
	private static final String QUERYING_REPOSITORY = "Querying Repository...";
46
	
47
	private String type;
46
48
47
	private TaskRepository repository;
49
	private TaskRepository repository;
48
50
Lines 118-124 Link Here
118
	public String getLabel() {
120
	public String getLabel() {
119
		return QUERYING_REPOSITORY;
121
		return QUERYING_REPOSITORY;
120
	}
122
	}
123
	
124
	public String getTypeLabel() {
125
		return type;
126
	}
121
127
128
	public void setTypeLabel(String type) {
129
		this.type = type;
130
	}
131
	
122
	public boolean canRerun() {
132
	public boolean canRerun() {
123
		return true;
133
		return true;
124
	}
134
	}
(-)src/org/eclipse/mylar/internal/tasks/ui/util/TasksUiExtensionReader.java (-31 / +69 lines)
Lines 27-32 Link Here
27
import org.eclipse.mylar.tasks.core.AbstractRepositoryConnector;
27
import org.eclipse.mylar.tasks.core.AbstractRepositoryConnector;
28
import org.eclipse.mylar.tasks.core.ITaskListExternalizer;
28
import org.eclipse.mylar.tasks.core.ITaskListExternalizer;
29
import org.eclipse.mylar.tasks.core.RepositoryTemplate;
29
import org.eclipse.mylar.tasks.core.RepositoryTemplate;
30
import org.eclipse.mylar.tasks.ui.AbstractDuplicateDetector;
30
import org.eclipse.mylar.tasks.ui.AbstractRepositoryConnectorUi;
31
import org.eclipse.mylar.tasks.ui.AbstractRepositoryConnectorUi;
31
import org.eclipse.mylar.tasks.ui.AbstractTaskRepositoryLinkProvider;
32
import org.eclipse.mylar.tasks.ui.AbstractTaskRepositoryLinkProvider;
32
import org.eclipse.mylar.tasks.ui.TasksUiPlugin;
33
import org.eclipse.mylar.tasks.ui.TasksUiPlugin;
Lines 53-59 Link Here
53
	public static final String ELMNT_TMPL_URLREPOSITORY = "urlRepository";
54
	public static final String ELMNT_TMPL_URLREPOSITORY = "urlRepository";
54
55
55
	public static final String ELMNT_TMPL_REPOSITORYKIND = "repositoryKind";
56
	public static final String ELMNT_TMPL_REPOSITORYKIND = "repositoryKind";
56
	
57
57
	public static final String ELMNT_TMPL_CHARACTERENCODING = "characterEncoding";
58
	public static final String ELMNT_TMPL_CHARACTERENCODING = "characterEncoding";
58
59
59
	public static final String ELMNT_TMPL_ANONYMOUS = "anonymous";
60
	public static final String ELMNT_TMPL_ANONYMOUS = "anonymous";
Lines 71-85 Link Here
71
	public static final String ELMNT_TMPL_ADDAUTO = "addAutomatically";
72
	public static final String ELMNT_TMPL_ADDAUTO = "addAutomatically";
72
73
73
	public static final String ELMNT_REPOSITORY_CONNECTOR = "connectorCore";
74
	public static final String ELMNT_REPOSITORY_CONNECTOR = "connectorCore";
74
	
75
75
	public static final String ATTR_USER_MANAGED = "userManaged";
76
	public static final String ATTR_USER_MANAGED = "userManaged";
76
	
77
77
	public static final String ATTR_CUSTOM_NOTIFICATIONS = "customNotifications";
78
	public static final String ATTR_CUSTOM_NOTIFICATIONS = "customNotifications";
78
79
79
	public static final String ELMNT_REPOSITORY_LINK_PROVIDER = "linkProvider";
80
	public static final String ELMNT_REPOSITORY_LINK_PROVIDER = "linkProvider";
80
	
81
81
	public static final String ELMNT_REPOSITORY_UI= "connectorUi";
82
	public static final String ELMNT_REPOSITORY_UI = "connectorUi";
82
	
83
83
	public static final String ELMNT_EXTERNALIZER = "externalizer";
84
	public static final String ELMNT_EXTERNALIZER = "externalizer";
84
85
85
	public static final String ATTR_BRANDING_ICON = "brandingIcon";
86
	public static final String ATTR_BRANDING_ICON = "brandingIcon";
Lines 101-107 Link Here
101
	public static final String ATTR_CLASS = "class";
102
	public static final String ATTR_CLASS = "class";
102
103
103
	public static final String ATTR_MENU_PATH = "menuPath";
104
	public static final String ATTR_MENU_PATH = "menuPath";
104
	
105
105
	public static final String EXTENSION_EDITORS = "org.eclipse.mylar.tasks.ui.editors";
106
	public static final String EXTENSION_EDITORS = "org.eclipse.mylar.tasks.ui.editors";
106
107
107
	public static final String ELMNT_EDITOR_FACTORY = "editorFactory";
108
	public static final String ELMNT_EDITOR_FACTORY = "editorFactory";
Lines 110-115 Link Here
110
111
111
	public static final String ELMNT_HYPERLINK_DETECTOR = "hyperlinkDetector";
112
	public static final String ELMNT_HYPERLINK_DETECTOR = "hyperlinkDetector";
112
113
114
	public static final String EXTENSION_DUPLICATE_DETECTORS = "org.eclipse.mylar.tasks.ui.duplicateDetectors";
115
116
	public static final String ELMNT_DUPLICATE_DETECTOR = "detector";
117
118
	public static final String ATTR_NAME = "name";
119
120
	public static final String ATTR_KIND = "kind";
121
113
	private static boolean coreExtensionsRead = false;
122
	private static boolean coreExtensionsRead = false;
114
123
115
	public static void initStartupExtensions(TaskListWriter delegatingExternalizer) {
124
	public static void initStartupExtensions(TaskListWriter delegatingExternalizer) {
Lines 180-186 Link Here
180
			for (int j = 0; j < elements.length; j++) {
189
			for (int j = 0; j < elements.length; j++) {
181
				if (elements[j].getName().equals(ELMNT_REPOSITORY_UI)) {
190
				if (elements[j].getName().equals(ELMNT_REPOSITORY_UI)) {
182
					readRepositoryConnectorUi(elements[j]);
191
					readRepositoryConnectorUi(elements[j]);
183
				} 
192
				}
184
			}
193
			}
185
		}
194
		}
186
195
Lines 191-210 Link Here
191
			for (int j = 0; j < elements.length; j++) {
200
			for (int j = 0; j < elements.length; j++) {
192
				if (elements[j].getName().equals(ELMNT_REPOSITORY_LINK_PROVIDER)) {
201
				if (elements[j].getName().equals(ELMNT_REPOSITORY_LINK_PROVIDER)) {
193
					readLinkProvider(elements[j]);
202
					readLinkProvider(elements[j]);
194
				} 
203
				}
204
			}
205
		}
206
207
		IExtensionPoint duplicateDetectorsExtensionPoint = registry.getExtensionPoint(EXTENSION_DUPLICATE_DETECTORS);
208
		IExtension[] dulicateDetectorsExtensions = duplicateDetectorsExtensionPoint.getExtensions();
209
		for (int i = 0; i < dulicateDetectorsExtensions.length; i++) {
210
			IConfigurationElement[] elements = dulicateDetectorsExtensions[i].getConfigurationElements();
211
			for (int j = 0; j < elements.length; j++) {
212
				if (elements[j].getName().equals(ELMNT_DUPLICATE_DETECTOR)) {
213
					readDuplicateDetector(elements[j]);
214
				}
195
			}
215
			}
196
		}
216
		}
197
	
217
218
	}
219
220
	private static void readDuplicateDetector(IConfigurationElement element) {
221
		try {
222
			Object obj = element.createExecutableExtension(ATTR_CLASS);
223
			if (obj instanceof AbstractDuplicateDetector) {
224
				AbstractDuplicateDetector duplicateDetector = (AbstractDuplicateDetector) obj;
225
				duplicateDetector.setName(element.getAttribute(ATTR_NAME));
226
				duplicateDetector.setKind(element.getAttribute(ATTR_KIND));
227
				TasksUiPlugin.getDefault().addDuplicateDetector((AbstractDuplicateDetector) duplicateDetector);
228
			} else {
229
				MylarStatusHandler.log("Could not load duplicate detector: " + obj.getClass().getCanonicalName(), null);
230
			}
231
		} catch (CoreException e) {
232
			MylarStatusHandler.log(e, "Could not load duplicate detector extension");
233
		}
198
	}
234
	}
199
	
235
200
	private static void readLinkProvider(IConfigurationElement element) {
236
	private static void readLinkProvider(IConfigurationElement element) {
201
		try {
237
		try {
202
			Object repositoryLinkProvider = element.createExecutableExtension(ATTR_CLASS);
238
			Object repositoryLinkProvider = element.createExecutableExtension(ATTR_CLASS);
203
			if (repositoryLinkProvider instanceof AbstractTaskRepositoryLinkProvider) {
239
			if (repositoryLinkProvider instanceof AbstractTaskRepositoryLinkProvider) {
204
				TasksUiPlugin.getDefault().addRepositoryLinkProvider((AbstractTaskRepositoryLinkProvider) repositoryLinkProvider);
240
				TasksUiPlugin.getDefault().addRepositoryLinkProvider(
241
						(AbstractTaskRepositoryLinkProvider) repositoryLinkProvider);
205
			} else {
242
			} else {
206
				MylarStatusHandler.log("Could not load repository link provider: " + repositoryLinkProvider.getClass().getCanonicalName(),
243
				MylarStatusHandler.log("Could not load repository link provider: "
207
						null);
244
						+ repositoryLinkProvider.getClass().getCanonicalName(), null);
208
			}
245
			}
209
		} catch (CoreException e) {
246
		} catch (CoreException e) {
210
			MylarStatusHandler.log(e, "Could not load repository link provider extension");
247
			MylarStatusHandler.log(e, "Could not load repository link provider extension");
Lines 246-257 Link Here
246
			if (connectorCore instanceof AbstractRepositoryConnector && type != null) {
283
			if (connectorCore instanceof AbstractRepositoryConnector && type != null) {
247
				AbstractRepositoryConnector repositoryConnector = (AbstractRepositoryConnector) connectorCore;
284
				AbstractRepositoryConnector repositoryConnector = (AbstractRepositoryConnector) connectorCore;
248
				TasksUiPlugin.getRepositoryManager().addRepositoryConnector(repositoryConnector);
285
				TasksUiPlugin.getRepositoryManager().addRepositoryConnector(repositoryConnector);
249
				
286
250
				String userManagedString = element.getAttribute(ATTR_USER_MANAGED);
287
				String userManagedString = element.getAttribute(ATTR_USER_MANAGED);
251
				if(userManagedString != null){
288
				if (userManagedString != null) {
252
					boolean userManaged = Boolean.parseBoolean(userManagedString);
289
					boolean userManaged = Boolean.parseBoolean(userManagedString);
253
					repositoryConnector.setUserManaged(userManaged);					
290
					repositoryConnector.setUserManaged(userManaged);
254
				}				
291
				}
255
			} else {
292
			} else {
256
				MylarStatusHandler.log("could not not load connector core: " + connectorCore, null);
293
				MylarStatusHandler.log("could not not load connector core: " + connectorCore, null);
257
			}
294
			}
Lines 265-285 Link Here
265
		try {
302
		try {
266
			Object connectorUiObject = element.createExecutableExtension(ATTR_CLASS);
303
			Object connectorUiObject = element.createExecutableExtension(ATTR_CLASS);
267
			if (connectorUiObject instanceof AbstractRepositoryConnectorUi) {
304
			if (connectorUiObject instanceof AbstractRepositoryConnectorUi) {
268
				AbstractRepositoryConnectorUi connectorUi = (AbstractRepositoryConnectorUi)connectorUiObject;
305
				AbstractRepositoryConnectorUi connectorUi = (AbstractRepositoryConnectorUi) connectorUiObject;
269
				TasksUiPlugin.addRepositoryConnectorUi((AbstractRepositoryConnectorUi) connectorUi);
306
				TasksUiPlugin.addRepositoryConnectorUi((AbstractRepositoryConnectorUi) connectorUi);
270
307
271
				String customNotificationsString = element.getAttribute(ATTR_CUSTOM_NOTIFICATIONS);
308
				String customNotificationsString = element.getAttribute(ATTR_CUSTOM_NOTIFICATIONS);
272
				if(customNotificationsString != null){
309
				if (customNotificationsString != null) {
273
					boolean customNotifications = Boolean.parseBoolean(customNotificationsString);
310
					boolean customNotifications = Boolean.parseBoolean(customNotificationsString);
274
					connectorUi.setCustomNotificationHandling(customNotifications);					
311
					connectorUi.setCustomNotificationHandling(customNotifications);
275
				}
312
				}
276
				
313
277
				String iconPath = element.getAttribute(ATTR_BRANDING_ICON);
314
				String iconPath = element.getAttribute(ATTR_BRANDING_ICON);
278
				if (iconPath != null) {
315
				if (iconPath != null) {
279
					ImageDescriptor descriptor = AbstractUIPlugin.imageDescriptorFromPlugin(element.getContributor()
316
					ImageDescriptor descriptor = AbstractUIPlugin.imageDescriptorFromPlugin(element.getContributor()
280
							.getName(), iconPath);
317
							.getName(), iconPath);
281
					if (descriptor != null) {
318
					if (descriptor != null) {
282
						TasksUiPlugin.getDefault().addBrandingIcon(((AbstractRepositoryConnectorUi)connectorUi).getRepositoryType(),
319
						TasksUiPlugin.getDefault().addBrandingIcon(
320
								((AbstractRepositoryConnectorUi) connectorUi).getRepositoryType(),
283
								TasksUiImages.getImage(descriptor));
321
								TasksUiImages.getImage(descriptor));
284
					}
322
					}
285
				}
323
				}
Lines 288-295 Link Here
288
					ImageDescriptor descriptor = AbstractUIPlugin.imageDescriptorFromPlugin(element.getContributor()
326
					ImageDescriptor descriptor = AbstractUIPlugin.imageDescriptorFromPlugin(element.getContributor()
289
							.getName(), overlayIconPath);
327
							.getName(), overlayIconPath);
290
					if (descriptor != null) {
328
					if (descriptor != null) {
291
						TasksUiPlugin.getDefault().addOverlayIcon(((AbstractRepositoryConnectorUi)connectorUi).getRepositoryType(),
329
						TasksUiPlugin.getDefault().addOverlayIcon(
292
								descriptor);
330
								((AbstractRepositoryConnectorUi) connectorUi).getRepositoryType(), descriptor);
293
					}
331
					}
294
				}
332
				}
295
			} else {
333
			} else {
Lines 300-306 Link Here
300
			MylarStatusHandler.log(e, "Could not load tasklist listener extension");
338
			MylarStatusHandler.log(e, "Could not load tasklist listener extension");
301
		}
339
		}
302
	}
340
	}
303
	
341
304
	private static void readRepositoryTemplate(IConfigurationElement element) {
342
	private static void readRepositoryTemplate(IConfigurationElement element) {
305
343
306
		boolean anonymous = false;
344
		boolean anonymous = false;
Lines 322-339 Link Here
322
				&& TasksUiPlugin.getRepositoryManager().getRepositoryConnector(repKind) != null) {
360
				&& TasksUiPlugin.getRepositoryManager().getRepositoryConnector(repKind) != null) {
323
			AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager()
361
			AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager()
324
					.getRepositoryConnector(repKind);
362
					.getRepositoryConnector(repKind);
325
			RepositoryTemplate template = new RepositoryTemplate(label, serverUrl, encoding, version, newTaskUrl, taskPrefix,
363
			RepositoryTemplate template = new RepositoryTemplate(label, serverUrl, encoding, version, newTaskUrl,
326
					taskQueryUrl, newAccountUrl, anonymous, addAuto);
364
					taskPrefix, taskQueryUrl, newAccountUrl, anonymous, addAuto);
327
			connector.addTemplate(template);
365
			connector.addTemplate(template);
328
			
366
329
			for (IConfigurationElement configElement : element.getChildren()) {
367
			for (IConfigurationElement configElement : element.getChildren()) {
330
				String name = configElement.getAttribute("name");
368
				String name = configElement.getAttribute("name");
331
				String value = configElement.getAttribute("value");
369
				String value = configElement.getAttribute("value");
332
				if(name != null && !name.equals("") && value != null) {
370
				if (name != null && !name.equals("") && value != null) {
333
					template.addAttribute(name, value);
371
					template.addAttribute(name, value);
334
				}
372
				}
335
			}
373
			}
336
			
374
337
		} else {
375
		} else {
338
			MylarStatusHandler.log("Could not load repository template extension " + element.getName(),
376
			MylarStatusHandler.log("Could not load repository template extension " + element.getName(),
339
					TasksUiExtensionReader.class);
377
					TasksUiExtensionReader.class);
(-)src/org/eclipse/mylar/tasks/ui/TasksUiPlugin.java (-53 / +71 lines)
Lines 132-137 Link Here
132
	private TreeSet<AbstractTaskRepositoryLinkProvider> repositoryLinkProviders = new TreeSet<AbstractTaskRepositoryLinkProvider>(
132
	private TreeSet<AbstractTaskRepositoryLinkProvider> repositoryLinkProviders = new TreeSet<AbstractTaskRepositoryLinkProvider>(
133
			new OrderComparator());
133
			new OrderComparator());
134
134
135
	private List<AbstractDuplicateDetector> duplicateDetectors = new ArrayList<AbstractDuplicateDetector>();
136
135
	private TaskListWriter taskListWriter;
137
	private TaskListWriter taskListWriter;
136
138
137
	private ITaskHighlighter highlighter;
139
	private ITaskHighlighter highlighter;
Lines 407-413 Link Here
407
			taskListManager.addActivityListener(CONTEXT_TASK_ACTIVITY_LISTENER);
409
			taskListManager.addActivityListener(CONTEXT_TASK_ACTIVITY_LISTENER);
408
			taskListManager.readExistingOrCreateNewList();
410
			taskListManager.readExistingOrCreateNewList();
409
			initialized = true;
411
			initialized = true;
410
			
412
411
			saveParticipant = new ISaveParticipant() {
413
			saveParticipant = new ISaveParticipant() {
412
414
413
				public void doneSaving(ISaveContext context) {
415
				public void doneSaving(ISaveContext context) {
Lines 491-498 Link Here
491
						MylarStatusHandler.fail(t, "Could not finish Tasks UI initialization", false);
493
						MylarStatusHandler.fail(t, "Could not finish Tasks UI initialization", false);
492
					}
494
					}
493
				}
495
				}
494
			});			
496
			});
495
			
497
496
			Bundle bundle = Platform.getBundle("org.eclipse.ui.workbench");
498
			Bundle bundle = Platform.getBundle("org.eclipse.ui.workbench");
497
			if (bundle.getLocation().contains("_3.3.")) {
499
			if (bundle.getLocation().contains("_3.3.")) {
498
				eclipse_3_3_workbench = true;
500
				eclipse_3_3_workbench = true;
Lines 764-794 Link Here
764
	private void readOfflineReports() {
766
	private void readOfflineReports() {
765
		IPath offlineReportsPath = Platform.getStateLocation(TasksUiPlugin.getDefault().getBundle());
767
		IPath offlineReportsPath = Platform.getStateLocation(TasksUiPlugin.getDefault().getBundle());
766
768
767
//		try {
769
		// try {
768
			taskDataManager = new TaskDataManager(taskRepositoryManager, offlineReportsPath);//, true);
770
		taskDataManager = new TaskDataManager(taskRepositoryManager, offlineReportsPath);// ,
769
//		} catch (Throwable t) {
771
																							// true);
770
//			MylarStatusHandler.log("Recreating offline task cache due to format update.", this);
772
		// } catch (Throwable t) {
771
//			boolean deleted = offlineReportsPath.toFile().delete();
773
		// MylarStatusHandler.log("Recreating offline task cache due to format
772
//			if (!deleted) {
774
		// update.", this);
773
//				MylarStatusHandler.log(t, "could not delete offline repository tasks file");
775
		// boolean deleted = offlineReportsPath.toFile().delete();
774
//			}
776
		// if (!deleted) {
775
//			try {
777
		// MylarStatusHandler.log(t, "could not delete offline repository tasks
776
//				taskDataManager = new TaskDataManager(taskRepositoryManager, offlineReportsPath, false);
778
		// file");
777
//			} catch (Exception e1) {
779
		// }
778
//				MylarStatusHandler.log(e1, "could not reset offline repository tasks file");
780
		// try {
779
//			}
781
		// taskDataManager = new TaskDataManager(taskRepositoryManager,
780
//		}
782
		// offlineReportsPath, false);
781
	}
783
		// } catch (Exception e1) {
782
784
		// MylarStatusHandler.log(e1, "could not reset offline repository tasks
783
//	/**
785
		// file");
784
//	 * Returns the path to the file caching the offline bug reports. PUBLIC FOR
786
		// }
785
//	 * TESTING
787
		// }
786
//	 */
788
	}
787
//	public IPath getOfflineReportsFilePath() {
789
788
//		IPath stateLocation = Platform.getStateLocation(TasksUiPlugin.getDefault().getBundle());
790
	// /**
789
//		IPath configFile = stateLocation.append("offlineReports");
791
	// * Returns the path to the file caching the offline bug reports. PUBLIC
790
//		return configFile;
792
	// FOR
791
//	}
793
	// * TESTING
794
	// */
795
	// public IPath getOfflineReportsFilePath() {
796
	// IPath stateLocation =
797
	// Platform.getStateLocation(TasksUiPlugin.getDefault().getBundle());
798
	// IPath configFile = stateLocation.append("offlineReports");
799
	// return configFile;
800
	// }
792
801
793
	public TaskDataManager getTaskDataManager() {
802
	public TaskDataManager getTaskDataManager() {
794
		if (taskDataManager == null) {
803
		if (taskDataManager == null) {
Lines 909-915 Link Here
909
918
910
	public static TaskListNotificationIncoming getIncommingNotification(AbstractRepositoryConnector connector,
919
	public static TaskListNotificationIncoming getIncommingNotification(AbstractRepositoryConnector connector,
911
			AbstractRepositoryTask repositoryTask) {
920
			AbstractRepositoryTask repositoryTask) {
912
		
921
913
		TaskListNotificationIncoming notification = new TaskListNotificationIncoming(repositoryTask);
922
		TaskListNotificationIncoming notification = new TaskListNotificationIncoming(repositoryTask);
914
923
915
		RepositoryTaskData newTaskData = getDefault().getTaskDataManager().getNewTaskData(
924
		RepositoryTaskData newTaskData = getDefault().getTaskDataManager().getNewTaskData(
Lines 918-931 Link Here
918
		RepositoryTaskData oldTaskData = getDefault().getTaskDataManager().getOldTaskData(
927
		RepositoryTaskData oldTaskData = getDefault().getTaskDataManager().getOldTaskData(
919
				repositoryTask.getHandleIdentifier());
928
				repositoryTask.getHandleIdentifier());
920
929
921
		
922
		if (newTaskData != null && oldTaskData != null) {
930
		if (newTaskData != null && oldTaskData != null) {
923
			
931
924
			String descriptionText = getChangedDescription(newTaskData, oldTaskData);
932
			String descriptionText = getChangedDescription(newTaskData, oldTaskData);
925
			if(descriptionText != null){
933
			if (descriptionText != null) {
926
				notification.setDescription(descriptionText);
934
				notification.setDescription(descriptionText);
927
			}
935
			}
928
			
936
929
			if (connector != null) {
937
			if (connector != null) {
930
				ITaskDataHandler offlineHandler = connector.getTaskDataHandler();
938
				ITaskDataHandler offlineHandler = connector.getTaskDataHandler();
931
				if (offlineHandler != null && newTaskData.getLastModified() != null) {
939
				if (offlineHandler != null && newTaskData.getLastModified() != null) {
Lines 940-951 Link Here
940
		}
948
		}
941
		return notification;
949
		return notification;
942
	}
950
	}
943
	
951
944
	private static String getChangedDescription(RepositoryTaskData newTaskData, RepositoryTaskData oldTaskData){
952
	private static String getChangedDescription(RepositoryTaskData newTaskData, RepositoryTaskData oldTaskData) {
945
		
953
946
		String descriptionText = "";
954
		String descriptionText = "";
947
		
955
948
		if(newTaskData.getComments().size() > oldTaskData.getComments().size()){
956
		if (newTaskData.getComments().size() > oldTaskData.getComments().size()) {
949
			List<TaskComment> taskComments = newTaskData.getComments();
957
			List<TaskComment> taskComments = newTaskData.getComments();
950
			if (taskComments != null && taskComments.size() > 0) {
958
			if (taskComments != null && taskComments.size() > 0) {
951
				TaskComment lastComment = taskComments.get(taskComments.size() - 1);
959
				TaskComment lastComment = taskComments.get(taskComments.size() - 1);
Lines 959-970 Link Here
959
				}
967
				}
960
			}
968
			}
961
		}
969
		}
962
		
970
963
		boolean attributeChanged = false;
971
		boolean attributeChanged = false;
964
		
972
965
		for(RepositoryTaskAttribute newAttribute: newTaskData.getAttributes()){
973
		for (RepositoryTaskAttribute newAttribute : newTaskData.getAttributes()) {
966
			RepositoryTaskAttribute oldAttribute = oldTaskData.getAttribute(newAttribute.getID());
974
			RepositoryTaskAttribute oldAttribute = oldTaskData.getAttribute(newAttribute.getID());
967
			if (oldAttribute == null){
975
			if (oldAttribute == null) {
968
				attributeChanged = true;
976
				attributeChanged = true;
969
				break;
977
				break;
970
			}
978
			}
Lines 976-995 Link Here
976
				break;
984
				break;
977
			}
985
			}
978
		}
986
		}
979
		
987
980
		if(attributeChanged){
988
		if (attributeChanged) {
981
			if (descriptionText.equals("")){
989
			if (descriptionText.equals("")) {
982
				descriptionText += "Attributes changed";
990
				descriptionText += "Attributes changed";
983
			} 
991
			}
984
		}
992
		}
985
//		else {
993
		// else {
986
//			String description = taskData.getDescription();
994
		// String description = taskData.getDescription();
987
//			if (description != null) {
995
		// if (description != null) {
988
//				notification.setDescription(description);
996
		// notification.setDescription(description);
989
//			}
997
		// }
990
//		}
998
		// }
991
		
999
992
		return descriptionText;
1000
		return descriptionText;
993
	}
1001
	}
994
1002
1003
	public void addDuplicateDetector(AbstractDuplicateDetector duplicateDetector) {
1004
		if (duplicateDetector != null) {
1005
			duplicateDetectors.add(duplicateDetector);
1006
		}
1007
	}
1008
1009
	public List<AbstractDuplicateDetector> getDuplicateSearchCollectorsList() {
1010
		return duplicateDetectors;
1011
	}
1012
995
}
1013
}
(-).refactorings/2007/6/23/refactorings.history (+5 lines)
Added Link Here
1
<?xml version="1.0" encoding="utf-8"?>
2
<session version="1.0">
3
<refactoring comment="Rename local variable 'kind' in 'org.eclipse.mylar.tasks.ui.editors.AbstractNewRepositoryTaskEditor.getDuplicateSearchCollector(...)' to 'name'&#13;&#10;- Original project: 'org.eclipse.mylar.tasks.ui'&#13;&#10;- Original element: 'org.eclipse.mylar.tasks.ui.editors.AbstractNewRepositoryTaskEditor.getDuplicateSearchCollector(String, String).kind'&#13;&#10;- Renamed element: 'org.eclipse.mylar.tasks.ui.editors.AbstractNewRepositoryTaskEditor.getDuplicateSearchCollector(String, String).name'&#13;&#10;- Update references to refactored element" description="Rename local variable 'kind'" id="org.eclipse.jdt.ui.rename.local.variable" input="/src&lt;org.eclipse.mylar.tasks.ui.editors{AbstractNewRepositoryTaskEditor.java" name="name" references="true" selection="21506 4" stamp="1181108866015" version="1.0"/>
4
<refactoring comment="Move 1 elements(s) to 'org.eclipse.mylar.bugzilla.ui/src/org.eclipse.mylar.internal.bugzilla.ui.search'&#13;&#10;- Original project: 'org.eclipse.mylar.tasks.ui'&#13;&#10;- Destination element: 'org.eclipse.mylar.bugzilla.ui/src/org.eclipse.mylar.internal.bugzilla.ui.search'&#13;&#10;- Original element: 'org.eclipse.mylar.internal.tasks.ui.search.StackTraceDuplicateDetector.java'&#13;&#10;- Update references to refactored element" description="Move compilation unit" destination="/src&lt;org.eclipse.mylar.internal.bugzilla.ui.search" element1="/src&lt;org.eclipse.mylar.internal.tasks.ui.search{StackTraceDuplicateDetector.java" files="0" flags="589830" folders="0" id="org.eclipse.jdt.ui.move" policy="org.eclipse.jdt.ui.moveResources" qualified="false" references="true" stamp="1181144506125" units="1" version="1.0"/>
5
</session>
(-)schema/duplicateDetectors.exsd (+116 lines)
Added Link Here
1
<?xml version='1.0' encoding='UTF-8'?>
2
<!-- Schema file written by PDE -->
3
<schema targetNamespace="org.eclipse.mylar.tasks.ui">
4
<annotation>
5
      <appInfo>
6
         <meta.schema plugin="org.eclipse.mylar.tasks.ui" id="duplicateDetectors" name="duplicateDetectors"/>
7
      </appInfo>
8
      <documentation>
9
         [Enter description of this extension point.]
10
      </documentation>
11
   </annotation>
12
13
   <element name="extension">
14
      <complexType>
15
         <sequence>
16
            <element ref="detector"/>
17
         </sequence>
18
         <attribute name="point" type="string" use="required">
19
            <annotation>
20
               <documentation>
21
                  
22
               </documentation>
23
            </annotation>
24
         </attribute>
25
         <attribute name="id" type="string">
26
            <annotation>
27
               <documentation>
28
                  
29
               </documentation>
30
            </annotation>
31
         </attribute>
32
         <attribute name="name" type="string">
33
            <annotation>
34
               <documentation>
35
                  
36
               </documentation>
37
               <appInfo>
38
                  <meta.attribute translatable="true"/>
39
               </appInfo>
40
            </annotation>
41
         </attribute>
42
      </complexType>
43
   </element>
44
45
   <element name="detector">
46
      <complexType>
47
         <attribute name="class" type="string" use="required">
48
            <annotation>
49
               <documentation>
50
                  
51
               </documentation>
52
            </annotation>
53
         </attribute>
54
         <attribute name="name" type="string" use="required">
55
            <annotation>
56
               <documentation>
57
                  
58
               </documentation>
59
            </annotation>
60
         </attribute>
61
         <attribute name="kind" type="string">
62
            <annotation>
63
               <documentation>
64
                  
65
               </documentation>
66
            </annotation>
67
         </attribute>
68
      </complexType>
69
   </element>
70
71
   <annotation>
72
      <appInfo>
73
         <meta.section type="since"/>
74
      </appInfo>
75
      <documentation>
76
         [Enter the first release in which this extension point appears.]
77
      </documentation>
78
   </annotation>
79
80
   <annotation>
81
      <appInfo>
82
         <meta.section type="examples"/>
83
      </appInfo>
84
      <documentation>
85
         [Enter extension point usage example here.]
86
      </documentation>
87
   </annotation>
88
89
   <annotation>
90
      <appInfo>
91
         <meta.section type="apiInfo"/>
92
      </appInfo>
93
      <documentation>
94
         [Enter API information here.]
95
      </documentation>
96
   </annotation>
97
98
   <annotation>
99
      <appInfo>
100
         <meta.section type="implementation"/>
101
      </appInfo>
102
      <documentation>
103
         [Enter information about supplied implementation of this extension point.]
104
      </documentation>
105
   </annotation>
106
107
   <annotation>
108
      <appInfo>
109
         <meta.section type="copyright"/>
110
      </appInfo>
111
      <documentation>
112
         
113
      </documentation>
114
   </annotation>
115
116
</schema>
(-)src/org/eclipse/mylar/tasks/ui/AbstractDuplicateDetector.java (+39 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2004 - 2006 Mylar committers and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *******************************************************************************/
8
9
package org.eclipse.mylar.tasks.ui;
10
11
import org.eclipse.mylar.tasks.core.RepositoryTaskData;
12
import org.eclipse.mylar.tasks.core.TaskRepository;
13
import org.eclipse.mylar.tasks.ui.search.SearchHitCollector;
14
15
public abstract class AbstractDuplicateDetector {
16
17
	protected String name;
18
19
	protected String kind;
20
21
	public abstract SearchHitCollector getSearchHitCollector(TaskRepository repository, RepositoryTaskData taskData);
22
23
	public void setName(String name) {
24
		this.name = name;
25
	}
26
27
	public void setKind(String kind) {
28
		this.kind = kind;
29
	}
30
31
	public String getName() {
32
		return this.name;
33
	}
34
35
	public String getKind() {
36
		return this.kind;
37
	}
38
39
}
(-).refactorings/2007/6/23/refactorings.index (+2 lines)
Added Link Here
1
1181108866015	Rename local variable 'kind'
2
1181144506125	Move compilation unit
(-)src/org/eclipse/mylar/internal/jira/ui/editor/NewJiraTaskEditor.java (-1 / +2 lines)
Lines 27-33 Link Here
27
	}
27
	}
28
28
29
	@Override
29
	@Override
30
	public SearchHitCollector getDuplicateSearchCollector(String searchString) {
30
	public SearchHitCollector getDuplicateSearchCollector(String name) {
31
		String searchString = AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(taskData.getDescription());
31
		ContentFilter contentFilter = new ContentFilter(searchString, false, true, false, true);
32
		ContentFilter contentFilter = new ContentFilter(searchString, false, true, false, true);
32
33
33
		FilterDefinition filter = new FilterDefinition();
34
		FilterDefinition filter = new FilterDefinition();
(-)plugin.xml (+11 lines)
Lines 38-41 Link Here
38
               <newWizardShortcut id="org.eclipse.mylar.bugzilla.bugWizard"/>
38
               <newWizardShortcut id="org.eclipse.mylar.bugzilla.bugWizard"/>
39
          </perspectiveExtension>
39
          </perspectiveExtension>
40
	</extension>
40
	</extension>
41
	
42
	
43
	
44
         <extension
45
   		point="org.eclipse.mylar.tasks.ui.duplicateDetectors">
46
            <detector class="org.eclipse.mylar.internal.bugzilla.ui.search.StackTraceDuplicateDetector"
47
                      name="Stack Trace">
48
            </detector>
49
          
50
   </extension>
51
	
41
</plugin>
52
</plugin>
(-)src/org/eclipse/mylar/internal/bugzilla/ui/editor/NewBugzillaTaskEditor.java (-21 / +16 lines)
Lines 10-26 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.mylar.internal.bugzilla.ui.editor;
11
package org.eclipse.mylar.internal.bugzilla.ui.editor;
12
12
13
import java.io.UnsupportedEncodingException;
13
import java.util.List;
14
import java.net.URLEncoder;
15
14
16
import org.eclipse.jface.dialogs.MessageDialog;
15
import org.eclipse.jface.dialogs.MessageDialog;
17
import org.eclipse.jface.fieldassist.ContentProposalAdapter;
16
import org.eclipse.jface.fieldassist.ContentProposalAdapter;
18
import org.eclipse.jface.layout.GridDataFactory;
17
import org.eclipse.jface.layout.GridDataFactory;
19
import org.eclipse.jface.viewers.ILabelProvider;
18
import org.eclipse.jface.viewers.ILabelProvider;
20
import org.eclipse.mylar.core.MylarStatusHandler;
21
import org.eclipse.mylar.internal.bugzilla.core.BugzillaRepositoryQuery;
22
import org.eclipse.mylar.tasks.core.RepositoryTaskAttribute;
19
import org.eclipse.mylar.tasks.core.RepositoryTaskAttribute;
23
import org.eclipse.mylar.tasks.ui.TaskFactory;
20
import org.eclipse.mylar.tasks.ui.AbstractDuplicateDetector;
24
import org.eclipse.mylar.tasks.ui.TasksUiPlugin;
21
import org.eclipse.mylar.tasks.ui.TasksUiPlugin;
25
import org.eclipse.mylar.tasks.ui.editors.AbstractNewRepositoryTaskEditor;
22
import org.eclipse.mylar.tasks.ui.editors.AbstractNewRepositoryTaskEditor;
26
import org.eclipse.mylar.tasks.ui.search.SearchHitCollector;
23
import org.eclipse.mylar.tasks.ui.search.SearchHitCollector;
Lines 102-125 Link Here
102
	}
99
	}
103
100
104
	@Override
101
	@Override
105
	public SearchHitCollector getDuplicateSearchCollector(String searchString) {
102
	public SearchHitCollector getDuplicateSearchCollector(String name) {
106
		String queryUrl = "";
103
		String duplicateDetectorName = name.equals("default") ? "Stack Trace" : name;
107
		try {
104
		List<AbstractDuplicateDetector> allDetectors = getDuplicateSearchCollectorsList();
108
			queryUrl = repository.getUrl() + "/buglist.cgi?long_desc_type=allwordssubstr&long_desc="
105
109
					+ URLEncoder.encode(searchString, repository.getCharacterEncoding());
106
		for (AbstractDuplicateDetector detector : allDetectors) {
110
		} catch (UnsupportedEncodingException e) {
107
			if (detector.getName().equals(duplicateDetectorName)) {
111
			MylarStatusHandler.log(e, "Error during duplicate detection");
108
				return detector.getSearchHitCollector(repository, taskData);
112
			return null;
109
			}
113
		}
110
		}
111
		// didn't find it
112
		return null;
113
	}
114
114
115
		queryUrl += "&product=" + taskData.getProduct();
115
	protected List<AbstractDuplicateDetector> getDuplicateSearchCollectorsList() {
116
116
		return TasksUiPlugin.getDefault().getDuplicateSearchCollectorsList();
117
		BugzillaRepositoryQuery bugzillaQuery = new BugzillaRepositoryQuery(repository.getUrl(), queryUrl, "search",
118
				TasksUiPlugin.getTaskListManager().getTaskList());
119
120
		SearchHitCollector collector = new SearchHitCollector(TasksUiPlugin.getTaskListManager().getTaskList(),
121
				repository, bugzillaQuery, new TaskFactory(repository));
122
		return collector;
123
	}
117
	}
124
118
125
	@Override
119
	@Override
Lines 177-180 Link Here
177
			return newText;
171
			return newText;
178
		}
172
		}
179
	}
173
	}
174
180
}
175
}
(-)src/org/eclipse/mylar/internal/bugzilla/ui/search/StackTraceDuplicateDetector.java (+57 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2004 - 2006 Mylar committers and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *******************************************************************************/
8
9
package org.eclipse.mylar.internal.bugzilla.ui.search;
10
11
import java.io.UnsupportedEncodingException;
12
import java.net.URLEncoder;
13
14
import org.eclipse.jface.dialogs.MessageDialog;
15
import org.eclipse.mylar.core.MylarStatusHandler;
16
import org.eclipse.mylar.internal.bugzilla.core.BugzillaRepositoryQuery;
17
import org.eclipse.mylar.tasks.core.RepositoryTaskData;
18
import org.eclipse.mylar.tasks.core.TaskRepository;
19
import org.eclipse.mylar.tasks.ui.AbstractDuplicateDetector;
20
import org.eclipse.mylar.tasks.ui.TaskFactory;
21
import org.eclipse.mylar.tasks.ui.TasksUiPlugin;
22
import org.eclipse.mylar.tasks.ui.editors.AbstractNewRepositoryTaskEditor;
23
import org.eclipse.mylar.tasks.ui.search.SearchHitCollector;
24
25
public class StackTraceDuplicateDetector extends AbstractDuplicateDetector {
26
27
	private static final String NO_STACK_MESSAGE = "Unable to locate a stack trace in the description text.";
28
	
29
	@Override
30
	public SearchHitCollector getSearchHitCollector(TaskRepository repository, RepositoryTaskData taskData) {
31
		String queryUrl = "";
32
		String searchString = AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(taskData.getDescription());
33
		
34
		if (searchString == null) {
35
			MessageDialog.openWarning(null, "No Stack Trace Found", NO_STACK_MESSAGE);
36
			return null;
37
		}
38
		
39
		try {
40
			queryUrl = repository.getUrl() + "/buglist.cgi?long_desc_type=allwordssubstr&long_desc="
41
					+ URLEncoder.encode(searchString, repository.getCharacterEncoding());
42
		} catch (UnsupportedEncodingException e) {
43
			MylarStatusHandler.log(e, "Error during duplicate detection");
44
			return null;
45
		}
46
47
		queryUrl += "&product=" + taskData.getProduct();
48
49
		BugzillaRepositoryQuery bugzillaQuery = new BugzillaRepositoryQuery(repository.getUrl(), queryUrl, "search",
50
				TasksUiPlugin.getTaskListManager().getTaskList());
51
52
		SearchHitCollector collector = new SearchHitCollector(TasksUiPlugin.getTaskListManager().getTaskList(),
53
				repository, bugzillaQuery, new TaskFactory(repository));
54
		return collector;
55
	}
56
57
}
(-)src/org/eclipse/mylar/internal/bugzilla/ui/editor/DummySearchHitProvider.java (+36 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2004 - 2006 University Of British Columbia and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     University Of British Columbia - initial API and implementation
10
 *******************************************************************************/
11
12
package org.eclipse.mylar.internal.bugzilla.ui.editor;
13
14
import org.eclipse.core.runtime.CoreException;
15
import org.eclipse.core.runtime.IProgressMonitor;
16
import org.eclipse.mylar.tasks.core.AbstractRepositoryTask;
17
import org.eclipse.mylar.tasks.core.ITaskFactory;
18
import org.eclipse.mylar.tasks.core.QueryHitCollector;
19
import org.eclipse.mylar.tasks.core.RepositoryTaskData;
20
import org.eclipse.mylar.tasks.core.TaskList;
21
22
public class DummySearchHitProvider extends QueryHitCollector {
23
24
	public DummySearchHitProvider(TaskList tasklist) {
25
		super(tasklist, new ITaskFactory() {
26
27
			public AbstractRepositoryTask createTask(RepositoryTaskData taskData, boolean synchData,
28
					boolean forced, IProgressMonitor monitor) throws CoreException {
29
				return null;
30
			}
31
		});
32
		// ignore
33
	}
34
35
36
}
(-)src/org/eclipse/mylar/bugzilla/tests/DuplicateDetetionTest.java (-8 / +9 lines)
Lines 23-28 Link Here
23
import org.eclipse.mylar.tasks.core.TaskRepository;
23
import org.eclipse.mylar.tasks.core.TaskRepository;
24
import org.eclipse.mylar.tasks.ui.TasksUiPlugin;
24
import org.eclipse.mylar.tasks.ui.TasksUiPlugin;
25
import org.eclipse.mylar.tasks.ui.TasksUiUtil;
25
import org.eclipse.mylar.tasks.ui.TasksUiUtil;
26
import org.eclipse.mylar.tasks.ui.editors.AbstractNewRepositoryTaskEditor;
26
import org.eclipse.mylar.tasks.ui.editors.NewTaskEditorInput;
27
import org.eclipse.mylar.tasks.ui.editors.NewTaskEditorInput;
27
import org.eclipse.mylar.tasks.ui.editors.TaskEditor;
28
import org.eclipse.mylar.tasks.ui.editors.TaskEditor;
28
import org.eclipse.ui.IWorkbenchPage;
29
import org.eclipse.ui.IWorkbenchPage;
Lines 74-80 Link Here
74
75
75
		TaskEditor taskEditor = (TaskEditor) page.getActiveEditor();
76
		TaskEditor taskEditor = (TaskEditor) page.getActiveEditor();
76
		NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance();
77
		NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance();
77
		assertNull(editor.getStackTraceFromDescription());
78
		assertNull(AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(model.getDescription()));
78
79
79
		editor.markDirty(false);
80
		editor.markDirty(false);
80
		editor.close();
81
		editor.close();
Lines 96-102 Link Here
96
97
97
		TaskEditor taskEditor = (TaskEditor) page.getActiveEditor();
98
		TaskEditor taskEditor = (TaskEditor) page.getActiveEditor();
98
		NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance();
99
		NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance();
99
		assertEquals(stackTrace, editor.getStackTraceFromDescription().trim());
100
		assertEquals(stackTrace, AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(model.getDescription()).trim());
100
101
101
		editor.markDirty(false);
102
		editor.markDirty(false);
102
		editor.close();
103
		editor.close();
Lines 126-132 Link Here
126
127
127
		TaskEditor taskEditor = (TaskEditor) page.getActiveEditor();
128
		TaskEditor taskEditor = (TaskEditor) page.getActiveEditor();
128
		NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance();
129
		NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance();
129
		assertEquals(stackTrace, editor.getStackTraceFromDescription().trim());
130
		assertEquals(stackTrace, AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(model.getDescription()).trim());
130
131
131
		editor.markDirty(false);
132
		editor.markDirty(false);
132
		editor.close();
133
		editor.close();
Lines 155-161 Link Here
155
156
156
		TaskEditor taskEditor = (TaskEditor) page.getActiveEditor();
157
		TaskEditor taskEditor = (TaskEditor) page.getActiveEditor();
157
		NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance();
158
		NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance();
158
		assertEquals(stackTrace, editor.getStackTraceFromDescription().trim());
159
		assertEquals(stackTrace, AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(model.getDescription()).trim());
159
160
160
		editor.markDirty(false);
161
		editor.markDirty(false);
161
		editor.close();
162
		editor.close();
Lines 180-186 Link Here
180
181
181
		TaskEditor taskEditor = (TaskEditor) page.getActiveEditor();
182
		TaskEditor taskEditor = (TaskEditor) page.getActiveEditor();
182
		NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance();
183
		NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance();
183
		assertEquals(stackTrace, editor.getStackTraceFromDescription().trim());
184
		assertEquals(stackTrace, AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(model.getDescription()).trim());
184
		
185
		
185
		editor.markDirty(false);
186
		editor.markDirty(false);
186
		editor.close();
187
		editor.close();
Lines 204-210 Link Here
204
205
205
		TaskEditor taskEditor = (TaskEditor) page.getActiveEditor();
206
		TaskEditor taskEditor = (TaskEditor) page.getActiveEditor();
206
		NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance();
207
		NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance();
207
		assertEquals(stackTrace, editor.getStackTraceFromDescription().trim());
208
		assertEquals(stackTrace, AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(model.getDescription()).trim());
208
		
209
		
209
		editor.markDirty(false);
210
		editor.markDirty(false);
210
		editor.close();
211
		editor.close();
Lines 230-236 Link Here
230
231
231
		TaskEditor taskEditor = (TaskEditor) page.getActiveEditor();
232
		TaskEditor taskEditor = (TaskEditor) page.getActiveEditor();
232
		NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance();
233
		NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance();
233
		assertEquals(stackTrace, editor.getStackTraceFromDescription().trim());
234
		assertEquals(stackTrace, AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(model.getDescription()).trim());
234
		
235
		
235
		editor.markDirty(false);
236
		editor.markDirty(false);
236
		editor.close();
237
		editor.close();
Lines 255-261 Link Here
255
256
256
		TaskEditor taskEditor = (TaskEditor) page.getActiveEditor();
257
		TaskEditor taskEditor = (TaskEditor) page.getActiveEditor();
257
		NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance();
258
		NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance();
258
		assertEquals(stackTrace, editor.getStackTraceFromDescription().trim());
259
		assertEquals(stackTrace, AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(model.getDescription()).trim());
259
		
260
		
260
		editor.markDirty(false);
261
		editor.markDirty(false);
261
		editor.close();
262
		editor.close();
(-)src/org/eclipse/mylar/internal/trac/ui/editor/NewTracTaskEditor.java (-1 / +4 lines)
Lines 29-37 Link Here
29
	}
29
	}
30
30
31
	@Override
31
	@Override
32
	public SearchHitCollector getDuplicateSearchCollector(String searchString) {
32
	public SearchHitCollector getDuplicateSearchCollector(String name) {
33
		TracSearchFilter filter = new TracSearchFilter("description");
33
		TracSearchFilter filter = new TracSearchFilter("description");
34
		filter.setOperator(CompareOperator.CONTAINS);
34
		filter.setOperator(CompareOperator.CONTAINS);
35
		
36
		String searchString = AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(taskData.getDescription());
37
		
35
		filter.addValue(searchString);
38
		filter.addValue(searchString);
36
39
37
		TracSearch search = new TracSearch();
40
		TracSearch search = new TracSearch();

Return to bug 187602