Action Management

I am just getting started with a plugin project but am having some
difficulty with Action Management.

I was able to create an action in the ReSharper menu using an Action.xml
file as described in the tutorial. However, I used a test name for the
menu item and when I change it to a different name I still get the old
menu item grayed out. Not only that, I both menus greyed out if I run VS
without the /Resharper.Plugin command line (the plugin is not loaded but
the menu sticks around anyway).

How do I remove the menu?

4 comments
Comment actions Permalink

Hello Alon,

most likely the appearance of the old name of the menu item is related to
the fact that ReSharper builds its menus (and menus of its plugins) on the
first-time startup to minimize time of subsequent startups when the persisted
menus are used. You can force it to rebuild the menus by removing the following
registry value before running VS:

HKCU\Softwate\Microsoft\VisualStudio\8.0\ReSharper_OneTimeInitializationDoneForBuild

Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


0
Comment actions Permalink

Thanks, that worked.

I have a few more questions on the same subject though:
1. I am writing an action that I want to replace an existing action. Is
this possible?
2. There is a place holder for dynamic action handling (managing actions
from an application) but is is currently empty. Any tips on how to do
this? There are 2 issues I can think of:
a. How do I get a class to load on VS startup?
b. What class can be used to add actions?



In article <c8a8945d12208c9396c287e9ae3@news.intellij.net>,
dsha@jetbrains.com says...

Hello Alon,

most likely the appearance of the old name of the menu item is related to
the fact that ReSharper builds its menus (and menus of its plugins) on the
first-time startup to minimize time of subsequent startups when the persisted
menus are used. You can force it to rebuild the menus by removing the following
registry value before running VS:

HKCU\Softwate\Microsoft\VisualStudio\8.0\ReSharper_OneTimeInitializationDoneForBuild

Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


0
Comment actions Permalink

Hello Alon,

could you please clarify a bit what you're trying to achieve? Concerning
the first question, I don't quite understand
what you mean under 'replace' - replacing the menu item in UI or substituting
different behavior for visually unchanged action?
The actions can be added and removed dynamically using the ActionManager
interface. Actions.xml is a declarative way to do that.


Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


Thanks, that worked.

I have a few more questions on the same subject though:
1. I am writing an action that I want to replace an existing action.
Is
this possible?
2. There is a place holder for dynamic action handling (managing
actions
from an application) but is is currently empty. Any tips on how to do
this? There are 2 issues I can think of:
a. How do I get a class to load on VS startup?
b. What class can be used to add actions?
In article <c8a8945d12208c9396c287e9ae3@news.intellij.net>,
dsha@jetbrains.com says...

>> Hello Alon,
>>
>> most likely the appearance of the old name of the menu item is
>> related to the fact that ReSharper builds its menus (and menus of its
>> plugins) on the first-time startup to minimize time of subsequent
>> startups when the persisted menus are used. You can force it to
>> rebuild the menus by removing the following registry value before
>> running VS:
>>
>> HKCU\Softwate\Microsoft\VisualStudio\8.0\ReSharper_OneTimeInitializat
>> ionDoneForBuild
>>
>> Dmitry Shaporenkov
>> JetBrains, Inc
>> http://www.jetbrains.com
>> "Develop with pleasure!"


0
Comment actions Permalink

Alon,

You may override action's appearance and execution using
IUpdatable action = ActionManager.Instance.GetAction( "actionId" );
acttion.AddHandler( new MyActionHandler() );

--
Sergey V. Coox
JetBrains, Inc
http://www.jetbrains.com


0

Please sign in to leave a comment.