當前位置: 首頁>>代碼示例>>Java>>正文


Java IFolder.getParent方法代碼示例

本文整理匯總了Java中org.eclipse.core.resources.IFolder.getParent方法的典型用法代碼示例。如果您正苦於以下問題:Java IFolder.getParent方法的具體用法?Java IFolder.getParent怎麽用?Java IFolder.getParent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.core.resources.IFolder的用法示例。


在下文中一共展示了IFolder.getParent方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: mkdirs

import org.eclipse.core.resources.IFolder; //導入方法依賴的package包/類
private static void mkdirs(IFolder destPath) {
	IContainer parent = destPath.getParent(); 
	if (! parent.exists()) {
		if (parent instanceof IFolder) {
			mkdirs((IFolder) parent);
		}
		else if (parent instanceof IProject) {
			mkdirs( ((IProject)parent).getFolder(".") );
		}
	}
	try {
		destPath.create(/*force*/true, /*local*/true, Constants.NULL_PROGRESS_MONITOR);
	} catch (CoreException e) {
		e.printStackTrace();
	}
}
 
開發者ID:Synectique,項目名稱:VerveineC-Cpp,代碼行數:17,代碼來源:FileUtil.java

示例2: createParentFolder

import org.eclipse.core.resources.IFolder; //導入方法依賴的package包/類
/***/
protected void createParentFolder(IFolder folder) throws CoreException {
	IContainer parent = folder.getParent();
	if (parent instanceof IFolder) {
		IFolder parentFolder = (IFolder) parent;
		if (!parentFolder.exists()) {
			createParentFolder(parentFolder);
			parentFolder.create(true, true, null);
		}
	}
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:12,代碼來源:AbstractBuilderParticipantTest.java

示例3: createFolder

import org.eclipse.core.resources.IFolder; //導入方法依賴的package包/類
public static void createFolder(IFolder folder, boolean force, boolean local, IProgressMonitor monitor)
		throws CoreException {
	if (!folder.exists()) {
		IContainer parent = folder.getParent();
		if (parent instanceof IFolder) {
			createFolder((IFolder) parent, force, local, new NullProgressMonitor());
		}
		folder.create(force, local, monitor);
	}
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:11,代碼來源:ProjectHelper.java

示例4: createFolder

import org.eclipse.core.resources.IFolder; //導入方法依賴的package包/類
/**
 * Creates the specified folder if it does not exists
 * @param folder
 * @throws CoreException
 */
private void createFolder(IFolder folder) throws CoreException {
	IContainer parent = folder.getParent();
	if (parent instanceof IFolder) {
		createFolder((IFolder) parent);
	}
	if (!folder.exists()) {
		folder.create(false, true, null);
	}
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:15,代碼來源:ProjectStructureCreator.java

示例5: create

import org.eclipse.core.resources.IFolder; //導入方法依賴的package包/類
/**
 * Create IFolder if it doesn't exists
 * Recursively creates parent IFolder if required
 * @param folder
 * @param force
 * @param local
 * @param monitor
 * @throws CoreException
 */
public static void create(IFolder folder, boolean force, boolean local, IProgressMonitor monitor) throws CoreException{
	if(folder.exists()) return;
	if(folder.getParent() instanceof IFolder && !folder.getParent().exists()){
		create((IFolder) folder.getParent(), force, local, monitor);
	}
	folder.create(force, local, monitor);
}
 
開發者ID:eclipse,項目名稱:gemoc-studio,代碼行數:17,代碼來源:IFolderUtils.java


注:本文中的org.eclipse.core.resources.IFolder.getParent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。