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


Java PyStructureConfigHelpers类代码示例

本文整理汇总了Java中org.python.pydev.plugin.PyStructureConfigHelpers的典型用法代码示例。如果您正苦于以下问题:Java PyStructureConfigHelpers类的具体用法?Java PyStructureConfigHelpers怎么用?Java PyStructureConfigHelpers使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: initializeBase

import org.python.pydev.plugin.PyStructureConfigHelpers; //导入依赖的package包/类
public IProject initializeBase() throws CoreException
{
	//IProject project = null;;
	return PyStructureConfigHelpers.createPydevProject(
			projectName, null, null,
			monitor, pyProjectType, projectInterpreter,
			getSourceFolderHandlesCallback, null, null,
			null);
}
 
开发者ID:robotpy,项目名称:robotpy-eclipse-plugins,代码行数:10,代码来源:WPIRobotRobotpyProjectCreator.java

示例2: doActionOnContainer

import org.python.pydev.plugin.PyStructureConfigHelpers; //导入依赖的package包/类
@Override
protected int doActionOnContainer(IContainer container, IProgressMonitor monitor) {
    try {
        IProject project = container.getProject();
        IPythonPathNature pythonPathNature = PythonNature.getPythonPathNature(project);
        if (pythonPathNature == null) {
            Log.log("Unable to get PythonNature on project: " + project);
            return 0;
        }
        OrderedMap<String, String> projectSourcePathMap = pythonPathNature
                .getProjectSourcePathResolvedToUnresolvedMap();
        String pathToAdd = container.getFullPath().toString();
        if (projectSourcePathMap.containsKey(pathToAdd)) {
            return 0;
        }

        pathToAdd = PyStructureConfigHelpers.convertToProjectRelativePath(project.getFullPath().toString(),
                pathToAdd);

        Collection<String> values = new ArrayList<String>(projectSourcePathMap.values());
        values.add(pathToAdd);
        pythonPathNature.setProjectSourcePath(StringUtils.join("|", values));
        PythonNature.getPythonNature(project).rebuildPath();
        return 1;
    } catch (CoreException e) {
        Log.log(IStatus.ERROR, "Unexpected error setting project properties", e);
    }
    return 0;
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:30,代码来源:PyAddSrcFolder.java

示例3: createAndConfigProject

import org.python.pydev.plugin.PyStructureConfigHelpers; //导入依赖的package包/类
/**
 * This method can be overridden to provide a custom creation of the project.
 *
 * It should create the project, configure the folders in the pythonpath (source folders and external folders
 * if applicable), set the project type and project interpreter.
 */
protected void createAndConfigProject(final IProject newProjectHandle, final IProjectDescription description,
        final String projectType, final String projectInterpreter, IProgressMonitor monitor,
        Object... additionalArgsToConfigProject) throws CoreException {
    ICallback<List<IContainer>, IProject> getSourceFolderHandlesCallback = this.getSourceFolderHandlesCallback;
    ICallback<List<IPath>, IProject> getExistingSourceFolderHandlesCallback = this.getExistingSourceFolderHandlesCallback;

    PyStructureConfigHelpers.createPydevProject(description, newProjectHandle, monitor, projectType,
            projectInterpreter, getSourceFolderHandlesCallback, null, getExistingSourceFolderHandlesCallback);
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:16,代码来源:PythonProjectWizard.java

示例4: getPathAsString

import org.python.pydev.plugin.PyStructureConfigHelpers; //导入依赖的package包/类
/**
 * @param project 
 * @return The passed path as a string (used for the selection dialog, as things come relative to the workspace).
 */
private String getPathAsString(IPath p, IProject project) {
    String ret = p.toString();
    if (ret.startsWith("/") == false) {
        ret = "/" + ret;
    }
    return PyStructureConfigHelpers.convertToProjectRelativePath(project.getFullPath().toString(), ret);
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:12,代码来源:TreeWithAddRemove.java

示例5: doCreateNew

import org.python.pydev.plugin.PyStructureConfigHelpers; //导入依赖的package包/类
@Override
protected IFile doCreateNew(IProgressMonitor monitor) throws CoreException {
    IProject project = filePage.getValidatedProject();
    String name = filePage.getValidatedName();
    IPath source = filePage.getSourceToLink();
    if (project == null || !project.exists()) {
        throw new RuntimeException("The project selected does not exist in the workspace.");
    }
    IPythonPathNature pathNature = PythonNature.getPythonPathNature(project);
    if (pathNature == null) {
        IPythonNature nature = PythonNature.addNature(project, monitor, null, null, null, null, null);
        pathNature = nature.getPythonPathNature();
        if (pathNature == null) {
            throw new RuntimeException("Unable to add the nature to the seleted project.");
        }
    }
    if (source == null || !source.toFile().exists()) {
        throw new RuntimeException("The source to link to, " + source.toString() + ", does not exist.");
    }
    IFolder folder = project.getFolder(name);
    if (!folder.exists()) {
        folder.createLink(source, IResource.BACKGROUND_REFRESH, monitor);
    }
    String newPath = folder.getFullPath().toString();

    String curr = pathNature.getProjectSourcePath(true);
    if (curr == null) {
        curr = "";
    }
    if (curr.endsWith("|")) {
        curr = curr.substring(0, curr.length() - 1);
    }
    String newPathRel = PyStructureConfigHelpers.convertToProjectRelativePath(
            project.getFullPath().toString(), newPath);
    if (curr.length() > 0) {
        //there is already some path
        Set<String> projectSourcePathSet = pathNature.getProjectSourcePathSet(true);
        if (!projectSourcePathSet.contains(newPath)) {
            //only add to the path if it doesn't already contain the new path
            curr += "|" + newPathRel;
        }
    } else {
        //there is still no other path
        curr = newPathRel;
    }
    pathNature.setProjectSourcePath(curr);
    PythonNature.getPythonNature(project).rebuildPath();
    return null;
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:50,代码来源:PythonExistingSourceFolderWizard.java

示例6: doCreateNew

import org.python.pydev.plugin.PyStructureConfigHelpers; //导入依赖的package包/类
@Override
protected IFile doCreateNew(IProgressMonitor monitor) throws CoreException {
    IProject project = filePage.getValidatedProject();
    String name = filePage.getValidatedName();
    if (project == null || !project.exists()) {
        throw new RuntimeException("The project selected does not exist in the workspace.");
    }
    IPythonPathNature pathNature = PythonNature.getPythonPathNature(project);
    if (pathNature == null) {
        IPythonNature nature = PythonNature.addNature(project, monitor, null, null, null, null, null);
        pathNature = nature.getPythonPathNature();
        if (pathNature == null) {
            throw new RuntimeException("Unable to add the nature to the seleted project.");
        }
    }
    IFolder folder = project.getFolder(name);
    if (folder.exists()) {
        Log.log("Source folder already exists. Nothing new was created");
        return null;
    }
    folder.create(true, true, monitor);
    String newPath = folder.getFullPath().toString();

    String curr = pathNature.getProjectSourcePath(false);
    if (curr == null) {
        curr = "";
    }
    if (curr.endsWith("|")) {
        curr = curr.substring(0, curr.length() - 1);
    }
    String newPathRel = PyStructureConfigHelpers.convertToProjectRelativePath(
            project.getFullPath().toString(), newPath);
    if (curr.length() > 0) {
        //there is already some path
        Set<String> projectSourcePathSet = pathNature.getProjectSourcePathSet(true);
        if (!projectSourcePathSet.contains(newPath)) {
            //only add to the path if it doesn't already contain the new path
            curr += "|" + newPathRel;
        }
    } else {
        //there is still no other path
        curr = newPathRel;
    }
    pathNature.setProjectSourcePath(curr);
    PythonNature.getPythonNature(project).rebuildPath();
    return null;
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:48,代码来源:PythonSourceFolderWizard.java

示例7: getProjectHandle

import org.python.pydev.plugin.PyStructureConfigHelpers; //导入依赖的package包/类
/**
 * Creates a project resource handle for the current project name field value.
 * <p>
 * This method does not create the project resource; this is the responsibility
 * of <code>IProject::create</code> invoked by the new project resource wizard.
 * </p>
 *
 * @return the new project resource handle
 */
public IProject getProjectHandle() {
    return PyStructureConfigHelpers.getProjectHandle(getProjectName());
}
 
开发者ID:HuaweiSNC,项目名称:OpsDev,代码行数:13,代码来源:NewProjectNameAndLocationWizardPage.java

示例8: getProjectHandle

import org.python.pydev.plugin.PyStructureConfigHelpers; //导入依赖的package包/类
/**
 * Creates a project resource handle for the current project name field value.
 * <p>
 * This method does not create the project resource; this is the responsibility
 * of <code>IProject::create</code> invoked by the new project resource wizard.
 * </p>
 *
 * @return the new project resource handle
 */
@Override
public IProject getProjectHandle() {
    return PyStructureConfigHelpers.getProjectHandle(getProjectName());
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:14,代码来源:NewProjectNameAndLocationWizardPage.java


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