Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 326765

Summary: Please make Shell.window a public field
Product: [Eclipse Project] Platform Reporter: Prakash Rangaraj <prakash>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: skovatch
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Prakash Rangaraj CLA 2010-10-01 07:21:13 EDT
I've seen the Control.view made as public along with proper comments saying that it should not be used. Will it be possible to make Shell.window public with similar comments?

It would be really helpful for me in fixing Bug# 201696. Right now, I'm using reflection to access that field (patch available in that bug).
Comment 1 Scott Kovatch CLA 2010-10-01 12:35:34 EDT
You can always get at the NSWindow of a Control by calling view.window(), which is public on NSWindow. I'd like to avoid making any more fields public. If it returns null the NSView hasn't been parented to a NSWindow yet. 

All of the usual caveats apply there about accessing the 'view' field, but at this point I highly doubt we would rename or otherwise change that.
Comment 2 Scott Kovatch CLA 2010-10-01 12:36:09 EDT
BTW, the 'view' field of a Shell is the content view of the window, so it will always be set.
Comment 3 Prakash Rangaraj CLA 2010-10-01 13:07:55 EDT
Thanks Scott. view.window() works fine for me