In <group> tag in plugin.xml how to use the class attribute .

Hi,
I have tried to explain what i want by giving example and the
description of what i want to do is given after the "Qestions I Have"
section
example
]]>

Questions I Have::
1)How can i hide "action2" using setVisible
2)How can i get presentation of "action2"
3) How can call class "FilterMenu" specified in group element Before The
popup menu appears to the User

Description::
I want to filter the options to be shown in the group whose popup attribute
is set to true.
so i require a class to be called when we select the popupmenu option .How
can I implement this?
and what is the abstract class which i need to extend so that the
perticular action get called on
selecting the groupmenu whose popup is true.


Thanks,
Yuvraj



1 comment

Hello yuvraj,

You do not need to use a custom group class if you need to hide or show actions
in the submenu dynamically. You only need to override the update() method
in your action class:

class Action1 extends AnAction {
public void execute(AnActionEvent e) { }
public void update(AnActionEvent e) {
if (checkCondition()) {
e.getPresentation().setVisible(false);
}
else {
e.getPresentation().setVisible(true);
}
}
}

Note that the actions API is completely documented, and you can find a lot
of examples for its usage in the plugins included in the Plugin Development
Package and other open-source plugins.

y> Hi,
y> I have tried to explain what i want by giving example and the
y> description of what i want to do is given after the "Qestions I Have"
y> section
y> example
y> description="something" y> > y> description="action1"/> y> description="action2"/> y> description="action3"/> y> y> y> Questions I Have:: y> 1)How can i hide "action2" using setVisible y> 2)How can i get presentation of "action2" y> 3) How can call class "FilterMenu" specified in group element Before y> The y> popup menu appears to the User y> Description:: y> I want to filter the options to be shown in the group whose popup y> attribute y> is set to true. y> so i require a class to be called when we select the popupmenu option y> .How y> can I implement this? y> and what is the abstract class which i need to extend so that the y> perticular action get called on y> selecting the groupmenu whose popup is true. y> Thanks, y>]]> Yuvraj
--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"


0

Please sign in to leave a comment.