65 }
66
67 @Override
68 public void updateImage() {
69 Image image = ((TrayIcon)target).getImage();
70 if (image != null) {
71 updateNativeImage(image);
72 }
73 }
74
75 @Override
76 public native void setToolTip(String tooltip);
77
78 @Override
79 public synchronized void showPopupMenu(final int x, final int y) {
80 if (isDisposed())
81 return;
82
83 SunToolkit.executeOnEventHandlerThread(target, new Runnable() {
84 @Override
85 public void run() {
86 PopupMenu newPopup = ((TrayIcon)target).getPopupMenu();
87 if (popup != newPopup) {
88 if (popup != null) {
89 popupParent.remove(popup);
90 }
91 if (newPopup != null) {
92 popupParent.add(newPopup);
93 }
94 popup = newPopup;
95 }
96 if (popup != null) {
97 ((WPopupMenuPeer)popup.getPeer()).show(popupParent, new Point(x, y));
98 }
99 }
100 });
101 }
102
103 @Override
104 public void displayMessage(String caption, String text, String messageType) {
|
65 }
66
67 @Override
68 public void updateImage() {
69 Image image = ((TrayIcon)target).getImage();
70 if (image != null) {
71 updateNativeImage(image);
72 }
73 }
74
75 @Override
76 public native void setToolTip(String tooltip);
77
78 @Override
79 public synchronized void showPopupMenu(final int x, final int y) {
80 if (isDisposed())
81 return;
82
83 SunToolkit.executeOnEventHandlerThread(target, new Runnable() {
84 @Override
85 @SuppressWarnings("deprecation")
86 public void run() {
87 PopupMenu newPopup = ((TrayIcon)target).getPopupMenu();
88 if (popup != newPopup) {
89 if (popup != null) {
90 popupParent.remove(popup);
91 }
92 if (newPopup != null) {
93 popupParent.add(newPopup);
94 }
95 popup = newPopup;
96 }
97 if (popup != null) {
98 ((WPopupMenuPeer)popup.getPeer()).show(popupParent, new Point(x, y));
99 }
100 }
101 });
102 }
103
104 @Override
105 public void displayMessage(String caption, String text, String messageType) {
|