FrameworkSupportprovider and JavaModuleType

My implementation of FrameworkSupportProvider class, does not recognize JavaModuleType when I do the following check:

    public boolean isEnabledForModuleType(@NotNull ModuleType moduleType) {
        return moduleType instanceof JavaModuleType;
    }


But when I set a breakpoint in this method, it clearly shows a com.intellij.openapi.module.JavaModuleType being passed in as a parameter. Is there any reason why Idea won't recognize JavaModuleType, or is my plugin environment broken?
(Running IntelliJ 9.0 build #UI-93.13 on Fedora 11, v 2.6.30.9-99.fc11.x86_64)

2 comments
Comment actions Permalink

Hello WarnerJan,

Make sure that you didn't add any of IDEA libraries to the classpath of your
plugin. If you do need to add some jars (like idea.jar or the JavaEE plugin
jar), you need to add them to the classpath of the IDEA JDK.

My implementation of FrameworkSupportProvider class, does not
recognize JavaModuleType when I do the following check:

public boolean isEnabledForModuleType(@NotNull ModuleType
moduleType) {
return moduleType instanceof JavaModuleType;
}
But when I set a breakpoint in this method, it clearly shows a
com.intellij.openapi.module.JavaModuleType being passed in as a
parameter. Is there any reason why Idea won't recognize
JavaModuleType, or is my plugin environment broken?

(Running IntelliJ 9.0 build #UI-93.13 on Fedora 11, v
2.6.30.9-99.fc11.x86_64)


--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

JavaModuleType isn't included in OpenAPI so in order to use it from the plugin you need to add idea.jar to IDEA Sdk configuration.

By the way JavaModuleType has no derived classes in IDEA so you can avoid using non-API classes by replacing "moduleType instanceof JavaModuleType"
with "moduleType.equals(StdModuleTypes.JAVA)".

My implementation of FrameworkSupportProvider class, does not recognize JavaModuleType when I do the following check:

    public boolean isEnabledForModuleType(@NotNull ModuleType moduleType) {
        return moduleType instanceof JavaModuleType;
    }

But when I set a breakpoint in this method, it clearly shows a com.intellij.openapi.module.JavaModuleType being passed in as a parameter. Is there any reason why Idea won't recognize JavaModuleType, or is my plugin environment broken?
(Running IntelliJ 9.0 build #UI-93.13 on Fedora 11, v 2.6.30.9-99.fc11.x86_64)

---
Original message URL: http://www.jetbrains.net/devnet/message/5252101#5252101



--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

Please sign in to leave a comment.