Cookie Action Disabling

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Cookie Action Disabling

Achyuth-3

Hi,

 

I have an action that extends CookieAction. This action is registered in the Layer.xml file that the IDE uses.

 

The action is connected to the nodes of the ExplorerPanel that my application uses i.e. the action is enabled/disabled based on the selection of nodes in the ExplorerPanel. How can I disable this action when the TopComponent that holds the ExplorerPanel is closed? The enable(Node[] nodes) method of the action is not called when the TopComponent is closed. Hence I do not know how to inform the cookie action about the closing of the TopComponent for it to disable. Is there any way that the action can be informed?

 

Regards,

Achyuth

(Huawei Technologies India Pvt. Ltd.)

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cookie Action Disabling

Tim Boudreau
Achyuth wrote:

> Hi,
>
> The action is connected to the nodes of the ExplorerPanel that my
> application uses i.e. the action is enabled/disabled based on the
> selection of nodes in the ExplorerPanel. How can I disable this action
> when the TopComponent that holds the ExplorerPanel is closed? The
> *enable(Node[] nodes)* method of the action is not called when the
> TopComponent is closed. Hence I do not know how to inform the cookie
> action about the closing of the TopComponent for it to disable. Is there
> any way that the action can be informed?

If you're in control of all the nodes in your ExplorerPanel, have them
all provide some cookie that nothing else provides, and make your action
sensitive to the presence of the cookie.

Otherwise, you could override one or another methods on your
ExplorerPanel and have it manually call your Action subclass and disable
it - call SystemAction.get (MyAction.class) to find the instance - when
your ExplorerPanel is closed.

-Tim

Loading...