| Summary: | [RCP] Need to get product branding elements from IProduct rather than platform configuration | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Nick Edgar <n.a.edgar> | ||||||
| Component: | UI | Assignee: | Andrew Eidsness <eclipse> | ||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | birsan, jeffmcaffer | ||||||
| Version: | 3.0 | ||||||||
| Target Milestone: | 3.0 M8 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows 2000 | ||||||||
| Whiteboard: | |||||||||
| Bug Depends on: | 52213, 54790 | ||||||||
| Bug Blocks: | |||||||||
| Attachments: |
|
||||||||
|
Description
Nick Edgar
This depends on Update providing the values for the constants we defined in bug 52213. Created attachment 8734 [details] removes about.ini references from WorkbenchPlugin This patch adds a ProductInfo class to replace the AboutInfo. The new class retrieves strings using the new IProduct.getProperty and then builds the needed URL, Image, etc. The values are stored in the ProductInfo in the same fashion as the older AboutInfo. This class is then used in the WorkbenchPlugin class. There are still 120+ references to AboutInfo, but they all seem related to the AboutDialog, which is the topic for bug#54548. I notice that ProductInfo.getUrl is looking up the URL in the bundle having the same id as the product. There are two problems with this: 1. Update should already be giving us the URL string in absolute terms. Is that not the case? 2. Although the product id corresponds to the primary feature when using Eclipse Update, we can't rely on this correspondence. Some other mechanism may be providing the IProduct. cc'ing Jeff for sanity check. Need to verify that about.mappings variables like the @build@ in the about text are getting properly substituted by Update. This is not happening when self-hosting, but it didn't always before either. I have org.eclipse.platform loaded from head, where it's unsubstituted, so that's probably why. I have runtime loaded from head as well, and there have apparently been coordinated changes in org.eclipse.platform, so I don't want to unload it now. RE: comment#4 I wasn't sure how to test the mapping functionality, but I confirmed that the code that loads the properties (in org.eclipse.update.internal.configurator. branding) uses both the about.mappings and about.properties files that the UI AboutInfo implementation uses. Created attachment 8736 [details] fix ProductInfo impl. in the previous patch RE: comment#3 I'm not sure why that version of ProductInfo was in the patch -- the #getUrl implementation should at least have been consistent with the #getUrls impl. Platform.asLocalUrl is the method that works for my test case -- jeff, is this the correct behaviour? E.g., IProduct.getProperty will return as string with something like: "file:/C:/eclipse/mar16/eclipse/plugins/org.eclipse.platform_3.0.0/eclipse.gif" and Platform.asLocalUrl converts it to an URL with file: "/C:/eclipse/mar16/eclipse/plugins/org.eclipse.platform_3.0.0/eclipse.gif" from which ImageDescriptor.createFromURL is able to build a proper URL. For the URLs, they are coming back as bundleentry: URLs, so there's no need to try to resolve it relative to the bundle with the same id as the product. Also, getURL converts it using asLocalURL, but this should not be necessary for the about image since it's just being loaded by ImageDescriptor as opposed to being handed out to an external program. There -are- cases where URLs are getting handed out (e.g. the "More Info" cases in the feature dialogs), but I think this should be done by the caller, not getURL. With the latest patch, I removed the asLocalURL calls, and it works fine. I've released this. Jeff, can you clarify the following? I'm not sure how it figures out the product when self-hosting. Who is setting the eclipse.product property? I don't see it in the config.ini generated by the PDE launcher. Will there be any problems if we release this to Monday morning's build? That is, is bug 54790 in good enough shape for us to use? Closing. verified on winxp on Build id: 200403260800 |