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 72304 Details for
Bug 172699
[new uex] create new task list query from search results
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]
AddTaskListAction v.2
172699-addlist-v2.txt (text/plain), 6.02 KB, created by
Balazs Brinkus
on 2007-06-24 17:38:28 EDT
(
hide
)
Description:
AddTaskListAction v.2
Filename:
MIME Type:
Creator:
Balazs Brinkus
Created:
2007-06-24 17:38:28 EDT
Size:
6.02 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.tasks.ui >Index: src/org/eclipse/mylyn/tasks/ui/search/SearchHitCollector.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/search/SearchHitCollector.java,v >retrieving revision 1.19 >diff -u -r1.19 SearchHitCollector.java >--- src/org/eclipse/mylyn/tasks/ui/search/SearchHitCollector.java 23 Jun 2007 03:23:01 -0000 1.19 >+++ src/org/eclipse/mylyn/tasks/ui/search/SearchHitCollector.java 24 Jun 2007 21:25:07 -0000 >@@ -223,4 +223,8 @@ > return taskResults; > } > >-} >\ No newline at end of file >+ public AbstractRepositoryQuery getRepositoryQuery() { >+ return repositoryQuery; >+ } >+ >+} >Index: src/org/eclipse/mylyn/internal/tasks/ui/search/RepositorySearchResultView.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/RepositorySearchResultView.java,v >retrieving revision 1.24 >diff -u -r1.24 RepositorySearchResultView.java >--- src/org/eclipse/mylyn/internal/tasks/ui/search/RepositorySearchResultView.java 23 Jun 2007 02:30:18 -0000 1.24 >+++ src/org/eclipse/mylyn/internal/tasks/ui/search/RepositorySearchResultView.java 24 Jun 2007 21:25:07 -0000 >@@ -75,6 +75,8 @@ > > private OpenSearchResultAction openInEditorAction; > >+ private AddTaskListAction addTaskListAction; >+ > private static final String[] SHOW_IN_TARGETS = new String[] { IPageLayout.ID_RES_NAV }; > > private static final IShowInTargetList SHOW_IN_TARGET_LIST = new IShowInTargetList() { >@@ -95,6 +97,8 @@ > currentSortOrder = ORDER_DEFAULT; > > openInEditorAction = new OpenSearchResultAction("Open in Editor", this); >+ >+ addTaskListAction = new AddTaskListAction("Add to Task List", this); > } > > @Override >@@ -231,6 +235,7 @@ > // Add the new context menu items > mgr.appendToGroup(IContextMenuConstants.GROUP_VIEWER_SETUP, sortMenu); > mgr.appendToGroup(IContextMenuConstants.GROUP_OPEN, openInEditorAction); >+ mgr.appendToGroup(IContextMenuConstants.GROUP_ADDITIONS, addTaskListAction); > } > > class SearchViewTableLabelProvider extends TaskTableLabelProvider { >Index: src/org/eclipse/mylyn/internal/tasks/ui/search/AddTaskListAction.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/tasks/ui/search/AddTaskListAction.java >diff -N src/org/eclipse/mylyn/internal/tasks/ui/search/AddTaskListAction.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/tasks/ui/search/AddTaskListAction.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,84 @@ >+/******************************************************************************* >+ * Copyright (c) 2004 - 20067 Mylyn committers and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ *******************************************************************************/ >+ >+package org.eclipse.mylyn.internal.tasks.ui.search; >+ >+import org.eclipse.jface.action.Action; >+import org.eclipse.jface.dialogs.InputDialog; >+import org.eclipse.jface.viewers.ISelection; >+import org.eclipse.jface.viewers.IStructuredSelection; >+import org.eclipse.jface.window.Window; >+import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; >+import org.eclipse.mylyn.tasks.core.AbstractRepositoryQuery; >+import org.eclipse.mylyn.tasks.core.AbstractTask; >+import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; >+import org.eclipse.mylyn.tasks.ui.search.SearchHitCollector; >+import org.eclipse.search.ui.ISearchQuery; >+import org.eclipse.search.ui.NewSearchUI; >+import org.eclipse.ui.PlatformUI; >+ >+/** >+ * Used for add the last search result to the Task List. >+ * >+ * @author Balazs Brinkus (bug 172699) >+ */ >+public class AddTaskListAction extends Action { >+ >+ /** The view this action works on */ >+ private RepositorySearchResultView resultView; >+ >+ /** The path of the icons */ >+ private final String iconPath = "icons/etool16/query-new.gif"; >+ >+ /** >+ * Constructor >+ * >+ * @param text >+ * The text for this action >+ * @param resultView >+ * The <code>RepositorySearchResultView</code> this action works on >+ */ >+ public AddTaskListAction(String text, RepositorySearchResultView resultView) { >+ setText(text); >+ setImageDescriptor(TasksUiPlugin.imageDescriptorFromPlugin(TasksUiPlugin.ID_PLUGIN, iconPath)); >+ this.resultView = resultView; >+ } >+ >+ /** >+ * Add the search result to the Task List. >+ */ >+ public void run() { >+ ISelection s = resultView.getViewer().getSelection(); >+ if (s instanceof IStructuredSelection) { >+ IStructuredSelection selection = (IStructuredSelection) s; >+ if (selection.getFirstElement() instanceof AbstractTask) { >+ ISearchQuery[] queries = NewSearchUI.getQueries(); >+ AbstractTask task = (AbstractTask) selection.getFirstElement(); >+ AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector( >+ task.getConnectorKind()); >+ if (queries.length != 0 && connector != null) { >+ SearchHitCollector searchHitCollector = (SearchHitCollector) queries[0]; >+ AbstractRepositoryQuery query = (AbstractRepositoryQuery) searchHitCollector.getRepositoryQuery(); >+ >+ InputDialog dialog = new InputDialog(PlatformUI.getWorkbench() >+ .getActiveWorkbenchWindow() >+ .getShell(), "Enter query name", "Enter the name for the Query: ", "", null); >+ int dialogResult = dialog.open(); >+ if (dialogResult == Window.OK) { >+ query.setHandleIdentifier(dialog.getValue()); >+ TasksUiPlugin.getTaskListManager().getTaskList().addQuery(query); >+ TasksUiPlugin.getSynchronizationManager().synchronize(connector, query, null, true); >+ } >+ >+ } >+ >+ } >+ } >+ } >+ >+}
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 172699
:
70042
|
70043
|
70045
|
72237
|
72238
| 72304 |
72305
|
72317