This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 86093

Summary: Palette API - global palette listener registration
Product: platform Reporter: Joelle Lam <joellelam>
Component: PaletteAssignee: Stanislav Aubrecht <saubrecht>
Status: RESOLVED WORKSFORME    
Severity: blocker CC: anebuzelsky, quynguyen
Priority: P2    
Version: 5.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on:    
Bug Blocks: 90211    

Description Joelle Lam 2006-09-28 21:57:09 UTC
We need some way to access palette and know when an item has been selected.  The
Palette samples currently require you to go through each instances controller
and add a listener.  Because we have multiple instances of palette, this would
require a lot of unnessary dependencies.  Any given modules should be able to
register with the "global" palette and be notified upon item selection change. 
This is a necessary requirement for our context sensitive help.
Comment 1 Stanislav Aubrecht 2006-09-29 12:12:45 UTC
this is an RFE, not a bug and it's too late to add this to release55.

if you describe in more details your context sensitive help requirements i might
be able to suggest a work around or some other solution
Comment 2 Joelle Lam 2006-09-29 18:21:07 UTC
Our help module simply needs to know when a item in the palette has been
selected so that it can call getHelpCtx.  Right now, the help module has no idea
when to call getHelpCtx.  Quy, can you add any comments as necessary?
Comment 3 Quy Nguyen 2006-09-29 18:42:17 UTC
Our dynamic help system relies on notification of UI focus changes in order to
populate its display.  For most windows, it changes based on
TompComponent.Registry.PROP_ACTIVATED_NODES events when a user sequentially
selects items within a single IDE window, causing our help window to call the
selected component's getHelpCtx() method.  However, in the palette this scheme
does not work; we require a way to be notified when a user switches between
selections in the palette.
Comment 4 Stanislav Aubrecht 2006-10-02 10:19:38 UTC
so why don't you listen to opened topcomponents in the TopComponent.Registry and
attach/detach a single PaletteListener to all currently available
PaletteControllers?
Comment 5 Quy Nguyen 2006-11-28 18:27:57 UTC
The workaround appears to work for our purposes, so I am resolving the issue.