简体   繁体   English

是否可以在启动图像单击时重定向到浏览器 URL?

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

I use PDE.我使用 PDE。 My tool has a splash image located in splash.bmp .我的工具在splash.bmp中有一个启动图像。 In the build.properties I include the image into bin.includes ( bin.includes = splash.bmp ).build.properties中,我将图像包含到bin.includesbin.includes = splash.bmp )中。 In the app.product file I have the following code:app.product文件中,我有以下代码:

   <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.如果重要,请使用 Java8 和 Eclipse Photon。 Is it even possible?甚至可能吗? Maybe a hint?也许是一个提示?

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. Eclipse 的原生启动器为闪屏创建 window 并在其上绘制配置的 bitmap。 Any additional functionality (eg the progress bar) is implemented in Java.任何附加功能(例如进度条)在 Java 中实现。 Since Eclipse 3.3.自 Eclipse 3.3 起。 this implementation can be customized through the extension point org.eclipse.ui.splashHandler .这个实现可以通过扩展点org.eclipse.ui.splashHandler来定制。

The default implementation is org.eclipse.ui.internal.splash.EclipseSplashHandler ( source ).默认实现是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.您可以从此或它的任何子 class 扩展您的自定义实现,或者您可以从头开始实现您自己的自定义处理程序。

The init method of your custom handler implementation is called with a Shell that represents the splash window.自定义处理程序实现的init方法使用 Shell 调用,该Shell表示启动。 You can easily add additional controls to the splash screen, including a Hyperlink control or a Label with a mouse listener.您可以轻松地向初始屏幕添加其他控件,包括Hyperlink控件或带有鼠标侦听器的Label

Latest Eclipse PDE (not tested with Photon) can even generate an interactive splash example.最新的 Eclipse PDE(未经 Photon 测试)甚至可以生成交互式启动示例。 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. 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 -> 确保选中Add a default splash screen to this plug-in plugin。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM