當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。