Is it possible to redirect to browser URL on splash image click?

为君一笑 提交于 2021-01-22 13:17:27

问题


I use PDE. My tool has a splash image located in splash.bmp. In the build.properties I include the image into bin.includes (bin.includes = splash.bmp). In the app.product file I have the following code:

   <splash startupProgressRect="5,275,445,15" />
   <launcher name="app">
      <linux icon="/icons/running.xpm"/>
      <win useIco="false">
         <bmp/>
      </win>
   </launcher>

My question is the following: Is it possible to add links in the splash image? I mean, once the app is loading, it possible to click on specific section in the splash and it will open the browser with a link?

Using Java8 and Eclipse Photon if that matters. Is it even possible? Maybe a hint?


回答1:


I think what you are looking for is a custom splash handler:

The native launcher of Eclipse creates the window for the splash screen and draws the configured bitmap on it. Any additional functionality (e.g. the progress bar) is implemented in Java. Since Eclipse 3.3. this implementation can be customized through the extension point org.eclipse.ui.splashHandler.

The default implementation is org.eclipse.ui.internal.splash.EclipseSplashHandler (source). You can either extend your custom implementation from this or any sub class of it or you can implement your own custom handler from scratch.

The init method of your custom handler implementation is called with a Shell that represents the splash window. You can easily add additional controls to the splash screen, including a Hyperlink control or a Label with a mouse listener.

Latest Eclipse PDE (not tested with Photon) can even generate an interactive splash example. Double click on the MAINFEST.MF of your main UI plugin -> Extensions -> Add.. -> select org.eclipse.ui.splashHandler -> Select Splash Handler template at the bottom -> Next -> Select Interactive - A simulated log-in session -> ensure that Add a default splash screen to this plug-in is checked.



来源:https://stackoverflow.com/questions/65648349/is-it-possible-to-redirect-to-browser-url-on-splash-image-click

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!