Search in sources :

Example 21 with IProjectFacetVersion

use of org.eclipse.wst.common.project.facet.core.IProjectFacetVersion in project liferay-ide by liferay.

the class LiferayMavenProjectConfigurator method _getNewLiferayFacetInstallAction.

private Action _getNewLiferayFacetInstallAction(String pluginType) {
    Action retval = null;
    IProjectFacetVersion newFacet = null;
    IDataModelProvider dataModel = null;
    if (ILiferayMavenConstants.PORTLET_PLUGIN_TYPE.equals(pluginType)) {
        newFacet = IPluginFacetConstants.LIFERAY_PORTLET_PROJECT_FACET.getDefaultVersion();
        dataModel = new MavenPortletPluginFacetInstallProvider();
    } else if (ILiferayMavenConstants.HOOK_PLUGIN_TYPE.equals(pluginType)) {
        newFacet = IPluginFacetConstants.LIFERAY_HOOK_PROJECT_FACET.getDefaultVersion();
        dataModel = new MavenHookPluginFacetInstallProvider();
    } else if (ILiferayMavenConstants.EXT_PLUGIN_TYPE.equals(pluginType)) {
        newFacet = IPluginFacetConstants.LIFERAY_EXT_PROJECT_FACET.getDefaultVersion();
        dataModel = new MavenExtPluginFacetInstallProvider();
    } else if (ILiferayMavenConstants.LAYOUTTPL_PLUGIN_TYPE.equals(pluginType)) {
        newFacet = IPluginFacetConstants.LIFERAY_LAYOUTTPL_PROJECT_FACET.getDefaultVersion();
        dataModel = new MavenLayoutTplPluginFacetInstallProvider();
    } else if (ILiferayMavenConstants.THEME_PLUGIN_TYPE.equals(pluginType)) {
        newFacet = IPluginFacetConstants.LIFERAY_THEME_PROJECT_FACET.getDefaultVersion();
        dataModel = new MavenThemePluginFacetInstallProvider();
    } else if (ILiferayMavenConstants.WEB_PLUGIN_TYPE.equals(pluginType)) {
        newFacet = IPluginFacetConstants.LIFERAY_WEB_PROJECT_FACET.getDefaultVersion();
        dataModel = new MavenWebPluginFacetInstallProvider();
    }
    if (newFacet != null) {
        IDataModel config = DataModelFactory.createDataModel(dataModel);
        retval = new Action(Action.Type.INSTALL, newFacet, config);
    }
    return retval;
}
Also used : Action(org.eclipse.wst.common.project.facet.core.IFacetedProject.Action) IProjectFacetVersion(org.eclipse.wst.common.project.facet.core.IProjectFacetVersion) IDataModelProvider(org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider) IDataModel(org.eclipse.wst.common.frameworks.datamodel.IDataModel)

Example 22 with IProjectFacetVersion

use of org.eclipse.wst.common.project.facet.core.IProjectFacetVersion in project mdw-designer by CenturyLinkCloud.

the class WorkflowProjectPage method setWizardContext.

public void setWizardContext(IWizardContext wizardContext) {
    IProjectFacetVersion workflowProjectFacetVersion = null;
    boolean hasJava16Facet = false;
    for (Object selectedFacetVersion : wizardContext.getSelectedProjectFacets()) {
        IProjectFacetVersion projectFacetVersion = (IProjectFacetVersion) selectedFacetVersion;
        if (projectFacetVersion.getProjectFacet().getId().equals("mdw.workflow"))
            workflowProjectFacetVersion = projectFacetVersion;
        else if (projectFacetVersion.getProjectFacet().getId().equals("java") && Float.parseFloat(projectFacetVersion.getVersionString()) >= 1.6)
            hasJava16Facet = true;
    }
    if (workflowProjectFacetVersion != null) {
        setProject((WorkflowProject) wizardContext.getAction(IFacetedProject.Action.Type.INSTALL, workflowProjectFacetVersion).getConfig());
        if (hasJava16Facet) {
            getProject().setCloudProject(true);
        }
    }
}
Also used : IProjectFacetVersion(org.eclipse.wst.common.project.facet.core.IProjectFacetVersion)

Aggregations

IProjectFacetVersion (org.eclipse.wst.common.project.facet.core.IProjectFacetVersion)22 IProjectFacet (org.eclipse.wst.common.project.facet.core.IProjectFacet)10 CoreException (org.eclipse.core.runtime.CoreException)7 IFacetedProject (org.eclipse.wst.common.project.facet.core.IFacetedProject)5 IFacetedProjectWorkingCopy (org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy)5 HashSet (java.util.HashSet)4 IPreset (org.eclipse.wst.common.project.facet.core.IPreset)4 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)3 IDataModel (org.eclipse.wst.common.frameworks.datamodel.IDataModel)3 Action (org.eclipse.wst.common.project.facet.core.IFacetedProject.Action)3 Iterator (java.util.Iterator)2 IProject (org.eclipse.core.resources.IProject)2 IStatus (org.eclipse.core.runtime.IStatus)2 Status (org.eclipse.core.runtime.Status)2 ILibraryProvider (org.eclipse.jst.common.project.facet.core.libprov.ILibraryProvider)2 LibraryInstallDelegate (org.eclipse.jst.common.project.facet.core.libprov.LibraryInstallDelegate)2 IRuntime (org.eclipse.wst.common.project.facet.core.runtime.IRuntime)2 ModifyFacetedProjectWizard (org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard)2 MdwProgressMonitorDialog (com.centurylink.mdw.plugin.designer.dialogs.MdwProgressMonitorDialog)1 ContainerType (com.centurylink.mdw.plugin.project.model.ServerSettings.ContainerType)1