本文整理汇总了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);
}
示例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);
}
}
示例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));
}
示例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;
}