Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 71584 Details for
Bug 156061
Search for duplicates should be available in existing task editor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch - refreshed against changes to repository
patch1.txt (text/plain), 14.08 KB, created by
Gail Murphy
on 2007-06-18 00:34:22 EDT
(
hide
)
Description:
Patch - refreshed against changes to repository
Filename:
MIME Type:
Creator:
Gail Murphy
Created:
2007-06-18 00:34:22 EDT
Size:
14.08 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.tasks.ui >Index: src/org/eclipse/mylyn/tasks/ui/editors/AbstractNewRepositoryTaskEditor.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractNewRepositoryTaskEditor.java,v >retrieving revision 1.31 >diff -u -r1.31 AbstractNewRepositoryTaskEditor.java >--- src/org/eclipse/mylyn/tasks/ui/editors/AbstractNewRepositoryTaskEditor.java 14 Jun 2007 18:43:58 -0000 1.31 >+++ src/org/eclipse/mylyn/tasks/ui/editors/AbstractNewRepositoryTaskEditor.java 18 Jun 2007 04:32:31 -0000 >@@ -82,18 +82,8 @@ > > private static final String LABEL_CREATE = "Create New"; > >- private static final String LABEL_SEARCH_DUPS = "Search for Duplicates"; >- >- private static final String LABEL_SELECT_DETECTOR = "Select duplicate detector:"; >- > private static final String ERROR_CREATING_BUG_REPORT = "Error creating bug report"; > >- protected Button searchForDuplicates; >- >- protected CCombo duplicateDetectorChooser; >- >- protected Label duplicateDetectorLabel; >- > protected DatePicker scheduledForDate; > > protected Spinner estimatedTime; >@@ -419,49 +409,6 @@ > @Override > protected void addActionButtons(Composite buttonComposite) { > FormToolkit toolkit = new FormToolkit(buttonComposite.getDisplay()); >- >- List<AbstractDuplicateDetector> allCollectors = getDuplicateSearchCollectorsList(); >- if (allCollectors != null) { >- duplicateDetectorLabel = new Label(buttonComposite, SWT.LEFT); >- duplicateDetectorLabel.setText(LABEL_SELECT_DETECTOR); >- >- duplicateDetectorChooser = new CCombo(buttonComposite, SWT.FLAT | SWT.READ_ONLY | SWT.BORDER); >- >- duplicateDetectorChooser.setLayoutData(GridDataFactory.swtDefaults().hint(150, SWT.DEFAULT).create()); >- duplicateDetectorChooser.setFont(TEXT_FONT); >- >- Collections.sort(allCollectors, new Comparator<AbstractDuplicateDetector>() { >- >- public int compare(AbstractDuplicateDetector c1, AbstractDuplicateDetector c2) { >- return c1.getName().compareToIgnoreCase(c2.getName()); >- } >- >- }); >- >- for (AbstractDuplicateDetector detector : allCollectors) { >- duplicateDetectorChooser.add(detector.getName()); >- } >- >- duplicateDetectorChooser.select(0); >- duplicateDetectorChooser.setEnabled(true); >- duplicateDetectorChooser.setData(allCollectors); >- } >- >- if (allCollectors != null && allCollectors.size() > 0) { >- >- searchForDuplicates = toolkit.createButton(buttonComposite, LABEL_SEARCH_DUPS, SWT.NONE); >- GridData searchDuplicatesButtonData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); >- searchForDuplicates.setLayoutData(searchDuplicatesButtonData); >- searchForDuplicates.addListener(SWT.Selection, new Listener() { >- public void handleEvent(Event e) { >- searchForDuplicates(); >- } >- }); >- } >- >- Label spacer = new Label(buttonComposite, SWT.NULL); >- spacer.setText(""); >- > submitButton = toolkit.createButton(buttonComposite, LABEL_CREATE, SWT.NONE); > GridData submitButtonData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); > submitButton.setLayoutData(submitButtonData); >@@ -506,22 +453,6 @@ > return true; > } > >- public boolean searchForDuplicates() { >- >- String duplicateDetectorName = duplicateDetectorChooser.getItem(duplicateDetectorChooser.getSelectionIndex()); >- >- // called so that the description text is set on taskData before we >- // search for duplicates >- this.saveTaskOffline(new NullProgressMonitor()); >- >- SearchHitCollector collector = getDuplicateSearchCollector(duplicateDetectorName); >- if (collector != null) { >- NewSearchUI.runQueryInBackground(collector); >- return true; >- } >- >- return false; >- } > > @Override > protected void createPeopleLayout(Composite composite) { >@@ -559,11 +490,6 @@ > return newTask; > } > >- protected abstract SearchHitCollector getDuplicateSearchCollector(String name); >- >- protected List<AbstractDuplicateDetector> getDuplicateSearchCollectorsList() { >- return TasksUiPlugin.getDefault().getDuplicateSearchCollectorsList(); >- } > > @Override > public void doSave(IProgressMonitor monitor) { >Index: src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java,v >retrieving revision 1.160 >diff -u -r1.160 AbstractRepositoryTaskEditor.java >--- src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java 16 Jun 2007 20:20:54 -0000 1.160 >+++ src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java 18 Jun 2007 04:32:34 -0000 >@@ -14,6 +14,7 @@ > import java.util.ArrayList; > import java.util.Arrays; > import java.util.Collections; >+import java.util.Comparator; > import java.util.Date; > import java.util.HashMap; > import java.util.HashSet; >@@ -92,9 +93,12 @@ > import org.eclipse.mylyn.tasks.core.TaskContainerDelta; > import org.eclipse.mylyn.tasks.core.TaskRepository; > import org.eclipse.mylyn.tasks.core.AbstractTask.RepositoryTaskSyncState; >+import org.eclipse.mylyn.tasks.ui.AbstractDuplicateDetector; > import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; > import org.eclipse.mylyn.tasks.ui.TasksUiUtil; >+import org.eclipse.mylyn.tasks.ui.search.SearchHitCollector; > import org.eclipse.osgi.util.NLS; >+import org.eclipse.search.ui.NewSearchUI; > import org.eclipse.swt.SWT; > import org.eclipse.swt.custom.CCombo; > import org.eclipse.swt.custom.StyledText; >@@ -188,6 +192,8 @@ > private static final String LABEL_DEFAULT_EDITOR = "Default Editor"; > > private static final String LABEL_TEXT_EDITOR = "Text Editor"; >+ >+ private static final String LABEL_NO_DETECTOR = "No duplicate detector available."; > > protected static final String CONTEXT_MENU_ID = "#MylarRepositoryEditor"; > >@@ -213,6 +219,10 @@ > > private static final String LABEL_SAVE = "Save..."; > >+ private static final String LABEL_SEARCH_DUPS = "Search for Duplicates"; >+ >+ private static final String LABEL_SELECT_DETECTOR = "Select duplicate detector:"; >+ > private RepositoryTaskEditorInput editorInput; > > private TaskEditor parentEditor = null; >@@ -249,9 +259,16 @@ > > private boolean attachContextEnabled = true; > >+ protected Button searchForDuplicates; >+ >+ protected CCombo duplicateDetectorChooser; >+ >+ protected Label duplicateDetectorLabel; >+ > protected enum SECTION_NAME { > ATTRIBTUES_SECTION("Attributes"), ATTACHMENTS_SECTION("Attachments"), DESCRIPTION_SECTION("Description"), COMMENTS_SECTION( >- "Comments"), NEWCOMMENT_SECTION("New Comment"), ACTIONS_SECTION("Actions"), PEOPLE_SECTION("People"); >+ "Comments"), NEWCOMMENT_SECTION("New Comment"), ACTIONS_SECTION("Actions"), PEOPLE_SECTION("People"), RELATEDBUGS_SECTION( >+ "Related Bugs"); > > private String prettyName; > >@@ -674,6 +691,8 @@ > createAttributeLayout(attribComp); > createCustomAttributeLayout(attribComp); > >+ createRelatedBugsSection(editorComposite); >+ > if (showAttachments) { > createAttachmentLayout(editorComposite); > } >@@ -946,6 +965,88 @@ > } > > /** >+ * Adds a related bugs section to the bug editor >+ */ >+ protected void createRelatedBugsSection(Composite composite) { >+ Section relatedBugsSection = createSection(editorComposite, getSectionLabel(SECTION_NAME.RELATEDBUGS_SECTION)); >+ Composite relatedBugsComposite = toolkit.createComposite(relatedBugsSection); >+ relatedBugsComposite.setLayout(new GridLayout(4, false)); >+ relatedBugsComposite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); >+ relatedBugsSection.setClient(relatedBugsComposite); >+ >+ List<AbstractDuplicateDetector> allCollectors = getDuplicateSearchCollectorsList(); >+ if (allCollectors != null) { >+ duplicateDetectorLabel = new Label(relatedBugsComposite, SWT.LEFT); >+ duplicateDetectorLabel.setText(LABEL_SELECT_DETECTOR); >+ >+ duplicateDetectorChooser = new CCombo(relatedBugsComposite, SWT.FLAT | SWT.READ_ONLY | SWT.BORDER); >+ >+ duplicateDetectorChooser.setLayoutData(GridDataFactory.swtDefaults().hint(150, SWT.DEFAULT).create()); >+ duplicateDetectorChooser.setFont(TEXT_FONT); >+ >+ Collections.sort(allCollectors, new Comparator<AbstractDuplicateDetector>() { >+ >+ public int compare(AbstractDuplicateDetector c1, AbstractDuplicateDetector c2) { >+ return c1.getName().compareToIgnoreCase(c2.getName()); >+ } >+ >+ }); >+ >+ for (AbstractDuplicateDetector detector : allCollectors) { >+ duplicateDetectorChooser.add(detector.getName()); >+ } >+ >+ duplicateDetectorChooser.select(0); >+ duplicateDetectorChooser.setEnabled(true); >+ duplicateDetectorChooser.setData(allCollectors); >+ >+ if (allCollectors.size() > 0) { >+ >+ searchForDuplicates = toolkit.createButton(relatedBugsComposite, LABEL_SEARCH_DUPS, SWT.NONE); >+ GridData searchDuplicatesButtonData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); >+ searchForDuplicates.setLayoutData(searchDuplicatesButtonData); >+ searchForDuplicates.addListener(SWT.Selection, new Listener() { >+ public void handleEvent(Event e) { >+ searchForDuplicates(); >+ } >+ }); >+ } >+ } >+ else { >+ Label label = new Label(relatedBugsComposite, SWT.LEFT); >+ label.setText(LABEL_NO_DETECTOR); >+ >+ } >+ >+ } >+ >+ protected SearchHitCollector getDuplicateSearchCollector(String name) { >+ return null; >+ } >+ >+ protected List<AbstractDuplicateDetector> getDuplicateSearchCollectorsList() { >+ // return TasksUiPlugin.getDefault().getDuplicateSearchCollectorsList(); >+ return null; >+ } >+ >+ public boolean searchForDuplicates() { >+ >+ String duplicateDetectorName = duplicateDetectorChooser.getItem(duplicateDetectorChooser.getSelectionIndex()); >+ >+ // called so that the description text is set on taskData before we >+ // search for duplicates >+ this.saveTaskOffline(new NullProgressMonitor()); >+ >+ SearchHitCollector collector = getDuplicateSearchCollector(duplicateDetectorName); >+ if (collector != null) { >+ NewSearchUI.runQueryInBackground(collector); >+ return true; >+ } >+ >+ return false; >+ } >+ >+ /** > * Adds content assist to the given text field. > * > * @param text >#P org.eclipse.mylyn.bugzilla.ui >Index: src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditor.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditor.java,v >retrieving revision 1.64 >diff -u -r1.64 BugzillaTaskEditor.java >--- src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditor.java 16 Jun 2007 01:59:42 -0000 1.64 >+++ src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditor.java 18 Jun 2007 04:32:36 -0000 >@@ -33,12 +33,14 @@ > import org.eclipse.mylyn.tasks.core.RepositoryOperation; > import org.eclipse.mylyn.tasks.core.RepositoryTaskAttribute; > import org.eclipse.mylyn.tasks.core.TaskComment; >+import org.eclipse.mylyn.tasks.ui.AbstractDuplicateDetector; > import org.eclipse.mylyn.tasks.ui.DatePicker; > import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; > import org.eclipse.mylyn.tasks.ui.TasksUiUtil; > import org.eclipse.mylyn.tasks.ui.editors.AbstractRepositoryTaskEditor; > import org.eclipse.mylyn.tasks.ui.editors.RepositoryTaskSelection; > import org.eclipse.mylyn.tasks.ui.editors.TaskEditor; >+import org.eclipse.mylyn.tasks.ui.search.SearchHitCollector; > import org.eclipse.swt.SWT; > import org.eclipse.swt.events.ModifyEvent; > import org.eclipse.swt.events.ModifyListener; >@@ -357,7 +359,7 @@ > try { > operation = BUGZILLA_OPERATION.valueOf(repositoryOperation.getKnobName()); > } catch (RuntimeException e) { >- StatusManager.log(e, "Unrecognized operatoin: " + repositoryOperation.getKnobName()); >+ StatusManager.log(e, "Unrecognized operation: " + repositoryOperation.getKnobName()); > operation = null; > } > >@@ -722,4 +724,29 @@ > return null; > } > } >+ >+ @Override >+ /** >+ * This method is duplicated in NewBugzillaTaskEditor for now. >+ */ >+ public SearchHitCollector getDuplicateSearchCollector(String name) { >+ String duplicateDetectorName = name.equals("default") ? "Stack Trace" : name; >+ java.util.List<AbstractDuplicateDetector> allDetectors = getDuplicateSearchCollectorsList(); >+ >+ for (AbstractDuplicateDetector detector : allDetectors) { >+ if (detector.getName().equals(duplicateDetectorName)) { >+ return detector.getSearchHitCollector(repository, taskData); >+ } >+ } >+ // didn't find it >+ return null; >+ } >+ >+ @Override >+ /** >+ * This method is duplicated in NewBugzillaTaskEditor for now. >+ */ >+ protected java.util.List<AbstractDuplicateDetector> getDuplicateSearchCollectorsList() { >+ return TasksUiPlugin.getDefault().getDuplicateSearchCollectorsList(); >+ } > } >\ No newline at end of file >Index: src/org/eclipse/mylyn/internal/bugzilla/ui/editor/NewBugzillaTaskEditor.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/NewBugzillaTaskEditor.java,v >retrieving revision 1.35 >diff -u -r1.35 NewBugzillaTaskEditor.java >--- src/org/eclipse/mylyn/internal/bugzilla/ui/editor/NewBugzillaTaskEditor.java 11 Jun 2007 21:50:26 -0000 1.35 >+++ src/org/eclipse/mylyn/internal/bugzilla/ui/editor/NewBugzillaTaskEditor.java 18 Jun 2007 04:32:36 -0000 >@@ -100,6 +100,9 @@ > } > > @Override >+ /** >+ * This method is duplicated in BugzillaTaskEditor for now. >+ */ > public SearchHitCollector getDuplicateSearchCollector(String name) { > String duplicateDetectorName = name.equals("default") ? "Stack Trace" : name; > List<AbstractDuplicateDetector> allDetectors = getDuplicateSearchCollectorsList(); >@@ -113,6 +116,10 @@ > return null; > } > >+ @Override >+ /** >+ * This method is duplicated in BugzillaTaskEditor for now. >+ */ > protected List<AbstractDuplicateDetector> getDuplicateSearchCollectorsList() { > return TasksUiPlugin.getDefault().getDuplicateSearchCollectorsList(); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 156061
:
71510
|
71511
| 71584 |
71585