📄 splashhandler.java
字号:
package com.siemens.ct.mp3m.handlers;
import org.eclipse.core.runtime.IProduct;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.StringConverter;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.branding.IProductConstants;
import org.eclipse.ui.splash.BasicSplashHandler;
public class SplashHandler extends BasicSplashHandler {
@Override
public void init(Shell splash) {
super.init(splash);
System.out.println("SplashHandler.init()");
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) {
e.gc.setForeground(getForeground());
e.gc.drawText("v3.3.1-20071029", buildIdPoint.x, buildIdPoint.y, true);
}
});
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -