Community
Participate
Working Groups
Build ID: M20080221-1800 Steps To Reproduce: 1. Create a new cheatsheet plugin 2. Add a contribution to the org.eclipse.ui.cheatsheets.cheatSheetContent extension 3. Add a category 4. Create a new cheatsheet file using the New Wizard 5. Register the new cheatsheet file 6. Add a jpg file or an html file to the plugin project 7. Add a command to a cheatsheet step or sub-step. In the browse dialog select the Open Browser command 8. In the url option for the Open Browser command, specify the path to the jpg or html file created in step 6. I have tried all different combinations of paths with the plugin id, without the plugin id, with a jar url 9. Preview the cheatsheet file and click on the Open Browser action which should open a browser window with the jpg or html file displayed. More information: I have made sure that the html or jpg resource is exported in the plugin editor.
Can you be more specific about what you want to do - are you looking to open the jpg or html file in an internal browser or in an external browser?
Created attachment 148828 [details] Patch for org.eclipse.ui.browser
Created attachment 148829 [details] Patch for org.eclipse.ua.tests JUnit test for this work item.
Uploaded patches for both the org.eclipse.ui.browser and org.eclipse.ua.tests plugins. This includes the code fixes (org.eclipse.ui.browser) and a JUnit test (org.eclipse.ua.tests)
The patch for org.eclipse.ui.browser is good apart from the copyright year needing to be 2009. I was unable to apply the second patch, I got unmatched segments. It does not look correct in that not every new line has a '+' in column 0. Can you recreate the patch for org.eclipse.ua.tests and make sure it can be applied?
I have committed the patch for org.eclipse.ui.browser. Jim, can you create a new patch for org.eclipse.ua.tests so I can close this bug?
In the current form, this looks like functionality that should be packaged with your cheat sheet plug-in, and not by UA. Unless I missed something, the patch only makes the contents of the given URL available, but all links to other resources (embedded images, style sheet, relative links, etc.) will not work when the plug-in is shipped in JAR'd form. If you decide to keep it, you should add a warning to the command description that tells that it will only work for self-contained files. Or expand the command to allow clients to specify required dependencies that also need to be made available. Or use the help server to support platform URL protocols.
That is a good point. When I originally discussed this with Jim we had considered using the help server but felt that it was unnecessary because we could open documents using the FileLocator, but as you say that leaves the possibility of not being able to load CSS files or images.
I tried this command on a document from a jarred help plugin and I saw the page but the images did not load. Having thought about this some more it seems that the command would be more useful if it could process html files and their included files correctly, which requires the help server to be started. This could be done with the line below in the command handler. if(!workspaceFile.exists()) { url = BaseHelpSystem.resolve("/" + pluginId + '/' + pluginPath , true); //$NON-NLS-1$ The command would need to be moved out of org.eclipse.ui.browser (which does not depend on the help system) and to one of the help plugins, probably org.eclipse.help.ui. Markus, does this seem like a reasonable solution?
I have changed the handler to use the help system to open resources from bundles, this way included images etc. will display correctly. I have also moved the code to org.eclipse.help.ui. Fixed in HEAD.
(In reply to comment #10) > I have changed the handler to use the help system to open resources from > bundles, this way included images etc. will display correctly. I have also > moved the code to org.eclipse.help.ui. Fixed in HEAD. Thanks, I think this is the right solution for the bug. My hack for cheatsheets was to publish the cheatsheet content as a help plugin and then use the urls. So now we this should work right out of the box, without creating a duplicate help plugin.
Shakeel, if you get a chance can you download N20091016-2000 or newer version and verify that this feature is working to your satisfaction. If so can you add a comment to that effect with the version number you tested with and if you have permission to do so set the state to verified (I think the submitter can change the state).