本文整理汇总了Java中org.eclipse.core.resources.IFolder.getFullPath方法的典型用法代码示例。如果您正苦于以下问题:Java IFolder.getFullPath方法的具体用法?Java IFolder.getFullPath怎么用?Java IFolder.getFullPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.core.resources.IFolder
的用法示例。
在下文中一共展示了IFolder.getFullPath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createProject
import org.eclipse.core.resources.IFolder; //导入方法依赖的package包/类
public static IJavaProject createProject(String name) throws CoreException {
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
IProject project = root.getProject(name);
if (!project.exists()) {
project.create(new NullProgressMonitor());
} else {
project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
}
if (!project.isOpen()) {
project.open(new NullProgressMonitor());
}
IFolder binFolder = project.getFolder("bin");
if (!binFolder.exists()) {
createFolder(binFolder, false, true, new NullProgressMonitor());
}
IPath outputLocation = binFolder.getFullPath();
addNatureToProject(project, JavaCore.NATURE_ID, new NullProgressMonitor());
IJavaProject jproject = JavaCore.create(project);
jproject.setOutputLocation(outputLocation, new NullProgressMonitor());
IClasspathEntry[] entries = PreferenceConstants.getDefaultJRELibrary();
jproject.setRawClasspath(entries, new NullProgressMonitor());
return jproject;
}
示例2: createTemprarySourceFolder
import org.eclipse.core.resources.IFolder; //导入方法依赖的package包/类
private IPath createTemprarySourceFolder(){
IPath tempSrcFolder=new Path(PathConstant.TEMP_BUILD_PATH_SETTINGS_FOLDER);
IFolder folder=BuildExpressionEditorDataSturcture.INSTANCE.getCurrentProject().getFolder(tempSrcFolder);
try {
if(!folder.exists()){
folder.create(true, true,null);
}
} catch (CoreException e) {
LOGGER.error("CoreException occurred while creating temporary source folder",e);
return null;
}
LOGGER.debug("Created temporary build path at "+PathConstant.TEMP_BUILD_PATH_SETTINGS_FOLDER);
return folder.getFullPath();
}
示例3: validatePage
import org.eclipse.core.resources.IFolder; //导入方法依赖的package包/类
public boolean validatePage() {
setErrorMessage(null);
if (!displayProjects)
return true;
if (createPackageButton != null)
createPackageButton.setEnabled(false);
if (fDestinationField != null) {
ITreeSelection sl = fDestinationField.getStructuredSelection();
if (sl.isEmpty()) {
setErrorMessage(MessageUtil.getString("choose_a_target_folder_for_the_graph"));
return false;
}
if (!(sl.getFirstElement() instanceof IFolder)) {
setErrorMessage(MessageUtil.getString("choose_a_target_folder_for_the_graph"));
return false;
}
if (sl.getFirstElement() instanceof IFolder) {
IFolder folder = (IFolder) sl.getFirstElement();
String[] folders = PreferenceManager.getDefaultAuthorizedFolderForGraphDefinition();
boolean found = false;
for (String f : folders) {
IFolder tmp = (IFolder) folder;
if (tmp == null)
return false;
IProject project = tmp.getProject();
IPath p = new Path(project.getFullPath().toString()).append(f);
IPath tmpPath = tmp.getFullPath();
if (p.isPrefixOf(tmpPath)) {
createPackageButton.setEnabled(true);
found = true;
}
}
if (!found) {
setErrorMessage(MessageUtil.getString("choose_a_target_folder_for_the_graph"));
return false;
}
}
}
if (this.provider != null) {
if (this.provider.getDefaultFileName() != null
&& ((nameField.getText() == null) || (nameField.getText().trim().length() == 0))) {
setErrorMessage(MessageUtil.getString("choose_a_valid_filename"));
return false;
}
String value = nameField.getText();
if (this.provider.getDefaultFileName() != null && !isValidFilename(value)) {
setErrorMessage(MessageUtil.getString("choose_a_valid_filename"));
return false;
}
}
return true;
}