Search in sources :

Example 6 with BaseModuleOp

use of com.liferay.ide.project.core.modules.BaseModuleOp in project liferay-ide by liferay.

the class NewModuleFragmentOpMethods method execute.

public static final Status execute(NewModuleFragmentOp op, ProgressMonitor pm) {
    IProgressMonitor monitor = ProgressMonitorBridge.create(pm);
    monitor.beginTask("Creating Liferay module fragment project (this process may take several minutes)", 100);
    Status retval = null;
    try {
        NewLiferayProjectProvider<BaseModuleOp> projectProvider = op.getProjectProvider().content(true);
        IStatus status = projectProvider.createNewProject(op, monitor);
        retval = StatusBridge.create(status);
        if (retval.ok()) {
            _updateBuildPrefs(op);
        }
    } catch (Exception e) {
        String msg = "Error creating Liferay module fragment project.";
        ProjectCore.logError(msg, e);
        return Status.createErrorStatus(msg + " Please see Eclipse error log for more details.", e);
    }
    return retval;
}
Also used : IStatus(org.eclipse.core.runtime.IStatus) Status(org.eclipse.sapphire.modeling.Status) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) IStatus(org.eclipse.core.runtime.IStatus) BaseModuleOp(com.liferay.ide.project.core.modules.BaseModuleOp) IOException(java.io.IOException) CoreException(org.eclipse.core.runtime.CoreException)

Aggregations

BaseModuleOp (com.liferay.ide.project.core.modules.BaseModuleOp)6 IStatus (org.eclipse.core.runtime.IStatus)5 File (java.io.File)2 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)2 Status (org.eclipse.sapphire.modeling.Status)2 IOException (java.io.IOException)1 IResource (org.eclipse.core.resources.IResource)1 CoreException (org.eclipse.core.runtime.CoreException)1 IPath (org.eclipse.core.runtime.IPath)1