SelectionChanged(IAction.., ISelection..) [message #332169] |
Wed, 08 October 2008 12:02  |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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 #332193 is a reply to message #332190] |
Thu, 09 October 2008 10:56  |
Eclipse User |
|
|
|
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
>
|
|
|
Powered by
FUDForum. Page generated in 0.03531 seconds