本文整理匯總了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);
}