本文整理汇总了Java中org.eclipse.ui.branding.IProductConstants类的典型用法代码示例。如果您正苦于以下问题:Java IProductConstants类的具体用法?Java IProductConstants怎么用?Java IProductConstants使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IProductConstants类属于org.eclipse.ui.branding包,在下文中一共展示了IProductConstants类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.eclipse.ui.branding.IProductConstants; //导入依赖的package包/类
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));
// the following code will be removed for release time
String[] mappings = loadMappings(product.getDefiningBundle());
StringBuilder sbId = new StringBuilder();
if (mappings.length >= 2) {
String version = mappings[0];
String timestamp = mappings[1];
if (!version.startsWith("$") && !timestamp.startsWith("$")) {
sbId.append(version);
sbId.append(".");
sbId.append(timestamp);
} else {
sbId.append("Unknown Build");
}
} else {
sbId.append("Unknown Build");
}
String eclipseBaseVersion = "";
if (mappings.length >= 3) {
eclipseBaseVersion = mappings[2];
if (eclipseBaseVersion.startsWith("$")) {
eclipseBaseVersion = "Unknown Eclipse Base Version";
}
}
Label idLabel = new Label(getContent(), SWT.LEFT);
idLabel.setForeground(getForeground());
idLabel.setBounds(new Rectangle(390, 105, 220, 40));
idLabel.setText(sbId.toString());
idLabel.setData(CSSSWTConstants.CSS_ID_KEY, CSS_ID_SPLASH_BUILD_ID);
Label basedOnLabel = new Label(getContent(), SWT.LEFT);
basedOnLabel.setForeground(getForeground());
basedOnLabel.setBounds(new Rectangle(190, 105, 220, 40));
basedOnLabel.setText(eclipseBaseVersion);
basedOnLabel.setData(CSSSWTConstants.CSS_ID_KEY, CSS_ID_SPLASH_BUILD_ID);
toString();
}
示例2: init
import org.eclipse.ui.branding.IProductConstants; //导入依赖的package包/类
@Override
public void init(final Shell splash) {
super.init(splash);
// keep the splash handler to be used outside of this splash handlers
TourbookPlugin.setSplashHandler(this);
String progressRectString = null;
String messageRectString = null;
// String foregroundColorString = null;
final 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);
}
// set progressbar position
Rectangle progressRect = parseRect(progressRectString);
if (progressRect == null) {
progressRect = new Rectangle(10, 0, 300, 15);
}
setProgressRect(progressRect);
// set message position
Rectangle messageRect = parseRect(messageRectString);
if (messageRect == null) {
messageRect = new Rectangle(10, 25, 300, 15);
}
setMessageRect(messageRect);
// set message color
int foregroundColorInteger;
// try {
// // debug color
// foregroundColorInteger = Integer.parseInt(foregroundColorString, 16);
// } catch (final Exception ex) {
// // production color, debug is not using this color
// foregroundColorInteger = 0x2d84f6;
// }
// foregroundColorInteger = 0x2d84f6;
// foregroundColorInteger = 0x2a7ce7;
foregroundColorInteger = 0xffffff;
setForeground(new RGB(
(foregroundColorInteger & 0xFF0000) >> 16,
(foregroundColorInteger & 0xFF00) >> 8,
foregroundColorInteger & 0xFF));
// final String buildId = "Version " + System.getProperty("eclipse.buildId", "Unknown Version"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
getContent().addPaintListener(new PaintListener() {
@Override
public void paintControl(final PaintEvent e) {
onPaint(e);
}
});
}