Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to get instance of action delegate?
How to get instance of action delegate? [message #136821] Fri, 26 September 2003 19:20 Go to next message
Eclipse UserFriend
Originally posted by: dubauski.rational.com

Hi,

I know that Eclipse (not a plugin) instantiates delegate classes for
plugin's action contributions. On several different occasions I needed to
get a hold of the actual instance. If there is a better way to achieve my
goal please advise.

We are contributing actions to Navigator view. The logic behind enablement
of our actions is very complex (cannot be defined via XML logic in our
plugin.xml): we traverse selected resources recursively looking at contained
files, owning project natures and so forth to determine if an action is
enabled or not. We cache the selection for further run() calls.

PROBLEM: everything works great when user changes selection in Navigator.
Unfortunately, when resources are changed outside Eclipse then our action
status becomes *stale* and doesn't reflect the current state of selected
resources.

I was thinking to implement a Resource Change listener that would react to
external changes in resources and notify our action delegates or force them
to recompute the action state. However, there seems to be no way to get a
hold of action delegate instances.

Again, if I'm thinking in the wrong direction and there is a more elegant
way to do this please advise.

Thanks,
-Boris
Re: How to get instance of action delegate? [message #136959 is a reply to message #136821] Sat, 27 September 2003 02:27 Go to previous message
Eclipse UserFriend
Originally posted by: bob.objfac.com

Well, the obvious way would be inside the action delegate instance, itself.
It knows who it is, and can arrange to share this information with others.

Bob

"Barys Dubauski" <dubauski@rational.com> wrote in message
news:bl23eo$9hn$1@eclipse.org...
> Hi,
>
> I know that Eclipse (not a plugin) instantiates delegate classes for
> plugin's action contributions. On several different occasions I needed to
> get a hold of the actual instance. If there is a better way to achieve my
> goal please advise.
>
> We are contributing actions to Navigator view. The logic behind enablement
> of our actions is very complex (cannot be defined via XML logic in our
> plugin.xml): we traverse selected resources recursively looking at
contained
> files, owning project natures and so forth to determine if an action is
> enabled or not. We cache the selection for further run() calls.
>
> PROBLEM: everything works great when user changes selection in Navigator.
> Unfortunately, when resources are changed outside Eclipse then our action
> status becomes *stale* and doesn't reflect the current state of selected
> resources.
>
> I was thinking to implement a Resource Change listener that would react to
> external changes in resources and notify our action delegates or force
them
> to recompute the action state. However, there seems to be no way to get a
> hold of action delegate instances.
>
> Again, if I'm thinking in the wrong direction and there is a more elegant
> way to do this please advise.
>
> Thanks,
> -Boris
>
>
Previous Topic:ClassCastException when starting Eclipse from Java program with SAX parser
Next Topic:StackOverFlow error in forked ProgressMonitorDialog
Goto Forum:
  


Current Time: Thu Jul 25 18:48:41 GMT 2024

Powered by FUDForum. Page generated in 0.02921 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top