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 72237 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
172699-addlist.txt (text/plain), 8.27 KB, created by
Balazs Brinkus
on 2007-06-22 19:37:19 EDT
(
hide
)
Description:
AddTaskListAction
Filename:
MIME Type:
Creator:
Balazs Brinkus
Created:
2007-06-22 19:37:19 EDT
Size:
8.27 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.tasks.ui >Index: src/org/eclipse/mylyn/tasks/ui/TasksUiPlugin.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiPlugin.java,v >retrieving revision 1.116 >diff -u -r1.116 TasksUiPlugin.java >--- src/org/eclipse/mylyn/tasks/ui/TasksUiPlugin.java 21 Jun 2007 20:43:11 -0000 1.116 >+++ src/org/eclipse/mylyn/tasks/ui/TasksUiPlugin.java 22 Jun 2007 22:49:29 -0000 >@@ -58,7 +58,6 @@ > import org.eclipse.mylyn.internal.tasks.ui.TaskListNotificationReminder; > import org.eclipse.mylyn.internal.tasks.ui.TaskListSynchronizationScheduler; > import org.eclipse.mylyn.internal.tasks.ui.TasksUiPreferenceConstants; >-import org.eclipse.mylyn.internal.tasks.ui.WorkspaceAwareContextStore; > import org.eclipse.mylyn.internal.tasks.ui.util.TaskListSaveManager; > import org.eclipse.mylyn.internal.tasks.ui.util.TaskListWriter; > import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiExtensionReader; >@@ -68,8 +67,8 @@ > 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.core.ITaskActivityListener; > import org.eclipse.mylyn.tasks.core.AbstractTaskDataHandler; >+import org.eclipse.mylyn.tasks.core.ITaskActivityListener; > import org.eclipse.mylyn.tasks.core.RepositoryTaskAttribute; > import org.eclipse.mylyn.tasks.core.RepositoryTaskData; > import org.eclipse.mylyn.tasks.core.RepositoryTemplate; >@@ -101,7 +100,7 @@ > > public static final String LABEL_VIEW_REPOSITORIES = "Task Repositories view"; > >- public static final String PLUGIN_ID = "org.eclipse.mylyn.tasklist"; >+ public static final String PLUGIN_ID = "org.eclipse.mylyn.tasks.ui"; > > private static final String DIRECTORY_METADATA = ".metadata"; > >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.16 >diff -u -r1.16 SearchHitCollector.java >--- src/org/eclipse/mylyn/tasks/ui/search/SearchHitCollector.java 15 Jun 2007 22:04:59 -0000 1.16 >+++ src/org/eclipse/mylyn/tasks/ui/search/SearchHitCollector.java 22 Jun 2007 22:49:30 -0000 >@@ -224,4 +224,8 @@ > return taskResults; > } > >+ public AbstractRepositoryQuery getRepositoryQuery() { >+ return repositoryQuery; >+ } >+ > } >\ No newline at end of file >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.22 >diff -u -r1.22 RepositorySearchResultView.java >--- src/org/eclipse/mylyn/internal/tasks/ui/search/RepositorySearchResultView.java 18 Jun 2007 15:46:42 -0000 1.22 >+++ src/org/eclipse/mylyn/internal/tasks/ui/search/RepositorySearchResultView.java 22 Jun 2007 22:49:26 -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 >@@ -212,8 +216,8 @@ > throws PartInitException { > AbstractTask repositoryHit = (AbstractTask) match.getElement(); > >- TasksUiUtil.openRepositoryTask(repositoryHit.getRepositoryUrl(), repositoryHit.getTaskId(), repositoryHit >- .getTaskUrl()); >+ TasksUiUtil.openRepositoryTask(repositoryHit.getRepositoryUrl(), repositoryHit.getTaskId(), >+ repositoryHit.getTaskUrl()); > } > > @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 - 2007 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 icon */ >+ 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.PLUGIN_ID, 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.getRepositoryKind()); >+ 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