IDEA requires the use of DefaultActionGroup over simple ActionGroup?
Hi,
I've created an action group which extends ActionGroup and not DefaultActionGroup. While loading,
intellij reported this error:
java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:34)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.b(ActionManagerImpl.java:218)
at
com.intellij.openapi.actionSystem.impl.ActionManagerImpl.processActionsElement(ActionManagerImpl.java:379)
at com.intellij.idea.IdeaApplication.c(IdeaApplication.java:1)
at com.intellij.idea.IdeaApplication.access$200(IdeaApplication.java:22)
at com.intellij.idea.IdeaApplication$IdeStarter.main(IdeaApplication.java:1)
at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:58)
at com.intellij.idea.Main$3.run(Main.java:1)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:110)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:171)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:143)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
ERROR - nSystem.impl.ActionManagerImpl - class with name
"org.mevenide.idea.synchronize.SynchronizeWithModuleActionGroup" should be instance of
com.intellij.openapi.actionSystem.DefaultActionGroup because there are children specified
ERROR - nSystem.impl.ActionManagerImpl - IntelliJ IDEA (Irida) #3397 Build #3397
ERROR - nSystem.impl.ActionManagerImpl - JDK: 1.5.0_03
ERROR - nSystem.impl.ActionManagerImpl - VM: Java HotSpot(TM) Client VM
ERROR - nSystem.impl.ActionManagerImpl - Vendor: Sun Microsystems Inc.
ERROR - nSystem.impl.ActionManagerImpl - OS: Windows XP
ERROR - nSystem.impl.ActionManagerImpl - Last Action:
ERROR - nSystem.impl.ActionManagerImpl - class with name
"org.mevenide.idea.synchronize.SynchronizeWithModuleActionGroup" should be instance of
com.intellij.openapi.actionSystem.DefaultActionGroup because there are children specified
java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:34)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.b(ActionManagerImpl.java:218)
at
com.intellij.openapi.actionSystem.impl.ActionManagerImpl.processActionsElement(ActionManagerImpl.java:379)
at com.intellij.idea.IdeaApplication.c(IdeaApplication.java:1)
at com.intellij.idea.IdeaApplication.access$200(IdeaApplication.java:22)
at com.intellij.idea.IdeaApplication$IdeStarter.main(IdeaApplication.java:1)
at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:58)
at com.intellij.idea.Main$3.run(Main.java:1)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:110)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:171)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:143)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Is the use of DefaultActionGroup mandated? I don't mind extending it, but I thought that
DefaultActionGroup is just a simple implementation of a generic ActionGroup. Since I wanted my group
to decide during runtime which actions it contains, I figured it would be best not to expose
action-manipulation methods such as the ones in DefaultActionGroup.
What is the recommended practice here?
Please sign in to leave a comment.
Hi,
if you register your action group in plugin.xml it should extends
DefaultActionGroup. Is it your case?
Thank you.
--
Anna Kozlova
JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
"Arik Kfir" <arikkfir@gmail.com> wrote in message
news:dasp0t$mj0$1@is.intellij.net...
>
DefaultActionGroup. While loading,
com.intellij.openapi.actionSystem.impl.ActionManagerImpl.b(ActionManagerImpl
.java:218)
>
com.intellij.openapi.actionSystem.impl.ActionManagerImpl.processActionsEleme
nt(ActionManagerImpl.java:379)
com.intellij.idea.IdeaApplication$IdeStarter.main(IdeaApplication.java:1)
com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:110)
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.ja
va:242)
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java
:163)
instance of
children specified
#3397 Build #3397
Client VM
Microsystems Inc.
instance of
children specified
com.intellij.openapi.actionSystem.impl.ActionManagerImpl.b(ActionManagerImpl
.java:218)
>
com.intellij.openapi.actionSystem.impl.ActionManagerImpl.processActionsEleme
nt(ActionManagerImpl.java:379)
com.intellij.idea.IdeaApplication$IdeStarter.main(IdeaApplication.java:1)
com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:110)
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.ja
va:242)
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java
:163)
>
I thought that
ActionGroup. Since I wanted my group
best not to expose
>
Hi
Yes I know - my question was why? I assumed you simply call 'getChildren' on the group, so extending
ActionGroup would be sufficient.
I got around the problem by indeed extending DefaultActionGroup, but I wanted to decide on the
group's children dynamically (in the getChildren method) and in DefaultActionGroup it is final...
Now, I need to register listeners and update the group...it's not too much, but I'd rather it was
dynamic...
Anna Kozlova (JetBrains) wrote:
Hi,
sorry, i was wrong - you can define group which extends ActionGroup (and not
DefaultActionGroup). One constraint here - do not define its children in
pligin.xml because it's not obvious what to do with them. So your "group
element" in xml must be empty.
--
Anna Kozlova
JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
"Arik Kfir" <arikkfir@gmail.com> wrote in message
news:db11h3$mc8$1@is.intellij.net...
>
on the group, so extending
>
wanted to decide on the
DefaultActionGroup it is final...
>
much, but I'd rather it was
>
Hi,
thanks. Does it have to be completely empty? because I had "<add-to-group>" elements in it (and got
the error...).
I can add the group manually via ActionMAnager, but then we'd miss the whole point of defining
action (groups) in plugin.xml...
What do you think?
Anna Kozlova (JetBrains) wrote:
You are right - it should be empty only from "action elements".
--
Anna Kozlova
JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
"Arik Kfir" <arikkfir@gmail.com> wrote in message
news:db3gac$e7h$1@is.intellij.net...
>
"<add-to-group>" elements in it (and got
>
whole point of defining
>
>
not