当前位置: 首页>>代码示例>>Java>>正文


Java IProductConstants类代码示例

本文整理汇总了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();
}
 
开发者ID:dice-project,项目名称:DICE-Platform,代码行数:68,代码来源:DiceSplashHandler.java

示例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);
			}
		});
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:62,代码来源:MyTourbookSplashHandler.java


注:本文中的org.eclipse.ui.branding.IProductConstants类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。