Lines 9-21
Link Here
|
9 |
package org.eclipse.mylyn.tasks.ui.editors; |
9 |
package org.eclipse.mylyn.tasks.ui.editors; |
10 |
|
10 |
|
11 |
import java.util.HashMap; |
11 |
import java.util.HashMap; |
|
|
12 |
import java.util.Iterator; |
12 |
import java.util.Map; |
13 |
import java.util.Map; |
13 |
|
14 |
|
14 |
import org.eclipse.core.runtime.IAdaptable; |
15 |
import org.eclipse.core.runtime.IAdaptable; |
15 |
import org.eclipse.jface.preference.JFacePreferences; |
16 |
import org.eclipse.jface.preference.JFacePreferences; |
16 |
import org.eclipse.jface.resource.JFaceResources; |
17 |
import org.eclipse.jface.resource.JFaceResources; |
17 |
import org.eclipse.jface.text.IDocument; |
18 |
import org.eclipse.jface.text.IDocument; |
|
|
19 |
import org.eclipse.jface.text.IRegion; |
18 |
import org.eclipse.jface.text.TextAttribute; |
20 |
import org.eclipse.jface.text.TextAttribute; |
|
|
21 |
import org.eclipse.jface.text.TextPresentation; |
19 |
import org.eclipse.jface.text.hyperlink.DefaultHyperlinkPresenter; |
22 |
import org.eclipse.jface.text.hyperlink.DefaultHyperlinkPresenter; |
20 |
import org.eclipse.jface.text.hyperlink.IHyperlink; |
23 |
import org.eclipse.jface.text.hyperlink.IHyperlink; |
21 |
import org.eclipse.jface.text.hyperlink.IHyperlinkPresenter; |
24 |
import org.eclipse.jface.text.hyperlink.IHyperlinkPresenter; |
Lines 38-44
Link Here
|
38 |
import org.eclipse.mylyn.tasks.ui.TaskHyperlink; |
41 |
import org.eclipse.mylyn.tasks.ui.TaskHyperlink; |
39 |
import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; |
42 |
import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; |
40 |
import org.eclipse.swt.SWT; |
43 |
import org.eclipse.swt.SWT; |
|
|
44 |
import org.eclipse.swt.custom.StyleRange; |
41 |
import org.eclipse.swt.graphics.Color; |
45 |
import org.eclipse.swt.graphics.Color; |
|
|
46 |
import org.eclipse.swt.graphics.RGB; |
42 |
import org.eclipse.swt.widgets.Control; |
47 |
import org.eclipse.swt.widgets.Control; |
43 |
import org.eclipse.ui.editors.text.EditorsUI; |
48 |
import org.eclipse.ui.editors.text.EditorsUI; |
44 |
import org.eclipse.ui.editors.text.TextSourceViewerConfiguration; |
49 |
import org.eclipse.ui.editors.text.TextSourceViewerConfiguration; |
Lines 135-144
Link Here
|
135 |
this.sourceViewer = sourceViewer; |
140 |
this.sourceViewer = sourceViewer; |
136 |
} |
141 |
} |
137 |
|
142 |
|
|
|
143 |
@SuppressWarnings("unchecked") |
138 |
@Override |
144 |
@Override |
139 |
public void showHyperlinks(IHyperlink[] hyperlinks) { |
145 |
public void applyTextPresentation(TextPresentation textPresentation) { |
140 |
super.showHyperlinks(hyperlinks); |
146 |
super.applyTextPresentation(textPresentation); |
|
|
147 |
if (currentTaskHyperlink != null && currentTaskHyperlink.isCompleted()) { |
148 |
Iterator<StyleRange> styleRangeIterator = textPresentation.getAllStyleRangeIterator(); |
149 |
while (styleRangeIterator.hasNext()) { |
150 |
StyleRange styleRange = styleRangeIterator.next(); |
151 |
if (styleRange.underline) { |
152 |
styleRange.strikeout = true; |
153 |
} |
154 |
} |
155 |
} |
156 |
} |
141 |
|
157 |
|
|
|
158 |
@Override |
159 |
public void showHyperlinks(IHyperlink[] hyperlinks) { |
142 |
if (hyperlinks != null && hyperlinks.length > 0 && hyperlinks[0] instanceof TaskHyperlink) { |
160 |
if (hyperlinks != null && hyperlinks.length > 0 && hyperlinks[0] instanceof TaskHyperlink) { |
143 |
TaskHyperlink hyperlink = (TaskHyperlink) hyperlinks[0]; |
161 |
TaskHyperlink hyperlink = (TaskHyperlink) hyperlinks[0]; |
144 |
|
162 |
|
Lines 160-165
Link Here
|
160 |
} |
178 |
} |
161 |
} |
179 |
} |
162 |
} |
180 |
} |
|
|
181 |
super.showHyperlinks(hyperlinks); |
163 |
} |
182 |
} |
164 |
|
183 |
|
165 |
@Override |
184 |
@Override |