Search in sources :

Example 11 with IProjectBuilder

use of com.liferay.ide.project.core.IProjectBuilder in project liferay-ide by liferay.

the class MavenBundlePluginProject method adapt.

@Override
public <T> T adapt(Class<T> adapterType) {
    T adapter = super.adapt(adapterType);
    if (adapter != null) {
        return adapter;
    }
    IMavenProjectFacade facade = MavenUtil.getProjectFacade(getProject(), new NullProgressMonitor());
    if (facade != null) {
        if (IProjectBuilder.class.equals(adapterType)) {
            IProjectBuilder projectBuilder = new MavenProjectBuilder(getProject());
            return adapterType.cast(projectBuilder);
        } else if (IRemoteServerPublisher.class.equals(adapterType)) {
            IRemoteServerPublisher remoteServerPublisher = new MavenProjectRemoteServerPublisher(getProject());
            return adapterType.cast(remoteServerPublisher);
        } else if (IBundleProject.class.equals(adapterType)) {
            return adapterType.cast(this);
        }
    }
    return null;
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) IRemoteServerPublisher(com.liferay.ide.server.remote.IRemoteServerPublisher) IMavenProjectFacade(org.eclipse.m2e.core.project.IMavenProjectFacade) IProjectBuilder(com.liferay.ide.project.core.IProjectBuilder)

Aggregations

IProjectBuilder (com.liferay.ide.project.core.IProjectBuilder)11 CoreException (org.eclipse.core.runtime.CoreException)5 ILiferayProject (com.liferay.ide.core.ILiferayProject)4 IProject (org.eclipse.core.resources.IProject)4 IStatus (org.eclipse.core.runtime.IStatus)3 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)3 IMavenProjectFacade (org.eclipse.m2e.core.project.IMavenProjectFacade)3 Test (org.junit.Test)3 IRemoteServerPublisher (com.liferay.ide.server.remote.IRemoteServerPublisher)2 IFile (org.eclipse.core.resources.IFile)2 IBundleProject (com.liferay.ide.core.IBundleProject)1 LiferayGradleProject (com.liferay.ide.gradle.core.LiferayGradleProject)1 GradleDependency (com.liferay.ide.gradle.core.parser.GradleDependency)1 GradleDependencyUpdater (com.liferay.ide.gradle.core.parser.GradleDependencyUpdater)1 NewLiferayModuleProjectOp (com.liferay.ide.project.core.modules.NewLiferayModuleProjectOp)1 File (java.io.File)1 URL (java.net.URL)1 ArrayList (java.util.ArrayList)1 Dependency (org.apache.maven.model.Dependency)1 MavenProject (org.apache.maven.project.MavenProject)1