diff options
author | deboer | 2005-06-13 21:29:54 +0000 |
---|---|---|
committer | deboer | 2005-06-13 21:29:54 +0000 |
commit | d8d3e02b905f176274173607d3c45096e14354a7 (patch) | |
tree | d4edb78b570e36dd6993b136715cee294ed917ab /plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerPropertyTester.java | |
parent | fed9b68a29e80ab033e2caef3872af5d4a52d23f (diff) | |
download | webtools.servertools-d8d3e02b905f176274173607d3c45096e14354a7.tar.gz webtools.servertools-d8d3e02b905f176274173607d3c45096e14354a7.tar.xz webtools.servertools-d8d3e02b905f176274173607d3c45096e14354a7.zip |
[99482] Enable Debug As from editor input
Diffstat (limited to 'plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerPropertyTester.java')
-rw-r--r-- | plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerPropertyTester.java | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerPropertyTester.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerPropertyTester.java index e5e09d3c2..e3205759b 100644 --- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerPropertyTester.java +++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerPropertyTester.java @@ -11,6 +11,8 @@ package org.eclipse.wst.server.ui.internal; import org.eclipse.core.expressions.PropertyTester; +import org.eclipse.core.resources.IFile; +import org.eclipse.ui.IFileEditorInput; import org.eclipse.wst.server.core.internal.ServerPlugin; /** * @@ -20,6 +22,29 @@ public class ServerPropertyTester extends PropertyTester { * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object) */ public boolean test(Object receiver, String property, Object[] args, Object expectedValue) { - return ServerPlugin.hasModuleArtifact(receiver); + boolean b = ServerPlugin.hasModuleArtifact(receiver); + if (b) + return true; + + /*if (!(receiver instanceof IEditorPart)) + return false; + + // check if the editor input itself can be run. Otherwise, check if + // the editor has a file input that can be run + IEditorPart editor = (IEditorPart) receiver; + IEditorInput input = editor.getEditorInput(); + + b = ServerPlugin.hasModuleArtifact(input); + if (b) + return true;*/ + + if (receiver instanceof IFileEditorInput) { + IFileEditorInput fei = (IFileEditorInput) receiver; + IFile file = fei.getFile(); + b = ServerPlugin.hasModuleArtifact(file); + if (b) + return true; + } + return false; } }
\ No newline at end of file |