Search in sources :

Example 16 with ICProject

use of org.eclipse.cdt.core.model.ICProject in project linuxtools by eclipse.

the class RemoteProxyCMainTab method performApply.

@Override
public void performApply(ILaunchConfigurationWorkingCopy config) {
    super.performApply(config);
    ICProject cProject = this.getCProject();
    if (cProject != null && cProject.exists()) {
        config.setMappedResources(new IResource[] { cProject.getProject() });
    } else {
        // the user typed in a non-existent project name. Ensure that
        // won't be suppressed from the dialog. This matches JDT behaviour
        config.setMappedResources(null);
    }
    config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, fProjText.getText());
    if (enableCopyFromExeButton != null) {
        config.setAttribute(ATTR_ENABLE_COPY_FROM_EXE, enableCopyFromExeButton.getSelection());
    }
    if (copyFromExeText != null) {
        config.setAttribute(ATTR_COPY_FROM_EXE_NAME, copyFromExeText.getText());
    }
    if (fProgText != null) {
        config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, fProgText.getText());
    }
    if (workingDirText != null) {
        config.setAttribute(ATTR_REMOTE_WORKING_DIRECTORY_NAME, workingDirText.getText());
    }
    if (fCoreText != null) {
        config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_COREFILE_PATH, fCoreText.getText());
    }
    if (fTerminalButton != null) {
        config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_USE_TERMINAL, fTerminalButton.getSelection());
    }
}
Also used : ICProject(org.eclipse.cdt.core.model.ICProject)

Example 17 with ICProject

use of org.eclipse.cdt.core.model.ICProject in project linuxtools by eclipse.

the class CProjectHelper method createCCProject.

private static ICProject createCCProject(final String projectName, final String binFolderName) throws CoreException {
    final IWorkspace ws = ResourcesPlugin.getWorkspace();
    final ICProject[] newProject = new ICProject[1];
    ws.run((IWorkspaceRunnable) monitor -> {
        ICProject cproject = createCProject2(projectName, binFolderName);
        if (!cproject.getProject().hasNature(CCProjectNature.CC_NATURE_ID)) {
            addNatureToProject(cproject.getProject(), CCProjectNature.CC_NATURE_ID, null);
        }
        newProject[0] = cproject;
    }, null);
    return newProject[0];
}
Also used : CProjectNature(org.eclipse.cdt.core.CProjectNature) ICConfigExtensionReference(org.eclipse.cdt.core.settings.model.ICConfigExtensionReference) ResourcesPlugin(org.eclipse.core.resources.ResourcesPlugin) CoreException(org.eclipse.core.runtime.CoreException) ICProjectDescription(org.eclipse.cdt.core.settings.model.ICProjectDescription) IWorkspaceRoot(org.eclipse.core.resources.IWorkspaceRoot) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) CCProjectNature(org.eclipse.cdt.core.CCProjectNature) IStatus(org.eclipse.core.runtime.IStatus) CCorePlugin(org.eclipse.cdt.core.CCorePlugin) IProject(org.eclipse.core.resources.IProject) IWorkspace(org.eclipse.core.resources.IWorkspace) IProjectDescription(org.eclipse.core.resources.IProjectDescription) IResource(org.eclipse.core.resources.IResource) Assert.fail(org.junit.Assert.fail) ICProject(org.eclipse.cdt.core.model.ICProject) IWorkspaceRunnable(org.eclipse.core.resources.IWorkspaceRunnable) ICProject(org.eclipse.cdt.core.model.ICProject) IWorkspace(org.eclipse.core.resources.IWorkspace)

Example 18 with ICProject

use of org.eclipse.cdt.core.model.ICProject in project linuxtools by eclipse.

the class AbstractTest method createProjectAndBuild.

protected ICProject createProjectAndBuild(Bundle bundle, String projname) throws CoreException, URISyntaxException, InvocationTargetException, InterruptedException, IOException {
    ICProject proj = createProject(bundle, projname);
    buildProject(proj);
    IBinary[] binaries = null;
    do {
        Thread.sleep(500);
        binaries = proj.getBinaryContainer().getBinaries();
    } while (binaries == null || binaries.length < 1);
    return proj;
}
Also used : ICProject(org.eclipse.cdt.core.model.ICProject) IBinary(org.eclipse.cdt.core.model.IBinary)

Aggregations

ICProject (org.eclipse.cdt.core.model.ICProject)18 CoreException (org.eclipse.core.runtime.CoreException)14 IProject (org.eclipse.core.resources.IProject)10 IResource (org.eclipse.core.resources.IResource)10 IBinary (org.eclipse.cdt.core.model.IBinary)7 IWorkspaceRoot (org.eclipse.core.resources.IWorkspaceRoot)6 IPath (org.eclipse.core.runtime.IPath)6 CCorePlugin (org.eclipse.cdt.core.CCorePlugin)5 ICProjectDescription (org.eclipse.cdt.core.settings.model.ICProjectDescription)5 IFile (org.eclipse.core.resources.IFile)5 IWorkspace (org.eclipse.core.resources.IWorkspace)5 ResourcesPlugin (org.eclipse.core.resources.ResourcesPlugin)5 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)5 CCProjectNature (org.eclipse.cdt.core.CCProjectNature)4 CProjectNature (org.eclipse.cdt.core.CProjectNature)4 CModelException (org.eclipse.cdt.core.model.CModelException)4 ICConfigExtensionReference (org.eclipse.cdt.core.settings.model.ICConfigExtensionReference)4 IProjectDescription (org.eclipse.core.resources.IProjectDescription)4 IWorkspaceRunnable (org.eclipse.core.resources.IWorkspaceRunnable)4 Path (org.eclipse.core.runtime.Path)4