[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] Splash screen customization with Swing

You can embed SWT widgets in the splash just fine using the SWT->AWT bridge. I just tried the following org.eclipse.ui.splashHandler extension and it works fine:

/**
* @since 3.3
*
*/
public class InteractiveSplashHandler extends AbstractSplashHandler {

/*
* (non-Javadoc)
*
* @see org.eclipse.ui.splash.AbstractSplashHandler#init (org.eclipse.swt.widgets.Shell)
*/
public void init(final Shell splash) {
// Store the shell
super.init(splash);
splash.setLayout(new FillLayout());
Composite parent = new Composite(splash, SWT.EMBEDDED);

Frame frame = SWT_AWT.new_Frame(parent);
frame.setBackground(new Color(255,0,0));
frame.add(new JLabel("HI!"));
splash.layout(true);

}
}




On May 10, 2007, at 3:55 AM, Alex Blewitt wrote:

I doubt that you'd do it directly, as there would be no way of passing
the native handle to the Swing libraries. You might have some success
if you create an SWT shell and then add inside an SWT_AWT bridge,
followed by your swing components.

The SWT newsgroup would probably be a good place to ask too, if you
haven't already.

Alex.

On 10/05/07, Steven E. Harris <seh@xxxxxxxxx> wrote:
I noticed that the Equinox launcher can create an "early" splash
screen using a BMP-formatted image, and it sets a property --
org.eclipse.equinox.launcher.splash.handle -- to the integer value of
the window handle (I'm guessing) created by the native code reached
through JNIBridge.

There's an example in the incubator CVS repository at demos/splash/
org.eclipse.equinox.examples.splash that shows how to acquire this
window handle and use it to create an SWT Shell, presumably redrawing
over the "early" splash screen with something custom and dynamic.

Is it possible to do anything with a window handle like this with
Swing? I have an existing splash screen written with Swing and I'm
wondering if there's some way to tie it together with the "early"
splash screen capability in the launcher.

--
Steven E. Harris

_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev

_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev