Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 240423

Summary: [wikitext] specify extension point for resource hyperlink detectors
Product: z_Archived Reporter: Steffen Pingel <steffen.pingel>
Component: MylynAssignee: 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 Flags
extension point reader
none
mylyn/context/zip
none
a patch renaming getUnknonGeneratedPrefix() to getGenericPrefix() none

Description Steffen Pingel CLA 2008-07-10 18:37:13 EDT
Specify an extension point for hyperlink detectors as described on bug 239087.
Comment 1 Steffen Pingel CLA 2008-07-10 18:38:55 EDT
Owen, can you attach a patch that specifies the extension point and a class for reading the extention point?
Comment 2 Jingwen 'Owen' Ou CLA 2008-07-10 23:33:29 EDT
Created attachment 107160 [details]
extension point reader
Comment 3 Jingwen 'Owen' Ou CLA 2008-07-10 23:33:32 EDT
Created attachment 107161 [details]
mylyn/context/zip
Comment 4 Steffen Pingel CLA 2008-07-21 19:32:22 EDT
Nice. Patch applied with minor modifications. 

Owen, what is the ResourceHyperlinkExtensions.getUnknownGeneratedPrefix() needed for?
Comment 5 Jingwen 'Owen' Ou CLA 2008-07-22 16:08:00 EDT
(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.
Comment 6 Jingwen 'Owen' Ou CLA 2008-07-22 16:21:03 EDT
Created attachment 108128 [details]
a patch renaming getUnknonGeneratedPrefix() to getGenericPrefix()
Comment 7 Steffen Pingel CLA 2008-07-23 19:04:45 EDT
If it's the default prefix why not call it getDefaultPrefix()? Can you also add a comment to the method that explains the purpose?
Comment 8 Steffen Pingel CLA 2008-07-23 19:22:46 EDT
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?
Comment 9 Steffen Pingel CLA 2008-08-16 02:29:32 EDT
Marking as resolved.