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 83394 Details for
Bug 169426
create a new bug from a comment
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]
follow-up patch
patch169426.txt (text/plain), 8.32 KB, created by
Frank Becker
on 2007-11-21 00:29:31 EST
(
hide
)
Description:
follow-up patch
Filename:
MIME Type:
Creator:
Frank Becker
Created:
2007-11-21 00:29:31 EST
Size:
8.32 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.tasks.ui >Index: src/org/eclipse/mylyn/internal/tasks/ui/actions/NewTaskFromCommentAction.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/NewTaskFromCommentAction.java,v >retrieving revision 1.1 >diff -u -r1.1 NewTaskFromCommentAction.java >--- src/org/eclipse/mylyn/internal/tasks/ui/actions/NewTaskFromCommentAction.java 20 Nov 2007 02:06:29 -0000 1.1 >+++ src/org/eclipse/mylyn/internal/tasks/ui/actions/NewTaskFromCommentAction.java 21 Nov 2007 05:22:29 -0000 >@@ -46,6 +46,10 @@ > @Override > public void run() { > AbstractRepositoryConnector connector = null; >+ >+ if (taskData == null) >+ return; >+ > TaskRepositoryManager repositoryManager = TasksUiPlugin.getRepositoryManager(); > connector = repositoryManager.getRepositoryConnector(taskData.getRepositoryKind()); > String textToInsert ; >Index: src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionContributor.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionContributor.java,v >retrieving revision 1.38 >diff -u -r1.38 TaskEditorActionContributor.java >--- src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionContributor.java 20 Nov 2007 02:06:29 -0000 1.38 >+++ src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionContributor.java 21 Nov 2007 05:22:37 -0000 >@@ -224,30 +224,6 @@ > manager.add(synchronizeEditorAction); > manager.add(openWithBrowserAction); > >- if (this.getEditor().getActivePageInstance() instanceof AbstractRepositoryTaskEditor) { >- if (this.getEditor().getSelection() instanceof RepositoryTaskSelection) { >- RepositoryTaskSelection repositoryTaskSelection = (RepositoryTaskSelection) this.getEditor() >- .getSelection(); >- TaskComment comment = repositoryTaskSelection.getComment(); >- if (comment != null) { >- newTaskFromCommentAction.setTaskComment(comment); >- AbstractRepositoryTaskEditor editor = (AbstractRepositoryTaskEditor) this.getEditor() >- .getActivePageInstance(); >- if (getEditor().getActivePageInstance() instanceof TaskFormPage) { >- TaskFormPage formPage = (TaskFormPage) getEditor().getActivePageInstance(); >- String selectionText = formPage.getSelectionText(); >- newTaskFromCommentAction.setSelectedCommentText(selectionText); >- } >- IEditorInput input = editor.getEditorInput(); >- if (input instanceof RepositoryTaskEditorInput) { >- RepositoryTaskEditorInput repositoryInput = (RepositoryTaskEditorInput) input; >- newTaskFromCommentAction.setTaskData(repositoryInput.getTaskData()); >- } >- manager.add(newTaskFromCommentAction); >- } >- } >- } >- > if (task.isActive()) { > manager.add(new TaskDeactivateAction() { > @Override >@@ -309,6 +285,38 @@ > }); > } > >+ if (this.getEditor().getActivePageInstance() instanceof AbstractRepositoryTaskEditor) { >+ if (this.getEditor().getSelection() instanceof RepositoryTaskSelection) { >+ RepositoryTaskSelection repositoryTaskSelection = (RepositoryTaskSelection) this.getEditor() >+ .getSelection(); >+ TaskComment comment = repositoryTaskSelection.getComment(); >+ if (comment != null) { >+ newTaskFromCommentAction.setTaskComment(comment); >+ AbstractRepositoryTaskEditor editor = (AbstractRepositoryTaskEditor) this.getEditor() >+ .getActivePageInstance(); >+ if (getEditor().getActivePageInstance() instanceof TaskFormPage) { >+ TaskFormPage formPage = (TaskFormPage) getEditor().getActivePageInstance(); >+ String selectionText = formPage.getSelectionText(); >+ newTaskFromCommentAction.setSelectedCommentText(selectionText); >+ } >+ IEditorInput input = editor.getEditorInput(); >+ if (input instanceof RepositoryTaskEditorInput) { >+ RepositoryTaskEditorInput repositoryInput = (RepositoryTaskEditorInput) input; >+ if (repositoryInput.getTaskData() != null) { >+ newTaskFromCommentAction.setTaskData(repositoryInput.getTaskData()); >+ IMenuManager subMenu = manager.findMenuUsingPath("org.eclipse.mylyn.tasks.ui.menu.new"); >+ if (subMenu == null) { >+ subMenu = new MenuManager("New", "org.eclipse.mylyn.tasks.ui.menu.new"); >+ manager.add(new Separator()); >+ manager.add(subMenu); >+ } >+ subMenu.add(newTaskFromCommentAction); >+ } >+ } >+ } >+ } >+ } >+ > manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); > } > >#P org.eclipse.mylyn.tasks.tests >Index: src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java,v >retrieving revision 1.37 >diff -u -r1.37 AllTasksTests.java >--- src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java 15 Nov 2007 01:36:48 -0000 1.37 >+++ src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java 21 Nov 2007 05:22:38 -0000 >@@ -26,6 +26,7 @@ > suite.addTestSuite(TaskRepositorySorterTest.class); > suite.addTestSuite(TaskDataManagerTest.class); > suite.addTestSuite(CopyDetailsActionTest.class); >+ suite.addTestSuite(NewTaskFromCommentActionTest.class); > suite.addTestSuite(TaskListTest.class); > suite.addTestSuite(ProjectRepositoryAssociationTest.class); > suite.addTestSuite(TaskList06DataMigrationTest.class); >Index: src/org/eclipse/mylyn/tasks/tests/NewTaskFromCommentActionTest.java >=================================================================== >RCS file: src/org/eclipse/mylyn/tasks/tests/NewTaskFromCommentActionTest.java >diff -N src/org/eclipse/mylyn/tasks/tests/NewTaskFromCommentActionTest.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/tasks/tests/NewTaskFromCommentActionTest.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,78 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2007 Mylyn project 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.tasks.tests; >+ >+import java.util.Date; >+import java.util.HashMap; >+import java.util.Map; >+ >+import junit.framework.TestCase; >+ >+import org.eclipse.mylyn.internal.tasks.ui.actions.NewTaskFromCommentAction; >+import org.eclipse.mylyn.tasks.core.AbstractAttributeFactory; >+import org.eclipse.mylyn.tasks.core.RepositoryTaskData; >+import org.eclipse.mylyn.tasks.core.TaskComment; >+ >+public class NewTaskFromCommentActionTest extends TestCase { >+ >+ public void testNewTaskFromCommentAction() throws Exception { >+ StubAttributeFactory targetFactory = new StubAttributeFactory(); >+ RepositoryTaskData repositoryTaskData = new RepositoryTaskData(targetFactory, "otherkind", "http://url", "2"); >+ TaskComment taskComment = new TaskComment(targetFactory, 1); >+ >+ NewTaskFromCommentAction newTaskFromCommentAction = new NewTaskFromCommentAction(); >+ newTaskFromCommentAction.setTaskData(repositoryTaskData); >+ newTaskFromCommentAction.setTaskData(null); >+ newTaskFromCommentAction.setTaskComment(taskComment); >+ try { >+ newTaskFromCommentAction.run(); >+ } catch (NullPointerException e) { >+ fail("NullPointerException not expected"); >+ } >+ >+ } >+ >+ private class StubAttributeFactory extends AbstractAttributeFactory { >+ >+ private static final long serialVersionUID = 1L; >+ >+ private Map<String, String> attributeMap = new HashMap<String, String>(); >+ >+ @Override >+ public Date getDateForAttributeType(String attributeKey, String dateString) { >+ // ignore >+ return null; >+ } >+ >+ @Override >+ public String getName(String key) { >+ // ignore >+ return null; >+ } >+ >+ @Override >+ public boolean isHidden(String key) { >+ // ignore >+ return false; >+ } >+ >+ @Override >+ public boolean isReadOnly(String key) { >+ // ignore >+ return false; >+ } >+ >+ @Override >+ public String mapCommonAttributeKey(String key) { >+ String mappedKey = attributeMap.get(key); >+ return (mappedKey != null) ? mappedKey : key; >+ } >+ >+ } >+}
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 169426
:
79776
|
79777
|
79787
|
79788
|
80500
|
80501
|
81215
|
81216
|
82013
|
82014
|
83199
|
83200
| 83394 |
83395