|
Lines 224-253
Link Here
|
| 224 |
manager.add(synchronizeEditorAction); |
224 |
manager.add(synchronizeEditorAction); |
| 225 |
manager.add(openWithBrowserAction); |
225 |
manager.add(openWithBrowserAction); |
| 226 |
|
226 |
|
| 227 |
if (this.getEditor().getActivePageInstance() instanceof AbstractRepositoryTaskEditor) { |
|
|
| 228 |
if (this.getEditor().getSelection() instanceof RepositoryTaskSelection) { |
| 229 |
RepositoryTaskSelection repositoryTaskSelection = (RepositoryTaskSelection) this.getEditor() |
| 230 |
.getSelection(); |
| 231 |
TaskComment comment = repositoryTaskSelection.getComment(); |
| 232 |
if (comment != null) { |
| 233 |
newTaskFromCommentAction.setTaskComment(comment); |
| 234 |
AbstractRepositoryTaskEditor editor = (AbstractRepositoryTaskEditor) this.getEditor() |
| 235 |
.getActivePageInstance(); |
| 236 |
if (getEditor().getActivePageInstance() instanceof TaskFormPage) { |
| 237 |
TaskFormPage formPage = (TaskFormPage) getEditor().getActivePageInstance(); |
| 238 |
String selectionText = formPage.getSelectionText(); |
| 239 |
newTaskFromCommentAction.setSelectedCommentText(selectionText); |
| 240 |
} |
| 241 |
IEditorInput input = editor.getEditorInput(); |
| 242 |
if (input instanceof RepositoryTaskEditorInput) { |
| 243 |
RepositoryTaskEditorInput repositoryInput = (RepositoryTaskEditorInput) input; |
| 244 |
newTaskFromCommentAction.setTaskData(repositoryInput.getTaskData()); |
| 245 |
} |
| 246 |
manager.add(newTaskFromCommentAction); |
| 247 |
} |
| 248 |
} |
| 249 |
} |
| 250 |
|
| 251 |
if (task.isActive()) { |
227 |
if (task.isActive()) { |
| 252 |
manager.add(new TaskDeactivateAction() { |
228 |
manager.add(new TaskDeactivateAction() { |
| 253 |
@Override |
229 |
@Override |
|
Lines 309-314
Link Here
|
| 309 |
}); |
285 |
}); |
| 310 |
} |
286 |
} |
| 311 |
|
287 |
|
|
|
288 |
if (this.getEditor().getActivePageInstance() instanceof AbstractRepositoryTaskEditor) { |
| 289 |
if (this.getEditor().getSelection() instanceof RepositoryTaskSelection) { |
| 290 |
RepositoryTaskSelection repositoryTaskSelection = (RepositoryTaskSelection) this.getEditor() |
| 291 |
.getSelection(); |
| 292 |
TaskComment comment = repositoryTaskSelection.getComment(); |
| 293 |
if (comment != null) { |
| 294 |
newTaskFromCommentAction.setTaskComment(comment); |
| 295 |
AbstractRepositoryTaskEditor editor = (AbstractRepositoryTaskEditor) this.getEditor() |
| 296 |
.getActivePageInstance(); |
| 297 |
if (getEditor().getActivePageInstance() instanceof TaskFormPage) { |
| 298 |
TaskFormPage formPage = (TaskFormPage) getEditor().getActivePageInstance(); |
| 299 |
String selectionText = formPage.getSelectionText(); |
| 300 |
newTaskFromCommentAction.setSelectedCommentText(selectionText); |
| 301 |
} |
| 302 |
IEditorInput input = editor.getEditorInput(); |
| 303 |
if (input instanceof RepositoryTaskEditorInput) { |
| 304 |
RepositoryTaskEditorInput repositoryInput = (RepositoryTaskEditorInput) input; |
| 305 |
if (repositoryInput.getTaskData() != null) { |
| 306 |
newTaskFromCommentAction.setTaskData(repositoryInput.getTaskData()); |
| 307 |
IMenuManager subMenu = manager.findMenuUsingPath("org.eclipse.mylyn.tasks.ui.menu.new"); |
| 308 |
if (subMenu == null) { |
| 309 |
subMenu = new MenuManager("New", "org.eclipse.mylyn.tasks.ui.menu.new"); |
| 310 |
manager.add(new Separator()); |
| 311 |
manager.add(subMenu); |
| 312 |
} |
| 313 |
subMenu.add(newTaskFromCommentAction); |
| 314 |
} |
| 315 |
} |
| 316 |
} |
| 317 |
} |
| 318 |
} |
| 319 |
|
| 312 |
manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); |
320 |
manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); |
| 313 |
} |
321 |
} |
| 314 |
|
322 |
|