diff options
author | Silenio Quarti <silenio> | 2011-03-03 15:19:09 +0000 |
---|---|---|
committer | Silenio Quarti <silenio> | 2011-03-03 15:19:09 +0000 |
commit | f1fbb8716f7eb6144440edb1c7a2f83e3f63fe10 (patch) | |
tree | d713e43f11533c28e26d1a716340568a692bf820 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java | |
parent | dbfdea5a6ace7254c9bcb69a7489276f3b9d3e35 (diff) | |
download | eclipse.platform.swt-f1fbb8716f7eb6144440edb1c7a2f83e3f63fe10.tar.gz eclipse.platform.swt-f1fbb8716f7eb6144440edb1c7a2f83e3f63fe10.tar.xz eclipse.platform.swt-f1fbb8716f7eb6144440edb1c7a2f83e3f63fe10.zip |
Bug 329456 - Add API to access the application menu (Mac) and system menu (win32/gtk)
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java index ab048052e3..dda0b9534b 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java @@ -39,7 +39,7 @@ import org.eclipse.swt.events.*; public class MenuItem extends Item { Menu parent, menu; int /*long*/ groupHandle; - int accelerator; + int accelerator, userId; /** * Constructs a new instance of this class given its parent @@ -349,6 +349,21 @@ public boolean getEnabled () { } /** + * Gets the identifier associated with the receiver. + * + * @exception SWTException <ul> + * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> + * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> + * </ul> + * + * @since 3.7 + */ +public int getID () { + checkWidget(); + return userId; +} + +/** * Returns the receiver's cascade menu if it has one or null * if it does not. Only <code>CASCADE</code> menu items can have * a pull down menu. The sequence of key strokes, button presses @@ -644,6 +659,25 @@ public void setEnabled (boolean enabled) { } /** + * Sets the identifier associated with the receiver to the argument. + * + * @param id the new identifier. This must be a non-negative value. System-defined identifiers are negative values. + * + * @exception SWTException <ul> + * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> + * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> + * <li>ERROR_INVALID_ARGUMENT - if called with an negative-valued argument.</li> + * </ul> + * + * @since 3.7 + */ +public void setID (int id) { + checkWidget(); + if (id < 0) error(SWT.ERROR_INVALID_ARGUMENT); + userId = id; +} + +/** * Sets the image the receiver will display to the argument. * <p> * Note: This operation is a hint and is not supported on |