Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 337484 - Using new Shell#getToolBar() leads to NPEs on startup
Summary: Using new Shell#getToolBar() leads to NPEs on startup
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.7   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-17 15:09 EST by Brian de Alwis CLA
Modified: 2011-02-18 12:15 EST (History)
2 users (show)

See Also:


Attachments
Patch to work around NPEs on startup (1001 bytes, application/octet-stream)
2011-02-17 15:09 EST, Brian de Alwis CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brian de Alwis CLA 2011-02-17 15:09:20 EST
Created attachment 189223 [details]
Patch to work around NPEs on startup

BuildId: Eclipse 3.7M5

I was experimenting with e4 to use the native shell toolbar on MacOS X.  I'd get NPEs in Control#forceFocus(NSView) and ToolItem#setFocus() as view.window() would return null.

The attached patches at least avoid the issue.
Comment 1 Felipe Heidrich CLA 2011-02-17 15:16:23 EST
Please do not use this API, there is a change this API will most likely be removed. 

We are working on an alternative API.
Comment 2 Scott Kovatch CLA 2011-02-17 16:10:58 EST
Actually, these are good patches for SWT_AWT. There are situations in the new Plugin2 on the Mac where the applet isn't attached to any NSWindow.

I won't reopen the bug; I need a new one for that work.
Comment 3 Brian de Alwis CLA 2011-02-18 09:52:36 EST
(In reply to comment #1)
> Please do not use this API, there is a change this API will most likely be
> removed. 
> 
> We are working on an alternative API.

Is there a bug tracking this alternative API?
Comment 4 Felipe Heidrich CLA 2011-02-18 11:58:51 EST
(In reply to comment #3)
> (In reply to comment #1)
> > Please do not use this API, there is a change this API will most likely be
> > removed. 
> > 
> > We are working on an alternative API.
> 
> Is there a bug tracking this alternative API?

https://bugs.eclipse.org/bugs/show_bug.cgi?id=222859#c135
[note: we are still playing with the idea]
Comment 5 Scott Kovatch CLA 2011-02-18 12:15:00 EST
(In reply to comment #3)
> (In reply to comment #1)
> > Please do not use this API, there is a change this API will most likely be
> > removed. 
> > 
> > We are working on an alternative API.
> 
> Is there a bug tracking this alternative API?

Also see bug 325795. That one talks about Aero Glass shells but it's related.