Example usage for org.eclipse.jdt.core IJavaProject readOutputLocation

List of usage examples for org.eclipse.jdt.core IJavaProject readOutputLocation

Introduction

In this page you can find the example usage for org.eclipse.jdt.core IJavaProject readOutputLocation.

Prototype

IPath readOutputLocation();

Source Link

Document

Returns the default output location for the project as defined by its .classpath file from disk, or null if unable to read the file.

Usage

From source file:org.jboss.tools.esb.core.facet.JBossESBFacetInstallationDelegate.java

License:Open Source License

public void execute(IProject project, IProjectFacetVersion fv, Object config, IProgressMonitor monitor)
        throws CoreException {
    model = (IDataModel) config;/*ww  w  .j  a  v  a 2  s. com*/
    final IJavaProject jproj = JavaCore.create(project);

    createProjectStructure(project);

    // Add WTP natures.
    WtpUtils.addNatures(project);

    // Setup the flexible project structure

    /* 
     * This is necessary because at time, the project has NO facets
     * So a call to createComponent(etc) returns a default implementation.
     * Today, this WTP default implementation does not handle  
     * new reference types in an acceptable fashion 
     * (Does not use extension point). 
     */
    IComponentImplFactory factory = new ESBVirtualComponent();
    IVirtualComponent newComponent = factory.createComponent(project);

    String outputLoc = jproj.readOutputLocation().removeFirstSegments(1).toString();
    newComponent.create(0, null);
    newComponent.setMetaProperty("java-output-path", outputLoc);

    final IVirtualFolder jbiRoot = newComponent.getRootFolder();

    // Map the esbcontent to root for deploy
    String resourcesFolder = model.getStringProperty(IJBossESBFacetDataModelProperties.ESB_CONTENT_FOLDER);
    jbiRoot.createLink(new Path("/" + resourcesFolder), 0, null);

    String sourcesFolder = model.getStringProperty(IJBossESBFacetDataModelProperties.ESB_SOURCE_FOLDER);
    jbiRoot.createLink(new Path("/" + sourcesFolder), 0, null);

    //addESBNature(project);
    IVirtualComponent outputFoldersComponent = new OutputFoldersVirtualComponent(project, newComponent);
    VCFUtil.addReference(outputFoldersComponent, newComponent, "/", null);

    JBossClassPathCommand command = new JBossClassPathCommand(project, model);
    IStatus status = command.executeOverride(monitor);
    if (!status.equals(Status.OK_STATUS)) {
        throw new CoreException(status);
    }

    ClasspathHelper.removeClasspathEntries(project, fv);
    ClasspathHelper.addClasspathEntries(project, fv);
}

From source file:org.limy.eclipse.qalab.common.LimyQalabUtils.java

License:Open Source License

/**
 * v?WFNgS?o?pX results ?B/*w  ww . ja  v  a2  s . com*/
 * @param project 
 * @param results i[?
 */
public static void appendProjectBinPaths(IJavaProject project, Collection<IPath> results) {

    results.add(project.readOutputLocation());
    // v?WFNg\?[XfBNg?[v
    for (IClasspathEntry entry : project.readRawClasspath()) {
        IPath location = entry.getOutputLocation();
        if (location != null) {
            // \?[XfBNgL?ofBNgw??
            results.add(location);
        }
    }
}