Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » SelectionChanged(IAction.., ISelection..)
SelectionChanged(IAction.., ISelection..) [message #332169] Wed, 08 October 2008 12:02 Go to next message
Eclipse UserFriend
Hi,

I want to enable/disable toolbar action using action.setEnabled()
method.But SelectionChanged() is only called at eclipse startup. And
afterwards , this method is not called.Hence, the button never gets
disabled.

public void SelectionChanged(IAction action, ISelection selection){

if(count%2 ==0)
action.setEnabled(true);
else
action.setEnabled(false);

}

Thanks,
Sana.
Re: SelectionChanged(IAction.., ISelection..) [message #332170 is a reply to message #332169] Wed, 08 October 2008 12:16 Go to previous messageGo to next message
Eclipse UserFriend
Sana,

You extended BaseSelectionListenerAction and specialized
updateSelection? (You could use action.setEnabled(count%2 ==0) for more
compact code.)


sana wrote:
> Hi,
>
> I want to enable/disable toolbar action using action.setEnabled()
> method.But SelectionChanged() is only called at eclipse startup. And
> afterwards , this method is not called.Hence, the button never gets
> disabled.
>
> public void SelectionChanged(IAction action, ISelection selection){
>
> if(count%2 ==0)
> action.setEnabled(true);
> else
> action.setEnabled(false);
>
> }
>
> Thanks,
> Sana.
>
Re: SelectionChanged(IAction.., ISelection..) [message #332190 is a reply to message #332170] Thu, 09 October 2008 07:08 Go to previous messageGo to next message
Eclipse UserFriend
No...how do i do that?

Thanks,
Sana
Re: SelectionChanged(IAction.., ISelection..) [message #332193 is a reply to message #332190] Thu, 09 October 2008 10:56 Go to previous message
Eclipse UserFriend
Sana,

Eclipse is full of source code that you can look at to see how others
have implemented something similar to what you're trying to do. Take
advantage of the ability to search the Eclipse site for information
related to what you're interested in...


Sana wrote:
> No...how do i do that?
> Thanks,
> Sana
>
Previous Topic:ISearchQuery.run(IProcessMonitor) ,how is it get called??
Next Topic:Problem with BasicNewProjectResourceWizard
Goto Forum:
  


Current Time: Wed Feb 19 00:08:39 GMT 2025

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

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

Back to the top