Skip to main content
summaryrefslogtreecommitdiffstats
blob: a06bc6a8d19b5ce14af704370f798605ac7c3a88 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/*******************************************************************************
 * Copyright (c) 2008, 2010 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
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * 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;
import org.eclipse.ui.contexts.IContextService;

/**
 * An extension that provides task editor capabilities beyond the default, oriented towards providing markup-aware
 * editing and viewing
 * 
 * @author David Green
 * @since 3.1
 */
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$

	/**
	 * 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
	 * @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.
	 * 
	 * @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
	 * @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);
	}

}

Back to the top