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

Bug 104280

Summary: Support the 'toolbar' button on OS X
Product: [Eclipse Project] Platform Reporter: Kim Horne <eclipse>
Component: UIAssignee: Kim Horne <eclipse>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: andre_weinand, Mike_Wilson, pombredanne, Silenio_Quarti, snorthov
Version: 3.1   
Target Milestone: 3.2 M1   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Bug Depends on: 104558    
Bug Blocks:    
Attachments:
Description Flags
Patch against org.eclipse.ui.carbon
none
Patch against org.eclipse.swt
none
Patch against org.eclipse.ui.carbon none

Description Kim Horne CLA 2005-07-18 17:02:49 EDT
It would be create if Eclipse windows could make use of the standard toolbar button that is found in the 
upper right hand corner of most OS X applications.
Comment 1 Kim Horne CLA 2005-07-18 17:14:38 EDT
Created attachment 24950 [details]
Patch against org.eclipse.ui.carbon
Comment 2 Kim Horne CLA 2005-07-18 17:16:51 EDT
Created attachment 24952 [details]
Patch against org.eclipse.swt

Note that this patch adds natives so Eclipse PI/carbon/library/build.xml needs
to be run before it will work.
Comment 3 Kim Horne CLA 2005-07-18 17:19:15 EDT
The attached patches require bug 104270 to be fixed before they work entirely.  As it is, they will only 
work for windows opened via Window/New Window.  Any windows present on startup will not have the 
toolbar button present.
Comment 4 Kim Horne CLA 2005-07-18 17:21:24 EDT
Steve, the solution we discussed requires the addition of one new internal OS method.  Would this be an 
acceptable compromise?  The patches provided add no new API methods...
Comment 5 Steve Northover CLA 2005-07-18 17:47:08 EDT
Yes.
Comment 6 Silenio Quarti CLA 2005-07-20 12:48:18 EDT
The SWT changes were released (except for the changes in Shell which can be avoided by calling 
OS.GetControlOwner(shell.handle)).
Comment 7 Kim Horne CLA 2005-07-20 14:39:34 EDT
Thanks Silenio!
Comment 8 Kim Horne CLA 2005-07-21 08:47:12 EDT
Created attachment 25124 [details]
Patch against org.eclipse.ui.carbon

Replacement patch.
Comment 9 Andre Weinand CLA 2005-07-21 09:20:43 EDT
I've tried the patch and it works great.
Very cool!

More things we could add in the CarbonUIEnhancer:
- AppleScript support
- open document support
- Services support
Comment 10 Kim Horne CLA 2005-07-21 09:27:16 EDT
Open document support was the next thing I was going to look at.  This problem exists on all of our 
supported OSs to some degree and there are many bugs that ask for it either directly or indirectly.  

And I would LOVE to get applescript support going.  You've been a MacHead longer than I have - have you 
got any ideas?
Comment 11 Andre Weinand CLA 2005-07-21 09:48:32 EDT
I've looked into AppleScript support only insofar as "open document" support is a required command for 
AppleScript's "Required Suite", that is the suite that every application is expected to have.

However, if I use the "Open Dictionary" command from the standard Script Editor (which has gotten a slick 
new UI in Tiger) to browse applications like BBEdit or Xcode, I can imagine that lots of Eclipse's generic 
workbench as well as IDE functionality could be made accessible via AppleScript. But IIRC the process of 
building the metadata that describes the functionality is rather laborious (and does not use XML :-)...
Comment 12 Kim Horne CLA 2005-07-21 18:14:27 EDT
Andre, could you please commit the provided patch?  My carbon commit rights are pending.

I've opened bug 104744 to address the open document/applescript work.
Comment 13 Andre Weinand CLA 2005-07-21 19:04:32 EDT
patch released.
Comment 14 Kim Horne CLA 2005-07-21 19:32:51 EDT
Thanks (and go to sleep :)!
Comment 15 Kim Horne CLA 2005-08-09 13:58:58 EDT
Verified in I20050808-2000.  Note that the fix for 104558 doesn't appear to work so the support will not 
be correct for RCP apps - the button will always be added even if the app doesn't have the coolbar/
perspective bar visible.