Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
101 views
in Technique[技术] by (71.8m points)

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

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?

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...