Пример #1
0
  @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);
              }
            });
  }
 /*
  * (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);
   // Configure the shell layout
   configureUISplash();
   // Create UI
   createUI();
   // Create UI listeners
   createUIListeners();
   // Force the splash screen to layout
   splash.layout(true);
   // Keep the splash screen visible and prevent the RCP application from
   // loading until the close loginButton is clicked.
   doEventLoop();
 }
  @Override
  public void init(final Shell splash) {
    super.init(splash);

    setProgressRect(new Rectangle(5, 194, 445, 10));
    setMessageRect(new Rectangle(193, 120, 257, 20));
    setForeground(new RGB(255, 255, 255));

    getContent()
        .addPaintListener(
            new PaintListener() {
              @Override
              public void paintControl(PaintEvent event) {
                String version = PortfolioPlugin.getDefault().getBundle().getVersion().toString();

                event.gc.setForeground(splash.getDisplay().getSystemColor(SWT.COLOR_WHITE));
                event.gc.drawText("Version " + version, 193, 100, true); // $NON-NLS-1$
              }
            });
  }