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