Search in sources :

Example 1 with IDataModelProvider

use of org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider 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)

Aggregations

IDataModel (org.eclipse.wst.common.frameworks.datamodel.IDataModel)1 IDataModelProvider (org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider)1 Action (org.eclipse.wst.common.project.facet.core.IFacetedProject.Action)1 IProjectFacetVersion (org.eclipse.wst.common.project.facet.core.IProjectFacetVersion)1