當前位置: 首頁>>代碼示例>>Java>>正文


Java IProjectDescription.setLocationURI方法代碼示例

本文整理匯總了Java中org.eclipse.core.resources.IProjectDescription.setLocationURI方法的典型用法代碼示例。如果您正苦於以下問題:Java IProjectDescription.setLocationURI方法的具體用法?Java IProjectDescription.setLocationURI怎麽用?Java IProjectDescription.setLocationURI使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.core.resources.IProjectDescription的用法示例。


在下文中一共展示了IProjectDescription.setLocationURI方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createBaseProject

import org.eclipse.core.resources.IProjectDescription; //導入方法依賴的package包/類
private static IProject createBaseProject(String projectName, URI location) {
	IProject newProject = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
	
	if (!newProject.exists()) {
		URI projectLocation = location;
		IProjectDescription description = newProject.getWorkspace().newProjectDescription(newProject.getName());
		if (location != null && ResourcesPlugin.getWorkspace().getRoot().getLocationURI().equals(location)) {
			projectLocation = null;
		}
		
		description.setLocationURI(projectLocation);
		try {
			newProject.create(description, null);
			if (!newProject.isOpen()) {
				newProject.open(null);
			}
		} catch (CoreException e) {
			e.printStackTrace();
		}
	}
	
	return newProject;
}
 
開發者ID:Imhotup,項目名稱:LibertyEiffel-Eclipse-Plugin,代碼行數:24,代碼來源:LEProjectSupport.java

示例2: createBaseProject

import org.eclipse.core.resources.IProjectDescription; //導入方法依賴的package包/類
private static IProject createBaseProject(String projectName, URI location) {
  IProject newProject = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);

  if (!newProject.exists()) {
    URI projectLocation = location;
    IProjectDescription desc =
        newProject.getWorkspace().newProjectDescription(newProject.getName());
    if (location != null
        && ResourcesPlugin.getWorkspace().getRoot().getLocationURI().equals(location)) {
      projectLocation = null;
    }

    desc.setLocationURI(projectLocation);
    try {
      newProject.create(desc, null);
      if (!newProject.isOpen()) {
        newProject.open(null);
      }
    } catch (CoreException e) {
      e.printStackTrace();
    }
  }

  return newProject;
}
 
開發者ID:bazelbuild,項目名稱:eclipse,代碼行數:26,代碼來源:BazelProjectSupport.java

示例3: createPgDbProject

import org.eclipse.core.resources.IProjectDescription; //導入方法依賴的package包/類
public static PgDbProject createPgDbProject(IProject newProject, URI location)
        throws CoreException {
    if (!newProject.exists()) {
        IProjectDescription desc = newProject.getWorkspace()
                .newProjectDescription(newProject.getName());

        desc.setLocationURI(location);
        desc.setNatureIds(new String[] {NATURE.ID});
        newProject.create(desc, null);
        newProject.open(IResource.BACKGROUND_REFRESH, null);
        newProject.getNature(NATURE.ID).configure();
    }
    return new PgDbProject(newProject);
}
 
開發者ID:pgcodekeeper,項目名稱:pgcodekeeper,代碼行數:15,代碼來源:PgDbProject.java

示例4: createTheProjectAtSpecifiedLocation

import org.eclipse.core.resources.IProjectDescription; //導入方法依賴的package包/類
private IProject createTheProjectAtSpecifiedLocation(String projectName,
		URI location) throws CoreException {
	IProject newProject;
	newProject = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);

	if(!newProject.exists()){
		IProjectDescription desc = newProject.getWorkspace().newProjectDescription(newProject.getName());
		if (location != null && ResourcesPlugin.getWorkspace().getRoot().getLocationURI().equals(location)) {
			desc.setLocationURI(null);
		}
		else{
			desc.setLocationURI(location);
		}

		try {
			newProject.create(desc, null);
			if (!newProject.isOpen()) {
				newProject.open(null);
			}
			logger.debug("Project base structure created"); 
		} catch (CoreException exception) {
			logger.debug("Project base structure creation failed");
			throw exception;
		}
	}
	return newProject;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:28,代碼來源:ProjectStructureCreator.java

示例5: execute

import org.eclipse.core.resources.IProjectDescription; //導入方法依賴的package包/類
@Override
public void execute(IProgressMonitor monitor) throws InvocationTargetException, CoreException {
  IWorkspace workspace = ResourcesPlugin.getWorkspace();
  IProject newProject = config.getProject();
  URI location = config.getEclipseProjectLocationUri();

  String name = newProject.getName();
  IProjectDescription description = workspace.newProjectDescription(name);
  description.setLocationURI(location);

  String operationLabel = getDescription();
  SubMonitor subMonitor = SubMonitor.convert(monitor, operationLabel, 120);
  CreateProjectOperation operation = new CreateProjectOperation(description, operationLabel);
  try {
    operation.execute(subMonitor.newChild(10), uiInfoAdapter);
    mostImportant = createAndConfigureProjectContent(newProject, config, subMonitor.newChild(80));
  } catch (ExecutionException ex) {
    throw new InvocationTargetException(ex);
  }

  IFacetedProject facetedProject = ProjectFacetsManager.create(
      newProject, true /* convertIfNecessary */, subMonitor.newChild(5));
  addAppEngineFacet(facetedProject, subMonitor.newChild(6));

  addAdditionalDependencies(newProject, config, subMonitor.newChild(20));

  fixTestSourceDirectorySettings(newProject, subMonitor.newChild(5));
}
 
開發者ID:GoogleCloudPlatform,項目名稱:google-cloud-eclipse,代碼行數:29,代碼來源:CreateAppEngineWtpProject.java

示例6: createBaseProject

import org.eclipse.core.resources.IProjectDescription; //導入方法依賴的package包/類
/**
 * Just do the basics: create a basic project.
 * 
 * @param location
 * @param projectName
 */
private static IProject createBaseProject(String projectName, URI location) {
	// it is acceptable to use the ResourcesPlugin class
	IProject newProject = ResourcesPlugin.getWorkspace().getRoot()
			.getProject(projectName);

	if (!newProject.exists()) {
		URI projectLocation = location;
		IProjectDescription desc = newProject.getWorkspace()
				.newProjectDescription(newProject.getName());
		if (location != null
				&& ResourcesPlugin.getWorkspace().getRoot()
						.getLocationURI().equals(location)) {
			projectLocation = null;
		}

		desc.setLocationURI(projectLocation);
		try {
			newProject.create(desc, null);
			if (!newProject.isOpen()) {
				newProject.open(null);
			}
		} catch (CoreException e) {
			e.printStackTrace();
		}
	}

	return newProject;
}
 
開發者ID:ncleclipse,項目名稱:ncl30-eclipse,代碼行數:35,代碼來源:CustomProjectSupport.java


注:本文中的org.eclipse.core.resources.IProjectDescription.setLocationURI方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。