Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326765 - Please make Shell.window a public field
Summary: Please make Shell.window a public field
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.7   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-01 07:21 EDT by Prakash Rangaraj CLA
Modified: 2010-10-01 13:07 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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