summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Aubry2012-09-06 12:06:05 (EDT)
committer Kevin KIN-FOO2012-09-11 12:59:46 (EDT)
commit7330a2a2dfb3fe3cefdca773de0071962b10cfe3 (patch)
tree203f59ca9301161f1209dda62844554f6e0a1bc5
parentb78fc743fdc14ad285772e14966f06102f70dbda (diff)
downloadorg.eclipse.koneki.ldt-7330a2a2dfb3fe3cefdca773de0071962b10cfe3.zip
org.eclipse.koneki.ldt-7330a2a2dfb3fe3cefdca773de0071962b10cfe3.tar.gz
org.eclipse.koneki.ldt-7330a2a2dfb3fe3cefdca773de0071962b10cfe3.tar.bz2
Bug 388750 - The Run As Lua Application should work on source folders and folders under source folders
-rw-r--r--plugins/org.eclipse.koneki.ldt.debug.ui/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.koneki.ldt.debug.ui/plugin.xml37
-rw-r--r--plugins/org.eclipse.koneki.ldt.debug.ui/src/org/eclipse/koneki/ldt/debug/ui/internal/LuaDebugPropertyTester.java28
3 files changed, 58 insertions, 10 deletions
diff --git a/plugins/org.eclipse.koneki.ldt.debug.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.koneki.ldt.debug.ui/META-INF/MANIFEST.MF
index a8601e9..58623d4 100644
--- a/plugins/org.eclipse.koneki.ldt.debug.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.koneki.ldt.debug.ui/META-INF/MANIFEST.MF
@@ -18,7 +18,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.dltk.launching;bundle-version="3.0.0",
org.eclipse.ui.ide;bundle-version="3.6.0",
org.eclipse.koneki.ldt.ui;bundle-version="0.9.0",
- org.eclipse.koneki.ldt.debug.core;bundle-version="0.9.0"
+ org.eclipse.koneki.ldt.debug.core;bundle-version="0.9.0",
+ org.eclipse.core.expressions;bundle-version="3.4.400"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: org.eclipse.koneki.ldt.debug.ui.internal;x-internal:=true,
diff --git a/plugins/org.eclipse.koneki.ldt.debug.ui/plugin.xml b/plugins/org.eclipse.koneki.ldt.debug.ui/plugin.xml
index fb85696..147d85b 100644
--- a/plugins/org.eclipse.koneki.ldt.debug.ui/plugin.xml
+++ b/plugins/org.eclipse.koneki.ldt.debug.ui/plugin.xml
@@ -168,6 +168,16 @@
</handler>
</extension>
<extension
+ point="org.eclipse.core.expressions.propertyTesters">
+ <propertyTester
+ class="org.eclipse.koneki.ldt.debug.ui.internal.LuaDebugPropertyTester"
+ id="org.eclipse.koneki.ldt.debug.ui.propertytester"
+ namespace="org.eclipse.koneki.ldt.debug.ui.propertytester"
+ properties="isLaunchableProjectFragment"
+ type="org.eclipse.dltk.core.IProjectFragment">
+ </propertyTester>
+ </extension>
+ <extension
point="org.eclipse.ui.preferencePages">
<page
category="org.eclipse.koneki.ldt.ui.globalpreferencepage"
@@ -198,18 +208,27 @@
<with variable="selection">
<count value="1"/>
<iterate>
- <adapt type="org.eclipse.core.resources.IResource">
- <and>
+ <and>
+ <adapt type="org.eclipse.core.resources.IResource">
<test property="org.eclipse.core.resources.projectNature"
value="org.eclipse.koneki.ldt.nature"/>
- <or>
+ </adapt>
+ <or>
+ <adapt type="org.eclipse.core.resources.IResource">
<test property="org.eclipse.core.resources.extension" value="lua"/>
- <adapt type="org.eclipse.core.resources.IProject">
- <test property="org.eclipse.core.resources.open"/>
- </adapt>
- </or>
- </and>
- </adapt>
+ </adapt>
+ <adapt type="org.eclipse.core.resources.IProject">
+ <test property="org.eclipse.core.resources.open"/>
+ </adapt>
+ <adapt type="org.eclipse.dltk.core.IProjectFragment">
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.koneki.ldt.debug.ui.propertytester.isLaunchableProjectFragment">
+ </test>
+ </adapt>
+ <instanceof value="org.eclipse.dltk.core.IScriptFolder"></instanceof>
+ </or>
+ </and>
</iterate>
</with>
</enablement>
diff --git a/plugins/org.eclipse.koneki.ldt.debug.ui/src/org/eclipse/koneki/ldt/debug/ui/internal/LuaDebugPropertyTester.java b/plugins/org.eclipse.koneki.ldt.debug.ui/src/org/eclipse/koneki/ldt/debug/ui/internal/LuaDebugPropertyTester.java
new file mode 100644
index 0000000..d478e1f
--- /dev/null
+++ b/plugins/org.eclipse.koneki.ldt.debug.ui/src/org/eclipse/koneki/ldt/debug/ui/internal/LuaDebugPropertyTester.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Sierra Wireless and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sierra Wireless - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.koneki.ldt.debug.ui.internal;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.dltk.core.IProjectFragment;
+
+public class LuaDebugPropertyTester extends PropertyTester {
+
+ static final String IS_LAUNCHABLEP_PROJECT_FRAG_PROPERTY = "isLaunchableProjectFragment"; //$NON-NLS-1$
+
+ @Override
+ public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+ if (IS_LAUNCHABLEP_PROJECT_FRAG_PROPERTY.equals(property) && receiver instanceof IProjectFragment) {
+ IProjectFragment projectFragment = (IProjectFragment) receiver;
+ return !projectFragment.isArchive() && !projectFragment.isBinary() && !projectFragment.isExternal() && !projectFragment.isBuiltin();
+ }
+ return false;
+ }
+}