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


Java Platform.getInstanceLocation方法代码示例

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


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

示例1: start

import org.eclipse.core.runtime.Platform; //导入方法依赖的package包/类
public Object start(IApplicationContext context) throws Exception {
	Display display = PlatformUI.createDisplay();
	Shell shell = WorkbenchPlugin.getSplashShell(display);

	if (OSValidator.isWindows() && !PreStartActivity.isDevLaunchMode(context.getArguments())) {
		PreStartActivity activity = new PreStartActivity(shell);
		if (ToolProvider.getSystemJavaCompiler() == null) {
			activity.performPreStartActivity();
		} else {
			activity.updateINIOnJDkUpgrade();
		}
	}
	try {
		Object instanceLocationCheck = checkInstanceLocation(shell, context.getArguments());
		if (instanceLocationCheck != null) {
           	WorkbenchPlugin.unsetSplashShell(display);
               context.applicationRunning();
               return instanceLocationCheck;
           }
		int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
		if (returnCode == PlatformUI.RETURN_RESTART)
			return IApplication.EXIT_RESTART;
		else
			return IApplication.EXIT_OK;
	} finally {
		if (display != null) {
			display.dispose();
		}
		Location instanceLoc = Platform.getInstanceLocation();
		if (instanceLoc != null){
			instanceLoc.release();
		}
	}
	
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:36,代码来源:Application.java

示例2: start

import org.eclipse.core.runtime.Platform; //导入方法依赖的package包/类
@Override
public Object start(final IApplicationContext appContext) throws Exception {
	final Display display = createDisplay();

	try {

		// look and see if there's a splash shell we can parent off of
		final Shell shell = WorkbenchPlugin.getSplashShell(display);
		if (shell != null) {
			// should should set the icon and message for this shell to be the
			// same as the chooser dialog - this will be the guy that lives in
			// the task bar and without these calls you'd have the default icon
			// with no message.
			shell.setText(ChooseWorkspaceDialog.getWindowTitle());
			shell.setImages(Window.getDefaultImages());
		}

		final Object instanceLocationCheck = checkInstanceLocation(shell, appContext.getArguments());
		if (instanceLocationCheck != null) {
			WorkbenchPlugin.unsetSplashShell(display);
			appContext.applicationRunning();
			return instanceLocationCheck;
		}

		// create the workbench with this advisor and run it until it exits
		// N.B. createWorkbench remembers the advisor, and also registers
		// the workbench globally so that all UI plug-ins can find it using
		// PlatformUI.getWorkbench() or AbstractUIPlugin.getWorkbench()
		final int returnCode = createAndRunWorkbench(display, new N4JSApplicationWorkbenchAdvisor());

		// the workbench doesn't support relaunch yet (bug 61809) so
		// for now restart is used, and exit data properties are checked
		// here to substitute in the relaunch return code if needed
		if (returnCode != PlatformUI.RETURN_RESTART) {
			return EXIT_OK;
		}

		// if the exit code property has been set to the relaunch code, then
		// return that code now, otherwise this is a normal restart
		return EXIT_RELAUNCH.equals(Integer.getInteger(PROP_EXIT_CODE)) ? EXIT_RELAUNCH
				: EXIT_RESTART;
	} finally {
		if (display != null) {
			display.dispose();
		}
		final Location instanceLoc = Platform.getInstanceLocation();
		if (instanceLoc != null)
			instanceLoc.release();
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:51,代码来源:N4JSApplication.java


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