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
sana is currently offline sanaFriend
Messages: 17
Registered: July 2009
Junior Member
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
Ed Merks is currently offline Ed MerksFriend
Messages: 33185
Registered: July 2009
Senior Member
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.
>


Ed Merks
Professional Support: https://www.macromodeling.com/
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
sana is currently offline sanaFriend
Messages: 17
Registered: July 2009
Junior Member
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
Ed Merks is currently offline Ed MerksFriend
Messages: 33185
Registered: July 2009
Senior Member
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
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:ISearchQuery.run(IProcessMonitor) ,how is it get called??
Next Topic:Problem with BasicNewProjectResourceWizard
Goto Forum:
  


Current Time: Sat Jul 20 23:21:42 GMT 2024

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

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

Back to the top