Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » SelectionChanged(IAction.., ISelection..)
SelectionChanged(IAction.., ISelection..) [message #332169] Wed, 08 October 2008 08: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 08: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 03: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 06: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: Tue Mar 18 07:45:45 EDT 2025

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

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

Back to the top