Example usage for org.springframework.ide.eclipse.core SpringCoreUtils isSpringProject

List of usage examples for org.springframework.ide.eclipse.core SpringCoreUtils isSpringProject

Introduction

In this page you can find the example usage for org.springframework.ide.eclipse.core SpringCoreUtils isSpringProject.

Prototype

public static boolean isSpringProject(IResource resource) 

Source Link

Document

Returns true if given resource's project is a Spring project.

Usage

From source file:org.eclipse.virgo.ide.ui.internal.actions.ConvertToPlanProject.java

private void addFacetsToProject(final IProject project) {
    IWorkspaceRunnable oper = new IWorkspaceRunnable() {
        public void run(IProgressMonitor monitor) throws CoreException {
            if (!SpringCoreUtils.isSpringProject(project)) {
                SpringCoreUtils.addProjectNature(project.getProject(), SpringCore.NATURE_ID, monitor);
            }/*  w  w  w.  ja  v  a 2 s. c o  m*/
            IFacetedProject fProject = ProjectFacetsManager.create(project, true, monitor);
            fProject.installProjectFacet(
                    ProjectFacetsManager.getProjectFacet(FacetCorePlugin.PLAN_FACET_ID).getDefaultVersion(),
                    null, monitor);
        }
    };

    try {
        ResourcesPlugin.getWorkspace().run(oper, new NullProgressMonitor());
    } catch (CoreException e) {
    }
}

From source file:org.eclipse.virgo.ide.ui.internal.actions.ConvertToBundleProject.java

private void addFacetsToProject(final IProject project) {
    IWorkspaceRunnable oper = new IWorkspaceRunnable() {
        public void run(IProgressMonitor monitor) throws CoreException {
            if (!SpringCoreUtils.isSpringProject(project)) {
                SpringCoreUtils.addProjectNature(project.getProject(), SpringCore.NATURE_ID, monitor);
            }//from   w  w w  . j a v  a 2s .  co m
            IFacetedProject fProject = ProjectFacetsManager.create(project, true, monitor);
            fProject.installProjectFacet(
                    ProjectFacetsManager.getProjectFacet(FacetCorePlugin.BUNDLE_FACET_ID).getDefaultVersion(),
                    null, monitor);
        }
    };

    try {
        ResourcesPlugin.getWorkspace().run(oper, new NullProgressMonitor());
    } catch (CoreException e) {
    }
}

From source file:org.eclipse.virgo.ide.beans.core.internal.locate.SpringOsgiBeansConfigLocator.java

/**
 * Returns <code>true</code> if the given <code>project</code> is SpringSource AP bundle project
 * and has the Spring IDE nature.// w w w .j  a  v a  2 s  .co  m
 */
public boolean supports(IProject project) {
    return FacetUtils.isBundleProject(project) && SpringCoreUtils.isSpringProject(project);
}