Package xvrengine.launching

Source Code of xvrengine.launching.XVRSourcePathComputerDelegate

package xvrengine.launching;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.sourcelookup.ISourceContainer;
import org.eclipse.debug.core.sourcelookup.ISourcePathComputerDelegate;
import org.eclipse.debug.core.sourcelookup.containers.ProjectSourceContainer;
import org.eclipse.debug.core.sourcelookup.containers.WorkspaceSourceContainer;
import org.xvr.xvrengine.util.XVRConstants;


public class XVRSourcePathComputerDelegate implements ISourcePathComputerDelegate {

 
 
  @Override
  public ISourceContainer[] computeSourceContainers(ILaunchConfiguration configuration, IProgressMonitor monitor) throws CoreException {
    //IProject project = XVRUtils.getActiveProject();
    String name = configuration.getAttribute(XVRConstants.XVR_LAUNCH_CONFIG_PROJECT_NAME_KEY, (String)null);
    IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
    ISourceContainer sourceContainer = null;
    if(project.exists()){
      sourceContainer = new ProjectSourceContainer(project, false);
    }else{
      sourceContainer = new WorkspaceSourceContainer();
    }
    return new ISourceContainer[]{sourceContainer};
  }

}
TOP

Related Classes of xvrengine.launching.XVRSourcePathComputerDelegate

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.