diff --git a/eclipse/common/plugins/com.liferay.ide.eclipse.project.core/src/com/liferay/ide/eclipse/project/core/util/ProjectUtil.java b/eclipse/common/plugins/com.liferay.ide.eclipse.project.core/src/com/liferay/ide/eclipse/project/core/util/ProjectUtil.java index 78b8002202..3eddba7888 100644 --- a/eclipse/common/plugins/com.liferay.ide.eclipse.project.core/src/com/liferay/ide/eclipse/project/core/util/ProjectUtil.java +++ b/eclipse/common/plugins/com.liferay.ide.eclipse.project.core/src/com/liferay/ide/eclipse/project/core/util/ProjectUtil.java @@ -724,6 +724,11 @@ public static boolean isLiferayPluginType(String type) { ISDKConstants.LAYOUTTPL_PLUGIN_PROJECT_SUFFIX.endsWith(type) || ISDKConstants.THEME_PLUGIN_PROJECT_SUFFIX.endsWith(type)); } + public static boolean isLiferayProject( IFolder folder ) { + return folder != null && folder.exists() && folder.getRawLocation() != null && + isLiferayProjectDir( folder.getRawLocation().toFile() ); + } + public static boolean isLiferayProject(IProject project) { boolean retval = false; @@ -805,6 +810,14 @@ public static boolean isPortletProject(IProject project) { return hasFacet(project, IPluginFacetConstants.LIFERAY_PORTLET_PROJECT_FACET); } + public static boolean isSDKProject( IProject project ) { + if (project == null || (!project.exists()) || (!project.isAccessible())) { + return false; + } + + return SDKUtil.isValidSDKLocation( project.getLocation().toOSString() ); + } + public static boolean isThemeProject(IProject project) { return hasFacet(project, IPluginFacetConstants.LIFERAY_THEME_FACET_ID); } diff --git a/eclipse/common/plugins/com.liferay.ide.eclipse.project.ui/plugin.xml b/eclipse/common/plugins/com.liferay.ide.eclipse.project.ui/plugin.xml index 5309806f46..1d1d670c0c 100644 --- a/eclipse/common/plugins/com.liferay.ide.eclipse.project.ui/plugin.xml +++ b/eclipse/common/plugins/com.liferay.ide.eclipse.project.ui/plugin.xml @@ -76,6 +76,13 @@ properties="isLiferayProject" type="org.eclipse.core.resources.IProject"> + + + + @@ -127,7 +141,7 @@ - + + + + + + + + + + + + + + + + + + +