Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[pde-dev] action enablement: selections vs. lazy initialization of plugins

Hi,

  Recently I have been developing a tiny plugin aiming in
generating some 'security methods' for already exisiting java
classes (clone(), ...) . The idea is to incorporate the plugin
into the standard Eclipse code generation scenarios - use the
'Source' menu and dynamically enable/disable the action when
various elements are selected. The enable/disable scenarios are
rather complicated and (as far as I am concerned) have to be done
programmatically. I've already coded that part. The problem is
that the programmatically done enablement works only after the
first use of the plugin (when the IAction is passed to the
delegate). I've defined the <enablement> node for the
IJavaElement in the plugin.xml file, but it's not enough. Is
there any means to define the enablement node for java editors,
etc. (to work similarly to the std code generation actions) ? Or
is it possible to force plugin initialization ? 

I've already investigated the JDT code generation actions.
Everything's done programmatically: action group generation,
action generation (there aren't any enablement nodes in the
plugin.xml file). The actions implement the IAction interface,
not the delegate. Ok, fine, the problem is that the JDT plugin is
initialized at the the start-up and that solution works ok. In my
case, the delagate is used and initialized lazily.

Are there any solutions (which do not require modification of the
Eclipse core  ;) ) ?

Best regards,
  B. Kowalewski

----------------------------------------------------
Zadbaj o bezpieczne wakacje nad wodÄ…!
Zobacz jak jest Bezpiecznie z NIVEA i WOPR - Kliknij:
http://klik.wp.pl/?adr=www.sport.wp.pl%2Fnivea-wopr.html&sid=828




Back to the top