Re: Re: Re: ToggleViewAction

Tor Norbye <[email protected]> Fri, 07 Nov 2003 13:19:02 -0800
Newsgroups gmane.comp.java.netbeans.modules.tasklist.devel
Organization Sun Microsystems, Inc
Message-ID <[email protected]>
Petr Kuzel wrote:

>Tim Lebedkov wrote:
>
>  
>
>>>>I written a class that helps to implement an action that shows/closes a
>>>>view.
>>>>        
>>>>
>>>It matches with following RFE. Could you take care of it?
>>><http://tasklist.netbeans.org/issues/show_bug.cgi?id=34305>
>>>      
>>>
>>OK
>>    
>>
>
>It seems you are rewriting current actions, but I'm affraid that
>you should introduce new toggle actions. We need original
>actions for View menu and their toggling variant for toolbars.
>

Here's an idea.  Have the action implement 
org.openide.util.actions.Presenter (as for example ExportAction in 
tasklist/core does); then you have separate
calls to getMenuPresenter and getToolbarPresenter so you can make the 
action behavior change depending on whether you were invoked from a menu 
context or a toolbar context.

-- Tor