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


Java IPath.isEmpty方法代码示例

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


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

示例1: updateProposalContext

import org.eclipse.core.runtime.IPath; //导入方法依赖的package包/类
/**
 * This method should be invoked whenever source folder or project value change, to update the proposal contexts for
 * the field source folder and module specifier
 */
private void updateProposalContext() {
	IPath projectPath = model.getProject();
	IPath sourceFolderPath = model.getSourceFolder();

	// Early exit for empty project value
	if (projectPath.isEmpty()) {
		sourceFolderContentProposalAdapter.setContentProposalProvider(null);
		moduleSpecifierContentProposalAdapter.setContentProposalProvider(null);
		return;
	}

	IProject project = ResourcesPlugin.getWorkspace().getRoot()
			.getProject(projectPath.toString());

	if (null == project || !project.exists()) {
		// Disable source folder and module specifier proposals
		sourceFolderContentProposalAdapter.setContentProposalProvider(null);
		moduleSpecifierContentProposalAdapter.setContentProposalProvider(null);
	} else {
		// Try to retrieve the source folder and if not specified set it to null
		IContainer sourceFolder = sourceFolderPath.segmentCount() != 0 ? project.getFolder(sourceFolderPath) : null;

		// If the project exists, enable source folder proposals
		sourceFolderContentProposalAdapter
				.setContentProposalProvider(sourceFolderContentProviderFactory.createProviderForProject(project));

		if (null != sourceFolder && sourceFolder.exists()) {
			// If source folder exists as well enable module specifier proposal
			moduleSpecifierContentProposalAdapter.setContentProposalProvider(
					moduleSpecifierContentProviderFactory.createProviderForPath(sourceFolder.getFullPath()));
		} else {
			// Otherwise disable module specifier proposals
			moduleSpecifierContentProposalAdapter.setContentProposalProvider(null);
		}
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:41,代码来源:WorkspaceWizardPage.java


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