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


Java Platform.getProduct方法代码示例

本文整理汇总了Java中org.eclipse.core.runtime.Platform.getProduct方法的典型用法代码示例。如果您正苦于以下问题:Java Platform.getProduct方法的具体用法?Java Platform.getProduct怎么用?Java Platform.getProduct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.core.runtime.Platform的用法示例。


在下文中一共展示了Platform.getProduct方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: CustomAboutDialog

import org.eclipse.core.runtime.Platform; //导入方法依赖的package包/类
/**
 * Create an instance of the AboutDialog for the given window.
 * 
 * @param parentShell
 *            The parent of the dialog.
 */
public CustomAboutDialog(Shell parentShell) {
	super(parentShell);
	this.parentShell = parentShell;
	setShellStyle(SWT.CLOSE | SWT.APPLICATION_MODAL | SWT.WRAP);
	product = Platform.getProduct();

	if (product != null) {
		productName = product.getName();
	}
	if (productName == null) {
		productName = WorkbenchMessages.AboutDialog_defaultProductName;
	}

	// setDialogHelpAvailable(true);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:22,代码来源:CustomAboutDialog.java

示例2: getApplicationBundle

import org.eclipse.core.runtime.Platform; //导入方法依赖的package包/类
/**
 * Returns the bundle that launched the application that this class runs in.
 *
 * @return the defining bundle
 */
private Bundle getApplicationBundle() {
    IProduct product = Platform.getProduct();
    if (product != null) {
        return product.getDefiningBundle();
    } else {
        return Platform.getBundle(ECLIPSE_RUNTIME_BULDEID);
    }
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:14,代码来源:EclipseEnvironment.java

示例3: configureShell

import org.eclipse.core.runtime.Platform; //导入方法依赖的package包/类
@Override
protected void configureShell(Shell newShell) {
	super.configureShell(newShell);
	String productName = ""; //$NON-NLS-1$
	IProduct product = Platform.getProduct();
	if (product != null && product.getName() != null)
		productName = product.getName();
	newShell.setText(NLS.bind(
			WorkbenchMessages.InstallationDialog_ShellTitle, productName));
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:11,代码来源:HydrographInstallationDialog.java

示例4: requiresInfrastructureForLibraryManager

import org.eclipse.core.runtime.Platform; //导入方法依赖的package包/类
/**
 * Returns with {@code true} if all the followings are {@code true}
 * <p>
 * <ul>
 * <li>The {@link Platform#isRunning() platform is running}.</li>
 * <li>The platforms runs a {@link IProduct product}.</li>
 * <li>The platforms runs the N4JS IDE product and it is configured to include built-in libraries.</li>
 * <ul>
 * <li>The N4JS IDE runs in production mode {@code OR}</li>
 * <li>The N4JS IDE runs in either {@link Platform#inDebugMode() debug mode} or {@link Platform#inDevelopmentMode()
 * development mode} and the {@link #INCLUDES_BUILT_INS_SYSTEM_PROPERTY} is configured to be {@code true}</li>
 * </ul>
 * </ul>
 * Otherwise returns with {@code false} and neither built-in libraries nor local git repository for the N4JS
 * definition files has to be set up .
 *
 * @return {@code true} if the infrastructure is required for the built-in and NPM support.
 */
public static boolean requiresInfrastructureForLibraryManager() {
	if (Platform.isRunning()) {
		final IProduct product = Platform.getProduct();
		if (null != product) {
			if (parseBoolean(product.getProperty(INCLUDES_BUILT_INS_PRODUCT_PROPERTY))) {
				// Runs in *non-production* mode and the system property is NOT set to include the built-ins.
				if ((inDebugMode() || inDevelopmentMode())
						&& !parseBoolean(System.getProperty(INCLUDES_BUILT_INS_SYSTEM_PROPERTY))) {
					return false;
				}
				return true;
			}
		}
	}
	return false;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:35,代码来源:ExternalLibrariesActivator.java


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