private void doEventLoop() { Shell splash = getSplash(); while (fAuthenticated == false) { if (splash.getDisplay().readAndDispatch() == false) { splash.getDisplay().sleep(); } } for (Control control : splash.getChildren()) { control.dispose(); } String progressRectString = null; String messageRectString = null; String foregroundColorString = null; IProduct product = Platform.getProduct(); if (product != null) { progressRectString = product.getProperty(IProductConstants.STARTUP_PROGRESS_RECT); messageRectString = product.getProperty(IProductConstants.STARTUP_MESSAGE_RECT); foregroundColorString = product.getProperty(IProductConstants.STARTUP_FOREGROUND_COLOR); } Rectangle progressRect = StringConverter.asRectangle(progressRectString, new Rectangle(5, 275, 445, 15)); setProgressRect(progressRect); Rectangle messageRect = StringConverter.asRectangle(messageRectString, new Rectangle(0, 0, 0, 0)); // new Rectangle(7, 252, 445, 20)); setMessageRect(messageRect); getContent(); }
@Override public void init(Shell splash) { super.init(splash); String progressRectString = null; String messageRectString = null; String foregroundColorString = null; IProduct product = Platform.getProduct(); if (product != null) { progressRectString = product.getProperty(IProductConstants.STARTUP_PROGRESS_RECT); messageRectString = product.getProperty(IProductConstants.STARTUP_MESSAGE_RECT); foregroundColorString = product.getProperty(IProductConstants.STARTUP_FOREGROUND_COLOR); } Rectangle progressRect = StringConverter.asRectangle(progressRectString, new Rectangle(10, 10, 300, 15)); setProgressRect(progressRect); Rectangle messageRect = StringConverter.asRectangle(messageRectString, new Rectangle(10, 35, 300, 15)); setMessageRect(messageRect); int foregroundColorInteger; try { foregroundColorInteger = Integer.parseInt(foregroundColorString, 16); } catch (Exception ex) { foregroundColorInteger = 0xD2D7FF; // off white } setForeground( new RGB( (foregroundColorInteger & 0xFF0000) >> 16, (foregroundColorInteger & 0xFF00) >> 8, foregroundColorInteger & 0xFF)); final Point buildIdPoint = new Point(322, 190); getContent() .addPaintListener( new PaintListener() { public void paintControl(PaintEvent e) { // System.out // .println("SplashHandler.init(...).new PaintListener() {...}.paintControl()"); e.gc.setForeground(getForeground()); e.gc.drawText( "v" + Activator.getDefault().getBundle().getHeaders().get("Bundle-Version"), buildIdPoint.x, buildIdPoint.y, true); } }); }