| Summary: | [wikitext] specify extension point for resource hyperlink detectors | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Steffen Pingel <steffen.pingel> | ||||||||
| Component: | Mylyn | Assignee: | Jingwen 'Owen' Ou <jingweno> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||
| Severity: | enhancement | ||||||||||
| Priority: | P3 | ||||||||||
| Version: | unspecified | ||||||||||
| Target Milestone: | 1.0.0 | ||||||||||
| Hardware: | All | ||||||||||
| OS: | All | ||||||||||
| Whiteboard: | |||||||||||
| Bug Depends on: | |||||||||||
| Bug Blocks: | 239087 | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Steffen Pingel
Owen, can you attach a patch that specifies the extension point and a class for reading the extention point? Created attachment 107160 [details]
extension point reader
Created attachment 107161 [details]
mylyn/context/zip
Nice. Patch applied with minor modifications. Owen, what is the ResourceHyperlinkExtensions.getUnknownGeneratedPrefix() needed for? (In reply to comment #4) > Nice. Patch applied with minor modifications. > > Owen, what is the ResourceHyperlinkExtensions.getUnknownGeneratedPrefix() needed > for? thats a helper class for drop and drag elements. For example you drop "about.html" file into the task editor which we don't have the implementation (e.g. Java) for it, it will be identified as "unknown" resource, generating <prefix> <qualified name> as "file about.html" with the generic <prefix> file. Its totally replaceable with getGeneratedPrefix("unknown"). Maybe the name would be more appropriate to be called getGenericPrefix(), like a get default prefix one. I think it makes sense to have a helper class to get the "parent" prefix afterall "java class foo.bar" can also be represented as "file foo.bar.java", right? Similar example in Mylyn is the AbstractContextStructureBridge series in which ResourceStructureBridge is the parent of all other bridges. Created attachment 108128 [details]
a patch renaming getUnknonGeneratedPrefix() to getGenericPrefix()
If it's the default prefix why not call it getDefaultPrefix()? Can you also add a comment to the method that explains the purpose? Concerning the support for drag and drop: I am not sure if the current scheme is flexible enough, e.g. when a Java file is dropped the generated text should only include the class name, e.g. "java class TaskEditor" whereas for resources it needs to include the path. How about adding a method to IResourceHyperlinkExtension that returns generated text for an IResource (or null if the file type is not supported) instead of putting this on the extension point? Marking as resolved. |