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

Bug 54547

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: UIAssignee: 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 Flags
removes about.ini references from WorkbenchPlugin
none
fix ProductInfo impl. in the previous patch none

Description Nick Edgar CLA 2004-03-11 17:11:51 EST
build I20040310

The new IProduct APIs should be used to obtain the product name and window 
image used in the generic workbench, rather than the platform configuration 
info for the primary features.  The platform configuration mechanism is 
specific to Update's feature story. The API for it is only in the 
org.eclipse.core.runtime.compatibility plugin, the dependency on which we want 
to remove for at least the RCP components (org.eclipse.ui and below).
Comment 1 Nick Edgar CLA 2004-03-11 17:12:40 EST
This depends on Update providing the values for the constants we defined in bug 
52213.
Comment 2 Andrew Eidsness CLA 2004-03-21 13:40:42 EST
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.
Comment 3 Nick Edgar CLA 2004-03-21 15:48:44 EST
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.
Comment 4 Nick Edgar CLA 2004-03-21 15:58:37 EST
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.
Comment 5 Andrew Eidsness CLA 2004-03-21 16:14:34 EST
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.
Comment 6 Andrew Eidsness CLA 2004-03-21 16:16:55 EST
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.
Comment 7 Nick Edgar CLA 2004-03-21 16:24:59 EST
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.


Comment 8 Nick Edgar CLA 2004-03-21 16:47:04 EST
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?
Comment 9 Nick Edgar CLA 2004-03-22 01:34:51 EST
Closing.
Comment 10 Andrew Eidsness CLA 2004-03-26 13:36:53 EST
verified on winxp on Build id: 200403260800