Dear
Navid/Pawel,
Yes, I can enable/disable my actions say if I need it in the debug context
changed. The only thing I was searching for was to disable the items
initially. For that you were talking about some constructor in the Action
class. But I added this action set from the extension point
“org.eclipse.ui.actionSet”. There we have a class that extends
IWorkbenchwindowActionDelegate. We get control over this only if we
click/select that action item. But I need to disable it before this click… So
can I proceed as you said?
Also as Pawel said, I tried with org.eclipse.ui.Menus. There we can add
menuConfigurations. If the “visibleWhen” attribute is set properly (if an
exact condition is specified), I think that would work for me.
But again I’m stuck with the condition I should specify there. I cross checked
with org.eclipse.debug.ui. breakpoint actions and similar other cases, but its
implementation seems difficult to digest L.
Please help …
Malu
From:
cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Pawel Piech
Sent: Friday, January 08, 2010 12:29
AM
To: CDT General developers
list.
Subject: Re: [cdt-dev]
RE: Disabling Menuitems at IDE startup
Hi Malu,
The action framework enables actions by
default until the plugin that contributed the action is loaded.
Additionally, retargetable actions, such as the breakpoint toggle actions also
have an internal mechanism to assume that the action target is enabled until
that plugin is loaded. This is a compromise that was done to avoid
loading unnecessary plugins at start up.
If you have your own
custom actions and you would like more control over their initial enablement,
you should look at using the newer command framework (org.eclipse.ui.menus
extension point) instead of actions.
Cheers,
Pawel
Mehregani,
Navid wrote:
Malu,
You shouldn’t do this
in ‘createInitialLaout()’. This function is only called once when the
perspective is initialized (e.g. when it’s first opened or when user resets
the perspective). Why don’t you just set the enablement of your action
in the constructor of your Action class? i.e. setEnabled(false).
This will ensure that your action will be disabled when it’s first
created. You can then enable it whenever it’s appropriate. If the
enablement of your actions depends on the debug context, listen in on
IDebugContextListener to enable/disable
them.
Navid
Dear
All,
I need to show some custom action items in Run menu of eclipse IDE as disabled
initially i.e; at the start up of work bench - like default action items in
Run menu - Toggle Breakpoint, Toggle Line Breakpoint, Debug actions like Run,
Debug,Resume etc.
We have a custom perspective derived from the extension point
org.eclipse.ui.perspectives. I tried to disable the required action items in
createInitialLayout() function. When we run the code for the first time the
control is passing through this function and the required result is obtained.
But next time it’s is not entering this function. But again if we delete the
runtime of previous session and run the code it works fine.
Also I tried by setting the “enablesFor ” attribute of action in
org.elipse.ui.actionSets as 1. But the result was unpredictable. Even though
it gets disabled initially, if any item in views like breakpoint, _expression_,
RSE etc is selected it gets enabled. So I can’t trust
this.
Can any one please suggest a method to disable the menu items
initially?
Thanks in
advance
Malu
***** Confidentiality Statement/Disclaimer *****
This message and any attachments is intended for the sole use of the
intended recipient. It may contain confidential information. Any unauthorized
use, dissemination or modification is strictly prohibited. If you are not the
intended recipient, please notify the sender immediately then delete it from
all your systems, and do not copy, use or print. Internet communications are
not secure and it is the responsibility of the recipient to make sure that it
is virus/malicious code exempt.
The company/sender cannot be
responsible for any unauthorized alterations or modifications made to the
contents. If you require any form of confirmation of the contents, please
contact the company/sender. The company/sender is not liable for any errors or
omissions in the content of this
message.
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev
*****
Confidentiality Statement/Disclaimer *****