From 0c693ec68aa92990fed67d5ac8294b0904382aa6 Mon Sep 17 00:00:00 2001 From: Carolyn MacLeod Date: Mon, 9 May 2011 17:12:22 +0000 Subject: After javadoc bash for 3.7RC1 --- .../cocoa/org/eclipse/swt/awt/SWT_AWT.java | 434 ++++++++++----------- .../org/eclipse/swt/accessibility/Accessible.java | 58 +-- .../org/eclipse/swt/accessibility/Accessible.java | 58 +-- .../org/eclipse/swt/accessibility/Accessible.java | 58 +-- .../org/eclipse/swt/accessibility/Accessible.java | 58 +-- .../emulated/org/eclipse/swt/dnd/Clipboard.java | 76 ++++ .../carbon/org/eclipse/swt/printing/Printer.java | 2 +- .../cocoa/org/eclipse/swt/printing/Printer.java | 2 +- .../emulated/org/eclipse/swt/printing/Printer.java | 2 +- .../gtk/org/eclipse/swt/printing/Printer.java | 2 +- .../motif/org/eclipse/swt/printing/Printer.java | 2 +- .../photon/org/eclipse/swt/printing/Printer.java | 2 +- .../wpf/org/eclipse/swt/printing/Printer.java | 2 +- .../carbon/org/eclipse/swt/widgets/Control.java | 56 ++- .../carbon/org/eclipse/swt/widgets/Display.java | 9 +- .../carbon/org/eclipse/swt/widgets/Menu.java | 27 ++ .../carbon/org/eclipse/swt/widgets/Text.java | 2 + .../carbon/org/eclipse/swt/widgets/ToolItem.java | 9 +- .../cocoa/org/eclipse/swt/widgets/Control.java | 51 ++- .../cocoa/org/eclipse/swt/widgets/Display.java | 9 +- .../cocoa/org/eclipse/swt/widgets/Menu.java | 27 ++ .../gtk/org/eclipse/swt/widgets/Control.java | 56 ++- .../gtk/org/eclipse/swt/widgets/Display.java | 9 +- .../gtk/org/eclipse/swt/widgets/Menu.java | 27 ++ .../gtk/org/eclipse/swt/widgets/Text.java | 2 + .../gtk/org/eclipse/swt/widgets/ToolItem.java | 9 +- .../motif/org/eclipse/swt/widgets/Control.java | 56 ++- .../motif/org/eclipse/swt/widgets/Display.java | 9 +- .../motif/org/eclipse/swt/widgets/Menu.java | 27 ++ .../motif/org/eclipse/swt/widgets/Text.java | 2 + .../motif/org/eclipse/swt/widgets/ToolItem.java | 9 +- .../photon/org/eclipse/swt/widgets/Control.java | 65 ++- .../photon/org/eclipse/swt/widgets/Display.java | 9 +- .../photon/org/eclipse/swt/widgets/Menu.java | 36 ++ .../photon/org/eclipse/swt/widgets/Text.java | 2 + .../photon/org/eclipse/swt/widgets/ToolItem.java | 9 +- .../wpf/org/eclipse/swt/widgets/Composite.java | 34 ++ .../wpf/org/eclipse/swt/widgets/Control.java | 65 ++- .../wpf/org/eclipse/swt/widgets/Display.java | 51 ++- .../wpf/org/eclipse/swt/widgets/Menu.java | 36 ++ .../wpf/org/eclipse/swt/widgets/Text.java | 2 + .../wpf/org/eclipse/swt/widgets/ToolItem.java | 9 +- 42 files changed, 1043 insertions(+), 427 deletions(-) (limited to 'bundles') diff --git a/bundles/org.eclipse.swt/Eclipse SWT AWT/cocoa/org/eclipse/swt/awt/SWT_AWT.java b/bundles/org.eclipse.swt/Eclipse SWT AWT/cocoa/org/eclipse/swt/awt/SWT_AWT.java index 08b8e4aefa..a80ca86abb 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT AWT/cocoa/org/eclipse/swt/awt/SWT_AWT.java +++ b/bundles/org.eclipse.swt/Eclipse SWT AWT/cocoa/org/eclipse/swt/awt/SWT_AWT.java @@ -83,231 +83,231 @@ public class SWT_AWT { } catch (Throwable e) {} } - /** - * Returns a java.awt.Frame which is the embedded frame - * associated with the specified composite. - * - * @param parent the parent Composite of the java.awt.Frame - * @return a java.awt.Frame the embedded frame or null. - * - * @exception IllegalArgumentException - * - * @since 3.2 - */ - public static Frame getFrame(Composite parent) { - if (parent == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); - if ((parent.getStyle() & SWT.EMBEDDED) == 0) return null; - return (Frame) parent.getData(EMBEDDED_FRAME_KEY); +/** + * Returns a java.awt.Frame which is the embedded frame + * associated with the specified composite. + * + * @param parent the parent Composite of the java.awt.Frame + * @return a java.awt.Frame the embedded frame or null. + * + * @exception IllegalArgumentException + * + * @since 3.2 + */ +public static Frame getFrame(Composite parent) { + if (parent == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); + if ((parent.getStyle() & SWT.EMBEDDED) == 0) return null; + return (Frame) parent.getData(EMBEDDED_FRAME_KEY); +} + +/** + * Creates a new java.awt.Frame. This frame is the root for + * the AWT components that will be embedded within the composite. In order + * for the embedding to succeed, the composite must have been created + * with the SWT.EMBEDDED style. + *

+ * IMPORTANT: As of JDK1.5, the embedded frame does not receive mouse events. + * When a lightweight component is added as a child of the embedded frame, + * the cursor does not change. In order to work around both these problems, it is + * strongly recommended that a heavyweight component such as java.awt.Panel + * be added to the frame as the root of all components. + *

+ * + * @param parent the parent Composite of the new java.awt.Frame + * @return a java.awt.Frame to be the parent of the embedded AWT components + * + * @exception IllegalArgumentException + * + * @since 3.0 + */ +public static Frame new_Frame(final Composite parent) { + if (parent == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); + if ((parent.getStyle() & SWT.EMBEDDED) == 0) { + SWT.error(SWT.ERROR_INVALID_ARGUMENT); } - /** - * Creates a new java.awt.Frame. This frame is the root for - * the AWT components that will be embedded within the composite. In order - * for the embedding to succeed, the composite must have been created - * with the SWT.EMBEDDED style. - *

- * IMPORTANT: As of JDK1.5, the embedded frame does not receive mouse events. - * When a lightweight component is added as a child of the embedded frame, - * the cursor does not change. In order to work around both these problems, it is - * strongly recommended that a heavyweight component such as java.awt.Panel - * be added to the frame as the root of all components. - *

- * - * @param parent the parent Composite of the new java.awt.Frame - * @return a java.awt.Frame to be the parent of the embedded AWT components - * - * @exception IllegalArgumentException - * - * @since 3.0 - */ - public static Frame new_Frame(final Composite parent) { - if (parent == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); - if ((parent.getStyle() & SWT.EMBEDDED) == 0) { - SWT.error(SWT.ERROR_INVALID_ARGUMENT); + final int /*long*/ handle = parent.view.id; + + Class clazz = null; + try { + String className = embeddedFrameClass != null ? embeddedFrameClass : "apple.awt.CEmbeddedFrame"; + if (embeddedFrameClass == null) { + clazz = Class.forName(className, true, ClassLoader.getSystemClassLoader()); + } else { + clazz = Class.forName(className); } - - final int /*long*/ handle = parent.view.id; - - Class clazz = null; - try { - String className = embeddedFrameClass != null ? embeddedFrameClass : "apple.awt.CEmbeddedFrame"; - if (embeddedFrameClass == null) { - clazz = Class.forName(className, true, ClassLoader.getSystemClassLoader()); - } else { - clazz = Class.forName(className); + } catch (ClassNotFoundException cne) { + SWT.error (SWT.ERROR_NOT_IMPLEMENTED, cne); + } catch (Throwable e) { + SWT.error (SWT.ERROR_UNSPECIFIED , e, " [Error while starting AWT]"); + } + + initializeSwing(); + Object value = null; + Constructor constructor = null; + try { + constructor = clazz.getConstructor (new Class [] {long.class}); + value = constructor.newInstance (new Object [] {new Long(handle)}); + } catch (Throwable e) { + SWT.error(SWT.ERROR_NOT_IMPLEMENTED, e); + } + final Frame frame = (Frame) value; + frame.addNotify(); + + parent.setData(EMBEDDED_FRAME_KEY, frame); + + /* Forward the iconify and deiconify events */ + final Listener shellListener = new Listener () { + public void handleEvent (Event e) { + switch (e.type) { + case SWT.Deiconify: + EventQueue.invokeLater(new Runnable () { + public void run () { + frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_DEICONIFIED)); + } + }); + break; + case SWT.Iconify: + EventQueue.invokeLater(new Runnable () { + public void run () { + frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_ICONIFIED)); + } + }); + break; } - } catch (ClassNotFoundException cne) { - SWT.error (SWT.ERROR_NOT_IMPLEMENTED, cne); - } catch (Throwable e) { - SWT.error (SWT.ERROR_UNSPECIFIED , e, " [Error while starting AWT]"); - } - - initializeSwing(); - Object value = null; - Constructor constructor = null; - try { - constructor = clazz.getConstructor (new Class [] {long.class}); - value = constructor.newInstance (new Object [] {new Long(handle)}); - } catch (Throwable e) { - SWT.error(SWT.ERROR_NOT_IMPLEMENTED, e); } - final Frame frame = (Frame) value; - frame.addNotify(); - - parent.setData(EMBEDDED_FRAME_KEY, frame); - - /* Forward the iconify and deiconify events */ - final Listener shellListener = new Listener () { - public void handleEvent (Event e) { - switch (e.type) { - case SWT.Deiconify: - EventQueue.invokeLater(new Runnable () { - public void run () { - frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_DEICONIFIED)); - } - }); - break; - case SWT.Iconify: - EventQueue.invokeLater(new Runnable () { - public void run () { - frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_ICONIFIED)); - } - }); - break; - } + }; + Shell shell = parent.getShell (); + shell.addListener (SWT.Deiconify, shellListener); + shell.addListener (SWT.Iconify, shellListener); + + /* + * Generate the appropriate events to activate and deactivate + * the embedded frame. This is needed in order to make keyboard + * focus work properly for lightweights. + */ + Listener listener = new Listener () { + public void handleEvent (Event e) { + switch (e.type) { + case SWT.Dispose: + Shell shell = parent.getShell (); + shell.removeListener (SWT.Deiconify, shellListener); + shell.removeListener (SWT.Iconify, shellListener); + parent.setVisible(false); + EventQueue.invokeLater(new Runnable () { + public void run () { + try { + frame.dispose (); + } catch (Throwable e) {} + } + }); + break; + case SWT.FocusIn: + EventQueue.invokeLater(new Runnable () { + public void run () { + if (frame.isActive()) return; + try { + Class clazz = frame.getClass(); + Method method = clazz.getMethod("synthesizeWindowActivation", new Class[]{boolean.class}); + if (method != null) method.invoke(frame, new Object[]{new Boolean(true)}); + } catch (Throwable e) {e.printStackTrace();} + } + }); + break; + case SWT.Deactivate: + EventQueue.invokeLater(new Runnable () { + public void run () { + if (!frame.isActive()) return; + try { + Class clazz = frame.getClass(); + Method method = clazz.getMethod("synthesizeWindowActivation", new Class[]{boolean.class}); + if (method != null) method.invoke(frame, new Object[]{new Boolean(false)}); + } catch (Throwable e) {e.printStackTrace();} + } + }); + break; } - }; - Shell shell = parent.getShell (); - shell.addListener (SWT.Deiconify, shellListener); - shell.addListener (SWT.Iconify, shellListener); - - /* - * Generate the appropriate events to activate and deactivate - * the embedded frame. This is needed in order to make keyboard - * focus work properly for lightweights. - */ - Listener listener = new Listener () { - public void handleEvent (Event e) { - switch (e.type) { - case SWT.Dispose: - Shell shell = parent.getShell (); - shell.removeListener (SWT.Deiconify, shellListener); - shell.removeListener (SWT.Iconify, shellListener); - parent.setVisible(false); - EventQueue.invokeLater(new Runnable () { - public void run () { - try { - frame.dispose (); - } catch (Throwable e) {} - } - }); - break; - case SWT.FocusIn: - EventQueue.invokeLater(new Runnable () { - public void run () { - if (frame.isActive()) return; - try { - Class clazz = frame.getClass(); - Method method = clazz.getMethod("synthesizeWindowActivation", new Class[]{boolean.class}); - if (method != null) method.invoke(frame, new Object[]{new Boolean(true)}); - } catch (Throwable e) {e.printStackTrace();} - } - }); - break; - case SWT.Deactivate: - EventQueue.invokeLater(new Runnable () { - public void run () { - if (!frame.isActive()) return; - try { - Class clazz = frame.getClass(); - Method method = clazz.getMethod("synthesizeWindowActivation", new Class[]{boolean.class}); - if (method != null) method.invoke(frame, new Object[]{new Boolean(false)}); - } catch (Throwable e) {e.printStackTrace();} - } - }); - break; + } + }; + + parent.addListener (SWT.FocusIn, listener); + parent.addListener (SWT.Deactivate, listener); + parent.addListener (SWT.Dispose, listener); + + parent.getDisplay().asyncExec(new Runnable() { + public void run () { + if (parent.isDisposed()) return; + final Rectangle clientArea = parent.getClientArea(); + EventQueue.invokeLater(new Runnable () { + public void run () { + frame.setSize (clientArea.width, clientArea.height); + frame.validate(); + + // Bug in Cocoa AWT? For some reason the frame isn't showing up on first draw. + // Toggling visibility seems to be the only thing that works. + frame.setVisible(false); + frame.setVisible(true); } - } - }; - - parent.addListener (SWT.FocusIn, listener); - parent.addListener (SWT.Deactivate, listener); - parent.addListener (SWT.Dispose, listener); - - parent.getDisplay().asyncExec(new Runnable() { - public void run () { - if (parent.isDisposed()) return; - final Rectangle clientArea = parent.getClientArea(); - EventQueue.invokeLater(new Runnable () { - public void run () { - frame.setSize (clientArea.width, clientArea.height); - frame.validate(); - - // Bug in Cocoa AWT? For some reason the frame isn't showing up on first draw. - // Toggling visibility seems to be the only thing that works. - frame.setVisible(false); - frame.setVisible(true); - } - }); - } - }); - - return frame; + }); + } + }); + + return frame; +} + +/** + * Creates a new Shell. This Shell is the root for + * the SWT widgets that will be embedded within the AWT canvas. + * + * @param display the display for the new Shell + * @param parent the parent java.awt.Canvas of the new Shell + * @return a Shell to be the parent of the embedded SWT widgets + * + * @exception IllegalArgumentException + * + * @since 3.0 + */ +public static Shell new_Shell(final Display display, final Canvas parent) { + if (display == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); + if (parent == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); + int /*long*/ handle = 0; + + try { + loadLibrary (); + handle = getAWTHandle (parent); + } catch (Throwable e) { + SWT.error (SWT.ERROR_NOT_IMPLEMENTED, e); } + if (handle == 0) SWT.error (SWT.ERROR_INVALID_ARGUMENT, null, " [peer not created]"); - /** - * Creates a new Shell. This Shell is the root for - * the SWT widgets that will be embedded within the AWT canvas. - * - * @param display the display for the new Shell - * @param parent the parent java.awt.Canvas of the new Shell - * @return a Shell to be the parent of the embedded SWT widgets - * - * @exception IllegalArgumentException - * - * @since 3.0 - */ - public static Shell new_Shell(final Display display, final Canvas parent) { - if (display == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); - if (parent == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); - int /*long*/ handle = 0; - - try { - loadLibrary (); - handle = getAWTHandle (parent); - } catch (Throwable e) { - SWT.error (SWT.ERROR_NOT_IMPLEMENTED, e); + final Shell shell = Shell.cocoa_new (display, handle); + final ComponentListener listener = new ComponentAdapter () { + public void componentResized (ComponentEvent e) { + display.asyncExec (new Runnable () { + public void run () { + if (shell.isDisposed()) return; + Dimension dim = parent.getSize (); + shell.setSize (dim.width, dim.height); + } + }); } - if (handle == 0) SWT.error (SWT.ERROR_INVALID_ARGUMENT, null, " [peer not created]"); - - final Shell shell = Shell.cocoa_new (display, handle); - final ComponentListener listener = new ComponentAdapter () { - public void componentResized (ComponentEvent e) { - display.asyncExec (new Runnable () { - public void run () { - if (shell.isDisposed()) return; - Dimension dim = parent.getSize (); - shell.setSize (dim.width, dim.height); - } - }); - } - }; - parent.addComponentListener(listener); - shell.addListener(SWT.Dispose, new Listener() { - public void handleEvent(Event event) { - parent.removeComponentListener(listener); - } - }); - shell.setVisible (true); - return shell; - } + }; + parent.addComponentListener(listener); + shell.addListener(SWT.Dispose, new Listener() { + public void handleEvent(Event event) { + parent.removeComponentListener(listener); + } + }); + shell.setVisible (true); + return shell; +} } \ No newline at end of file diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/carbon/org/eclipse/swt/accessibility/Accessible.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/carbon/org/eclipse/swt/accessibility/Accessible.java index 0f439c79e2..c89cf209a6 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/carbon/org/eclipse/swt/accessibility/Accessible.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/carbon/org/eclipse/swt/accessibility/Accessible.java @@ -94,6 +94,7 @@ public class Accessible { *
  • ERROR_NULL_ARGUMENT - if the parent is null
  • * * + * @see #dispose * @see Control#getAccessible * * @since 3.6 @@ -234,10 +235,10 @@ public class Accessible { /** * Adds the listener to the collection of listeners that will be * notified when an accessible client asks for any of the properties - * defined in the AccessibleAction interface. + * defined in the AccessibleActionListener interface. * * @param listener the listener that should be notified when the receiver - * is asked for AccessibleAction interface properties + * is asked for AccessibleActionListener interface properties * * @exception IllegalArgumentException