Browse files

IDE-826 IDE-827

  • Loading branch information...
1 parent 2d40783 commit 31f706193a1d6fe8d19e1e3ba026cb08c8ad05aa @gamerson gamerson committed Feb 25, 2013
View
117 tools/plugins/com.liferay.ide.project.ui/plugin.xml
@@ -84,6 +84,13 @@
type="org.eclipse.core.resources.IProject">
</propertyTester>
<propertyTester
+ class="com.liferay.ide.project.ui.SDKFolderProjectPropertyTester"
+ id="com.liferay.ide.project.ui.isSDKFolderProject"
+ namespace="com.liferay.ide.project.ui"
+ properties="isSDKFolderProject"
+ type="org.eclipse.core.resources.IProject">
+ </propertyTester>
+ <propertyTester
class="com.liferay.ide.project.ui.ProjectNaturePropertyTester"
id="com.liferay.ide.project.ui.hasNature"
namespace="com.liferay.ide.project.ui"
@@ -261,7 +268,7 @@
<enablement>
<adapt type="org.eclipse.core.resources.IProject">
<test
- property="com.liferay.ide.project.ui.isSDKProject" />
+ property="com.liferay.ide.project.ui.isSDKFolderProject" />
</adapt>
</enablement>
</objectContribution>
@@ -609,33 +616,40 @@
property="com.liferay.ide.project.ui.isBuildFile"
value="true" />
</adapt>
- <or>
- <adapt type="org.eclipse.core.resources.IProject">
+ <and>
+ <adapt type="org.eclipse.core.resources.IProject">
<test forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="liferay.portlet" />
- </adapt>
- <adapt type="org.eclipse.core.resources.IProject">
- <test forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="liferay.hook" />
- </adapt>
- <adapt type="org.eclipse.core.resources.IProject">
- <test forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="liferay.ext" />
- </adapt>
- <adapt type="org.eclipse.core.resources.IProject">
- <test forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="liferay.layouttpl" />
+ property="com.liferay.ide.project.ui.isSDKProject"
+ value="true" />
</adapt>
- <adapt type="org.eclipse.core.resources.IProject">
+ <or>
+ <adapt type="org.eclipse.core.resources.IProject">
+ <test forcePluginActivation="true"
+ property="org.eclipse.wst.common.project.facet.core.projectFacet"
+ value="liferay.portlet" />
+ </adapt>
+ <adapt type="org.eclipse.core.resources.IProject">
+ <test forcePluginActivation="true"
+ property="org.eclipse.wst.common.project.facet.core.projectFacet"
+ value="liferay.hook" />
+ </adapt>
+ <adapt type="org.eclipse.core.resources.IProject">
<test forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="liferay.theme" />
- </adapt>
- </or>
+ property="org.eclipse.wst.common.project.facet.core.projectFacet"
+ value="liferay.ext" />
+ </adapt>
+ <adapt type="org.eclipse.core.resources.IProject">
+ <test forcePluginActivation="true"
+ property="org.eclipse.wst.common.project.facet.core.projectFacet"
+ value="liferay.layouttpl" />
+ </adapt>
+ <adapt type="org.eclipse.core.resources.IProject">
+ <test forcePluginActivation="true"
+ property="org.eclipse.wst.common.project.facet.core.projectFacet"
+ value="liferay.theme" />
+ </adapt>
+ </or>
+ </and>
</or>
</adapt>
</enablement>
@@ -661,33 +675,40 @@
property="com.liferay.ide.project.ui.isBuildFile"
value="true" />
</adapt>
- <or>
- <adapt type="org.eclipse.core.resources.IProject">
+ <and>
+ <adapt type="org.eclipse.core.resources.IProject">
<test forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="liferay.portlet" />
+ property="com.liferay.ide.project.ui.isSDKProject"
+ value="true" />
</adapt>
- <adapt type="org.eclipse.core.resources.IProject">
- <test forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="liferay.hook" />
- </adapt>
- <adapt type="org.eclipse.core.resources.IProject">
- <test forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="liferay.ext" />
- </adapt>
- <adapt type="org.eclipse.core.resources.IProject">
+ <or>
+ <adapt type="org.eclipse.core.resources.IProject">
<test forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="liferay.layouttpl" />
- </adapt>
- <adapt type="org.eclipse.core.resources.IProject">
+ property="org.eclipse.wst.common.project.facet.core.projectFacet"
+ value="liferay.portlet" />
+ </adapt>
+ <adapt type="org.eclipse.core.resources.IProject">
<test forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="liferay.theme" />
- </adapt>
- </or>
+ property="org.eclipse.wst.common.project.facet.core.projectFacet"
+ value="liferay.hook" />
+ </adapt>
+ <adapt type="org.eclipse.core.resources.IProject">
+ <test forcePluginActivation="true"
+ property="org.eclipse.wst.common.project.facet.core.projectFacet"
+ value="liferay.ext" />
+ </adapt>
+ <adapt type="org.eclipse.core.resources.IProject">
+ <test forcePluginActivation="true"
+ property="org.eclipse.wst.common.project.facet.core.projectFacet"
+ value="liferay.layouttpl" />
+ </adapt>
+ <adapt type="org.eclipse.core.resources.IProject">
+ <test forcePluginActivation="true"
+ property="org.eclipse.wst.common.project.facet.core.projectFacet"
+ value="liferay.theme" />
+ </adapt>
+ </or>
+ </and>
</or>
<test
args="6.1.0"
View
46 ...liferay.ide.project.ui/src/com/liferay/ide/project/ui/SDKFolderProjectPropertyTester.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ *******************************************************************************/
+
+package com.liferay.ide.project.ui;
+
+import com.liferay.ide.sdk.core.SDKUtil;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
+
+/**
+ * @author Greg Amerson
+ */
+public class SDKFolderProjectPropertyTester extends PropertyTester
+{
+
+ public boolean test( Object receiver, String property, Object[] args, Object expectedValue )
+ {
+ if( receiver instanceof IProject )
+ {
+ final IProject project = (IProject) receiver;
+ final IPath location = project.getLocation();
+
+ if( location != null )
+ {
+ return SDKUtil.isValidSDKLocation( location.toOSString() );
+ }
+ }
+
+ return false;
+ }
+
+}

0 comments on commit 31f7061

Please sign in to comment.