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 71510 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]
Adds related bugs section (moves search for duplicates functionality)
patch.txt (text/plain), 16.89 KB, created by
Gail Murphy
on 2007-06-15 15:42:48 EDT
(
hide
)
Description:
Adds related bugs section (moves search for duplicates functionality)
Filename:
MIME Type:
Creator:
Gail Murphy
Created:
2007-06-15 15:42:48 EDT
Size:
16.89 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 15 Jun 2007 19:19:30 -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.156 >diff -u -r1.156 AbstractRepositoryTaskEditor.java >--- src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java 14 Jun 2007 22:01:06 -0000 1.156 >+++ src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java 15 Jun 2007 19:19:30 -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; >@@ -91,9 +92,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; >@@ -187,6 +191,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"; > >@@ -209,9 +215,13 @@ > private static final String LABEL_BUTTON_SUBMIT = "Submit"; > > private static final String LABEL_COPY_TO_CLIPBOARD = "Copy to Clipboard"; >- >+ > 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; >@@ -248,9 +258,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; > >@@ -286,7 +303,6 @@ > } > }; > >- > private final ITaskListChangeListener TASKLIST_CHANGE_LISTENER = new ITaskListChangeListener() { > > public void containersChanged(Set<TaskContainerDelta> containers) { >@@ -294,7 +310,7 @@ > for (TaskContainerDelta taskContainerDelta : containers) { > if (repositoryTask != null && repositoryTask.equals(taskContainerDelta.getContainer())) { > if (taskContainerDelta.getKind().equals(TaskContainerDelta.Kind.CONTENT)) { >- taskToRefresh = (AbstractTask)taskContainerDelta.getContainer(); >+ taskToRefresh = (AbstractTask) taskContainerDelta.getContainer(); > break; > } > } >@@ -322,10 +338,9 @@ > } > } > }); >- } >+ } > } > }; >- > > private List<ISelectionChangedListener> selectionChangedListeners = new ArrayList<ISelectionChangedListener>(); > >@@ -657,6 +672,8 @@ > createAttributeLayout(attribComp); > createCustomAttributeLayout(attribComp); > >+ createRelatedBugsSection(editorComposite); >+ > if (showAttachments) { > createAttachmentLayout(editorComposite); > } >@@ -929,6 +946,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 >@@ -1237,7 +1336,7 @@ > popupMenu.addMenuListener(new IMenuListener() { > public void menuAboutToShow(IMenuManager manager) { > popupMenu.removeAll(); >- >+ > ISelection selection = attachmentsTableViewer.getSelection(); > if (selection.isEmpty()) { > return; >@@ -1264,12 +1363,12 @@ > popupMenu.add(copyToClipAction); > } > popupMenu.add(new Separator("actions")); >- >+ > // TODO: use workbench mechanism for this? > ObjectActionContributorManager.getManager().contributeObjectActions( > AbstractRepositoryTaskEditor.this, popupMenu, attachmentsTableViewer); > } >- }); >+ }); > } else { > Label label = toolkit.createLabel(attachmentsComposite, "No attachments"); > registerDropListener(label); >@@ -1282,7 +1381,8 @@ > /* Launch a NewAttachemntWizard */ > Button addAttachmentButton = toolkit.createButton(attachmentControlsComposite, "Attach File...", SWT.PUSH); > >- AbstractTask task = TasksUiPlugin.getTaskListManager().getTaskList().getTask(repository.getUrl(), taskData.getId()); >+ AbstractTask task = TasksUiPlugin.getTaskListManager().getTaskList().getTask(repository.getUrl(), >+ taskData.getId()); > if (task == null) { > addAttachmentButton.setEnabled(false); > } >@@ -1898,7 +1998,8 @@ > > toolkit.createLabel(buttonComposite, " "); > >- AbstractTask task = TasksUiPlugin.getTaskListManager().getTaskList().getTask(repository.getUrl(), taskData.getId()); >+ AbstractTask task = TasksUiPlugin.getTaskListManager().getTaskList().getTask(repository.getUrl(), >+ taskData.getId()); > if (attachContextEnabled && task != null) { > addAttachContextButton(buttonComposite, task); > } >@@ -2533,9 +2634,8 @@ > "Task could not be created. No additional information was provided by the connector.")); > } > } else { >- modifiedTask = (AbstractTask) TasksUiPlugin.getTaskListManager() >- .getTaskList() >- .getTask(repository.getUrl(), taskData.getId()); >+ modifiedTask = (AbstractTask) TasksUiPlugin.getTaskListManager().getTaskList().getTask( >+ repository.getUrl(), taskData.getId()); > } > > // Synchronization accounting... >#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.62 >diff -u -r1.62 BugzillaTaskEditor.java >--- src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditor.java 14 Jun 2007 18:43:55 -0000 1.62 >+++ src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditor.java 15 Jun 2007 19:19:31 -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; >@@ -725,4 +727,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 15 Jun 2007 19:19:31 -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