Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2010-05-22 22:28:23 +0000
committerspingel2010-05-22 22:28:23 +0000
commit42bf25423fa8d0463d4716e9dfe2acd587f35da3 (patch)
tree004064257a74fa70a297f573ac860071c537d0bf /org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui
parentd8b43340325ba921057cf7bf9ba7c9e86cc344aa (diff)
downloadorg.eclipse.mylyn.tasks-42bf25423fa8d0463d4716e9dfe2acd587f35da3.tar.gz
org.eclipse.mylyn.tasks-42bf25423fa8d0463d4716e9dfe2acd587f35da3.tar.xz
org.eclipse.mylyn.tasks-42bf25423fa8d0463d4716e9dfe2acd587f35da3.zip
NEW - bug 304910: [patch] recognize comment#number link on bug editor without bug number too
https://bugs.eclipse.org/bugs/show_bug.cgi?id=304910
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/AbstractRepositoryConnectorUi.java23
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorExtension.java50
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/TaskAttachmentPage.java2
3 files changed, 73 insertions, 2 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/AbstractRepositoryConnectorUi.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/AbstractRepositoryConnectorUi.java
index ad45785f9..a2d0f15c8 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/AbstractRepositoryConnectorUi.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/AbstractRepositoryConnectorUi.java
@@ -239,7 +239,9 @@ public abstract class AbstractRepositoryConnectorUi {
* the offset of <code>text</code>
* @return an array of hyperlinks, or null if no hyperlinks were found
* @since 2.0
+ * @deprecated use {@link #findHyperlinks(TaskRepository, ITask, String, int, int)} instead
*/
+ @Deprecated
public IHyperlink[] findHyperlinks(TaskRepository repository, String text, int index, int textOffset) {
return null;
}
@@ -266,4 +268,25 @@ public abstract class AbstractRepositoryConnectorUi {
return new TaskAttachmentPage(model);
}
+ /**
+ * Returns an array of hyperlinks that link to tasks within <code>text</code>. If <code>index</code> is != -1
+ * clients may limit the results to hyperlinks found at <code>index</code>. It is legal for clients to always return
+ * all results.
+ *
+ * @param repository
+ * the task repository, never <code>null</code>
+ * @param task
+ * the task, can be <code>null</code>
+ * @param text
+ * the line of text
+ * @param index
+ * the index within <code>text</code>, if -1 return all hyperlinks found in text
+ * @param textOffset
+ * the offset of <code>text</code>
+ * @return an array of hyperlinks, or null if no hyperlinks were found
+ * @since 3.4
+ */
+ public IHyperlink[] findHyperlinks(TaskRepository repository, ITask task, String text, int index, int textOffset) {
+ return findHyperlinks(repository, text, index, textOffset);
+ }
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorExtension.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorExtension.java
index 3858f8c3c..4edceb2b0 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorExtension.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorExtension.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2008 David Green and others.
+ * Copyright (c) 2008 David Green 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
@@ -7,10 +7,12 @@
*
* Contributors:
* David Green - initial API and implementation
+ * Tasktop Technologies - improvements
*******************************************************************************/
package org.eclipse.mylyn.tasks.ui.editors;
+import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.text.source.SourceViewer;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.swt.widgets.Composite;
@@ -27,6 +29,8 @@ public abstract class AbstractTaskEditorExtension {
/**
* The key to access the {@link TaskRepository} property that stores the URL of an associated wiki.
+ *
+ * @since 3.1
*/
public static final String INTERNAL_WIKI_LINK_PATTERN = "wikiLinkPattern"; //$NON-NLS-1$
@@ -40,10 +44,31 @@ public abstract class AbstractTaskEditorExtension {
* the control parent of the source viewer
* @param style
* the styles to use
+ * @deprecated use {@link #createViewer(TaskRepository, Composite, int, IAdaptable)} instead
+ * @since 3.1
*/
+ @Deprecated
public abstract SourceViewer createViewer(TaskRepository taskRepository, Composite parent, int style);
/**
+ * Creates a source viewer that can be used to view content in the task editor. The source viewer should be
+ * configured with a source viewer configuration prior to returning.
+ *
+ * @param taskRepository
+ * the task repository for which the viewer is created
+ * @param parent
+ * the control parent of the source viewer
+ * @param style
+ * the styles to use
+ * @param context
+ * the context for the hyperlink detector, may be null
+ * @since 3.4
+ */
+ public SourceViewer createViewer(TaskRepository taskRepository, Composite parent, int style, IAdaptable context) {
+ return createViewer(taskRepository, parent, style);
+ }
+
+ /**
* Creates a source viewer that can be used to edit content in the task editor. The source viewer should be
* configured with a source viewer configuration prior to returning.
*
@@ -53,12 +78,35 @@ public abstract class AbstractTaskEditorExtension {
* the control parent of the source viewer
* @param style
* the styles to use
+ * @deprecated use {@link #createViewer(TaskRepository, Composite, int, IAdaptable)} instead
+ * @since 3.1
*/
+ @Deprecated
public abstract SourceViewer createEditor(TaskRepository taskRepository, Composite parent, int style);
/**
* Returns the editor context id, to be passed to the {@link IContextService} when the editor is in focus.
+ *
+ * @since 3.1
*/
public abstract String getEditorContextId();
+ /**
+ * Creates a source viewer that can be used to edit content in the task editor. The source viewer should be
+ * configured with a source viewer configuration prior to returning.
+ *
+ * @param taskRepository
+ * the task repository for which the viewer is created
+ * @param parent
+ * the control parent of the source viewer
+ * @param style
+ * the styles to use
+ * @param context
+ * the context for the hyperlink detector, may be null
+ * @since 3.4
+ */
+ public SourceViewer createEditor(TaskRepository taskRepository, Composite parent, int style, IAdaptable context) {
+ return createEditor(taskRepository, parent, style);
+ }
+
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/TaskAttachmentPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/TaskAttachmentPage.java
index c39c562de..d4a15499d 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/TaskAttachmentPage.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/TaskAttachmentPage.java
@@ -148,7 +148,7 @@ public class TaskAttachmentPage extends WizardPage {
}
commentEditor = new RichTextEditor(getModel().getTaskRepository(), SWT.V_SCROLL | SWT.BORDER | SWT.WRAP,
- contextService, extension) {
+ contextService, extension, getModel().getTask()) {
@Override
protected void valueChanged(String value) {
apply();

Back to the top