Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 320389 - Support system tray API
Summary: Support system tray API
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.3   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 1.4 M2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-20 08:58 EDT by Benjamin Muskalla CLA
Modified: 2010-08-27 03:58 EDT (History)
1 user (show)

See Also:


Attachments
Patch for Bug 320389 (15.31 KB, patch)
2010-08-18 08:32 EDT, Artur Kronenberg CLA
ivan: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Muskalla CLA 2010-07-20 08:58:26 EDT
SWT supports access to the system tray. As we cannot support a tray in RAP, we should implement this API as no-op.
SWT itself states that platforms that do not support system tray, should return null. But the API like classes / methods are needed for compiling.

See 
/**
 * Returns the single instance of the system tray or null
 * when there is no system tray available for the platform.
 *
 * @return the system tray or <code>null</code>
 * 
 * @exception SWTException <ul>
 *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
 * </ul>
 *
 * @since 3.0
 */
public Tray getSystemTray () {
Comment 1 Artur Kronenberg CLA 2010-08-18 08:32:34 EDT
Created attachment 176884 [details]
Patch for Bug 320389
Comment 2 Ivan Furnadjiev CLA 2010-08-24 05:22:23 EDT
In order to support a getSystemTray method that always returns null in RAP, we introduce an API classes Tray and TrayItem with some empty method implementation like TrayItem#setVisible. I would prefer to not implement this method at all, instead of introducing an unsupported API classes/methods. Maybe another possible solution is to change the method signature to:
public Widget getSystemTray (). Benny, what do you think?
Comment 3 Ivan Furnadjiev CLA 2010-08-24 06:02:07 EDT
But... after looking more carefully in the code, Display#getSystemTray is the only way to create an instance of the Tray widget. The empty implementations of Tray and TrayItem can't be accessed at all, but will help single sourcing. Please discard comment #2.
Comment 4 Rüdiger Herrmann CLA 2010-08-26 17:50:32 EDT
(In reply to comment #3)
> But... after looking more carefully in the code, Display#getSystemTray is the
> only way to create an instance of the Tray widget. The empty implementations of
> Tray and TrayItem can't be accessed at all, but will help single sourcing.
> Please discard comment #2.
Not sure if it would ever make sense to do a 1:1 port of an application to RAP that makes use of the SystemTray. However, I agree with Ivan that it would do no harm and would help single-sourcing.
Comment 5 Ivan Furnadjiev CLA 2010-08-27 03:58:34 EDT
Applied patch to CVS HEAD.