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 70042 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]
create query from task search
172699-query.txt (text/plain), 5.82 KB, created by
Balazs Brinkus
on 2007-06-04 18:11:17 EDT
(
hide
)
Description:
create query from task search
Filename:
MIME Type:
Creator:
Balazs Brinkus
Created:
2007-06-04 18:11:17 EDT
Size:
5.82 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylar.context.ui >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.context.ui/META-INF/MANIFEST.MF,v >retrieving revision 1.307 >diff -u -r1.307 MANIFEST.MF >--- META-INF/MANIFEST.MF 1 Jun 2007 22:24:49 -0000 1.307 >+++ META-INF/MANIFEST.MF 4 Jun 2007 22:04:45 -0000 >@@ -16,7 +16,8 @@ > org.eclipse.mylar.monitor.ui, > org.eclipse.ui.forms, > org.eclipse.ui.navigator, >- org.eclipse.mylar >+ org.eclipse.mylar, >+ org.eclipse.search > Eclipse-AutoStart: true > Bundle-Vendor: Eclipse.org > Export-Package: org.eclipse.mylar.context.ui, >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.context.ui/plugin.xml,v >retrieving revision 1.121 >diff -u -r1.121 plugin.xml >--- plugin.xml 27 May 2007 11:53:36 -0000 1.121 >+++ plugin.xml 4 Jun 2007 22:04:45 -0000 >@@ -187,6 +187,14 @@ > menubarPath="context" > tooltip="Copy Context to..."> > </action> >+ <action >+ class="org.eclipse.mylar.internal.context.ui.actions.CreateTaskListQueryAction" >+ icon="icons/etool16/context-query.gif" >+ id="org.eclipse.mylar.context.ui.action.query" >+ label="Create a Query" >+ menubarPath="context" >+ tooltip="Create a Query from the Search"> >+ </action> > </objectContribution> > </extension> > >Index: src/org/eclipse/mylar/internal/context/ui/actions/CreateTaskListQueryAction.java >=================================================================== >RCS file: src/org/eclipse/mylar/internal/context/ui/actions/CreateTaskListQueryAction.java >diff -N src/org/eclipse/mylar/internal/context/ui/actions/CreateTaskListQueryAction.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylar/internal/context/ui/actions/CreateTaskListQueryAction.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,77 @@ >+/******************************************************************************* >+ * Copyright (c) 2004 - 2007 University Of British Columbia 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 >+ * >+ * Contributors: >+ * University Of British Columbia - initial API and implementation >+ *******************************************************************************/ >+ >+package org.eclipse.mylar.internal.context.ui.actions; >+ >+import org.eclipse.jface.action.IAction; >+import org.eclipse.jface.dialogs.InputDialog; >+import org.eclipse.jface.viewers.ISelection; >+import org.eclipse.jface.window.Window; >+import org.eclipse.mylar.internal.tasks.ui.views.TaskListView; >+import org.eclipse.mylar.tasks.core.AbstractRepositoryConnector; >+import org.eclipse.mylar.tasks.core.AbstractRepositoryQuery; >+import org.eclipse.mylar.tasks.core.AbstractRepositoryTask; >+import org.eclipse.mylar.tasks.core.ITask; >+import org.eclipse.mylar.tasks.ui.TasksUiPlugin; >+import org.eclipse.mylar.tasks.ui.search.SearchHitCollector; >+import org.eclipse.search.ui.ISearchQuery; >+import org.eclipse.search.ui.NewSearchUI; >+import org.eclipse.ui.IViewActionDelegate; >+import org.eclipse.ui.IViewPart; >+import org.eclipse.ui.PlatformUI; >+ >+/** >+ * Used for creating a query from the last task search result. >+ * >+ * @author Balazs Brinkus (bug 172699) >+ */ >+public class CreateTaskListQueryAction implements IViewActionDelegate { >+ >+ private AbstractRepositoryConnector connector; >+ >+ private AbstractRepositoryQuery query; >+ >+ public void init(IViewPart view) { >+ // ignore >+ } >+ >+ public void run(IAction action) { >+ ISearchQuery[] queries = NewSearchUI.getQueries(); >+ >+ if (queries.length != 0 && connector != null) { >+ SearchHitCollector searchHitCollector = (SearchHitCollector) queries[0]; >+ 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); >+ } >+ >+ } >+ } >+ >+ public void selectionChanged(IAction action, ISelection selection) { >+ ITask selectedTask = TaskListView.getSelectedTask(selection); >+ if (selectedTask instanceof AbstractRepositoryTask) { >+ AbstractRepositoryTask task = (AbstractRepositoryTask) selectedTask; >+ connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(task.getRepositoryKind()); >+ action.setEnabled(true); >+ } else { >+ connector = null; >+ action.setEnabled(false); >+ } >+ } >+ >+} >#P org.eclipse.mylar.tasks.ui >Index: src/org/eclipse/mylar/tasks/ui/search/SearchHitCollector.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.tasks.ui/src/org/eclipse/mylar/tasks/ui/search/SearchHitCollector.java,v >retrieving revision 1.7 >diff -u -r1.7 SearchHitCollector.java >--- src/org/eclipse/mylar/tasks/ui/search/SearchHitCollector.java 7 May 2007 23:00:36 -0000 1.7 >+++ src/org/eclipse/mylar/tasks/ui/search/SearchHitCollector.java 4 Jun 2007 22:04:46 -0000 >@@ -126,4 +126,8 @@ > return Status.OK_STATUS; > } > >+ public AbstractRepositoryQuery getRepositoryQuery() { >+ return repositoryQuery; >+ } >+ > } >\ No newline at end of file
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