platform-update-home/doc/eclipse_splash.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (view) (download) (as text)

1 : jeem 1.1 <html>
2 :    
3 :     <head>
4 :     <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
5 :     <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
6 :     <meta name="ProgId" content="FrontPage.Editor.Document">
7 :     <title>Eclipse executable launcher</title>
8 :     </head>
9 :    
10 :     <body>
11 :    
12 :     <h1>Eclipse Splash Screens</h1>
13 : jeem 1.2 <p>Last revised 16:45 Saturday June 1, 2002</p>
14 : jeem 1.1 <p>This note describes how splash screens work.</p>
15 :     <h2>What product developers need to know</h2>
16 :     <p>From the product developer's standpoint, the product owner supplies a product
17 :     splash screen containing a color image roughly 500x330 pixels in size. This
18 :     file, named &quot;<code>splash.bmp</code>&quot;, lives in the plug-in for the
19 : jeem 1.2 product's primary feature. The file is in 24-bit color BMP format on all operating
20 :     environments (note: it must be a simple RGB with 8 bits per channel, not an
21 :     indexed color BMP). For internationalized applications, translated splash
22 : jeem 1.1 screens live in locale-specific subdirectories of the plug-in (e.g., the splash
23 :     screen for locale code &quot;fr_FR_EURO&quot; is in &quot;<code>nl/fr/FR/EURO/splash.bmp</code>&quot;)
24 :     . For example,</p>
25 :     <p><code>&lt;<i>install</i>&gt;/<br>
26 :     &nbsp; eclipse/<br>
27 :     &nbsp;&nbsp;&nbsp; plugins/<br>
28 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <i>com.example.acme.acmefeature_1.0.0</i>/<br>
29 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; splash.bmp<br>
30 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nl/<br>
31 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fr/<br>
32 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; splash.bmp<br>
33 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CA/<br>
34 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; splash.bmp<br>
35 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FR/<br>
36 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; splash.bmp<br>
37 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EURO/<br>
38 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
39 :     splash.bmp<br>
40 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; en/<br>
41 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; splash.bmp<br>
42 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; US/<br>
43 :     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
44 :     splash.bmp<br>
45 :     </code></p>
46 :     <p>Any of the translated splash screens can live in a fragment of the product's
47 :     primary feature plug-in; they do not need to live in the plug-in itself. This
48 :     allows another feature (or features) to supply translated splash screens; e.g.,
49 :     a special feature that provides a product's Asian language translations.</p>
50 :     <p>Each version of a primary feature supplies a version of the splash screen
51 :     file. This means that it is possible to update a product's splash screen like
52 :     any other file in a plug-in.</p>
53 :     <p>A product can have multiple primary features, although only one primary
54 :     feature is in control on a given occasion of use. Each of the different primary
55 :     features in a product has its own splash screen.</p>
56 :     <p>A splash image is shown each time the product is launched (unless the <code>-nosplash</code>
57 :     command line option is specified). The splash screen presented is the one for the
58 :     controlling primary feature version, translated for the desired locale.</p>
59 :     <h2>What product developers do not need to know</h2>
60 :     <p><b>N.B. The details in this section are not Eclipse platform API, and may
61 :     change over time. Things are described here only to provide a sense of what goes
62 :     on in the wings. Product developers must not rely on anything described in this
63 :     section.</b></p>
64 :     <p>The product splash screen is shown to the user upon launching the program from a desktop item, menu item, or shortcut key. If there
65 :     is more than a brief delay, the user will think the product sluggish or
66 :     malfunctioning. Time is of the essence when getting the splash screen on the
67 :     screen.</p>
68 :     <p>In a naive implementation, the Eclipse platform would determine the right splash
69 :     screen for the product being launched and locale, and show the splash
70 :     screen to the user in a window created with SWT. Unfortunately, the complexity
71 :     of starting up the Eclipse platform makes this approach unacceptably slow in
72 :     getting the splash screen up. Thus we need a somewhat more sophisticated
73 :     approach.</p>
74 :     <p>On each occasion of running <code>eclipse.exe</code>, the following factors
75 :     determine which splash screen to show:</p>
76 :     <ul>
77 :     <li>Primary feature id. Each primary features has its own splash screen. The
78 :     primary feature is given either by the <code>-feature</code>
79 :     command line option, or defaults to a choice recorded in the workspace (<code>&lt;<i>workspace</i>&gt;/.metadata/.config/platform.cfg</code>),
80 :     or in <code>&lt;<i>install</i>&gt;/eclipse/.config/platform.cfg</code> if this is
81 :     the first time for this workspace.</li>
82 :     <li>Primary feature version. Each primary features version has its own splash
83 :     screen. The version to be used is recorded in in the workspace (<code>&lt;<i>workspace</i>&gt;/.metadata/.config/platform.cfg</code>),
84 :     or in <code>&lt;<i>install</i>&gt;/eclipse/.config/platform.cfg</code> if this is
85 :     the first time for this workspace.</li>
86 :     <li>Locale. Each splash screen may exist in translation. The locale is given either by the <code>-nl</code> command line option,
87 :     or obtained directly from the operating system.</li>
88 :     </ul>
89 :     <p>Because of this complexity is determining which splash screen to show, the
90 :     responsibilities are divided as follows:</p>
91 :     <ul>
92 :     <li>Eclipse itself (BootLoader) is responsible for
93 :     determining the full path of the splash screen file and requesting the Eclipse executable launcher
94 :     to show it. This is done by analyzing command line arguments and reading the
95 :     configuration files in the install or the workspace.</li>
96 :     <li>The Eclipse executable launcher is responsible for displaying the
97 :     specified splash screen to the user. The Eclipse executable launcher passes
98 :     a &quot;show&quot; command to Main; Main calls it with the path of the
99 :     appropriate splash file and and holds onto the process object reference. The
100 :     process puts up a window with the splash image in it. Since the full path of the splash screen file is
101 :     passed as a parameter, the Eclipse executable launcher can remain completely
102 :     ignorant of the existence of a splash screen cache and of locale-specific
103 :     concerns. If the Eclipse executable launcher is unable to find or read the
104 :     requested splash screen file, the launch simply proceeds without showing any
105 :     splash screen.</li>
106 :     <li>Eclipse itself (Main, Workbench, and BootLoader) is responsible for
107 :     deciding when to stop showing the splash screen. As soon as the workbench window has been displayed to the
108 :     user, the workbench tells Main to take down the splash screen, which it does
109 :     by destroying the process it spawned. If there are any problems with taking
110 :     down the splash screen, the launch simply proceeds as if no splash screen
111 :     had been shown.</li>
112 :     </ul>
113 :     <p>When the Eclipse platform formulates a configuration file (<code>platform.cfg</code>), it computes and stores the mapping
114 :     from primary feature version and known locale to splash file path. Splash file
115 :     paths are stored in install-relative form to ensure they are usable by any user
116 :     that locates the install. The absolute file path of the correct splash screen
117 :     must be determined quickly so that the splash screen can be displayed to the
118 :     user without further delay. The ability to properly resolve arbitrary plug-in
119 :     relative paths only becomes available once the plug-in registry has been built;
120 :     however, by that time the Eclipse platform is almost up and running, and the
121 :     splash screen is already too late. For splash screen purposes, splash file paths
122 :     are resolved by prefixing them with <code>&lt;<i>install</i>&gt;/eclipse/plugins</code>/.
123 :     This works for all splash screens within plug-ins and fragments located within
124 :     the product's install directory, which is most of the time. However, it fails to
125 :     find splash screens located in another local site, such as an extension.</p>
126 :    
127 :     <p>The very first time the Eclipse platform is launched with a new workspace,
128 :     there is no <code>platform.cfg</code> (unless there is a pre-computed default
129 :     one stored with the install), and it will take several seconds to compute one.
130 :     Until it does, it won't know the correct splash screen. So it immediately
131 :     displays an interim splash screen (a plain canned image that reads
132 :     &quot;Completing the install. Please wait...&quot;) and goes about its business.
133 :     When it is done, it takes down the splash screen and does an exit-with-relaunch;
134 :     the product now starts with the newly-computed <code>platform.cfg</code> telling it exactly where
135 :     to find the correct splash screen. The same holds true for subsequent launches.
136 :     This special splash screen and all its&nbsp; translations are in the <code>org.eclipse.core.boot</code>
137 :     plug-in (to simplify the implementation, we do <i>not</i> look in fragments).</p>
138 :    
139 :     </body>
140 :    
141 :     </html>