Community
Participate
Working Groups
This has been discussed on bug 200117: TaskTextViewerConfiguration (old name: RepositoryViewerConfig) uses a list of hard-coded patterns for syntax highlighting (e.g. bug, task#). This should be made more flexible so connectors can contribute custom patterns optimally based on existing hyper link detectors.
why just not use hyperlink detectors and decorate text based on detection results? so, there will be nothing to contribute then on the connector side, as long as they have hyperlink detector already.
That sounds like a great idea.
David, this will be covered by your work on bug 167941, right?
(In reply to comment #3) > David, this will be covered by your work on bug 167941, right? > Yes. The work on bug 167941 is strictly about strikethrough font for completed tasks, detected using the hyperlink detector. So plug-ins that implement an AbstractConnectorUi will be able to affect this behaviour. The wording of this bug suggests that some other type of syntax highlighting might be desirable. If this is true, then bug 167941 won't be sufficient. Patterns may also be contributed using the taskEditorExtension extension point and optionally WikiText. This gives plug-ins ultimate control over syntax highlighting, since they can dictate the SourceViewer and its configuration. This depends on bug 244650.
Now that decoration of completed tasks is based on hyperlink detection I would like to determine the requirements for decorating task ids in the task editor. In Mylyn 2.x the following tokens are highlighted in blue (hyperlink color): * task ids (e.g. bug 123) * urls (e.g. http://eclipse.org) If the same decoration is desired for Mylyn 3.x with WikiText enabled the current tokenizer based implementation will have to be replaced with a solution similar to bug 167941. For task ids there is a difference whether a task is in the task list (and it's completion status is known) or not. Should this be indicated by using a lighter color for those links for instance?
I think that the following are the ideal minimum that needs to be supported consistently in both WikiText and standard editors: * Hyperlink style is blue foreground color and underline on-demand. The following are hyperlinks: * Task references (e.g., bug#9999, bug 9999) * Comment references (e.g., comment#1, comment 1) * URLs (e.g., http://eclipse.org) * Java stack trace elements (e.g., org.eclipse.core.runtime.Platform.run(Platform.java:816)) I think the following are optional (i.e., help with usability, but are not key to the discoverabilty of hyperlink functionality) * Completed tasks appear with strikethrough (very nice that we have this now) * Completed tasks appear with the gray foreground color that's set. Regarding tasks references that appear in the Task List, I think that these will be tricky to distinguish with color in an obvious way. I think that instead we should improve the tooltips for all task references. Currently we have no tooltips for tasks that aren't in the Task List and a one line tooltip for tasks that are, and we could expand on this to provide more descriptive multiline tooltips.
David, do you think it's feasible to implement this with the current hyperlink detector based approach? We could try adding additional TaskHyperlinkTextPresentationManagers that set the foreground color of matching tokens to JFacePreferences.ACTIVE_HYPERLINK_COLOR.
Created attachment 114515 [details] first cut
Patch is a proof of concept, it's still missing the following, but basically works: - set the context to limit hyperlink detection to the respective TaskRepository - get hyperlink detectors from extension registry (see HtmlViewerConfiguration) - merge HighlightingHyperlinkTextPresentationManager with TaskHyperlinkTextPresentationManager
(In reply to comment #7) > David, do you think it's feasible to implement this with the current hyperlink > detector based approach? Yes, at first glance the hyperlink detector API is the right approach > We could try adding additional > TaskHyperlinkTextPresentationManagers that set the foreground color of > matching tokens to JFacePreferences.ACTIVE_HYPERLINK_COLOR. You may need some additional preferences to handle the foreground color, font etc based on task status for task hyperlinks
Created attachment 114893 [details] screenshot of Trac editor
I have committed an updated patch that now properly does highlighting based on the available hyperlink detectors (see attachment). (In reply to comment #6) > I think that the following are the ideal minimum that needs to be supported > consistently in both WikiText and standard editors: > * Hyperlink style is blue foreground color and underline on-demand. The > following are hyperlinks: > * Task references (e.g., bug#9999, bug 9999) > * Comment references (e.g., comment#1, comment 1) > * URLs (e.g., http://eclipse.org) The highlighting is now based on hyperlink detectors and should pick up all clickable tokens. This only works if a hyperlink detector returns all detected links in a regions of text which to my knowledge only detectors contributed by Mylyn do. > * Java stack trace elements (e.g., > org.eclipse.core.runtime.Platform.run(Platform.java:816)) Only the filename is highlighted but the whole line is clickable which is supported through the IHighlightingHyperlink interface. I found it to intrusive when the whole stack trace was highlighted. > I think the following are optional (i.e., help with usability, but are not key > to the discoverabilty of hyperlink functionality) > * Completed tasks appear with strikethrough (very nice that we have this now) This will work for tasks in the task list. > * Completed tasks appear with the gray foreground color that's set. I am not sure if that's a good idea as it would break the consistency of highlighting all hyperlinks in the same color?
Looks great.