diff options
author | Andrey Loskutov | 2016-01-07 21:13:38 +0000 |
---|---|---|
committer | Andrey Loskutov | 2016-01-07 21:13:38 +0000 |
commit | 5ac9a285370904f70d1bfedebeb9324141831c8d (patch) | |
tree | 637a04022166c17d3e9d315ac4bdeee77624290e /bundles/org.eclipse.swt | |
parent | 99e351989b664361d67301543e836c2f84860038 (diff) | |
download | eclipse.platform.swt-5ac9a285370904f70d1bfedebeb9324141831c8d.tar.gz eclipse.platform.swt-5ac9a285370904f70d1bfedebeb9324141831c8d.tar.xz eclipse.platform.swt-5ac9a285370904f70d1bfedebeb9324141831c8d.zip |
Bug 485367 - cleaned trailing spaces in swt (cocoa)
Change-Id: I47e7c08d8fdd9beea2ace6603c5de79755925f48
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Diffstat (limited to 'bundles/org.eclipse.swt')
105 files changed, 3486 insertions, 3486 deletions
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 d75ca4eaba..cdc70ed472 100644 --- 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 @@ -29,39 +29,39 @@ import org.eclipse.swt.widgets.Event; * * @see <a href="http://www.eclipse.org/swt/snippets/#awt">Swing/AWT snippets</a> * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> - * + * * @since 3.0 */ public class SWT_AWT { - + /** * The name of the embedded Frame class. The default class name - * for the platform will be used if <code>null</code>. + * for the platform will be used if <code>null</code>. */ public static String embeddedFrameClass; - + /** * Key for looking up the embedded frame for a Composite using - * getData(). + * getData(). */ static String EMBEDDED_FRAME_KEY = "org.eclipse.swt.awt.SWT_AWT.embeddedFrame"; - + /** - * Key for running pending AWT invokeLater() events. + * Key for running pending AWT invokeLater() events. */ static final String RUN_AWT_INVOKE_LATER_KEY = "org.eclipse.swt.internal.runAWTInvokeLater"; //$NON-NLS-1$ - + static { System.setProperty("apple.awt.usingSWT", "true"); } static final String JDK16_FRAME = "apple.awt.CEmbeddedFrame"; static final String JDK17_FRAME = "sun.lwawt.macosx.CViewEmbeddedFrame"; - + static boolean loaded, swingInitialized; - + static native final long /*int*/ getAWTHandle (Canvas canvas); - + static synchronized void loadLibrary () { if (loaded) return; loaded = true; @@ -77,7 +77,7 @@ public class SWT_AWT { } catch (Throwable e) {} Library.loadLibrary("swt-awt"); } - + static synchronized void initializeSwing() { if (swingInitialized) return; swingInitialized = true; @@ -88,18 +88,18 @@ public class SWT_AWT { if (method != null) method.invoke(clazz); } catch (Throwable e) {} } - + /** * Returns a <code>java.awt.Frame</code> which is the embedded frame * associated with the specified composite. - * + * * @param parent the parent <code>Composite</code> of the <code>java.awt.Frame</code> * @return a <code>java.awt.Frame</code> the embedded frame or <code>null</code>. - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the parent is null</li> * </ul> - * + * * @since 3.2 */ public static Frame getFrame(Composite parent) { @@ -107,7 +107,7 @@ public static Frame getFrame(Composite parent) { if ((parent.getStyle() & SWT.EMBEDDED) == 0) return null; return (Frame) parent.getData(EMBEDDED_FRAME_KEY); } - + /** * Creates a new <code>java.awt.Frame</code>. This frame is the root for * the AWT components that will be embedded within the composite. In order @@ -120,15 +120,15 @@ public static Frame getFrame(Composite parent) { * strongly recommended that a heavyweight component such as <code>java.awt.Panel</code> * be added to the frame as the root of all components. * </p> - * + * * @param parent the parent <code>Composite</code> of the new <code>java.awt.Frame</code> * @return a <code>java.awt.Frame</code> to be the parent of the embedded AWT components - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the parent is null</li> - * <li>ERROR_INVALID_ARGUMENT - if the parent Composite does not have the SWT.EMBEDDED style</li> + * <li>ERROR_INVALID_ARGUMENT - if the parent Composite does not have the SWT.EMBEDDED style</li> * </ul> - * + * * @since 3.0 */ public static Frame new_Frame(final Composite parent) { @@ -136,7 +136,7 @@ public static Frame new_Frame(final Composite parent) { if ((parent.getStyle() & SWT.EMBEDDED) == 0) { SWT.error(SWT.ERROR_INVALID_ARGUMENT); } - + final long /*int*/ handle = parent.view.id; final Class<?> [] clazz = new Class [1]; @@ -154,9 +154,9 @@ public static Frame new_Frame(final Composite parent) { SWT.error (SWT.ERROR_NOT_IMPLEMENTED, cne1); } } catch (Throwable e) { - SWT.error (SWT.ERROR_UNSPECIFIED , e, " [Error while starting AWT]"); + SWT.error (SWT.ERROR_UNSPECIFIED , e, " [Error while starting AWT]"); } - + /* NOTE: Swing must not be initialize in an invokeLater() or it hangs */ initializeSwing(); @@ -196,12 +196,12 @@ public static Frame new_Frame(final Composite parent) { } final Frame frame = result[0]; final boolean isJDK17 = JDK17_FRAME.equals(frame.getClass().getName()); - + /* NOTE: addNotify() should not be called in the UI thread or we could hang */ //frame.addNotify(); - + parent.setData(EMBEDDED_FRAME_KEY, frame); - + /* Forward the iconify and deiconify events */ final Listener shellListener = new Listener () { public void handleEvent (Event e) { @@ -226,7 +226,7 @@ public static Frame new_Frame(final Composite parent) { Shell shell = parent.getShell (); shell.addListener (SWT.Deiconify, shellListener); shell.addListener (SWT.Iconify, shellListener); - + /* When display is disposed the frame is disposed in AWT EventQueue. * Force main event loop to run to let the frame finish dispose. */ @@ -244,7 +244,7 @@ public static Frame new_Frame(final Composite parent) { } } }); - + /* * Generate the appropriate events to activate and deactivate * the embedded frame. This is needed in order to make keyboard @@ -300,18 +300,18 @@ public static Frame new_Frame(final Composite parent) { } } }; - + parent.addListener (SWT.FocusIn, listener); if (isJDK17) { parent.addListener(SWT.FocusOut, listener); //To allow cross-app activation/deactivation - shell.addListener (SWT.Activate, listener); - shell.addListener (SWT.Deactivate, listener); + shell.addListener (SWT.Activate, listener); + shell.addListener (SWT.Deactivate, listener); } else { - parent.addListener (SWT.Deactivate, listener); + parent.addListener (SWT.Deactivate, listener); } parent.addListener (SWT.Dispose, listener); - + display.asyncExec(new Runnable() { public void run () { if (parent.isDisposed()) return; @@ -326,7 +326,7 @@ public static Frame new_Frame(final Composite parent) { 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); @@ -336,31 +336,31 @@ public static Frame new_Frame(final Composite parent) { } } }); - + return frame; } - + /** * Creates a new <code>Shell</code>. This Shell is the root for - * the SWT widgets that will be embedded within the AWT canvas. - * + * the SWT widgets that will be embedded within the AWT canvas. + * * @param display the display for the new Shell * @param parent the parent <code>java.awt.Canvas</code> of the new Shell * @return a <code>Shell</code> to be the parent of the embedded SWT widgets - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the display is null</li> * <li>ERROR_NULL_ARGUMENT - if the parent is null</li> * <li>ERROR_INVALID_ARGUMENT - if the parent's peer is not created</li> * </ul> - * + * * @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); long /*int*/ handle = 0; - + try { loadLibrary (); handle = getAWTHandle (parent); @@ -368,7 +368,7 @@ public static Shell new_Shell(final Display display, final Canvas parent) { SWT.error (SWT.ERROR_NOT_IMPLEMENTED, e); } 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 () { @Override diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/Accessible.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/Accessible.java index 53e3d69ede..78a51f02df 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/Accessible.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/Accessible.java @@ -31,7 +31,7 @@ import org.eclipse.swt.widgets.*; * As a rule of thumb, an application would only want to use the * accessible control listener to implement accessibility for a * custom control. - * + * * @see Control#getAccessible * @see AccessibleListener * @see AccessibleEvent @@ -39,17 +39,17 @@ import org.eclipse.swt.widgets.*; * @see AccessibleControlEvent * @see <a href="http://www.eclipse.org/swt/snippets/#accessibility">Accessibility snippets</a> * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> - * + * * @since 2.0 */ @SuppressWarnings({"rawtypes", "unchecked"}) public class Accessible { static boolean DEBUG = false; - + static final int MAX_RELATION_TYPES = 15; - static NSString[] baseAttributes = { + static NSString[] baseAttributes = { OS.NSAccessibilityRoleAttribute, OS.NSAccessibilitySubroleAttribute, OS.NSAccessibilityRoleDescriptionAttribute, @@ -62,7 +62,7 @@ public class Accessible { OS.NSAccessibilityWindowAttribute, OS.NSAccessibilityTopLevelUIElementAttribute, }; - + NSMutableArray attributeNames = null; NSMutableArray parameterizedAttributeNames = null; NSMutableArray actionNames = null; @@ -90,19 +90,19 @@ public class Accessible { int index = -1; TableAccessibleDelegate tableDelegate; - + /** * Constructs a new instance of this class given its parent. - * + * * @param parent the Accessible parent, which must not be null - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the parent is null</li> * </ul> - * + * * @see #dispose * @see Control#getAccessible - * + * * @since 3.6 */ public Accessible(Accessible parent) { @@ -111,7 +111,7 @@ public class Accessible { this.control = parent.control; delegate = new SWTAccessibleDelegate(this, ACC.CHILDID_SELF); } - + /** * @since 3.5 * @deprecated @@ -123,7 +123,7 @@ public class Accessible { Accessible(Control control) { this.control = control; } - + /** * Invokes platform specific functionality to allocate a new accessible object. * <p> @@ -136,13 +136,13 @@ public class Accessible { * * @param control the control to get the accessible object for * @return the platform specific accessible object - * + * * @noreference This method is not intended to be referenced by clients. */ public static Accessible internal_new_Accessible(Control control) { return new Accessible(control); } - + id accessibleHandle(Accessible accessible) { if (accessible.delegate != null) return accessible.delegate; if (accessible.control != null) { @@ -180,7 +180,7 @@ public class Accessible { if (accessibleListeners == null) accessibleListeners = new ArrayList<AccessibleListener>(); accessibleListeners.add(listener); } - + /** * Adds the listener to the collection of listeners who will * be notified when an accessible client asks for custom control @@ -230,7 +230,7 @@ public class Accessible { * @see AccessibleTextListener * @see AccessibleTextExtendedListener * @see #removeAccessibleTextListener - * + * * @since 3.0 */ public void addAccessibleTextListener (AccessibleTextListener listener) { @@ -238,13 +238,13 @@ public class Accessible { if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); if (listener instanceof AccessibleTextExtendedListener) { if (accessibleTextExtendedListeners == null) accessibleTextExtendedListeners = new ArrayList<AccessibleTextExtendedListener>(); - accessibleTextExtendedListeners.add ((AccessibleTextExtendedListener) listener); + accessibleTextExtendedListeners.add ((AccessibleTextExtendedListener) listener); } else { if (accessibleTextListeners == null) accessibleTextListeners = new ArrayList<AccessibleTextListener>(); accessibleTextListeners.add (listener); } } - + /** * Adds the listener to the collection of listeners that will be * notified when an accessible client asks for any of the properties @@ -263,7 +263,7 @@ public class Accessible { * * @see AccessibleActionListener * @see #removeAccessibleActionListener - * + * * @since 3.6 */ public void addAccessibleActionListener(AccessibleActionListener listener) { @@ -291,7 +291,7 @@ public class Accessible { * * @see AccessibleEditableTextListener * @see #removeAccessibleEditableTextListener - * + * * @since 3.7 */ public void addAccessibleEditableTextListener(AccessibleEditableTextListener listener) { @@ -319,7 +319,7 @@ public class Accessible { * * @see AccessibleHyperlinkListener * @see #removeAccessibleHyperlinkListener - * + * * @since 3.6 */ public void addAccessibleHyperlinkListener(AccessibleHyperlinkListener listener) { @@ -347,7 +347,7 @@ public class Accessible { * * @see AccessibleTableListener * @see #removeAccessibleTableListener - * + * * @since 3.6 */ public void addAccessibleTableListener(AccessibleTableListener listener) { @@ -375,7 +375,7 @@ public class Accessible { * * @see AccessibleTableCellListener * @see #removeAccessibleTableCellListener - * + * * @since 3.6 */ public void addAccessibleTableCellListener(AccessibleTableCellListener listener) { @@ -403,7 +403,7 @@ public class Accessible { * * @see AccessibleValueListener * @see #removeAccessibleValueListener - * + * * @since 3.6 */ public void addAccessibleValueListener(AccessibleValueListener listener) { @@ -431,7 +431,7 @@ public class Accessible { * * @see AccessibleAttributeListener * @see #removeAccessibleAttributeListener - * + * * @since 3.6 */ public void addAccessibleAttributeListener(AccessibleAttributeListener listener) { @@ -452,10 +452,10 @@ public class Accessible { /** * Adds a relation with the specified type and target * to the receiver's set of relations. - * + * * @param type an <code>ACC</code> constant beginning with RELATION_* indicating the type of relation * @param target the accessible that is the target for this relation - * + * * @since 3.6 */ public void addRelation(int type, Accessible target) { @@ -465,7 +465,7 @@ public class Accessible { } relations[type].addTarget(target); } - + int accessibleListenersSize() { return accessibleListeners == null ? 0 : accessibleListeners.size(); } @@ -515,17 +515,17 @@ public class Accessible { // the current role for the control. If it changes, reset the attribute list. if (role != currentRole) { currentRole = role; - + if (attributeNames != null) { attributeNames.release(); attributeNames = null; } - + if (parameterizedAttributeNames != null) { parameterizedAttributeNames.release(); parameterizedAttributeNames = null; } - + if (actionNames != null) { actionNames.release(); actionNames = null; @@ -538,7 +538,7 @@ public class Accessible { tableDelegate = new TableAccessibleDelegate(this); } } - + id getColumnIndexRangeAttribute(int childID) { AccessibleTableCellEvent event = new AccessibleTableCellEvent(this); for (int i = 0; i < accessibleTableCellListenersSize(); i++) { @@ -594,12 +594,12 @@ public class Accessible { listener.getColumnHeader(tableEvent); } if (tableEvent.accessible != null) returnValue = tableEvent.accessible.delegate; - + return returnValue; } - + id getVisibleColumnsAttribute(int childID) { - if (accessibleTableListenersSize() == 0) return null; + if (accessibleTableListenersSize() == 0) return null; id returnValue = null; AccessibleTableEvent event = new AccessibleTableEvent(this); for (int i = 0; i < accessibleTableListenersSize(); i++) { @@ -619,7 +619,7 @@ public class Accessible { } id getVisibleRowsAttribute(int childID) { - if (accessibleTableListenersSize() == 0) return null; + if (accessibleTableListenersSize() == 0) return null; id returnValue = null; AccessibleTableEvent event = new AccessibleTableEvent(this); for (int i = 0; i < accessibleTableListenersSize(); i++) { @@ -639,7 +639,7 @@ public class Accessible { } id getSelectedRowsAttribute(int childID) { - if (accessibleTableListenersSize() == 0) return null; + if (accessibleTableListenersSize() == 0) return null; id returnValue = null; AccessibleTableEvent event = new AccessibleTableEvent(this); for (int i = 0; i < accessibleTableListenersSize(); i++) { @@ -653,7 +653,7 @@ public class Accessible { event.row = selected[i]; for (int j = 0; j < accessibleTableListenersSize(); j++) { AccessibleTableListener listener = accessibleTableListeners.get(j); - listener.getRow(event); + listener.getRow(event); } if (event.accessible != null) array.addObject(event.accessible.delegate); } @@ -661,31 +661,31 @@ public class Accessible { } return returnValue == null ? NSArray.array() : returnValue; } - + int getRowCount() { AccessibleTableEvent event = new AccessibleTableEvent(this); - + for (int i = 0; i < accessibleTableListenersSize(); i++) { AccessibleTableListener listener = accessibleTableListeners.get(i); listener.getRowCount(event); } - + return event.count; } id getRowsAttribute(int childID) { if (accessibleTableListenersSize() == 0) return null; - + AccessibleTableEvent event = new AccessibleTableEvent(this); for (int i = 0; i < accessibleTableListenersSize(); i++) { AccessibleTableListener listener = accessibleTableListeners.get(i); listener.getRowCount(event); listener.getRows(event); } - + if (event.accessibles == null) event.accessibles = new Accessible[0]; - + if (event.count != event.accessibles.length) { createTableDelegate(); @@ -709,7 +709,7 @@ public class Accessible { id getSelectedColumnsAttribute(int childID) { if (accessibleTableListenersSize() == 0) return null; - + id returnValue = null; AccessibleTableEvent event = new AccessibleTableEvent(this); for (int i = 0; i < accessibleTableListenersSize(); i++) { @@ -723,7 +723,7 @@ public class Accessible { event.column = selected[i]; for (int j = 0; j < accessibleTableListenersSize(); j++) { AccessibleTableListener listener = accessibleTableListeners.get(j); - listener.getColumn(event); + listener.getColumn(event); } if (event.accessible != null) array.addObject(event.accessible.delegate); } @@ -731,18 +731,18 @@ public class Accessible { } return returnValue == null ? NSArray.array() : returnValue; } - + int getColumnCount() { AccessibleTableEvent event = new AccessibleTableEvent(this); - + for (int i = 0; i < accessibleTableListenersSize(); i++) { AccessibleTableListener listener = accessibleTableListeners.get(i); listener.getColumnCount(event); } - + return event.count; } - + id getColumnsAttribute(int childID) { if (accessibleTableListenersSize() == 0) return null; @@ -775,16 +775,16 @@ public class Accessible { } return array; } - + /** - * Gets the human-readable description of an action. + * Gets the human-readable description of an action. * <p> * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT * public API. It is marked public only so that it can be shared * within the packages provided by SWT. It is not available on all * platforms and should never be accessed from application code. * </p> - * + * * @noreference This method is not intended to be referenced by clients. */ public id internal_accessibilityActionDescription(NSString action, int childID) { @@ -817,19 +817,19 @@ public class Accessible { } if (event.result != null) returnValue = NSString.stringWith(event.result); } - } + } return returnValue; } - + /** - * Gets the array of action names that this object can perform. + * Gets the array of action names that this object can perform. * <p> * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT * public API. It is marked public only so that it can be shared * within the packages provided by SWT. It is not available on all * platforms and should never be accessed from application code. * </p> - * + * * @noreference This method is not intended to be referenced by clients. */ public NSArray internal_accessibilityActionNames(int childID) { @@ -846,7 +846,7 @@ public class Accessible { AccessibleActionListener listener = accessibleActionListeners.get(j); listener.getName(event); } - array.addObject(NSString.stringWith(event.result)); + array.addObject(NSString.stringWith(event.result)); } return array; } else { @@ -858,20 +858,20 @@ public class Accessible { AccessibleControlListener listener = accessibleControlListeners.get(i); listener.getRole(event); } - + // No accessible listener is overriding the role of the control, so let Cocoa return the default set for the control. if (event.detail == -1) { return null; } - + checkRole(event.detail); - + if ((childID == ACC.CHILDID_SELF) && (actionNames != null)) { return retainedAutoreleased(actionNames); } - + NSMutableArray returnValue = NSMutableArray.arrayWithCapacity(5); - + switch (event.detail) { case ACC.ROLE_PUSHBUTTON: case ACC.ROLE_RADIOBUTTON: @@ -892,8 +892,8 @@ public class Accessible { // returnValue.addObject(OS.NSAccessibilityRaiseAction); break; } - - + + if (childID == ACC.CHILDID_SELF) { actionNames = returnValue; actionNames.retain(); @@ -904,17 +904,17 @@ public class Accessible { } } } - + /** * Checks to see if the specified attribute can be set by a screen reader or other - * assistive service. + * assistive service. * <p> * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT * public API. It is marked public only so that it can be shared * within the packages provided by SWT. It is not available on all * platforms and should never be accessed from application code. * </p> - * + * * @noreference This method is not intended to be referenced by clients. */ public boolean internal_accessibilityIsAttributeSettable(NSString attribute, int childID) { @@ -930,16 +930,16 @@ public class Accessible { } return false; } - + /** - * Gets the array of attributes this object supports. + * Gets the array of attributes this object supports. * <p> * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT * public API. It is marked public only so that it can be shared * within the packages provided by SWT. It is not available on all * platforms and should never be accessed from application code. * </p> - * + * * @noreference This method is not intended to be referenced by clients. */ public NSArray internal_accessibilityAttributeNames(int childID) { @@ -957,19 +957,19 @@ public class Accessible { // return the default set for the control. if (event.detail == -1) return null; - + checkRole(event.detail); - + // If the attributes haven't changed return the cached list. if (attributeNames != null) return retainedAutoreleased(attributeNames); - + // Set up the base set of attributes. NSMutableArray returnValue = NSMutableArray.arrayWithCapacity(baseAttributes.length); for (int i = 0; i < baseAttributes.length; i++) { returnValue.addObject(baseAttributes[i]); } - + switch(event.detail) { case ACC.ROLE_CLIENT_AREA: break; @@ -1049,7 +1049,7 @@ public class Accessible { returnValue.addObject(OS.NSAccessibilityInsertionPointLineNumberAttribute); returnValue.addObject(OS.NSAccessibilitySelectedTextRangesAttribute); returnValue.addObject(OS.NSAccessibilityVisibleCharacterRangeAttribute); - returnValue.addObject(OS.NSAccessibilityValueAttribute); + returnValue.addObject(OS.NSAccessibilityValueAttribute); break; case ACC.ROLE_TOOLBAR: break; @@ -1184,8 +1184,8 @@ public class Accessible { case ACC.ROLE_SECTION: break; } - - + + /* * Only report back sub-roles when the SWT role maps to a sub-role. */ @@ -1201,7 +1201,7 @@ public class Accessible { if (childID != ACC.CHILDID_SELF) { returnValue.removeObject(OS.NSAccessibilityChildrenAttribute); } - + if (childID == ACC.CHILDID_SELF) { attributeNames = returnValue; attributeNames.retain(); @@ -1214,14 +1214,14 @@ public class Accessible { /** * Returns the value for the specified attribute. Return type depends on the attribute - * being queried; see the implementations of the accessor methods for details. + * being queried; see the implementations of the accessor methods for details. * <p> * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT * public API. It is marked public only so that it can be shared * within the packages provided by SWT. It is not available on all * platforms and should never be accessed from application code. * </p> - * + * * @noreference This method is not intended to be referenced by clients. */ public id internal_accessibilityAttributeValue(NSString attribute, int childID) { @@ -1266,21 +1266,21 @@ public class Accessible { if (attribute.isEqualToString(OS.NSAccessibilitySelectedAttribute)) return getSelectedAttribute(childID); if (OS.VERSION >= 0x1060 && attribute.isEqualToString(OS.NSAccessibilityRowIndexRangeAttribute)) return getRowIndexRangeAttribute(childID); if (OS.VERSION >= 0x1060 && attribute.isEqualToString(OS.NSAccessibilityColumnIndexRangeAttribute)) return getColumnIndexRangeAttribute(childID); - + // If this object don't know how to get the value it's up to the control itself to return an attribute value. return null; } - + /** * Returns the value of the specified attribute, using the supplied parameter. Return - * and parameter types vary depending on the attribute being queried. + * and parameter types vary depending on the attribute being queried. * <p> * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT * public API. It is marked public only so that it can be shared * within the packages provided by SWT. It is not available on all * platforms and should never be accessed from application code. * </p> - * + * * @noreference This method is not intended to be referenced by clients. */ public id internal_accessibilityAttributeValue_forParameter(NSString attribute, id parameter, int childID) { @@ -1297,17 +1297,17 @@ public class Accessible { } /** - * Returns the UI Element that has the focus. You can assume that the search + * Returns the UI Element that has the focus. You can assume that the search * for the focus has already been narrowed down to the receiver. - * Override this method to do a deeper search with a UIElement - - * e.g. a NSMatrix would determine if one of its cells has the focus. + * Override this method to do a deeper search with a UIElement - + * e.g. a NSMatrix would determine if one of its cells has the focus. * <p> * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT * public API. It is marked public only so that it can be shared * within the packages provided by SWT. It is not available on all * platforms and should never be accessed from application code. * </p> - * + * * @noreference This method is not intended to be referenced by clients. */ public id internal_accessibilityFocusedUIElement(int childID) { @@ -1318,28 +1318,28 @@ public class Accessible { AccessibleControlListener listener = accessibleControlListeners.get(i); listener.getFocus(event); } - + // The listener did not respond, so let Cocoa figure it out. if (event.childID == ACC.CHILDID_MULTIPLE) return null; - + /* The application can optionally answer an accessible. */ if (event.accessible != null) { return new id(OS.NSAccessibilityUnignoredAncestor(event.accessible.control.view.id)); } - + /* Or the application can answer a valid child ID, including CHILDID_SELF and CHILDID_NONE. */ if (event.childID == ACC.CHILDID_SELF || event.childID == ACC.CHILDID_NONE) { return new id(OS.NSAccessibilityUnignoredAncestor(control.view.id)); - } + } return new id(OS.NSAccessibilityUnignoredAncestor(childIDToOs(event.childID).id)); } /** - * Returns the deepest descendant of the UIElement hierarchy that contains the point. + * Returns the deepest descendant of the UIElement hierarchy that contains the point. * You can assume the point has already been determined to lie within the receiver. - * Override this method to do deeper hit testing within a UIElement - e.g. a NSMatrix + * Override this method to do deeper hit testing within a UIElement - e.g. a NSMatrix * would test its cells. The point is bottom-left relative screen coordinates. * * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT @@ -1347,7 +1347,7 @@ public class Accessible { * within the packages provided by SWT. It is not available on all * platforms and should never be accessed from application code. * </p> - * + * * @noreference This method is not intended to be referenced by clients. */ public id internal_accessibilityHitTest(NSPoint point, int childID) { @@ -1355,32 +1355,32 @@ public class Accessible { event.x = (int) point.x; Monitor primaryMonitor = Display.getCurrent().getPrimaryMonitor(); event.y = (int) (primaryMonitor.getBounds().height - point.y); - + // Set an impossible value to determine if anything responded to the event. event.childID = ACC.CHILDID_MULTIPLE; for (int i = 0; i < accessibleControlListenersSize(); i++) { AccessibleControlListener listener = accessibleControlListeners.get(i); listener.getChildAtPoint(event); } - + // The listener did not respond, so let Cocoa figure it out. if (event.childID == ACC.CHILDID_MULTIPLE && event.accessible == null) return null; - + if (event.accessible != null) { return new id(OS.NSAccessibilityUnignoredAncestor(event.accessible.delegate.id)); } - + if (event.childID == ACC.CHILDID_SELF || event.childID == ACC.CHILDID_NONE) { return new id(OS.NSAccessibilityUnignoredAncestor(control.view.id)); } - + return new id(OS.NSAccessibilityUnignoredAncestor(childIDToOs(event.childID).id)); } /** - * Return YES if the UIElement doesn't show up to the outside world - - * i.e. its parent should return the UIElement's children as its own - + * Return YES if the UIElement doesn't show up to the outside world - + * i.e. its parent should return the UIElement's children as its own - * cutting the UIElement out. E.g. NSControls are ignored when they are single-celled. * * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT @@ -1388,7 +1388,7 @@ public class Accessible { * within the packages provided by SWT. It is not available on all * platforms and should never be accessed from application code. * </p> - * + * * @noreference This method is not intended to be referenced by clients. */ public boolean internal_accessibilityIsIgnored(int childID) { @@ -1401,11 +1401,11 @@ public class Accessible { } boolean shouldIgnore = (event.detail == -1); - + if (shouldIgnore) { shouldIgnore = getTitleAttribute(childID) == null && getHelpAttribute(childID) == null && getDescriptionAttribute(childID) == null; } - + return shouldIgnore; } @@ -1417,7 +1417,7 @@ public class Accessible { * within the packages provided by SWT. It is not available on all * platforms and should never be accessed from application code. * </p> - * + * * @noreference This method is not intended to be referenced by clients. */ public NSArray internal_accessibilityParameterizedAttributeNames(int childID) { @@ -1433,15 +1433,15 @@ public class Accessible { // return the default set for the control. if (event.detail == -1) return null; - + checkRole(event.detail); - + if ((childID == ACC.CHILDID_SELF) && (parameterizedAttributeNames != null)) { return retainedAutoreleased(parameterizedAttributeNames); } NSMutableArray returnValue = NSMutableArray.arrayWithCapacity(4); - + switch(event.detail) { case ACC.ROLE_TEXT: case ACC.ROLE_PARAGRAPH: @@ -1478,7 +1478,7 @@ public class Accessible { * within the packages provided by SWT. It is not available on all * platforms and should never be accessed from application code. * </p> - * + * * @noreference This method is not intended to be referenced by clients. */ public boolean internal_accessibilityPerformAction(NSString action, int childID) { @@ -1510,7 +1510,7 @@ public class Accessible { } return ACC.OK.equals(event.result); } - } + } return false; } @@ -1523,14 +1523,14 @@ public class Accessible { * within the packages provided by SWT. It is not available on all * platforms and should never be accessed from application code. * </p> - * + * * @noreference This method is not intended to be referenced by clients. */ public void internal_accessibilitySetValue_forAttribute(id value, NSString attribute, int childId) { if (attribute.isEqualToString(OS.NSAccessibilitySelectedTextRangeAttribute)) setSelectedTextRangeAttribute(value, childId); if (attribute.isEqualToString(OS.NSAccessibilitySelectedTextAttribute)) setSelectedTextAttribute(value, childId); if (attribute.isEqualToString(OS.NSAccessibilityVisibleCharacterRangeAttribute)) setVisibleCharacterRangeAttribute(value, childId); - + if (accessibleValueListenersSize() > 0) { AccessibleValueEvent event = new AccessibleValueEvent(this); NSNumber number = new NSNumber(value); @@ -1541,7 +1541,7 @@ public class Accessible { } } } - + /** * Disposes of the operating system resources associated with * the receiver, and removes the receiver from its parent's @@ -1555,7 +1555,7 @@ public class Accessible { * It is also not necessary to call this for instances of <code>Accessible</code> * that were retrieved with <code>Control.getAccessible()</code>. * </p> - * + * * @since 3.6 */ public void dispose () { @@ -1565,7 +1565,7 @@ public class Accessible { } /** - * Returns the control for this Accessible object. + * Returns the control for this Accessible object. * * @return the receiver's control * @since 3.0 @@ -1583,7 +1583,7 @@ public class Accessible { * available on all platforms, and should never be called from * application code. * </p> - * + * * @noreference This method is not intended to be referenced by clients. */ public void internal_dispose_Accessible() { @@ -1592,23 +1592,23 @@ public class Accessible { id getAttributedStringForRangeParameterizedAttribute(id parameter, int childID) { if (accessibleAttributeListenersSize() == 0) return null; - + id stringFragment = getStringForRangeParameterizedAttribute(parameter, childID); NSMutableAttributedString attribString = (NSMutableAttributedString)new NSMutableAttributedString().alloc(); attribString.initWithString(new NSString(stringFragment), null); attribString.autorelease(); - - // Parameter is an NSRange wrapped in an NSValue. + + // Parameter is an NSRange wrapped in an NSValue. NSValue parameterObject = new NSValue(parameter.id); NSRange range = parameterObject.rangeValue(); - + AccessibleTextAttributeEvent event = new AccessibleTextAttributeEvent(this); - + event.offset = (int) /*64*/ range.location; event.start = event.end = -1; - + NSRange attributeRange = new NSRange(); - + while (event.offset < range.location + range.length) { for (int i = 0; i < accessibleAttributeListenersSize(); i++) { AccessibleAttributeListener listener = accessibleAttributeListeners.get(i); @@ -1616,7 +1616,7 @@ public class Accessible { } if (event.start == -1 && event.end == -1) return stringFragment; - + // The returned attributed string must have zero-based attributes. attributeRange.location = event.start - range.location; attributeRange.length = event.end - event.start; @@ -1628,7 +1628,7 @@ public class Accessible { attributeRange.location = 0; } - // Likewise, make sure the last attribute set does not run past the end of the requested range. + // Likewise, make sure the last attribute set does not run past the end of the requested range. if (attributeRange.location + attributeRange.length > range.length) { attributeRange.length = range.length - attributeRange.location; } @@ -1654,15 +1654,15 @@ public class Accessible { attribString.addAttribute(OS.NSAccessibilityFontTextAttribute, fontInfoDict, attributeRange); } - + if (ts.foreground != null) { addCGColor(ts.foreground.handle, attribString, OS.NSAccessibilityForegroundColorTextAttribute, attributeRange); } - + if (ts.background != null) { addCGColor(ts.background.handle, attribString, OS.NSAccessibilityBackgroundColorTextAttribute, attributeRange); } - + if (ts.underline) { int style = ts.underlineStyle; NSString attribute = OS.NSAccessibilityUnderlineTextAttribute; @@ -1681,22 +1681,22 @@ public class Accessible { default: styleObj = NSNumber.numberWithInt(OS.kAXUnderlineStyleNone); } - - attribString.addAttribute(attribute, styleObj, attributeRange); + + attribString.addAttribute(attribute, styleObj, attributeRange); } - + if (ts.underlineColor != null) { addCGColor(ts.underlineColor.handle, attribString, OS.NSAccessibilityUnderlineColorTextAttribute, attributeRange); } - + if (ts.strikeout) { attribString.addAttribute(OS.NSAccessibilityStrikethroughTextAttribute, NSNumber.numberWithBool(true), attributeRange); - + if (ts.strikeoutColor != null) { addCGColor(ts.strikeoutColor.handle, attribString, OS.NSAccessibilityStrikethroughColorTextAttribute, attributeRange); } } - + if (ts.data != null) { if (ts.data instanceof URL) { URL dataAsURL = (URL)ts.data; @@ -1706,7 +1706,7 @@ public class Accessible { } } } - + // Now add the alignment, justification, and indent, if available. AccessibleAttributeEvent docAttributes = new AccessibleAttributeEvent(this); docAttributes.indent = Integer.MAX_VALUE; // if unchanged no listener filled it in. @@ -1735,13 +1735,13 @@ public class Accessible { range.location = 0; attribString.addAttribute(NSString.stringWith("AXParagraphStyle"), paragraphDict, range); } - + return attribString; } id getBoundsForRangeParameterizedAttribute(id parameter, int childID) { if (accessibleTextExtendedListenersSize() == 0) return null; - + id returnValue = null; NSValue parameterObject = new NSValue(parameter.id); NSRange range = parameterObject.rangeValue(); @@ -1756,13 +1756,13 @@ public class Accessible { listener.getTextBounds(event); } rect.x = event.x; - + // Flip y coordinate for Cocoa. NSArray screens = NSScreen.screens(); NSScreen screen = new NSScreen(screens.objectAtIndex(0)); NSRect frame = screen.frame(); rect.y = frame.height - event.y - event.height; - + rect.width = event.width; rect.height = event.height; returnValue = NSValue.valueWithRect(rect); @@ -1772,7 +1772,7 @@ public class Accessible { } return returnValue; } - + id getExpandedAttribute(int childID) { // TODO: May need to expand the API so the combo box state can be reported. return NSNumber.numberWithBool(false); @@ -1786,11 +1786,11 @@ public class Accessible { AccessibleListener listener = accessibleListeners.get(i); listener.getHelp(event); } - + if (event.result != null) { returnValue = NSString.stringWith(event.result); } - + return returnValue; } @@ -1860,7 +1860,7 @@ public class Accessible { } return returnValue; } - + id getRoleDescriptionAttribute (int childID) { id returnValue = null; AccessibleControlEvent event = new AccessibleControlEvent(this); @@ -1883,18 +1883,18 @@ public class Accessible { } NSString nsAppRole = NSString.stringWith(appRole); NSString nsAppSubrole = null; - + if (appSubrole != null) nsAppSubrole = NSString.stringWith(appSubrole); returnValue = new NSString(OS.NSAccessibilityRoleDescription (((nsAppRole != null) ? nsAppRole.id : 0), (nsAppSubrole != null) ? nsAppSubrole.id : 0)); } } return returnValue; } - + id getTitleAttribute (int childID) { - + id returnValue = null; - + /* * Feature of the Macintosh. The text of a Label is returned in its value, * not its title, so ensure that the role is not Label before asking for the title. @@ -1914,22 +1914,22 @@ public class Accessible { AccessibleListener listener = accessibleListeners.get(i); listener.getName(event); } - + if (event.result != null) returnValue = NSString.stringWith(event.result); } return returnValue; } - + id getTitleUIElementAttribute(int childID) { id returnValue = null; - Relation relation = relations[ACC.RELATION_LABELLED_BY]; + Relation relation = relations[ACC.RELATION_LABELLED_BY]; if (relation != null) { returnValue = relation.getTitleUIElement(); } return returnValue; } - + id getValueAttribute (int childID) { id returnValue = null; if (accessibleValueListenersSize() > 0) { @@ -1951,7 +1951,7 @@ public class Accessible { } int role = event.detail; String value = event.result; - + switch (role) { case ACC.ROLE_RADIOBUTTON: // 1 = on, 0 = off case ACC.ROLE_CHECKBUTTON: // 1 = checked, 0 = unchecked, 2 = mixed @@ -1988,7 +1988,7 @@ public class Accessible { returnValue = new id(OS.NSAccessibilityUnignoredAncestor(childIDToOs(ace.childID).id)); } } else { - returnValue = NSNumber.numberWithBool(false); + returnValue = NSNumber.numberWithBool(false); } break; case ACC.ROLE_COMBOBOX: // text of the currently selected item @@ -2031,7 +2031,7 @@ public class Accessible { if (!enabled && delegate == null) enabled = control.isEnabled(); return NSNumber.numberWithBool(enabled); } - + id getFocusedAttribute (int childID) { AccessibleControlEvent event = new AccessibleControlEvent(this); event.childID = ACC.CHILDID_MULTIPLE; // set to invalid value, to test if the application sets it in getFocus() @@ -2045,7 +2045,7 @@ public class Accessible { boolean hasFocus = (event.accessible.index == childID) && (event.accessible.control == this.control); return NSNumber.numberWithBool(hasFocus); } - + /* Or the application can answer a valid child ID, including CHILDID_SELF and CHILDID_NONE. */ if (event.childID == ACC.CHILDID_SELF) { return NSNumber.numberWithBool(true); @@ -2058,11 +2058,11 @@ public class Accessible { return NSNumber.numberWithBool(event.childID == childID); } - // Invalid childID at this point means the application did not implement getFocus, so + // Invalid childID at this point means the application did not implement getFocus, so // let the default handler return the native focus. return null; } - + id getParentAttribute (int childID) { id returnValue = null; if (childID == ACC.CHILDID_SELF) { @@ -2081,19 +2081,19 @@ public class Accessible { } return returnValue; } - + id getChildrenAttribute (int childID, boolean visibleOnly) { - id returnValue = null; + id returnValue = null; if (childID == ACC.CHILDID_SELF) { // Test for a table first. if (currentRole == ACC.ROLE_TABLE) { // If the row count differs from the row elements returned, - // we need to create our own adapter to map the cells onto + // we need to create our own adapter to map the cells onto // rows and columns. The rows and columns attributes determine that for us. getRowsAttribute(childID); getColumnsAttribute(childID); } - + AccessibleControlEvent event = new AccessibleControlEvent(this); event.childID = childID; event.detail = -1; // set to impossible value to test if app resets @@ -2122,9 +2122,9 @@ public class Accessible { } } else { if (child instanceof Integer) { - id accChild = childIDToOs(((Integer)child).intValue()); + id accChild = childIDToOs(((Integer)child).intValue()); childArray.addObject(accChild); - } + } } } returnValue = new id(OS.NSAccessibilityUnignoredChildren(childArray.id)); @@ -2139,7 +2139,7 @@ public class Accessible { // implemented getChildCount/getChildren, references to those objects would have been returned above. return returnValue; } - + id getTabsAttribute (int childID) { id returnValue = null; if (childID == ACC.CHILDID_SELF) { @@ -2170,9 +2170,9 @@ public class Accessible { AccessibleControlListener listener = accessibleControlListeners.get(j); listener.getRole(event); } - + if (event.detail == ACC.ROLE_TABITEM) { - id accChild = childIDToOs(((Integer)child).intValue()); + id accChild = childIDToOs(((Integer)child).intValue()); childArray.addObject(accChild); } } else { @@ -2193,28 +2193,28 @@ public class Accessible { // implemented getChildCount/getChildren, references to those objects would have been returned above. return returnValue; } - + id getWindowAttribute (int childID) { return control.view.window(); } - + id getTopLevelUIElementAttribute (int childID) { return control.view.window(); } - + id getPositionAttribute (int childID) { id returnValue = null; AccessibleControlEvent event = new AccessibleControlEvent(this); event.childID = childID; event.width = -1; - + for (int i = 0; i < accessibleControlListenersSize(); i++) { AccessibleControlListener listener = accessibleControlListeners.get(i); listener.getLocation(event); } Monitor primaryMonitor = Display.getCurrent().getPrimaryMonitor(); - + NSPoint osPositionAttribute = new NSPoint (); if (event.width != -1) { // The point returned is the lower-left coordinate of the widget in lower-left relative screen coordinates. @@ -2228,7 +2228,7 @@ public class Accessible { if (control.getParent() != null) pt = control.getParent().toDisplay(location.x, location.y); - else + else pt = ((Shell)control).toDisplay(location.x, location.y); osPositionAttribute.x = pt.x; @@ -2236,10 +2236,10 @@ public class Accessible { returnValue = NSValue.valueWithPoint(osPositionAttribute); } } - + return returnValue; } - + id getSizeAttribute (int childID) { id returnValue = null; AccessibleControlEvent event = new AccessibleControlEvent(this); @@ -2262,10 +2262,10 @@ public class Accessible { returnValue = NSValue.valueWithSize(controlSize); } } - + return returnValue; } - + id getCellForColumnAndRowParameter(id parameter, int childID) { id returnValue = null; NSArray parameterObject = new NSArray(parameter.id); @@ -2302,7 +2302,7 @@ public class Accessible { return returnValue; } - + id getInsertionPointLineNumberAttribute (int childID) { id returnValue = null; if (accessibleTextExtendedListenersSize() > 0) { @@ -2344,10 +2344,10 @@ public class Accessible { } return returnValue; } - + id getLineForIndexParameterizedAttribute (id parameter, int childID) { id returnValue = null; - NSNumber charNumberObj = new NSNumber(parameter.id); + NSNumber charNumberObj = new NSNumber(parameter.id); int charNumber = charNumberObj.intValue(); if (accessibleTextExtendedListenersSize() > 0) { AccessibleTextEvent event = new AccessibleTextEvent(this); @@ -2374,7 +2374,7 @@ public class Accessible { } return returnValue; } - + id getMaxValueAttribute(int childID) { id returnValue = null; if (accessibleValueListenersSize() > 0) { @@ -2387,7 +2387,7 @@ public class Accessible { } return returnValue; } - + id getMinValueAttribute(int childID) { id returnValue = null; if (accessibleValueListenersSize() > 0) { @@ -2400,7 +2400,7 @@ public class Accessible { } return returnValue; } - + id getNumberOfCharactersAttribute (int childID) { id returnValue = null; AccessibleTextEvent event = new AccessibleTextEvent(this); @@ -2423,11 +2423,11 @@ public class Accessible { } return returnValue; } - + id getRangeForLineParameterizedAttribute (id parameter, int childID) { id returnValue = null; // The parameter is an NSNumber with the line number. - NSNumber lineNumberObj = new NSNumber(parameter.id); + NSNumber lineNumberObj = new NSNumber(parameter.id); int lineNumber = lineNumberObj.intValue(); if (accessibleTextExtendedListenersSize() > 0) { AccessibleTextEvent event = new AccessibleTextEvent(this); @@ -2464,7 +2464,7 @@ public class Accessible { id getRangeForIndexParameterizedAttribute (id parameter, int childID) { id returnValue = null; // The parameter is an NSNumber with the character number. - NSNumber charNumberObj = new NSNumber(parameter.id); + NSNumber charNumberObj = new NSNumber(parameter.id); int charNumber = charNumberObj.intValue(); if (accessibleTextExtendedListenersSize() > 0) { AccessibleTextEvent event = new AccessibleTextEvent(this); @@ -2546,7 +2546,7 @@ public class Accessible { } return returnValue; } - + id getSelectedTextRangeAttribute (int childID) { id returnValue = null; if (accessibleTextExtendedListenersSize() > 0) { @@ -2579,18 +2579,18 @@ public class Accessible { } return returnValue; } - + id getServesAsTitleForUIElementsAttribute(int childID) { id returnValue = null; Relation relation = relations[ACC.RELATION_LABEL_FOR]; if (relation != null) returnValue = relation.getServesAsTitleForUIElements(); return returnValue; } - + id getStringForRangeParameterizedAttribute (id parameter, int childID) { id returnValue = null; - - // Parameter is an NSRange wrapped in an NSValue. + + // Parameter is an NSRange wrapped in an NSValue. NSValue parameterObject = new NSValue(parameter.id); NSRange range = parameterObject.rangeValue(); if (accessibleTextExtendedListenersSize() > 0) { @@ -2613,14 +2613,14 @@ public class Accessible { listener.getValue(event); } String appValue = event.result; - + if (appValue != null) { returnValue = NSString.stringWith(appValue.substring((int)/*64*/range.location, (int)/*64*/(range.location + range.length))); } } return returnValue; } - + id getSelectedTextRangesAttribute (int childID) { NSMutableArray returnValue = NSMutableArray.arrayWithCapacity(3); if (accessibleTextExtendedListenersSize() > 0) { @@ -2636,7 +2636,7 @@ public class Accessible { for (int j = 0; j < accessibleTextExtendedListenersSize(); j++) { AccessibleTextExtendedListener listener = accessibleTextExtendedListeners.get(j); listener.getSelection(event); - } + } NSRange range = new NSRange(); range.location = event.start; range.length = event.end - event.start; @@ -2666,14 +2666,14 @@ public class Accessible { } return returnValue; } - + id getStyleRangeForIndexAttribute (id parameter, int childID) { if (accessibleAttributeListenersSize() == 0) return null; - // Parameter is an NSRange wrapped in an NSValue. + // Parameter is an NSRange wrapped in an NSValue. NSNumber parameterObject = new NSNumber(parameter.id); int index = parameterObject.intValue(); - + AccessibleTextAttributeEvent event = new AccessibleTextAttributeEvent(this); event.offset = (int) /*64*/ index; @@ -2696,7 +2696,7 @@ public class Accessible { return NSValue.valueWithRange(range); } - + id getVisibleCharacterRangeAttribute (int childID) { NSRange range = null; if (accessibleTextExtendedListenersSize() > 0) { @@ -2732,7 +2732,7 @@ public class Accessible { int length = text.length(); for (int i = 0; i < offset; i++) { switch (text.charAt (i)) { - case '\r': + case '\r': if (i + 1 < length) { if (text.charAt (i + 1) == '\n') ++i; } @@ -2759,7 +2759,7 @@ public class Accessible { } if (line > lineNumber) break; switch (text.charAt (i)) { - case '\r': + case '\r': if (i + 1 < length && text.charAt (i + 1) == '\n') i++; // FALL THROUGH case '\n': @@ -2845,7 +2845,7 @@ public class Accessible { * @see AccessibleTextListener * @see AccessibleTextExtendedListener * @see #addAccessibleTextListener - * + * * @since 3.0 */ public void removeAccessibleTextListener (AccessibleTextListener listener) { @@ -2882,7 +2882,7 @@ public class Accessible { * * @see AccessibleActionListener * @see #addAccessibleActionListener - * + * * @since 3.6 */ public void removeAccessibleActionListener(AccessibleActionListener listener) { @@ -2912,7 +2912,7 @@ public class Accessible { * * @see AccessibleEditableTextListener * @see #addAccessibleEditableTextListener - * + * * @since 3.7 */ public void removeAccessibleEditableTextListener(AccessibleEditableTextListener listener) { @@ -2923,7 +2923,7 @@ public class Accessible { if (accessibleEditableTextListeners.isEmpty()) accessibleEditableTextListeners = null; } } - + /** * Removes the listener from the collection of listeners that will be * notified when an accessible client asks for any of the properties @@ -2942,7 +2942,7 @@ public class Accessible { * * @see AccessibleHyperlinkListener * @see #addAccessibleHyperlinkListener - * + * * @since 3.6 */ public void removeAccessibleHyperlinkListener(AccessibleHyperlinkListener listener) { @@ -2972,7 +2972,7 @@ public class Accessible { * * @see AccessibleTableListener * @see #addAccessibleTableListener - * + * * @since 3.6 */ public void removeAccessibleTableListener(AccessibleTableListener listener) { @@ -3002,7 +3002,7 @@ public class Accessible { * * @see AccessibleTableCellListener * @see #addAccessibleTableCellListener - * + * * @since 3.6 */ public void removeAccessibleTableCellListener(AccessibleTableCellListener listener) { @@ -3032,7 +3032,7 @@ public class Accessible { * * @see AccessibleValueListener * @see #addAccessibleValueListener - * + * * @since 3.6 */ public void removeAccessibleValueListener(AccessibleValueListener listener) { @@ -3062,7 +3062,7 @@ public class Accessible { * * @see AccessibleAttributeListener * @see #addAccessibleAttributeListener - * + * * @since 3.6 */ public void removeAccessibleAttributeListener(AccessibleAttributeListener listener) { @@ -3077,10 +3077,10 @@ public class Accessible { /** * Removes the relation with the specified type and target * from the receiver's set of relations. - * + * * @param type an <code>ACC</code> constant beginning with RELATION_* indicating the type of relation * @param target the accessible that is the target for this relation - * + * * @since 3.6 */ public void removeRelation(int type, Accessible target) { @@ -3089,7 +3089,7 @@ public class Accessible { relations[type].removeTarget(target); } } - + void release(boolean destroy) { if (actionNames != null) actionNames.release(); actionNames = null; @@ -3103,7 +3103,7 @@ public class Accessible { } delegate = null; relations = null; - + if (childToIdMap != null) { Collection delegates = childToIdMap.values(); Iterator iter = delegates.iterator(); @@ -3115,16 +3115,16 @@ public class Accessible { childToIdMap.clear(); childToIdMap = null; } - + if (tableDelegate != null) tableDelegate.release(); } - + static NSArray retainedAutoreleased(NSArray inObject) { id temp = inObject.retain(); id temp2 = new NSObject(temp.id).autorelease(); return new NSArray(temp2.id); } - + /** * Sends a message with event-specific data to accessible clients * indicating that something has changed within a custom control. @@ -3132,12 +3132,12 @@ public class Accessible { * @param event an <code>ACC</code> constant beginning with EVENT_* indicating the message to send * @param eventData an object containing event-specific data, or null if there is no event-specific data * (eventData is specified in the documentation for individual ACC.EVENT_* constants) - * + * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li> * </ul> - * + * * @see ACC#EVENT_ACTION_CHANGED * @see ACC#EVENT_ATTRIBUTE_CHANGED * @see ACC#EVENT_DESCRIPTION_CHANGED @@ -3170,7 +3170,7 @@ public class Accessible { * @see ACC#EVENT_TEXT_COLUMN_CHANGED * @see ACC#EVENT_TEXT_SELECTION_CHANGED * @see ACC#EVENT_VALUE_CHANGED - * + * * @since 3.6 */ public void sendEvent(int event, Object eventData) { @@ -3227,8 +3227,8 @@ public class Accessible { if (eventParams[2] != 0) OS.NSAccessibilityPostNotification(eventSource.id, OS.NSAccessibilityRowCountChangedNotification.id); } break; - - // None of these correspond to anything in Cocoa. + + // None of these correspond to anything in Cocoa. case ACC.EVENT_HYPERTEXT_LINK_SELECTED: case ACC.EVENT_DOCUMENT_LOAD_COMPLETE: case ACC.EVENT_DOCUMENT_LOAD_STOPPED: @@ -3242,7 +3242,7 @@ public class Accessible { * Sends a message with event-specific data and a childID * to accessible clients, indicating that something has changed * within a custom control. - * + * * NOTE: This API is intended for applications that are still using childIDs. * Moving forward, applications should use accessible objects instead of childIDs. * @@ -3250,12 +3250,12 @@ public class Accessible { * @param eventData an object containing event-specific data, or null if there is no event-specific data * (eventData is specified in the documentation for individual ACC.EVENT_* constants) * @param childID an identifier specifying a child of the control - * + * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li> * </ul> - * + * * @see ACC#EVENT_DESCRIPTION_CHANGED * @see ACC#EVENT_LOCATION_CHANGED * @see ACC#EVENT_NAME_CHANGED @@ -3263,12 +3263,12 @@ public class Accessible { * @see ACC#EVENT_STATE_CHANGED * @see ACC#EVENT_TEXT_SELECTION_CHANGED * @see ACC#EVENT_VALUE_CHANGED - * + * * @since 3.8 */ public void sendEvent(int event, Object eventData, int childID) { checkWidget(); - + id eventSource = childIDToOs(childID); if (DEBUG) System.out.println("sendEvent: 0x" + Integer.toHexString(event) + ", data = " + eventData + ", source = " + eventSource); @@ -3286,7 +3286,7 @@ public class Accessible { OS.NSAccessibilityPostNotification(eventSource.id, OS.NSAccessibilityTitleChangedNotification.id); break; } } - + /** * Sends a message to accessible clients that the child selection * within a custom container control has changed. @@ -3295,7 +3295,7 @@ public class Accessible { * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li> * </ul> - * + * * @since 3.0 */ public void selectionChanged () { @@ -3314,7 +3314,7 @@ public class Accessible { * has changed within a custom control. * * @param childID an identifier specifying a child of the control - * + * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li> @@ -3330,16 +3330,16 @@ public class Accessible { void setSelectedTextAttribute(id value, int childId) { NSString newText = new NSString(value.id); int rangeStart = 0; - id charsValue = getNumberOfCharactersAttribute(childId); + id charsValue = getNumberOfCharactersAttribute(childId); int rangeEnd = new NSNumber(charsValue).intValue(); id rangeObj = getSelectedTextRangeAttribute(childId); - + if (rangeObj != null) { NSRange range = new NSValue(rangeObj).rangeValue(); rangeStart = (int)/*64*/range.location; rangeEnd = (int)/*64*/(range.location + range.length); } - + if (accessibleEditableTextListenersSize() > 0) { AccessibleEditableTextEvent event = new AccessibleEditableTextEvent(this); event.start = rangeStart; @@ -3350,7 +3350,7 @@ public class Accessible { AccessibleEditableTextListener listener = (AccessibleEditableTextListener) accessibleEditableTextListeners.get(i); listener.replaceText(event); } - } + } } void setSelectedTextRangeAttribute(id value, int childId) { @@ -3366,7 +3366,7 @@ public class Accessible { listener.removeSelection(event); listener.addSelection(event); } - } + } } void setVisibleCharacterRangeAttribute(id value, int childId) { @@ -3381,15 +3381,15 @@ public class Accessible { AccessibleTextExtendedListener listener = accessibleTextExtendedListeners.get(i); listener.scrollText(event); } - } - } + } + } /** * Sends a message to accessible clients that the text * caret has moved within a custom control. * * @param index the new caret index within the control - * + * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li> @@ -3401,7 +3401,7 @@ public class Accessible { checkWidget(); OS.NSAccessibilityPostNotification(control.view.id, OS.NSAccessibilitySelectedTextChangedNotification.id); } - + /** * Sends a message to accessible clients that the text * within a custom control has changed. @@ -3415,17 +3415,17 @@ public class Accessible { * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li> * </ul> - * + * * @see ACC#TEXT_INSERT * @see ACC#TEXT_DELETE - * + * * @since 3.0 */ public void textChanged (int type, int startIndex, int length) { checkWidget(); OS.NSAccessibilityPostNotification(control.view.id, OS.NSAccessibilityValueChangedNotification.id); } - + /** * Sends a message to accessible clients that the text * selection has changed within a custom control. @@ -3441,7 +3441,7 @@ public class Accessible { checkWidget(); OS.NSAccessibilityPostNotification(control.view.id, OS.NSAccessibilitySelectedTextChangedNotification.id); } - + id childIDToOs(int childID) { if (childID == ACC.CHILDID_SELF) { return control.view; @@ -3449,12 +3449,12 @@ public class Accessible { /* Check cache for childID, if found, return corresponding osChildID. */ SWTAccessibleDelegate childRef = (SWTAccessibleDelegate) childToIdMap.get(new Integer(childID)); - + if (childRef == null) { childRef = new SWTAccessibleDelegate(this, childID); childToIdMap.put(new Integer(childID), childRef); } - + return childRef; } @@ -3463,11 +3463,11 @@ public class Accessible { returnValue = returnValue.stringByAppendingString(NSString.stringWith(":")); returnValue = returnValue.stringByAppendingString(str2); return returnValue; - } - + } + String roleToOs(int role) { NSString nsReturnValue = null; //OS.NSAccessibilityUnknownRole; - + switch (role) { case ACC.ROLE_CLIENT_AREA: nsReturnValue = OS.NSAccessibilityGroupRole; break; case ACC.ROLE_WINDOW: nsReturnValue = OS.NSAccessibilityWindowRole; break; @@ -3486,13 +3486,13 @@ public class Accessible { case ACC.ROLE_COMBOBOX: nsReturnValue = OS.NSAccessibilityComboBoxRole; break; case ACC.ROLE_TEXT: { int style = control.getStyle(); - + if ((style & SWT.MULTI) != 0) { nsReturnValue = OS.NSAccessibilityTextAreaRole; } else { nsReturnValue = OS.NSAccessibilityTextFieldRole; } - + break; } case ACC.ROLE_TOOLBAR: nsReturnValue = OS.NSAccessibilityToolbarRole; break; @@ -3501,7 +3501,7 @@ public class Accessible { case ACC.ROLE_COLUMN: nsReturnValue = OS.NSAccessibilityColumnRole; break; case ACC.ROLE_ROW: nsReturnValue = concatStringsAsRole(OS.NSAccessibilityRowRole, OS.NSAccessibilityTableRowSubrole); break; case ACC.ROLE_TABLE: nsReturnValue = OS.NSAccessibilityTableRole; break; - case ACC.ROLE_TABLECELL: nsReturnValue = OS.NSAccessibilityStaticTextRole; break; + case ACC.ROLE_TABLECELL: nsReturnValue = OS.NSAccessibilityStaticTextRole; break; case ACC.ROLE_TABLECOLUMNHEADER: nsReturnValue = OS.NSAccessibilityGroupRole; break; case ACC.ROLE_TABLEROWHEADER: nsReturnValue = OS.NSAccessibilityGroupRole; break; case ACC.ROLE_TREE: nsReturnValue = OS.NSAccessibilityOutlineRole; break; @@ -3511,13 +3511,13 @@ public class Accessible { case ACC.ROLE_PROGRESSBAR: nsReturnValue = OS.NSAccessibilityProgressIndicatorRole; break; case ACC.ROLE_SLIDER: nsReturnValue = OS.NSAccessibilitySliderRole; break; case ACC.ROLE_LINK: nsReturnValue = OS.NSAccessibilityLinkRole; break; - + //10.6 only -> case ACC.ROLE_CANVAS: nsReturnValue = OS.NSAccessibilityLayoutAreaRole; break; case ACC.ROLE_CANVAS: nsReturnValue = OS.NSAccessibilityGroupRole; break; case ACC.ROLE_GRAPHIC: nsReturnValue = OS.NSAccessibilityImageRole; break; - + //CLIENT_AREA uses NSAccessibilityGroupRole already - case ACC.ROLE_GROUP: nsReturnValue = OS.NSAccessibilityGroupRole; break; + case ACC.ROLE_GROUP: nsReturnValue = OS.NSAccessibilityGroupRole; break; //SPLIT_BUTTON uses NSAccessibilityMenuButtonRole already case ACC.ROLE_CHECKMENUITEM: nsReturnValue = OS.NSAccessibilityMenuButtonRole; break; case ACC.ROLE_RADIOMENUITEM: nsReturnValue = OS.NSAccessibilityMenuButtonRole; break; @@ -3536,8 +3536,8 @@ public class Accessible { case ACC.ROLE_CLOCK: case ACC.ROLE_DATETIME: case ACC.ROLE_CALENDAR: - case ACC.ROLE_ALERT: - case ACC.ROLE_ANIMATION: + case ACC.ROLE_ALERT: + case ACC.ROLE_ANIMATION: case ACC.ROLE_DOCUMENT: case ACC.ROLE_SPINBUTTON: case ACC.ROLE_STATUSBAR: @@ -3559,29 +3559,29 @@ public class Accessible { } /** - * Adds relationship attributes if needed to the property list. + * Adds relationship attributes if needed to the property list. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the SWT * public API. It is marked public only so that it can be shared * within the packages provided by SWT. It is not available on all * platforms and should never be accessed from application code. * </p> - * + * * @noreference This method is not intended to be referenced by clients. */ public long /*int*/ internal_addRelationAttributes(long /*int*/ defaultAttributes) { NSArray attributes = new NSArray(defaultAttributes); NSMutableArray returnArray = NSMutableArray.arrayWithCapacity(attributes.count()); returnArray.addObjectsFromArray(attributes); - + if (getTitleAttribute(ACC.CHILDID_SELF) != null) { if (!returnArray.containsObject(OS.NSAccessibilityTitleAttribute)) returnArray.addObject(OS.NSAccessibilityTitleAttribute); } - + if (getDescriptionAttribute(ACC.CHILDID_SELF) != null) { if (!returnArray.containsObject(OS.NSAccessibilityDescriptionAttribute)) returnArray.addObject(OS.NSAccessibilityDescriptionAttribute); } - + // See if this object has a label or is a label for something else. If so, add that to the list. if (relations[ACC.RELATION_LABEL_FOR] != null) { if (!returnArray.containsObject(OS.NSAccessibilityServesAsTitleForUIElementsAttribute)) returnArray.addObject(OS.NSAccessibilityServesAsTitleForUIElementsAttribute); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/AccessibleTableColumn.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/AccessibleTableColumn.java index 7e06fe83ae..0464794cf3 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/AccessibleTableColumn.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/AccessibleTableColumn.java @@ -14,11 +14,11 @@ import org.eclipse.swt.internal.cocoa.*; /** * This class is used to describe a table column for objects that have an accessible - * role of ACC.ROLE_TABLE, but aren't implemented like NSTableViews. + * role of ACC.ROLE_TABLE, but aren't implemented like NSTableViews. * * Instances of this class represent one column in a table. Cocoa accessibility expects * columns to report their location, number of rows, and elements in those rows. - * + * * @see TableAccessibleDelegate */ class AccessibleTableColumn extends Accessible { @@ -26,7 +26,7 @@ class AccessibleTableColumn extends Accessible { public AccessibleTableColumn(Accessible accessible, int childID) { super(accessible); index = childID; - + addAccessibleControlListener(new AccessibleControlAdapter() { @Override public void getLocation(AccessibleControlEvent e) { @@ -37,7 +37,7 @@ class AccessibleTableColumn extends Accessible { event.childID = ACC.CHILDID_SELF; event.width = -1; Accessible child = cells[0]; - + for (int i = 0; i < child.accessibleControlListeners.size(); i++) { AccessibleControlListener listener = child.accessibleControlListeners.get(i); listener.getLocation(event); @@ -52,7 +52,7 @@ class AccessibleTableColumn extends Accessible { if (size.width > width) width = (int) size.width; height += size.height; } - + e.x = event.x; e.y = event.y; e.width = width; @@ -83,7 +83,7 @@ class AccessibleTableColumn extends Accessible { } }); } - + private Accessible[] getColumnCells() { int validRowCount = Math.max (1, parent.getRowCount()); Accessible[] cells = new Accessible[validRowCount]; @@ -91,12 +91,12 @@ class AccessibleTableColumn extends Accessible { for (int i = 0; i < validRowCount; i++) { event.column = index; event.row = i; - + for (int j = 0; j < parent.accessibleTableListeners.size(); j++) { AccessibleTableListener listener = parent.accessibleTableListeners.get(j); listener.getCell(event); } - + cells[i] = event.accessible; } return cells; diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/AccessibleTableHeader.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/AccessibleTableHeader.java index 8afd9b1765..1252bd0789 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/AccessibleTableHeader.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/AccessibleTableHeader.java @@ -19,7 +19,7 @@ import org.eclipse.swt.internal.cocoa.*; * rows with cells as children of those rows. The assumption is that the first 'row' * of cells (cell 0 to cell 'column-count - 1') are the column headers of the table. * - * This class works with the parent control to act as the header section of the table, + * This class works with the parent control to act as the header section of the table, * and reports the cells in the header so that screen readers (VoiceOver, mainly) can * identify the column of the cell that the VoiceOver cursor is reading. */ @@ -48,7 +48,7 @@ class AccessibleTableHeader extends Accessible { event.accessible.parent = AccessibleTableHeader.this; children[i] = event.accessible; } - e.children = children; + e.children = children; } @Override public void getChildCount(AccessibleControlEvent e) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/AccessibleTableRow.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/AccessibleTableRow.java index f20df6f280..885d9c6467 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/AccessibleTableRow.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/AccessibleTableRow.java @@ -14,11 +14,11 @@ import org.eclipse.swt.internal.cocoa.*; /** * This class is used to describe a table column for objects that have an accessible - * role of ACC.ROLE_TABLE, but aren't implemented like NSTableViews. + * role of ACC.ROLE_TABLE, but aren't implemented like NSTableViews. * * Instances of this class represent one row in a table. Cocoa accessibility expects * rows to report their location, and assumes the cells of the table are children of the rows. - * + * * @see TableAccessibleDelegate */ class AccessibleTableRow extends Accessible { @@ -26,7 +26,7 @@ class AccessibleTableRow extends Accessible { public AccessibleTableRow(Accessible accessible, int childID) { super(accessible); index = childID; - + addAccessibleControlListener(new AccessibleControlAdapter() { @Override public void getChildCount(AccessibleControlEvent e) { @@ -44,16 +44,16 @@ class AccessibleTableRow extends Accessible { AccessibleTableListener listener = parent.accessibleTableListeners.get(j); listener.getCell(event); } - + if (event.accessible != null) { event.accessible.parent = AccessibleTableRow.this; } - + children[i] = event.accessible; } - + e.children = children; - } + } @Override public void getLocation(AccessibleControlEvent e) { int validColumnCount = Math.max (1, parent.getColumnCount()); @@ -74,7 +74,7 @@ class AccessibleTableRow extends Accessible { // Ask first child for position. NSValue positionObj = (NSValue)children[0].getPositionAttribute(ACC.CHILDID_SELF); NSPoint position = positionObj.pointValue(); - + // Ask all children for size. int height = 0; int width = 0; @@ -121,7 +121,7 @@ class AccessibleTableRow extends Accessible { } } }); - + addAccessibleTableListener(new AccessibleTableAdapter() { @Override public void isColumnSelected(AccessibleTableEvent e) { @@ -137,10 +137,10 @@ class AccessibleTableRow extends Accessible { listener.isRowSelected(event); } e.isSelected = event.isSelected; - } + } }); } - + void getChildAtPoint(AccessibleControlEvent e) { int validColumnCount = Math.max (1, parent.getColumnCount()); Accessible[] children = new Accessible[validColumnCount]; @@ -156,11 +156,11 @@ class AccessibleTableRow extends Accessible { children[i] = event.accessible; } - + for (int j = 0; j < children.length; j++) { NSValue positionObj = (NSValue)children[j].getPositionAttribute(index); NSPoint position = positionObj.pointValue(); - + NSValue sizeObj = (NSValue)children[j].getSizeAttribute(index); NSSize size = sizeObj.sizeValue(); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/Relation.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/Relation.java index 95e9b49834..6a61d5d033 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/Relation.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/Relation.java @@ -53,7 +53,7 @@ class Relation { id getTitleUIElement() { id result = null; for (int i = 0; i < targets.length; i++) { - Accessible target = targets[i]; + Accessible target = targets[i]; result = target.accessibleHandle(target); } return result; @@ -62,7 +62,7 @@ class Relation { id getServesAsTitleForUIElements() { NSMutableArray result = NSMutableArray.arrayWithCapacity(targets.length); for (int i = 0; i < targets.length; i++) { - Accessible target = targets[i]; + Accessible target = targets[i]; id accessibleElement = target.accessibleHandle(target); result.addObject(accessibleElement); } @@ -72,7 +72,7 @@ class Relation { id getLinkedUIElements() { NSMutableArray result = NSMutableArray.arrayWithCapacity(targets.length); for (int i = 0; i < targets.length; i++) { - Accessible target = targets[i]; + Accessible target = targets[i]; id accessibleElement = target.accessibleHandle(target); result.addObject(accessibleElement); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/SWTAccessibleDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/SWTAccessibleDelegate.java index a5faf4ca0e..a699ae4ead 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/SWTAccessibleDelegate.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/SWTAccessibleDelegate.java @@ -19,9 +19,9 @@ import org.eclipse.swt.internal.cocoa.*; class SWTAccessibleDelegate extends NSObject { /** - * Accessible Key: The string constant for looking up the accessible + * Accessible Key: The string constant for looking up the accessible * for a control using <code>getData(String)</code>. When an accessible - * is created for a control, it is stored as a property in the control + * is created for a control, it is stored as a property in the control * using <code>setData(String, Object)</code>. */ static final String ACCESSIBLE_KEY = "Accessible"; //$NON-NLS-1$ @@ -47,15 +47,15 @@ class SWTAccessibleDelegate extends NSObject { accessible3Args = new Callback(clazz, "accessibleProc", 3); proc3Args = accessible3Args.getAddress(); - if (proc3Args == 0) SWT.error (SWT.ERROR_NO_MORE_CALLBACKS); + if (proc3Args == 0) SWT.error (SWT.ERROR_NO_MORE_CALLBACKS); accessible4Args = new Callback(clazz, "accessibleProc", 4); proc4Args = accessible3Args.getAddress(); - if (proc4Args == 0) SWT.error (SWT.ERROR_NO_MORE_CALLBACKS); + if (proc4Args == 0) SWT.error (SWT.ERROR_NO_MORE_CALLBACKS); - // Accessible custom controls need to implement the NSAccessibility protocol. To do that, - // we dynamically add the methods to the control's class that are required - // by NSAccessibility. Then, when external assistive technology services are used, + // Accessible custom controls need to implement the NSAccessibility protocol. To do that, + // we dynamically add the methods to the control's class that are required + // by NSAccessibility. Then, when external assistive technology services are used, // those methods get called to provide the needed information. String className = "SWTAccessibleDelegate"; @@ -98,20 +98,20 @@ class SWTAccessibleDelegate extends NSObject { } NSArray accessibilityActionNames() { - + if (actionNames != null) return retainedAutoreleased(actionNames); - + actionNames = accessible.internal_accessibilityActionNames(childID); actionNames.retain(); return retainedAutoreleased(actionNames); } NSArray accessibilityAttributeNames() { - + if (attributeNames != null) return retainedAutoreleased(attributeNames); - + attributeNames = accessible.internal_accessibilityAttributeNames(childID); attributeNames.retain(); return retainedAutoreleased(attributeNames); @@ -120,18 +120,18 @@ class SWTAccessibleDelegate extends NSObject { id accessibilityAttributeValue(NSString attribute) { return accessible.internal_accessibilityAttributeValue(attribute, childID); } - + // parameterized attribute methods NSArray accessibilityParameterizedAttributeNames() { - + if (parameterizedAttributeNames != null) return retainedAutoreleased(parameterizedAttributeNames); - + parameterizedAttributeNames = accessible.internal_accessibilityParameterizedAttributeNames(childID); parameterizedAttributeNames.retain(); return retainedAutoreleased(parameterizedAttributeNames); } - + id accessibilityAttributeValue_forParameter(NSString attribute, id parameter) { return accessible.internal_accessibilityAttributeValue_forParameter(attribute, parameter, childID); } @@ -158,25 +158,25 @@ class SWTAccessibleDelegate extends NSObject { void accessibilityPerformAction(NSString action) { accessible.internal_accessibilityPerformAction(action, childID); } - + id accessibilityActionDescription(NSString action) { return accessible.internal_accessibilityActionDescription(action, childID); } - + void accessibilitySetValue_forAttribute(id value, NSString attribute) { accessible.internal_accessibilitySetValue_forAttribute(value, attribute, childID); } - + static NSArray retainedAutoreleased(NSArray inObject) { id temp = inObject.retain(); id temp2 = new NSObject(temp.id).autorelease(); return new NSArray(temp2.id); } - + static long /*int*/ accessibleProc(long /*int*/ id, long /*int*/ sel) { SWTAccessibleDelegate swtAcc = getAccessibleDelegate(id); if (swtAcc == null) return 0; - + if (sel == OS.sel_accessibilityAttributeNames) { NSArray retObject = swtAcc.accessibilityAttributeNames(); return (retObject == null ? 0 : retObject.id); @@ -200,7 +200,7 @@ class SWTAccessibleDelegate extends NSObject { static long /*int*/ accessibleProc(long /*int*/ id, long /*int*/ sel, long /*int*/ arg0) { SWTAccessibleDelegate swtAcc = getAccessibleDelegate(id); if (swtAcc == null) return 0; - + if (sel == OS.sel_accessibilityAttributeValue_) { NSString attribute = new NSString(arg0); id retObject = swtAcc.accessibilityAttributeValue(attribute); @@ -228,7 +228,7 @@ class SWTAccessibleDelegate extends NSObject { static long /*int*/ accessibleProc(long /*int*/ id, long /*int*/ sel, long /*int*/ arg0, long /*int*/ arg1) { SWTAccessibleDelegate swtAcc = getAccessibleDelegate(id); if (swtAcc == null) return 0; - + if (sel == OS.sel_accessibilityAttributeValue_forParameter_) { NSString attribute = new NSString(arg0); id parameter = new id(arg1); @@ -257,8 +257,8 @@ class SWTAccessibleDelegate extends NSObject { if (attributeNames != null) attributeNames.release(); attributeNames = null; if (parameterizedAttributeNames != null) parameterizedAttributeNames.release(); - parameterizedAttributeNames = null; - + parameterizedAttributeNames = null; + if (delegateJniRef != 0) OS.DeleteGlobalRef(delegateJniRef); delegateJniRef = 0; OS.object_setInstanceVariable(this.id, SWT_OBJECT, 0); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/TableAccessibleDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/TableAccessibleDelegate.java index dd973cb01e..86756a3910 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/TableAccessibleDelegate.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/TableAccessibleDelegate.java @@ -35,10 +35,10 @@ class TableAccessibleDelegate { Map /*<Integer, AccessibleTableRow>*/ childRowToIdMap = new HashMap(); Accessible tableAccessible; AccessibleTableHeader headerAccessible; - + public TableAccessibleDelegate(Accessible accessible) { tableAccessible = accessible; - + tableAccessible.addAccessibleControlListener(new AccessibleControlAdapter() { @Override public void getChildCount(AccessibleControlEvent e) { @@ -55,41 +55,41 @@ class TableAccessibleDelegate { if (childColumnToIdMap.size() > 1) childCount++; Accessible[] children = new Accessible[childCount]; int childIndex = 0; - + Iterator iter = childRowToIdMap.values().iterator(); while (iter.hasNext()) { - AccessibleTableRow row = (AccessibleTableRow)iter.next(); + AccessibleTableRow row = (AccessibleTableRow)iter.next(); children[childIndex++] = row; } - + iter = childColumnToIdMap.values().iterator(); while (iter.hasNext()) { AccessibleTableColumn col = (AccessibleTableColumn)iter.next(); children[childIndex++] = col; } - + if (childColumnToIdMap.size() > 1) children[childIndex] = headerAccessible(); - + e.children = children; } - + @Override public void getChildAtPoint(AccessibleControlEvent e) { NSPoint testPoint = new NSPoint(); testPoint.x = e.x; Monitor primaryMonitor = Display.getCurrent().getPrimaryMonitor(); testPoint.y = primaryMonitor.getBounds().height - e.y; - + Iterator iter = childRowToIdMap.values().iterator(); - + while (iter.hasNext()) { AccessibleTableRow row = (AccessibleTableRow) iter.next(); NSValue locationValue = new NSValue(row.getPositionAttribute(ACC.CHILDID_SELF).id); NSPoint location = locationValue.pointValue(); - + NSValue sizeValue = new NSValue(row.getSizeAttribute(ACC.CHILDID_SELF)); NSSize size = sizeValue.sizeValue(); - + if (location.y < testPoint.y && testPoint.y < (location.y + size.height)) { AccessibleControlEvent e2 = new AccessibleControlEvent(e.getSource()); e2.x = (int) testPoint.x; @@ -99,20 +99,20 @@ class TableAccessibleDelegate { } } } - + @Override public void getState(AccessibleControlEvent e) { int state = ACC.STATE_NORMAL | ACC.STATE_FOCUSABLE | ACC.STATE_SELECTABLE; - + AccessibleTableEvent event = new AccessibleTableEvent(this); for (int i = 0; i < tableAccessible.accessibleTableListeners.size(); i++) { AccessibleTableListener listener = tableAccessible.accessibleTableListeners.get(i); listener.getSelectedRows(event); } - + if (event.selected != null) { int[] selected = event.selected; - + for (int i = 0; i < selected.length; i++) { if (selected[i] == tableAccessible.index) { state |= ACC.STATE_SELECTED; @@ -120,26 +120,26 @@ class TableAccessibleDelegate { } } } - + NSNumber focusedObject = (NSNumber)tableAccessible.getFocusedAttribute(ACC.CHILDID_SELF); if (focusedObject.boolValue()) { state |= ACC.STATE_FOCUSED; } - + e.detail = state; } }); - + tableAccessible.addAccessibleTableListener(new AccessibleTableAdapter() { @Override public void getColumnCount(AccessibleTableEvent e) { AccessibleTableEvent event = new AccessibleTableEvent(this); - + for (int i = 0; i < tableAccessible.accessibleTableListeners.size(); i++) { AccessibleTableListener listener = tableAccessible.accessibleTableListeners.get(i); if (listener != this) listener.getColumnCount(event); } - + e.count = event.count; } @Override @@ -152,20 +152,20 @@ class TableAccessibleDelegate { public void getColumns(AccessibleTableEvent e) { AccessibleTableEvent event = new AccessibleTableEvent(this); getColumnCount(event); - + // This happens if the table listeners just report back a column count but don't have // distinct objects for each of the column. // When that happens we need to make 'fake' accessibles that represent the rows. if (event.count != childColumnToIdMap.size()) { childColumnToIdMap.clear(); } - + Accessible[] columns = new Accessible[event.count]; - + for (int i = 0; i < event.count; i++) { columns[i] = childColumnToOs(i); } - + int columnCount = childColumnToIdMap.size() > 0 ? childColumnToIdMap.size() : 1; Accessible[] accessibles = new Accessible[columnCount]; for (int i = 0; i < columnCount; i++) { @@ -180,12 +180,12 @@ class TableAccessibleDelegate { @Override public void getRowCount(AccessibleTableEvent e) { AccessibleTableEvent event = new AccessibleTableEvent(this); - + for (int i = 0; i < tableAccessible.accessibleTableListeners.size(); i++) { AccessibleTableListener listener = tableAccessible.accessibleTableListeners.get(i); if (listener != this) listener.getRowCount(event); } - + e.count = event.count; } @Override @@ -198,20 +198,20 @@ class TableAccessibleDelegate { public void getRows(AccessibleTableEvent e) { AccessibleTableEvent event = new AccessibleTableEvent(this); getRowCount(event); - + // This happens if the table listeners just report back a column count but don't have // distinct objects for each of the column. // When that happens we need to make 'fake' accessibles that represent the rows. if (event.count != childRowToIdMap.size()) { childRowToIdMap.clear(); } - + Accessible[] rows = new Accessible[event.count]; - + for (int i = 0; i < event.count; i++) { rows[i] = childRowToOs(i); } - + int columnCount = childRowToIdMap.size() > 0 ? childRowToIdMap.size() : 1; Accessible[] accessibles = new Accessible[columnCount]; for (int i = 0; i < columnCount; i++) { @@ -220,22 +220,22 @@ class TableAccessibleDelegate { e.accessibles = accessibles; } }); - + } Accessible childColumnToOs(int childID) { if (childID == ACC.CHILDID_SELF) { return tableAccessible; } - + /* Check cache for childID, if found, return corresponding osChildID. */ AccessibleTableColumn childRef = (AccessibleTableColumn) childColumnToIdMap.get(new Integer(childID)); - + if (childRef == null) { childRef = new AccessibleTableColumn(tableAccessible, childID); childColumnToIdMap.put(new Integer(childID), childRef); } - + return childRef; } @@ -246,12 +246,12 @@ class TableAccessibleDelegate { /* Check cache for childID, if found, return corresponding osChildID. */ AccessibleTableRow childRef = (AccessibleTableRow) childRowToIdMap.get(new Integer(childID)); - + if (childRef == null) { childRef = new AccessibleTableRow(tableAccessible, childID); childRowToIdMap.put(new Integer(childID), childRef); } - + return childRef; } @@ -291,7 +291,7 @@ class TableAccessibleDelegate { childColumnToIdMap = null; } } - + void reset() { release(); childColumnToIdMap = new HashMap(); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/ByteArrayTransfer.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/ByteArrayTransfer.java index e7bd6e7b7c..8effb729f8 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/ByteArrayTransfer.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/ByteArrayTransfer.java @@ -12,23 +12,23 @@ package org.eclipse.swt.dnd; import org.eclipse.swt.internal.cocoa.*; - + /** - * The class <code>ByteArrayTransfer</code> provides a platform specific - * mechanism for converting a java <code>byte[]</code> to a platform + * The class <code>ByteArrayTransfer</code> provides a platform specific + * mechanism for converting a java <code>byte[]</code> to a platform * specific representation of the byte array and vice versa. * - * <p><code>ByteArrayTransfer</code> is never used directly but is sub-classed + * <p><code>ByteArrayTransfer</code> is never used directly but is sub-classed * by transfer agents that convert between data in a java format such as a * <code>String</code> and a platform specific byte array. - * - * <p>If the data you are converting <b>does not</b> map to a - * <code>byte[]</code>, you should sub-class <code>Transfer</code> directly + * + * <p>If the data you are converting <b>does not</b> map to a + * <code>byte[]</code>, you should sub-class <code>Transfer</code> directly * and do your own mapping to a platform data type.</p> - * + * * <p>The following snippet shows a subclass of ByteArrayTransfer that transfers * data defined by the class <code>MyType</code>.</p> - * + * * <pre><code> * public class MyType { * public String fileName; @@ -36,24 +36,24 @@ import org.eclipse.swt.internal.cocoa.*; * public long lastModified; * } * </code></pre> - * + * * <pre><code> * public class MyTypeTransfer extends ByteArrayTransfer { - * + * * private static final String MYTYPENAME = "my_type_name"; * private static final int MYTYPEID = registerType(MYTYPENAME); * private static MyTypeTransfer _instance = new MyTypeTransfer(); - * + * * private MyTypeTransfer() {} - * + * * public static MyTypeTransfer getInstance () { * return _instance; * } * public void javaToNative (Object object, TransferData transferData) { * if (object == null || !(object instanceof MyType[])) return; - * + * * if (isSupportedType(transferData)) { - * MyType[] myTypes = (MyType[]) object; + * MyType[] myTypes = (MyType[]) object; * try { * // write data to a byte array and then ask super to convert to pMedium * ByteArrayOutputStream out = new ByteArrayOutputStream(); @@ -67,20 +67,20 @@ import org.eclipse.swt.internal.cocoa.*; * } * byte[] buffer = out.toByteArray(); * writeOut.close(); - * + * * super.javaToNative(buffer, transferData); - * + * * } catch (IOException e) { * } * } * } - * public Object nativeToJava(TransferData transferData){ - * + * public Object nativeToJava(TransferData transferData){ + * * if (isSupportedType(transferData)) { - * + * * byte[] buffer = (byte[])super.nativeToJava(transferData); * if (buffer == null) return null; - * + * * MyType[] myData = new MyType[0]; * try { * ByteArrayInputStream in = new ByteArrayInputStream(buffer); @@ -104,7 +104,7 @@ import org.eclipse.swt.internal.cocoa.*; * } * return myData; * } - * + * * return null; * } * protected String[] getTypeNames(){ @@ -142,13 +142,13 @@ public boolean isSupportedType(TransferData transferData){ } /** - * This implementation of <code>javaToNative</code> converts a java + * This implementation of <code>javaToNative</code> converts a java * <code>byte[]</code> to a platform specific representation. - * + * * @param object a java <code>byte[]</code> containing the data to be converted * @param transferData an empty <code>TransferData</code> object that will * be filled in on return with the platform specific format of the data - * + * * @see Transfer#nativeToJava */ @Override @@ -162,13 +162,13 @@ protected void javaToNative (Object object, TransferData transferData) { } /** - * This implementation of <code>nativeToJava</code> converts a platform specific - * representation of a byte array to a java <code>byte[]</code>. - * + * This implementation of <code>nativeToJava</code> converts a platform specific + * representation of a byte array to a java <code>byte[]</code>. + * * @param transferData the platform specific representation of the data to be converted * @return a java <code>byte[]</code> containing the converted data if the conversion was * successful; otherwise null - * + * * @see Transfer#javaToNative */ @Override diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/Clipboard.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/Clipboard.java index 745f049e56..7c22076d31 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/Clipboard.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/Clipboard.java @@ -18,7 +18,7 @@ import org.eclipse.swt.widgets.*; /** * The <code>Clipboard</code> provides a mechanism for transferring data from one * application to another or within an application. - * + * * <p>IMPORTANT: This class is <em>not</em> intended to be subclassed.</p> * * @see <a href="http://www.eclipse.org/swt/snippets/#clipboard">Clipboard snippets</a> @@ -45,7 +45,7 @@ public class Clipboard { * @see Clipboard#dispose * @see Clipboard#checkSubclass */ -public Clipboard(Display display) { +public Clipboard(Display display) { checkSubclass (); if (display == null) { display = Display.getCurrent(); @@ -62,12 +62,12 @@ public Clipboard(Display display) { /** * Checks that this class can be subclassed. * <p> - * The SWT class library is intended to be subclassed + * The SWT class library is intended to be subclassed * only at specific, controlled points. This method enforces this * rule unless it is overridden. * </p><p> * <em>IMPORTANT:</em> By providing an implementation of this - * method that allows a subclass of a class which does not + * method that allows a subclass of a class which does not * normally allow subclassing to be created, the implementer * agrees to be fully responsible for the fact that any such * subclass will likely fail between SWT releases and will be @@ -101,7 +101,7 @@ protected void checkSubclass () { * widget implementors to enforce the standard SWT invariants. * <p> * Currently, it is an error to invoke any method (other than - * <code>isDisposed()</code>) on a widget that has had its + * <code>isDisposed()</code>) on a widget that has had its * <code>dispose()</code> method called. It is also an error * to call widget methods from any thread that is different * from the thread that created the widget. @@ -125,15 +125,15 @@ protected void checkWidget () { /** * If this clipboard is currently the owner of the data on the system clipboard, * clear the contents. If this clipboard is not the owner, then nothing is done. - * Note that there are clipboard assistant applications that take ownership of - * data or make copies of data when it is placed on the clipboard. In these + * Note that there are clipboard assistant applications that take ownership of + * data or make copies of data when it is placed on the clipboard. In these * cases, it may not be possible to clear the clipboard. - * + * * @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.1 */ public void clearContents() { @@ -141,29 +141,29 @@ public void clearContents() { } /** - * If this clipboard is currently the owner of the data on the specified - * clipboard, clear the contents. If this clipboard is not the owner, then + * If this clipboard is currently the owner of the data on the specified + * clipboard, clear the contents. If this clipboard is not the owner, then * nothing is done. - * + * * <p>Note that there are clipboard assistant applications that take ownership - * of data or make copies of data when it is placed on the clipboard. In these + * of data or make copies of data when it is placed on the clipboard. In these * cases, it may not be possible to clear the clipboard.</p> - * + * * <p>The clipboards value is either one of the clipboard constants defined in - * class <code>DND</code>, or must be built by <em>bitwise OR</em>'ing together + * class <code>DND</code>, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>DND</code> clipboard constants.</p> - * + * * @param clipboards to be cleared - * + * * @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> - * + * * @see DND#CLIPBOARD * @see DND#SELECTION_CLIPBOARD - * + * * @since 3.1 */ public void clearContents(int clipboards) { @@ -174,13 +174,13 @@ public void clearContents(int clipboards) { } /** - * Disposes of the operating system resources associated with the clipboard. - * The data will still be available on the system clipboard after the dispose - * method is called. - * + * Disposes of the operating system resources associated with the clipboard. + * The data will still be available on the system clipboard after the dispose + * method is called. + * * <p>NOTE: On some platforms the data will not be available once the application * has exited or the display has been disposed.</p> - * + * * @exception SWTException <ul> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li> * </ul> @@ -192,13 +192,13 @@ public void dispose () { } /** - * Retrieve the data of the specified type currently available on the system - * clipboard. Refer to the specific subclass of <code>Transfer</code> to + * Retrieve the data of the specified type currently available on the system + * clipboard. Refer to the specific subclass of <code>Transfer</code> to * determine the type of object returned. - * - * <p>The following snippet shows text and RTF text being retrieved from the + * + * <p>The following snippet shows text and RTF text being retrieved from the * clipboard:</p> - * + * * <code><pre> * Clipboard clipboard = new Clipboard(display); * TextTransfer textTransfer = TextTransfer.getInstance(); @@ -209,10 +209,10 @@ public void dispose () { * if (rtfData != null) System.out.println("RTF Text is "+rtfData); * clipboard.dispose(); * </code></pre> - * + * * @param transfer the transfer agent for the type of data being requested * @return the data obtained from the clipboard or null if no data of this type is available - * + * * @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> @@ -220,7 +220,7 @@ public void dispose () { * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if transfer is null</li> * </ul> - * + * * @see Transfer */ public Object getContents(Transfer transfer) { @@ -228,13 +228,13 @@ public Object getContents(Transfer transfer) { } /** - * Retrieve the data of the specified type currently available on the specified - * clipboard. Refer to the specific subclass of <code>Transfer</code> to + * Retrieve the data of the specified type currently available on the specified + * clipboard. Refer to the specific subclass of <code>Transfer</code> to * determine the type of object returned. - * - * <p>The following snippet shows text and RTF text being retrieved from the + * + * <p>The following snippet shows text and RTF text being retrieved from the * clipboard:</p> - * + * * <code><pre> * Clipboard clipboard = new Clipboard(display); * TextTransfer textTransfer = TextTransfer.getInstance(); @@ -245,17 +245,17 @@ public Object getContents(Transfer transfer) { * if (rtfData != null) System.out.println("RTF Text is "+rtfData); * clipboard.dispose(); * </code></pre> - * + * * <p>The clipboards value is either one of the clipboard constants defined in - * class <code>DND</code>, or must be built by <em>bitwise OR</em>'ing together + * class <code>DND</code>, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>DND</code> clipboard constants.</p> - * + * * @param transfer the transfer agent for the type of data being requested * @param clipboards on which to look for data - * + * * @return the data obtained from the clipboard or null if no data of this type is available - * + * * @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> @@ -263,11 +263,11 @@ public Object getContents(Transfer transfer) { * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if transfer is null</li> * </ul> - * + * * @see Transfer * @see DND#CLIPBOARD * @see DND#SELECTION_CLIPBOARD - * + * * @since 3.1 */ public Object getContents(Transfer transfer, int clipboards) { @@ -285,7 +285,7 @@ public Object getContents(Transfer transfer, int clipboards) { if (type != null) { TransferData tdata = new TransferData(); tdata.type = Transfer.registerType(type.getString()); - if (type.isEqual(OS.NSStringPboardType) || + if (type.isEqual(OS.NSStringPboardType) || type.isEqual(OS.NSRTFPboardType) || type.isEqual(OS.NSHTMLPboardType)) { tdata.data = pasteboard.stringForType(type); @@ -315,7 +315,7 @@ public Object getContents(Transfer transfer, int clipboards) { * </p> * * @return <code>true</code> when the widget is disposed and <code>false</code> otherwise - * + * * @since 3.0 */ public boolean isDisposed () { @@ -326,17 +326,17 @@ public boolean isDisposed () { * Place data of the specified type on the system clipboard. More than one type * of data can be placed on the system clipboard at the same time. Setting the * data clears any previous data from the system clipboard, regardless of type. - * + * * <p>NOTE: On some platforms, the data is immediately copied to the system * clipboard but on other platforms it is provided upon request. As a result, - * if the application modifies the data object it has set on the clipboard, that - * modification may or may not be available when the data is subsequently + * if the application modifies the data object it has set on the clipboard, that + * modification may or may not be available when the data is subsequently * requested.</p> * * <p>The following snippet shows text and RTF text being set on the copy/paste * clipboard: * </p> - * + * * <code><pre> * Clipboard clipboard = new Clipboard(display); * String textData = "Hello World"; @@ -350,12 +350,12 @@ public boolean isDisposed () { * </code></pre> * * @param data the data to be set in the clipboard - * @param dataTypes the transfer agents that will convert the data to its - * platform specific format; each entry in the data array must have a + * @param dataTypes the transfer agents that will convert the data to its + * platform specific format; each entry in the data array must have a * corresponding dataType - * + * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if data is null or datatypes is null + * <li>ERROR_INVALID_ARGUMENT - if data is null or datatypes is null * or the length of data is not the same as the length of dataTypes</li> * </ul> * @exception SWTException <ul> @@ -365,7 +365,7 @@ public boolean isDisposed () { * @exception SWTError <ul> * <li>ERROR_CANNOT_SET_CLIPBOARD - if the clipboard is locked or otherwise unavailable</li> * </ul> - * + * * <p>NOTE: ERROR_CANNOT_SET_CLIPBOARD should be an SWTException, since it is a * recoverable error, but can not be changed due to backward compatibility.</p> */ @@ -374,26 +374,26 @@ public void setContents(Object[] data, Transfer[] dataTypes) { } /** - * Place data of the specified type on the specified clipboard. More than one + * Place data of the specified type on the specified clipboard. More than one * type of data can be placed on the specified clipboard at the same time. * Setting the data clears any previous data from the specified * clipboard, regardless of type. - * + * * <p>NOTE: On some platforms, the data is immediately copied to the specified - * clipboard but on other platforms it is provided upon request. As a result, - * if the application modifies the data object it has set on the clipboard, that - * modification may or may not be available when the data is subsequently + * clipboard but on other platforms it is provided upon request. As a result, + * if the application modifies the data object it has set on the clipboard, that + * modification may or may not be available when the data is subsequently * requested.</p> * * <p>The clipboards value is either one of the clipboard constants defined in - * class <code>DND</code>, or must be built by <em>bitwise OR</em>'ing together + * class <code>DND</code>, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>DND</code> clipboard constants.</p> - * + * * <p>The following snippet shows text and RTF text being set on the copy/paste * clipboard: * </p> - * + * * <code><pre> * Clipboard clipboard = new Clipboard(display); * String textData = "Hello World"; @@ -407,13 +407,13 @@ public void setContents(Object[] data, Transfer[] dataTypes) { * </code></pre> * * @param data the data to be set in the clipboard - * @param dataTypes the transfer agents that will convert the data to its - * platform specific format; each entry in the data array must have a + * @param dataTypes the transfer agents that will convert the data to its + * platform specific format; each entry in the data array must have a * corresponding dataType * @param clipboards on which to set the data - * + * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if data is null or datatypes is null + * <li>ERROR_INVALID_ARGUMENT - if data is null or datatypes is null * or the length of data is not the same as the length of dataTypes</li> * </ul> * @exception SWTException <ul> @@ -423,13 +423,13 @@ public void setContents(Object[] data, Transfer[] dataTypes) { * @exception SWTError <ul> * <li>ERROR_CANNOT_SET_CLIPBOARD - if the clipboard is locked or otherwise unavailable</li> * </ul> - * + * * <p>NOTE: ERROR_CANNOT_SET_CLIPBOARD should be an SWTException, since it is a * recoverable error, but can not be changed due to backward compatibility.</p> - * + * * @see DND#CLIPBOARD * @see DND#SELECTION_CLIPBOARD - * + * * @since 3.1 */ public void setContents(Object[] data, Transfer[] dataTypes, int clipboards) { @@ -457,7 +457,7 @@ public void setContents(Object[] data, Transfer[] dataTypes, int clipboards) { NSObject tdata = transferData.data; NSString dataType = NSString.stringWith(typeNames[j]); pasteboard.addTypes(NSArray.arrayWithObject(dataType), null); - if (dataType.isEqual(OS.NSStringPboardType) || + if (dataType.isEqual(OS.NSStringPboardType) || dataType.isEqual(OS.NSRTFPboardType) || dataType.isEqual(OS.NSHTMLPboardType)) { pasteboard.setString((NSString) tdata, dataType); @@ -474,18 +474,18 @@ public void setContents(Object[] data, Transfer[] dataTypes, int clipboards) { } /** - * Returns an array of the data types currently available on the system + * Returns an array of the data types currently available on the system * clipboard. Use with Transfer.isSupportedType. * * @return array of data types currently available on the system clipboard - * + * * @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> * * @see Transfer#isSupportedType - * + * * @since 3.0 */ public TransferData[] getAvailableTypes() { @@ -493,17 +493,17 @@ public TransferData[] getAvailableTypes() { } /** - * Returns an array of the data types currently available on the specified + * Returns an array of the data types currently available on the specified * clipboard. Use with Transfer.isSupportedType. - * + * * <p>The clipboards value is either one of the clipboard constants defined in - * class <code>DND</code>, or must be built by <em>bitwise OR</em>'ing together + * class <code>DND</code>, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>DND</code> clipboard constants.</p> - * + * * @param clipboards from which to get the data types * @return array of data types currently available on the specified clipboard - * + * * @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> @@ -512,7 +512,7 @@ public TransferData[] getAvailableTypes() { * @see Transfer#isSupportedType * @see DND#CLIPBOARD * @see DND#SELECTION_CLIPBOARD - * + * * @since 3.1 */ public TransferData[] getAvailableTypes(int clipboards) { @@ -532,16 +532,16 @@ public TransferData[] getAvailableTypes(int clipboards) { } /** - * Returns a platform specific list of the data types currently available on the + * Returns a platform specific list of the data types currently available on the * system clipboard. - * - * <p>Note: <code>getAvailableTypeNames</code> is a utility for writing a Transfer - * sub-class. It should NOT be used within an application because it provides + * + * <p>Note: <code>getAvailableTypeNames</code> is a utility for writing a Transfer + * sub-class. It should NOT be used within an application because it provides * platform specific information.</p> - * - * @return a platform specific list of the data types currently available on the + * + * @return a platform specific list of the data types currently available on the * system clipboard - * + * * @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> diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DragSource.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DragSource.java index b03aa1840c..5e8cfd0d01 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DragSource.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DragSource.java @@ -21,34 +21,34 @@ import org.eclipse.swt.widgets.*; * <code>DragSource</code> defines the source object for a drag and drop transfer. * * <p>IMPORTANT: This class is <em>not</em> intended to be subclassed.</p> - * - * <p>A drag source is the object which originates a drag and drop operation. For the specified widget, - * it defines the type of data that is available for dragging and the set of operations that can - * be performed on that data. The operations can be any bit-wise combination of DND.MOVE, DND.COPY or - * DND.LINK. The type of data that can be transferred is specified by subclasses of Transfer such as - * TextTransfer or FileTransfer. The type of data transferred can be a predefined system type or it + * + * <p>A drag source is the object which originates a drag and drop operation. For the specified widget, + * it defines the type of data that is available for dragging and the set of operations that can + * be performed on that data. The operations can be any bit-wise combination of DND.MOVE, DND.COPY or + * DND.LINK. The type of data that can be transferred is specified by subclasses of Transfer such as + * TextTransfer or FileTransfer. The type of data transferred can be a predefined system type or it * can be a type defined by the application. For instructions on how to define your own transfer type, * refer to <code>ByteArrayTransfer</code>.</p> * - * <p>You may have several DragSources in an application but you can only have one DragSource - * per Control. Data dragged from this DragSource can be dropped on a site within this application + * <p>You may have several DragSources in an application but you can only have one DragSource + * per Control. Data dragged from this DragSource can be dropped on a site within this application * or it can be dropped on another application such as an external Text editor.</p> - * + * * <p>The application supplies the content of the data being transferred by implementing the * <code>DragSourceListener</code> and associating it with the DragSource via DragSource#addDragListener.</p> - * - * <p>When a successful move operation occurs, the application is required to take the appropriate + * + * <p>When a successful move operation occurs, the application is required to take the appropriate * action to remove the data from its display and remove any associated operating system resources or - * internal references. Typically in a move operation, the drop target makes a copy of the data - * and the drag source deletes the original. However, sometimes copying the data can take a long - * time (such as copying a large file). Therefore, on some platforms, the drop target may actually - * move the data in the operating system rather than make a copy. This is usually only done in + * internal references. Typically in a move operation, the drop target makes a copy of the data + * and the drag source deletes the original. However, sometimes copying the data can take a long + * time (such as copying a large file). Therefore, on some platforms, the drop target may actually + * move the data in the operating system rather than make a copy. This is usually only done in * file transfers. In this case, the drag source is informed in the DragEnd event that a - * DROP_TARGET_MOVE was performed. It is the responsibility of the drag source at this point to clean + * DROP_TARGET_MOVE was performed. It is the responsibility of the drag source at this point to clean * up its displayed information. No action needs to be taken on the operating system resources.</p> * * <p> The following example shows a Label widget that allows text to be dragged from it.</p> - * + * * <code><pre> * // Enable a label as a Drag Source * Label label = new Label(shell, SWT.NONE); @@ -56,7 +56,7 @@ import org.eclipse.swt.widgets.*; * Transfer[] types = new Transfer[] {TextTransfer.getInstance()}; * // This example will allow the text to be copied or moved to the drop target * int operations = DND.DROP_MOVE | DND.DROP_COPY; - * + * * DragSource source = new DragSource(label, operations); * source.setTransfer(types); * source.addDragListener(new DragSourceListener() { @@ -68,10 +68,10 @@ import org.eclipse.swt.widgets.*; * } * }; * public void dragSetData(DragSourceEvent event) { - * // A drop has been performed, so provide the data of the + * // A drop has been performed, so provide the data of the * // requested type. - * // (Checking the type of the requested data is only - * // necessary if the drag source supports more than + * // (Checking the type of the requested data is only + * // necessary if the drag source supports more than * // one data type but is shown here as an example). * if (TextTransfer.getInstance().isSupportedType(event.dataType)){ * event.data = label.getText(); @@ -107,10 +107,10 @@ public class DragSource extends Widget { static Callback dragSource2Args, dragSource3Args, dragSource4Args, dragSource5Args, dragSource6Args; static final byte[] SWT_OBJECT = {'S', 'W', 'T', '_', 'O', 'B', 'J', 'E', 'C', 'T', '\0'}; static long /*int*/ proc2 = 0, proc3 = 0, proc4 = 0, proc5 = 0, proc6 = 0; - + String paths[]; boolean exist[]; - + static { String className = "SWTDragSourceDelegate"; @@ -151,7 +151,7 @@ public class DragSource extends Widget { OS.class_addMethod(cls, OS.sel_pasteboard_provideDataForType_, proc4, "@:@@"); OS.objc_registerClassPair(cls); - } + } // info for registering as a drag source Control control; @@ -161,21 +161,21 @@ public class DragSource extends Widget { Image dragImageFromListener; private int dragOperations; SWTDragSourceDelegate dragSourceDelegate; - + static final String DEFAULT_DRAG_SOURCE_EFFECT = "DEFAULT_DRAG_SOURCE_EFFECT"; //$NON-NLS-1$ private long /*int*/ delegateJniRef; private Point dragOffset; - + /** * Creates a new <code>DragSource</code> to handle dragging from the specified <code>Control</code>. - * Creating an instance of a DragSource may cause system resources to be allocated depending on the platform. + * Creating an instance of a DragSource may cause system resources to be allocated depending on the platform. * It is therefore mandatory that the DragSource instance be disposed when no longer required. * * @param control the <code>Control</code> that the user clicks on to initiate the drag - * @param style the bitwise OR'ing of allowed operations; this may be a combination of any of + * @param style the bitwise OR'ing of allowed operations; this may be a combination of any of * DND.DROP_NONE, DND.DROP_COPY, DND.DROP_MOVE, DND.DROP_LINK - * + * * @exception SWTException <ul> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li> * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li> @@ -185,10 +185,10 @@ public class DragSource extends Widget { * drag source is created for a control or if the operating system will not allow the creation * of the drag source</li> * </ul> - * + * * <p>NOTE: ERROR_CANNOT_INIT_DRAG should be an SWTException, since it is a * recoverable error, but can not be changed due to backward compatibility.</p> - * + * * @see Widget#dispose * @see DragSource#checkSubclass * @see DND#DROP_NONE @@ -203,7 +203,7 @@ public DragSource(Control control, int style) { DND.error(DND.ERROR_CANNOT_INIT_DRAG); } control.setData(DND.DRAG_SOURCE_KEY, this); - + controlListener = new Listener () { public void handleEvent (Event event) { if (event.type == SWT.Dispose) { @@ -224,13 +224,13 @@ public DragSource(Control control, int style) { }; control.addListener (SWT.Dispose, controlListener); control.addListener (SWT.DragDetect, controlListener); - + this.addListener(SWT.Dispose, new Listener() { public void handleEvent(Event e) { onDispose(); } }); - + Object effect = control.getData(DEFAULT_DRAG_SOURCE_EFFECT); if (effect instanceof DragSourceEffect) { dragEffect = (DragSourceEffect) effect; @@ -244,7 +244,7 @@ public DragSource(Control control, int style) { if (delegateJniRef == 0) SWT.error(SWT.ERROR_NO_HANDLES); // The dragSourceDelegate implements the pasteboard callback to provide the dragged data, so we always need - // to create it. NSDraggingSource methods are ignored in the table and tree case. + // to create it. NSDraggingSource methods are ignored in the table and tree case. dragSourceDelegate = (SWTDragSourceDelegate)new SWTDragSourceDelegate().alloc().init(); OS.object_setInstanceVariable(dragSourceDelegate.id, SWT_OBJECT, delegateJniRef); @@ -267,10 +267,10 @@ public DragSource(Control control, int style) { OS.class_addMethod(cls, OS.sel_draggedImage_beganAt_, proc4, "@:@{NSPoint=ff}"); OS.class_addMethod(cls, OS.sel_draggedImage_endedAt_operation_, draggedImage_endedAt_operationProc, "@:@{NSPoint=ff}I"); OS.class_addMethod(cls, OS.sel_ignoreModifierKeysWhileDragging, proc3, "@:"); - + // Override to return the drag effect's image. OS.class_addMethod(cls, OS.sel_dragImageForRowsWithIndexes_tableColumns_event_offset_, proc6, "@:@@@^NSPoint"); - } + } } @@ -279,13 +279,13 @@ public DragSource(Control control, int style) { * be notified when a drag and drop operation is in progress, by sending * it one of the messages defined in the <code>DragSourceListener</code> * interface. - * + * * <p><ul> - * <li><code>dragStart</code> is called when the user has begun the actions required to drag the widget. + * <li><code>dragStart</code> is called when the user has begun the actions required to drag the widget. * This event gives the application the chance to decide if a drag should be started. * <li><code>dragSetData</code> is called when the data is required from the drag source. - * <li><code>dragFinished</code> is called when the drop has successfully completed (mouse up - * over a valid target) or has been terminated (such as hitting the ESC key). Perform cleanup + * <li><code>dragFinished</code> is called when the drop has successfully completed (mouse up + * over a valid target) or has been terminated (such as hitting the ESC key). Perform cleanup * such as removing data from the source side on a successful move operation. * </ul></p> * @@ -349,21 +349,21 @@ static int checkStyle (int style) { } void drag(Event dragDetectEvent) { - + DNDEvent event = startDrag(dragDetectEvent); if (event == null) return; - + // Start the drag here from the Control's view. NSEvent currEvent = NSApplication.sharedApplication().currentEvent(); NSPoint pt = currEvent.locationInWindow(); NSPoint viewPt = control.view.convertPoint_fromView_(pt, null); - + // Get the image for the drag. The drag should happen from the middle of the image. NSImage dragImage = null; Image defaultDragImage = null; - try { + try { Image image = event.image; - + // If no image was provided, just create a trivial image. dragImage requires a non-null image. if (image == null) { int width = 20, height = 20; @@ -395,10 +395,10 @@ void drag(Event dragDetectEvent) { // The third argument to dragImage is ignored as of 10.4. NSSize ignored = new NSSize(); - + control.view.dragImage(dragImage, viewPt, ignored, NSApplication.sharedApplication().currentEvent(), NSPasteboard.pasteboardWithName(OS.NSDragPboard), dragSourceDelegate, true); - - } finally { + + } finally { if (defaultDragImage != null) defaultDragImage.dispose(); } } @@ -409,9 +409,9 @@ void dragOutlineViewStart(Event dragDetectEvent) { // Save off the custom image, if any. dragImageFromListener = event.image; - + // Save the computed offset for the image. This needs to be passed back in dragImageForRowsWithIndexes - // so the proxy image originates from the selection and not centered under the mouse. + // so the proxy image originates from the selection and not centered under the mouse. dragOffset = new Point(event.offsetX, event.offsetY); } @@ -440,16 +440,16 @@ void draggedImage_endedAt_operation(long /*int*/ id, long /*int*/ sel, long /*in try { Event event = new DNDEvent(); event.widget = this; - event.time = (int)System.currentTimeMillis(); + event.time = (int)System.currentTimeMillis(); event.doit = swtOperation != DND.DROP_NONE; - event.detail = swtOperation; + event.detail = swtOperation; notifyListeners(DND.DragEnd, event); dragImageFromListener = null; - + if (new NSObject(id).isKindOfClass(OS.class_NSTableView)) { dndCallSuper(id, sel, arg0, arg1, arg2); } - } finally { + } finally { OS.objc_msgSend(id, OS.sel_release); } } @@ -466,7 +466,7 @@ long /*int*/ dragImageForRowsWithIndexes_tableColumns_event_offset(long /*int*/ } } -/** +/** * Cocoa NSDraggingSource implementations */ long /*int*/ draggingSourceOperationMaskForLocal(long /*int*/ id, long /*int*/ sel, long /*int*/ arg0) { @@ -480,19 +480,19 @@ static long /*int*/ dragSourceProc(long /*int*/ id, long /*int*/ sel) { Widget widget = display.findWidget(id); if (widget == null) return 0; DragSource ds = null; - + if (widget instanceof DragSource) { ds = (DragSource)widget; } else { - ds = (DragSource)widget.getData(DND.DRAG_SOURCE_KEY); + ds = (DragSource)widget.getData(DND.DRAG_SOURCE_KEY); } if (ds == null) return 0; - + if (sel == OS.sel_ignoreModifierKeysWhileDragging) { return (ds.ignoreModifierKeysWhileDragging(id, sel) ? 1 : 0); } - + return 0; } @@ -502,19 +502,19 @@ static long /*int*/ dragSourceProc(long /*int*/ id, long /*int*/ sel, long /*int Widget widget = display.findWidget(id); if (widget == null) return 0; DragSource ds = null; - + if (widget instanceof DragSource) { ds = (DragSource)widget; } else { - ds = (DragSource)widget.getData(DND.DRAG_SOURCE_KEY); + ds = (DragSource)widget.getData(DND.DRAG_SOURCE_KEY); } - + if (ds == null) return 0; - + if (sel == OS.sel_draggingSourceOperationMaskForLocal_) { return ds.draggingSourceOperationMaskForLocal(id, sel, arg0); } - + return 0; } @@ -524,21 +524,21 @@ static long /*int*/ dragSourceProc(long /*int*/ id, long /*int*/ sel, long /*int Widget widget = display.findWidget(id); if (widget == null) return 0; DragSource ds = null; - + if (widget instanceof DragSource) { ds = (DragSource)widget; } else { - ds = (DragSource)widget.getData(DND.DRAG_SOURCE_KEY); + ds = (DragSource)widget.getData(DND.DRAG_SOURCE_KEY); } if (ds == null) return 0; - + if (sel == OS.sel_draggedImage_beganAt_) { ds.draggedImage_beganAt(id, sel, arg0, arg1); } else if (sel == OS.sel_pasteboard_provideDataForType_) { ds.pasteboard_provideDataForType(id, sel, arg0, arg1); } - + return 0; } @@ -548,21 +548,21 @@ static long /*int*/ dragSourceProc(long /*int*/ id, long /*int*/ sel, long /*int Widget widget = display.findWidget(id); if (widget == null) return 0; DragSource ds = null; - + if (widget instanceof DragSource) { ds = (DragSource)widget; } else { - ds = (DragSource)widget.getData(DND.DRAG_SOURCE_KEY); + ds = (DragSource)widget.getData(DND.DRAG_SOURCE_KEY); } if (ds == null) return 0; - + if (sel == OS.sel_draggedImage_endedAt_operation_) { NSPoint point = new NSPoint(); OS.memmove(point, arg1, NSPoint.sizeof); ds.draggedImage_endedAt_operation(id, sel, arg0, point, arg2); } - + return 0; } @@ -572,24 +572,24 @@ static long /*int*/ dragSourceProc(long /*int*/ id, long /*int*/ sel, long /*int Widget widget = display.findWidget(id); if (widget == null) return 0; DragSource ds = null; - + if (widget instanceof DragSource) { ds = (DragSource)widget; } else { - ds = (DragSource)widget.getData(DND.DRAG_SOURCE_KEY); + ds = (DragSource)widget.getData(DND.DRAG_SOURCE_KEY); } if (ds == null) return 0; - + if (sel == OS.sel_dragImageForRowsWithIndexes_tableColumns_event_offset_) { return ds.dragImageForRowsWithIndexes_tableColumns_event_offset(id, sel, arg0, arg1, arg2, arg3); } - + return 0; } /** - * Returns the Control which is registered for this DragSource. This is the control that the + * Returns the Control which is registered for this DragSource. This is the control that the * user clicks in to initiate dragging. * * @return the Control which is registered for this DragSource @@ -599,8 +599,8 @@ public Control getControl () { } /** - * Returns an array of listeners who will be notified when a drag and drop - * operation is in progress, by sending it one of the messages defined in + * Returns an array of listeners who will be notified when a drag and drop + * operation is in progress, by sending it one of the messages defined in * the <code>DragSourceListener</code> interface. * * @return the listeners who will be notified when a drag and drop @@ -615,7 +615,7 @@ public Control getControl () { * @see #addDragListener * @see #removeDragListener * @see DragSourceEvent - * + * * @since 3.4 */ public DragSourceListener[] getDragListeners() { @@ -641,7 +641,7 @@ public DragSourceListener[] getDragListeners() { * effect will be used during a drag and drop operation. * * @return the drag effect that is registered for this DragSource - * + * * @since 3.3 */ public DragSourceEffect getDragSourceEffect() { @@ -679,7 +679,7 @@ void onDispose() { if (delegateJniRef != 0) OS.DeleteGlobalRef(delegateJniRef); delegateJniRef = 0; - + if (dragSourceDelegate != null) { OS.object_setInstanceVariable(dragSourceDelegate.id, SWT_OBJECT, 0); dragSourceDelegate.release(); @@ -731,8 +731,8 @@ void pasteboard_provideDataForType(long /*int*/ id, long /*int*/ sel, long /*int transferData.type = Transfer.registerType(dataType.getString()); DNDEvent event = new DNDEvent(); event.widget = this; - event.time = (int)System.currentTimeMillis(); - event.dataType = transferData; + event.time = (int)System.currentTimeMillis(); + event.dataType = transferData; notifyListeners(DND.DragSetData, event); if (!event.doit) return; Transfer transfer = null; @@ -750,7 +750,7 @@ void pasteboard_provideDataForType(long /*int*/ id, long /*int*/ sel, long /*int NSObject tdata = transferData.data; if (dataType.isEqual(OS.NSStringPboardType) || - dataType.isEqual(OS.NSHTMLPboardType) || + dataType.isEqual(OS.NSHTMLPboardType) || dataType.isEqual(OS.NSRTFPboardType)) { pasteboard.setString((NSString) tdata, dataType); } else if (dataType.isEqual(OS.NSURLPboardType) || dataType.isEqual(OS.kUTTypeURL)) { @@ -799,11 +799,11 @@ public void removeDragListener(DragSourceListener listener) { } /** - * Specifies the drag effect for this DragSource. This drag effect will be + * Specifies the drag effect for this DragSource. This drag effect will be * used during a drag and drop operation. * * @param effect the drag effect that is registered for this DragSource - * + * * @since 3.3 */ public void setDragSourceEffect(DragSourceEffect effect) { @@ -813,7 +813,7 @@ public void setDragSourceEffect(DragSourceEffect effect) { * Specifies the list of data types that can be transferred by this DragSource. * The application must be able to provide data to match each of these types when * a successful drop has occurred. - * + * * @param transferAgents a list of Transfer objects which define the types of data that can be * dragged from this source */ @@ -830,10 +830,10 @@ DNDEvent startDrag(Event dragEvent) { event.doit = true; notifyListeners(DND.DragStart, event); if (!event.doit || transferAgents == null || transferAgents.length == 0) return null; - + NSPasteboard dragBoard = NSPasteboard.pasteboardWithName(OS.NSDragPboard); NSMutableArray nativeTypeArray = NSMutableArray.arrayWithCapacity(10); - + for (int i = 0; i < transferAgents.length; i++) { Transfer transfer = transferAgents[i]; if (transfer != null) { @@ -841,13 +841,13 @@ DNDEvent startDrag(Event dragEvent) { for (int j = 0; j < typeNames.length; j++) { nativeTypeArray.addObject(NSString.stringWith(typeNames[j])); - } - } + } + } } dragBoard.declareTypes(nativeTypeArray, dragSourceDelegate); // Save off the drag operations -- AppKit will call back to us to request them during the drag. - dragOperations = opToOsOp(getStyle()); + dragOperations = opToOsOp(getStyle()); return event; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DropTarget.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DropTarget.java index 98c3aeae83..62ed8e6d12 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DropTarget.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DropTarget.java @@ -25,10 +25,10 @@ import org.eclipse.swt.widgets.*; * <p>IMPORTANT: This class is <em>not</em> intended to be subclassed.</p> * * <p>This class identifies the <code>Control</code> over which the user must position the cursor - * in order to drop the data being transferred. It also specifies what data types can be dropped on - * this control and what operations can be performed. You may have several DropTragets in an + * in order to drop the data being transferred. It also specifies what data types can be dropped on + * this control and what operations can be performed. You may have several DropTragets in an * application but there can only be a one to one mapping between a <code>Control</code> and a <code>DropTarget</code>. - * The DropTarget can receive data from within the same application or from other applications + * The DropTarget can receive data from within the same application or from other applications * (such as text dragged from a text editor like Word).</p> * * <code><pre> @@ -38,11 +38,11 @@ import org.eclipse.swt.widgets.*; * target.setTransfer(types); * </code></pre> * - * <p>The application is notified of data being dragged over this control and of when a drop occurs by - * implementing the interface <code>DropTargetListener</code> which uses the class - * <code>DropTargetEvent</code>. The application can modify the type of drag being performed - * on this Control at any stage of the drag by modifying the <code>event.detail</code> field or the - * <code>event.currentDataType</code> field. When the data is dropped, it is the responsibility of + * <p>The application is notified of data being dragged over this control and of when a drop occurs by + * implementing the interface <code>DropTargetListener</code> which uses the class + * <code>DropTargetEvent</code>. The application can modify the type of drag being performed + * on this Control at any stage of the drag by modifying the <code>event.detail</code> field or the + * <code>event.currentDataType</code> field. When the data is dropped, it is the responsibility of * the application to copy this data for its own purposes. * * <code><pre> @@ -65,7 +65,7 @@ import org.eclipse.swt.widgets.*; * * <dl> * <dt><b>Styles</b></dt> <dd>DND.DROP_NONE, DND.DROP_COPY, DND.DROP_MOVE, DND.DROP_LINK</dd> - * <dt><b>Events</b></dt> <dd>DND.DragEnter, DND.DragLeave, DND.DragOver, DND.DragOperationChanged, + * <dt><b>Events</b></dt> <dd>DND.DragEnter, DND.DragLeave, DND.DragOver, DND.DragOperationChanged, * DND.DropAccept, DND.Drop </dd> * </dl> * @@ -94,11 +94,11 @@ public class DropTarget extends Widget { dropTarget6Args = new Callback(clazz, "dropTargetProc", 6); proc6Args = dropTarget6Args.getAddress(); - if (proc6Args == 0) SWT.error (SWT.ERROR_NO_MORE_CALLBACKS); + if (proc6Args == 0) SWT.error (SWT.ERROR_NO_MORE_CALLBACKS); } static boolean dropNotAllowed = false; - + Control control; Listener controlListener; Transfer[] transferAgents = new Transfer[0]; @@ -108,18 +108,18 @@ public class DropTarget extends Widget { // Track application selections TransferData selectedDataType; int selectedOperation; - + // workaround - There is no event for "operation changed" so track operation based on key state int keyOperation = -1; - + static final String DEFAULT_DROP_TARGET_EFFECT = "DEFAULT_DROP_TARGET_EFFECT"; //$NON-NLS-1$ static final String IS_ACTIVE = "org.eclipse.swt.internal.isActive"; //$NON-NLS-1$ - + void addDragHandlers() { - // Our strategy here is to dynamically add methods to the control's class that are required + // Our strategy here is to dynamically add methods to the control's class that are required // by NSDraggingDestination. Then, when setTransfer is called, we just register // the types with the Control's NSView and AppKit will call the methods in the protocol - // when a drag goes over the view. + // when a drag goes over the view. long /*int*/ cls = OS.object_getClass(control.view.id); @@ -131,7 +131,7 @@ void addDragHandlers() { long /*int*/ procPtr = OS.class_getMethodImplementation(cls, OS.sel_draggingEntered_); if (procPtr == proc3Args) return; addDragHandlers(cls); - + // If the content view can be image view, then add the dragging methods to image view too. // This is used by Label so that dragging can work even when the Label has an image set on it. long /*int*/ imageView = 0; @@ -148,7 +148,7 @@ void addDragHandlers (long /*int*/ cls) { OS.class_addMethod(cls, OS.sel_draggingExited_, proc3Args, "@:@"); OS.class_addMethod(cls, OS.sel_performDragOperation_, proc3Args, "@:@"); OS.class_addMethod(cls, OS.sel_wantsPeriodicDraggingUpdates, proc2Args, "@:"); - + if (OS.class_getSuperclass(cls) == OS.class_NSOutlineView) { OS.class_addMethod(cls, OS.sel_outlineView_acceptDrop_item_childIndex_, proc6Args, "@:@@@i"); OS.class_addMethod(cls, OS.sel_outlineView_validateDrop_proposedItem_proposedChildIndex_, proc6Args, "@:@@@i"); @@ -163,15 +163,15 @@ void addDragHandlers (long /*int*/ cls) { * be notified when a drag and drop operation is in progress, by sending * it one of the messages defined in the <code>DropTargetListener</code> * interface. - * + * * <p><ul> * <li><code>dragEnter</code> is called when the cursor has entered the drop target boundaries * <li><code>dragLeave</code> is called when the cursor has left the drop target boundaries and just before * the drop occurs or is cancelled. - * <li><code>dragOperationChanged</code> is called when the operation being performed has changed + * <li><code>dragOperationChanged</code> is called when the operation being performed has changed * (usually due to the user changing the selected modifier key(s) while dragging) * <li><code>dragOver</code> is called when the cursor is moving over the drop target - * <li><code>dropAccept</code> is called just before the drop is performed. The drop target is given + * <li><code>dropAccept</code> is called just before the drop is performed. The drop target is given * the chance to change the nature of the drop or veto the drop by setting the <code>event.detail</code> field * <li><code>drop</code> is called when the data is being dropped * </ul></p> @@ -225,19 +225,19 @@ protected void checkSubclass () { } int draggingEntered(long /*int*/ id, long /*int*/ sel, NSObject sender) { - if (sender == null) return OS.NSDragOperationNone; - + if (sender == null) return OS.NSDragOperationNone; + DNDEvent event = new DNDEvent(); if (!setEventData(sender, event)) { keyOperation = -1; setDropNotAllowed(); return OS.NSDragOperationNone; } - + int allowedOperations = event.operations; TransferData[] allowedDataTypes = new TransferData[event.dataTypes.length]; System.arraycopy(event.dataTypes, 0, allowedDataTypes, 0, allowedDataTypes.length); - + selectedDataType = null; selectedOperation = DND.DROP_NONE; notifyListeners(DND.DragEnter, event); @@ -245,7 +245,7 @@ int draggingEntered(long /*int*/ id, long /*int*/ sel, NSObject sender) { if (event.detail == DND.DROP_DEFAULT) { event.detail = (allowedOperations & DND.DROP_MOVE) != 0 ? DND.DROP_MOVE : DND.DROP_NONE; } - + if (event.dataType != null) { for (int i = 0; i < allowedDataTypes.length; i++) { if (allowedDataTypes[i].type == event.dataType.type) { @@ -254,11 +254,11 @@ int draggingEntered(long /*int*/ id, long /*int*/ sel, NSObject sender) { } } } - + if (selectedDataType != null && (allowedOperations & event.detail) != 0) { selectedOperation = event.detail; } - + if (selectedOperation == DND.DROP_NONE) { setDropNotAllowed(); } else { @@ -279,22 +279,22 @@ void draggingExited(long /*int*/ id, long /*int*/ sel, NSObject sender) { clearDropNotAllowed(); if (keyOperation == -1) return; keyOperation = -1; - + DNDEvent event = new DNDEvent(); event.widget = this; event.time = (int)System.currentTimeMillis(); event.detail = DND.DROP_NONE; notifyListeners(DND.DragLeave, event); - + if (new NSObject(id).isKindOfClass(OS.class_NSTableView)) { dndCallSuper(id, sel, sender.id); } } int draggingUpdated(long /*int*/ id, long /*int*/ sel, NSObject sender) { - if (sender == null) return OS.NSDragOperationNone; + if (sender == null) return OS.NSDragOperationNone; int oldKeyOperation = keyOperation; - + DNDEvent event = new DNDEvent(); if (!setEventData(sender, event)) { keyOperation = -1; @@ -321,7 +321,7 @@ int draggingUpdated(long /*int*/ id, long /*int*/ sel, NSObject sender) { if (event.detail == DND.DROP_DEFAULT) { event.detail = (allowedOperations & DND.DROP_MOVE) != 0 ? DND.DROP_MOVE : DND.DROP_NONE; } - + if (event.dataType != null) { for (int i = 0; i < allowedDataTypes.length; i++) { if (allowedDataTypes[i].type == event.dataType.type) { @@ -334,7 +334,7 @@ int draggingUpdated(long /*int*/ id, long /*int*/ sel, NSObject sender) { if (selectedDataType != null && (event.detail & allowedOperations) != 0) { selectedOperation = event.detail; } - + if (selectedOperation == DND.DROP_NONE) { setDropNotAllowed(); } else { @@ -353,14 +353,14 @@ int draggingUpdated(long /*int*/ id, long /*int*/ sel, NSObject sender) { } /** - * Creates a new <code>DropTarget</code> to allow data to be dropped on the specified + * Creates a new <code>DropTarget</code> to allow data to be dropped on the specified * <code>Control</code>. - * Creating an instance of a DropTarget may cause system resources to be allocated - * depending on the platform. It is therefore mandatory that the DropTarget instance + * Creating an instance of a DropTarget may cause system resources to be allocated + * depending on the platform. It is therefore mandatory that the DropTarget instance * be disposed when no longer required. - * + * * @param control the <code>Control</code> over which the user positions the cursor to drop the data - * @param style the bitwise OR'ing of allowed operations; this may be a combination of any of + * @param style the bitwise OR'ing of allowed operations; this may be a combination of any of * DND.DROP_NONE, DND.DROP_COPY, DND.DROP_MOVE, DND.DROP_LINK * * @exception SWTException <ul> @@ -375,7 +375,7 @@ int draggingUpdated(long /*int*/ id, long /*int*/ sel, NSObject sender) { * * <p>NOTE: ERROR_CANNOT_INIT_DROP should be an SWTException, since it is a * recoverable error, but can not be changed due to backward compatibility.</p> - * + * * @see Widget#dispose * @see DropTarget#checkSubclass * @see DND#DROP_NONE @@ -401,7 +401,7 @@ public DropTarget(Control control, int style) { } }; control.addListener (SWT.Dispose, controlListener); - + this.addListener(SWT.Dispose, new Listener() { public void handleEvent (Event event) { onDispose(); @@ -417,7 +417,7 @@ public DropTarget(Control control, int style) { dropEffect = new TreeDropTargetEffect((Tree) control); } - addDragHandlers(); + addDragHandlers(); } static long /*int*/ dropTargetProc(long /*int*/ id, long /*int*/ sel) { @@ -431,7 +431,7 @@ static long /*int*/ dropTargetProc(long /*int*/ id, long /*int*/ sel) { if (sel == OS.sel_wantsPeriodicDraggingUpdates) { return dt.wantsPeriodicDraggingUpdates(id, sel) ? 1 : 0; } - + return 0; } @@ -442,11 +442,11 @@ static long /*int*/ dropTargetProc(long /*int*/ id, long /*int*/ sel, long /*int if (widget == null) return 0; DropTarget dt = (DropTarget)widget.getData(DND.DROP_TARGET_KEY); if (dt == null) return 0; - + // arg0 is _always_ the sender, and implements NSDraggingInfo. // Looks like an NSObject for our purposes, though. NSObject sender = new NSObject(arg0); - + if (sel == OS.sel_draggingEntered_) { return dt.draggingEntered(id, sel, sender); } else if (sel == OS.sel_draggingUpdated_) { @@ -456,7 +456,7 @@ static long /*int*/ dropTargetProc(long /*int*/ id, long /*int*/ sel, long /*int } else if (sel == OS.sel_performDragOperation_) { return dt.performDragOperation(id, sel, sender) ? 1 : 0; } - + return 0; } @@ -477,12 +477,12 @@ static long /*int*/ dropTargetProc(long /*int*/ id, long /*int*/ sel, long /*int } else if (sel == OS.sel_tableView_validateDrop_proposedRow_proposedDropOperation_) { return dt.tableView_validateDrop_proposedRow_proposedDropOperation(id, sel, arg0, arg1, arg2, arg3); } - + return 0; } /** - * Returns the Control which is registered for this DropTarget. This is the control over which the + * Returns the Control which is registered for this DropTarget. This is the control over which the * user positions the cursor to drop the data. * * @return the Control which is registered for this DropTarget @@ -492,11 +492,11 @@ public Control getControl () { } /** - * Returns an array of listeners who will be notified when a drag and drop - * operation is in progress, by sending it one of the messages defined in + * Returns an array of listeners who will be notified when a drag and drop + * operation is in progress, by sending it one of the messages defined in * the <code>DropTargetListener</code> interface. * - * @return the listeners who will be notified when a drag and drop + * @return the listeners who will be notified when a drag and drop * operation is in progress * * @exception SWTException <ul> @@ -508,7 +508,7 @@ public Control getControl () { * @see #addDropListener * @see #removeDropListener * @see DropTargetEvent - * + * * @since 3.4 */ public DropTargetListener[] getDropListeners() { @@ -530,12 +530,12 @@ public DropTargetListener[] getDropListeners() { } /** - * Returns the drop effect for this DropTarget. This drop effect will be - * used during a drag and drop to display the drag under effect on the + * Returns the drop effect for this DropTarget. This drop effect will be + * used during a drag and drop to display the drag under effect on the * target widget. * * @return the drop effect that is registered for this DropTarget - * + * * @since 3.3 */ public DropTargetEffect getDropTargetEffect() { @@ -543,11 +543,11 @@ public DropTargetEffect getDropTargetEffect() { } int getOperationFromKeyState() { - // The NSDraggingInfo object already combined the modifier keys with the + // The NSDraggingInfo object already combined the modifier keys with the // drag source's allowed events. This might be better accomplished by diffing // the base drag source mask with the active drag state mask instead of snarfing // the current event. - + // See documentation on [NSDraggingInfo draggingSourceOperationMask] for the // correct Cocoa behavior. Control + Option or Command is NSDragOperationGeneric, // or DND.DROP_DEFAULT in the SWT. @@ -558,7 +558,7 @@ int getOperationFromKeyState() { if (control && option) return DND.DROP_DEFAULT; if (control) return DND.DROP_LINK; if (option) return DND.DROP_COPY; - return DND.DROP_DEFAULT; + return DND.DROP_DEFAULT; } /** @@ -570,7 +570,7 @@ public Transfer[] getTransfer() { return transferAgents; } -void onDispose () { +void onDispose () { if (control == null) return; if (controlListener != null) @@ -578,7 +578,7 @@ void onDispose () { controlListener = null; control.setData(DND.DROP_TARGET_KEY, null); transferAgents = null; - + // Unregister the control as a drop target. control.view.unregisterDraggedTypes(); control = null; @@ -626,21 +626,21 @@ boolean drop(NSObject sender) { DNDEvent event = new DNDEvent(); event.widget = this; event.time = (int)System.currentTimeMillis(); - + if (dropEffect != null) { NSPoint mouseLocation = sender.draggingLocation(); NSPoint globalLoc = sender.draggingDestinationWindow().convertBaseToScreen(mouseLocation); event.item = dropEffect.getItem((int)globalLoc.x, (int)globalLoc.y); } - + event.detail = DND.DROP_NONE; notifyListeners(DND.DragLeave, event); - + event = new DNDEvent(); if (!setEventData(sender, event) || (((Boolean)control.getData(IS_ACTIVE)).booleanValue() == false)) { return false; } - + keyOperation = -1; int allowedOperations = event.operations; TransferData[] allowedDataTypes = new TransferData[event.dataTypes.length]; @@ -662,12 +662,12 @@ boolean drop(NSObject sender) { selectedOperation = DND.DROP_NONE; if (selectedDataType != null && (event.detail & allowedOperations) != 0) { selectedOperation = event.detail; - } - + } + if (selectedOperation == DND.DROP_NONE) { return false; } - + // ask drag source for dropped data NSPasteboard pasteboard = sender.draggingPasteboard(); NSObject data = null; @@ -677,7 +677,7 @@ boolean drop(NSObject sender) { Transfer transfer = transferAgents[i]; String[] typeNames = transfer.getTypeNames(); int[] typeIds = transfer.getTypeIds(); - + for (int j = 0; j < typeNames.length; j++) { if (selectedDataType.type == typeIds[j]) { types.addObject(NSString.stringWith(typeNames[j])); @@ -718,11 +718,11 @@ boolean drop(NSObject sender) { break; } } - + if (object == null) { selectedOperation = DND.DROP_NONE; } - + event.dataType = selectedDataType; event.detail = selectedOperation; event.data = object; @@ -739,7 +739,7 @@ boolean performDragOperation(long /*int*/ id, long /*int*/ sel, NSObject sender) if (new NSObject(id).isKindOfClass(OS.class_NSTableView)) { return dndCallSuper(id, sel, sender.id) != 0; } - + return drop (sender); } @@ -756,7 +756,7 @@ long /*int*/ outlineView_validateDrop_proposedItem_proposedChildIndex(long /*int Tree tree = (Tree)getControl(); TreeItem childItem = tree.getItem(new Point((int)pt.x, (int)pt.y)); if (feedback == 0 || childItem == null) { - widget.setDropItem(null, -1); + widget.setDropItem(null, -1); } else { if ((feedback & DND.FEEDBACK_SELECT) != 0) { widget.setDropItem(childItem.handle, -1); @@ -776,9 +776,9 @@ long /*int*/ outlineView_validateDrop_proposedItem_proposedChildIndex(long /*int if ((feedback & DND.FEEDBACK_INSERT_BEFORE) != 0) { widget.setDropItem(parentID, childIndex); } - } + } } - + return opToOsOp(selectedOperation); } @@ -800,7 +800,7 @@ long /*int*/ outlineView_validateDrop_proposedItem_proposedChildIndex(long /*int * @see #addDropListener * @see #getDropListeners */ -public void removeDropListener(DropTargetListener listener) { +public void removeDropListener(DropTargetListener listener) { if (listener == null) DND.error (SWT.ERROR_NULL_ARGUMENT); removeListener (DND.DragEnter, listener); removeListener (DND.DragLeave, listener); @@ -811,12 +811,12 @@ public void removeDropListener(DropTargetListener listener) { } /** - * Specifies the drop effect for this DropTarget. This drop effect will be - * used during a drag and drop to display the drag under effect on the + * Specifies the drop effect for this DropTarget. This drop effect will be + * used during a drag and drop to display the drag under effect on the * target widget. * * @param effect the drop effect that is registered for this DropTarget - * + * * @since 3.3 */ public void setDropTargetEffect(DropTargetEffect effect) { @@ -825,7 +825,7 @@ public void setDropTargetEffect(DropTargetEffect effect) { boolean setEventData(NSObject draggingState, DNDEvent event) { if (draggingState == null) return false; - + // get allowed operations int style = getStyle(); long /*int*/ allowedActions = draggingState.draggingSourceOperationMask(); @@ -842,15 +842,15 @@ boolean setEventData(NSObject draggingState, DNDEvent event) { } else { if ((operation & operations) == 0) operation = DND.DROP_NONE; } - - + + // get allowed transfer types NSPasteboard dragPBoard = draggingState.draggingPasteboard(); NSArray draggedTypes = dragPBoard.types(); if (draggedTypes == null) return false; - + long /*int*/ draggedTypeCount = draggedTypes.count(); - + TransferData[] dataTypes = new TransferData[(int)draggedTypeCount]; int index = -1; for (int i = 0; i < draggedTypeCount; i++) { @@ -858,7 +858,7 @@ boolean setEventData(NSObject draggingState, DNDEvent event) { NSString nativeDataType = new NSString(draggedType); TransferData data = new TransferData(); data.type = Transfer.registerType(nativeDataType.getString()); - + for (int j = 0; j < transferAgents.length; j++) { Transfer transfer = transferAgents[j]; if (transfer != null && transfer.isSupportedType(data)) { @@ -868,7 +868,7 @@ boolean setEventData(NSObject draggingState, DNDEvent event) { } } if (index == -1) return false; - + if (index < dataTypes.length - 1) { TransferData[] temp = new TransferData[index + 1]; System.arraycopy(dataTypes, 0, temp, 0, index + 1); @@ -881,7 +881,7 @@ boolean setEventData(NSObject draggingState, DNDEvent event) { NSArray screens = NSScreen.screens(); NSRect screenRect = new NSScreen(screens.objectAtIndex(0)).frame(); globalMouse.y = screenRect.height - globalMouse.y; - + event.widget = this; event.x = (int)globalMouse.x; event.y = (int)globalMouse.y; @@ -894,19 +894,19 @@ boolean setEventData(NSObject draggingState, DNDEvent event) { if (dropEffect != null) { event.item = dropEffect.getItem(event.x, event.y); } - + return true; } /** - * Specifies the data types that can be transferred to this DropTarget. If data is - * being dragged that does not match one of these types, the drop target will be notified of - * the drag and drop operation but the currentDataType will be null and the operation + * Specifies the data types that can be transferred to this DropTarget. If data is + * being dragged that does not match one of these types, the drop target will be notified of + * the drag and drop operation but the currentDataType will be null and the operation * will be DND.NONE. * * @param transferAgents a list of Transfer objects which define the types of data that can be * dropped on this target - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if transferAgents is null</li> * </ul> @@ -914,28 +914,28 @@ boolean setEventData(NSObject draggingState, DNDEvent event) { public void setTransfer(Transfer[] transferAgents){ if (transferAgents == null) DND.error(SWT.ERROR_NULL_ARGUMENT); this.transferAgents = transferAgents; - - + + // Register the types as valid drop types in Cocoa. // Accumulate all of the transfer types into a list. ArrayList typeStrings = new ArrayList(); - + for (int i = 0; i < this.transferAgents.length; i++) { String[] types = transferAgents[i].getTypeNames(); - + for (int j = 0; j < types.length; j++) { typeStrings.add(types[j]); } } - + // Convert to an NSArray of NSStrings so we can register with the Control. int typeStringCount = typeStrings.size(); NSMutableArray nsTypeStrings = NSMutableArray.arrayWithCapacity(typeStringCount); - + for (int i = 0; i < typeStringCount; i++) { nsTypeStrings.addObject(NSString.stringWith((String)typeStrings.get(i))); } - + control.view.registerForDraggedTypes(nsTypeStrings); } @@ -974,7 +974,7 @@ int tableView_validateDrop_proposedRow_proposedDropOperation(long /*int*/ id, lo long /*int*/ hitRow = widget.rowAtPoint(pt); if (0 <= hitRow && hitRow < widget.numberOfRows()) { if (feedback == 0) { - widget.setDropRow(-1, OS.NSTableViewDropOn); + widget.setDropRow(-1, OS.NSTableViewDropOn); } else { if ((feedback & DND.FEEDBACK_SELECT) != 0) { widget.setDropRow(hitRow, OS.NSTableViewDropOn); @@ -988,7 +988,7 @@ int tableView_validateDrop_proposedRow_proposedDropOperation(long /*int*/ id, lo } } } - return opToOsOp(selectedOperation); + return opToOsOp(selectedOperation); } // By returning true we get draggingUpdated messages even when the mouse isn't moving. diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/FileTransfer.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/FileTransfer.java index 8e9bc02515..b13a4d4f5c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/FileTransfer.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/FileTransfer.java @@ -12,17 +12,17 @@ package org.eclipse.swt.dnd; import org.eclipse.swt.internal.cocoa.*; - + /** - * The class <code>FileTransfer</code> provides a platform specific mechanism - * for converting a list of files represented as a java <code>String[]</code> to a - * platform specific representation of the data and vice versa. - * Each <code>String</code> in the array contains the absolute path for a single + * The class <code>FileTransfer</code> provides a platform specific mechanism + * for converting a list of files represented as a java <code>String[]</code> to a + * platform specific representation of the data and vice versa. + * Each <code>String</code> in the array contains the absolute path for a single * file or directory. - * - * <p>An example of a java <code>String[]</code> containing a list of files is shown + * + * <p>An example of a java <code>String[]</code> containing a list of files is shown * below:</p> - * + * * <code><pre> * File file1 = new File("C:\temp\file1"); * File file2 = new File("C:\temp\file2"); @@ -34,13 +34,13 @@ import org.eclipse.swt.internal.cocoa.*; * @see Transfer */ public class FileTransfer extends ByteArrayTransfer { - + static FileTransfer _instance = new FileTransfer(); static final String ID_NAME = OS.NSFilenamesPboardType.getString(); static final int ID = registerType(ID_NAME); static final String ID1_NAME = OS.kUTTypeFileURL.getString(); static final int ID1 = registerType(ID1_NAME); - + FileTransfer() {} /** @@ -55,13 +55,13 @@ public static FileTransfer getInstance () { /** * This implementation of <code>javaToNative</code> converts a list of file names * represented by a java <code>String[]</code> to a platform specific representation. - * Each <code>String</code> in the array contains the absolute path for a single + * Each <code>String</code> in the array contains the absolute path for a single * file or directory. - * + * * @param object a java <code>String[]</code> containing the file names to be converted * @param transferData an empty <code>TransferData</code> object that will * be filled in on return with the platform specific format of the data - * + * * @see Transfer#nativeToJava */ @Override @@ -80,14 +80,14 @@ public void javaToNative(Object object, TransferData transferData) { transferData.data = array; } /** - * This implementation of <code>nativeToJava</code> converts a platform specific - * representation of a list of file names to a java <code>String[]</code>. - * Each String in the array contains the absolute path for a single file or directory. - * + * This implementation of <code>nativeToJava</code> converts a platform specific + * representation of a list of file names to a java <code>String[]</code>. + * Each String in the array contains the absolute path for a single file or directory. + * * @param transferData the platform specific representation of the data to be converted * @return a java <code>String[]</code> containing a list of file names if the conversion * was successful; otherwise null - * + * * @see Transfer#javaToNative */ @Override diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/HTMLTransfer.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/HTMLTransfer.java index 63f1d76606..ee887e4559 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/HTMLTransfer.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/HTMLTransfer.java @@ -9,17 +9,17 @@ * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.swt.dnd; - + import org.eclipse.swt.internal.cocoa.*; /** - * The class <code>HTMLTransfer</code> provides a platform specific mechanism - * for converting text in HTML format represented as a java <code>String</code> + * The class <code>HTMLTransfer</code> provides a platform specific mechanism + * for converting text in HTML format represented as a java <code>String</code> * to a platform specific representation of the data and vice versa. - * - * <p>An example of a java <code>String</code> containing HTML text is shown + * + * <p>An example of a java <code>String</code> containing HTML text is shown * below:</p> - * + * * <code><pre> * String htmlData = "<p>This is a paragraph of text.</p>"; * </code></pre> @@ -46,11 +46,11 @@ public static HTMLTransfer getInstance () { /** * This implementation of <code>javaToNative</code> converts HTML-formatted text * represented by a java <code>String</code> to a platform specific representation. - * + * * @param object a java <code>String</code> containing HTML text * @param transferData an empty <code>TransferData</code> object that will * be filled in on return with the platform specific format of the data - * + * * @see Transfer#nativeToJava */ @Override @@ -62,13 +62,13 @@ public void javaToNative (Object object, TransferData transferData){ } /** - * This implementation of <code>nativeToJava</code> converts a platform specific + * This implementation of <code>nativeToJava</code> converts a platform specific * representation of HTML text to a java <code>String</code>. - * + * * @param transferData the platform specific representation of the data to be converted * @return a java <code>String</code> containing HTML text if the conversion was successful; * otherwise null - * + * * @see Transfer#javaToNative */ @Override diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/ImageTransfer.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/ImageTransfer.java index 754931dad4..cce9ad6cf4 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/ImageTransfer.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/ImageTransfer.java @@ -17,19 +17,19 @@ import org.eclipse.swt.internal.cocoa.*; import org.eclipse.swt.widgets.*; /** - * The class <code>ImageTransfer</code> provides a platform specific mechanism - * for converting an Image represented as a java <code>ImageData</code> to a - * platform specific representation of the data and vice versa. - * + * The class <code>ImageTransfer</code> provides a platform specific mechanism + * for converting an Image represented as a java <code>ImageData</code> to a + * platform specific representation of the data and vice versa. + * * <p>An example of a java <code>ImageData</code> is shown below:</p> - * + * * <code><pre> * Image image = new Image(display, "C:\temp\img1.gif"); * ImageData imgData = image.getImageData(); * </code></pre> * * @see Transfer - * + * * @since 3.4 */ public class ImageTransfer extends ByteArrayTransfer { @@ -53,11 +53,11 @@ public static ImageTransfer getInstance() { /** * This implementation of <code>javaToNative</code> converts an ImageData object represented * by java <code>ImageData</code> to a platform specific representation. - * + * * @param object a java <code>ImageData</code> containing the ImageData to be converted * @param transferData an empty <code>TransferData</code> object that will * be filled in on return with the platform specific format of the data - * + * * @see Transfer#nativeToJava */ @Override @@ -73,13 +73,13 @@ public void javaToNative(Object object, TransferData transferData) { } /** - * This implementation of <code>nativeToJava</code> converts a platform specific - * representation of an image to java <code>ImageData</code>. - * + * This implementation of <code>nativeToJava</code> converts a platform specific + * representation of an image to java <code>ImageData</code>. + * * @param transferData the platform specific representation of the data to be converted * @return a java <code>ImageData</code> of the image if the conversion was successful; * otherwise null - * + * * @see Transfer#javaToNative */ @Override @@ -89,7 +89,7 @@ public Object nativeToJava(TransferData transferData) { if (data.length() == 0) return null; NSImage nsImage = (NSImage) new NSImage().alloc(); nsImage.initWithData(data); - + NSSize size = nsImage.size(); NSImageRep rep = nsImage.bestRepresentationForDevice(null); if (size.width != rep.pixelsWide() || size.height != rep.pixelsHigh()) { @@ -105,7 +105,7 @@ public Object nativeToJava(TransferData transferData) { nsImage.release(); nsImage = newImage; } - + //TODO: Image representation wrong??? Image image = Image.cocoa_new(Display.getCurrent(), SWT.BITMAP, nsImage); ImageData imageData = image.getImageData(); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/RTFTransfer.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/RTFTransfer.java index bca8346472..2809ba21ff 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/RTFTransfer.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/RTFTransfer.java @@ -9,17 +9,17 @@ * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.swt.dnd; - + import org.eclipse.swt.internal.cocoa.*; /** - * The class <code>RTFTransfer</code> provides a platform specific mechanism - * for converting text in RTF format represented as a java <code>String</code> + * The class <code>RTFTransfer</code> provides a platform specific mechanism + * for converting text in RTF format represented as a java <code>String</code> * to a platform specific representation of the data and vice versa. - * - * <p>An example of a java <code>String</code> containing RTF text is shown + * + * <p>An example of a java <code>String</code> containing RTF text is shown * below:</p> - * + * * <code><pre> * String rtfData = "{\\rtf1{\\colortbl;\\red255\\green0\\blue0;}\\uc1\\b\\i Hello World}"; * </code></pre> @@ -46,11 +46,11 @@ public static RTFTransfer getInstance () { /** * This implementation of <code>javaToNative</code> converts RTF-formatted text * represented by a java <code>String</code> to a platform specific representation. - * + * * @param object a java <code>String</code> containing RTF text * @param transferData an empty <code>TransferData</code> object that will * be filled in on return with the platform specific format of the data - * + * * @see Transfer#nativeToJava */ @Override @@ -62,13 +62,13 @@ public void javaToNative (Object object, TransferData transferData){ } /** - * This implementation of <code>nativeToJava</code> converts a platform specific + * This implementation of <code>nativeToJava</code> converts a platform specific * representation of RTF text to a java <code>String</code>. - * + * * @param transferData the platform specific representation of the data to be converted * @return a java <code>String</code> containing RTF text if the conversion was successful; * otherwise null - * + * * @see Transfer#javaToNative */ @Override diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/TableDragSourceEffect.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/TableDragSourceEffect.java index fccdcfdc28..4969cf8b56 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/TableDragSourceEffect.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/TableDragSourceEffect.java @@ -18,10 +18,10 @@ import org.eclipse.swt.widgets.*; /** * This class provides default implementations to display a source image * when a drag is initiated from a <code>Table</code>. - * + * * <p>Classes that wish to provide their own source image for a <code>Table</code> can - * extend the <code>TableDragSourceEffect</code> class, override the - * <code>TableDragSourceEffect.dragStart</code> method and set the field + * extend the <code>TableDragSourceEffect</code> class, override the + * <code>TableDragSourceEffect.dragStart</code> method and set the field * <code>DragSourceEvent.image</code> with their own image.</p> * * Subclasses that override any methods of this class must call the corresponding @@ -30,14 +30,14 @@ import org.eclipse.swt.widgets.*; * @see DragSourceEffect * @see DragSourceEvent * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> - * + * * @since 3.3 */ public class TableDragSourceEffect extends DragSourceEffect { Image dragSourceImage = null; - + /** - * Creates a new <code>TableDragSourceEffect</code> to handle drag effect + * Creates a new <code>TableDragSourceEffect</code> to handle drag effect * from the specified <code>Table</code>. * * @param table the <code>Table</code> that the user clicks on to initiate the drag @@ -49,37 +49,37 @@ public class TableDragSourceEffect extends DragSourceEffect { /** * This implementation of <code>dragFinished</code> disposes the image * that was created in <code>TableDragSourceEffect.dragStart</code>. - * + * * Subclasses that override this method should call <code>super.dragFinished(event)</code> * to dispose the image in the default implementation. - * + * * @param event the information associated with the drag finished event */ @Override public void dragFinished(DragSourceEvent event) { if (dragSourceImage != null) dragSourceImage.dispose(); - dragSourceImage = null; + dragSourceImage = null; } - + /** * This implementation of <code>dragStart</code> will create a default * image that will be used during the drag. The image should be disposed * when the drag is completed in the <code>TableDragSourceEffect.dragFinished</code> * method. - * + * * Subclasses that override this method should call <code>super.dragStart(event)</code> * to use the image from the default implementation. - * + * * @param event the information associated with the drag start event */ @Override public void dragStart(DragSourceEvent event) { event.image = getDragSourceImage(event); } - + Image getDragSourceImage(DragSourceEvent event) { if (dragSourceImage != null) dragSourceImage.dispose(); - dragSourceImage = null; + dragSourceImage = null; NSPoint point = new NSPoint(); long /*int*/ ptr = OS.malloc(NSPoint.sizeof); OS.memmove(ptr, point, NSPoint.sizeof); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/TableDropTargetEffect.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/TableDropTargetEffect.java index 2d816dbc81..56b40e5bba 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/TableDropTargetEffect.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/TableDropTargetEffect.java @@ -14,21 +14,21 @@ import org.eclipse.swt.internal.cocoa.*; import org.eclipse.swt.widgets.*; /** - * This class provides a default drag under effect (eg. select, insert and scroll) + * This class provides a default drag under effect (eg. select, insert and scroll) * when a drag occurs over a <code>Table</code>. - * + * * <p>Classes that wish to provide their own drag under effect for a <code>Table</code> - * can extend the <code>TableDropTargetEffect</code> and override any applicable methods + * can extend the <code>TableDropTargetEffect</code> and override any applicable methods * in <code>TableDropTargetEffect</code> to display their own drag under effect.</p> - * + * * Subclasses that override any methods of this class must call the corresponding * <code>super</code> method to get the default drag under effect implementation. * - * <p>The feedback value is either one of the FEEDBACK constants defined in - * class <code>DND</code> which is applicable to instances of this class, - * or it must be built by <em>bitwise OR</em>'ing together + * <p>The feedback value is either one of the FEEDBACK constants defined in + * class <code>DND</code> which is applicable to instances of this class, + * or it must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more - * of those <code>DND</code> effect constants. + * of those <code>DND</code> effect constants. * </p> * <p> * <dl> @@ -36,20 +36,20 @@ import org.eclipse.swt.widgets.*; * <dd>FEEDBACK_SELECT, FEEDBACK_SCROLL</dd> * </dl> * </p> - * + * * @see DropTargetAdapter * @see DropTargetEvent * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> - * + * * @since 3.3 */ public class TableDropTargetEffect extends DropTargetEffect { boolean shouldEnableScrolling; /** - * Creates a new <code>TableDropTargetEffect</code> to handle the drag under effect on the specified + * Creates a new <code>TableDropTargetEffect</code> to handle the drag under effect on the specified * <code>Table</code>. - * + * * @param table the <code>Table</code> over which the user positions the cursor to drop the data */ public TableDropTargetEffect(Table table) { @@ -62,18 +62,18 @@ public class TableDropTargetEffect extends DropTargetEffect { if ((effect & DND.FEEDBACK_INSERT_BEFORE) != 0) effect = effect & ~DND.FEEDBACK_INSERT_AFTER; return effect; } - + /** * This implementation of <code>dragEnter</code> provides a default drag under effect * for the feedback specified in <code>event.feedback</code>. - * + * * For additional information see <code>DropTargetAdapter.dragEnter</code>. - * + * * Subclasses that override this method should call <code>super.dragEnter(event)</code> * to get the default drag under effect implementation. * * @param event the information associated with the drag enter event - * + * * @see DropTargetAdapter * @see DropTargetEvent */ @@ -83,15 +83,15 @@ public class TableDropTargetEffect extends DropTargetEffect { /** * This implementation of <code>dragLeave</code> provides a default drag under effect - * for the feedback specified in <code>event.feedback</code>. - * + * for the feedback specified in <code>event.feedback</code>. + * * For additional information see <code>DropTargetAdapter.dragLeave</code>. - * + * * Subclasses that override this method should call <code>super.dragLeave(event)</code> * to get the default drag under effect implementation. * * @param event the information associated with the drag leave event - * + * * @see DropTargetAdapter * @see DropTargetEvent */ @@ -106,16 +106,16 @@ public class TableDropTargetEffect extends DropTargetEffect { /** * This implementation of <code>dragOver</code> provides a default drag under effect - * for the feedback specified in <code>event.feedback</code>. The class description + * for the feedback specified in <code>event.feedback</code>. The class description * lists the FEEDBACK constants that are applicable to the class. - * + * * For additional information see <code>DropTargetAdapter.dragOver</code>. - * + * * Subclasses that override this method should call <code>super.dragOver(event)</code> * to get the default drag under effect implementation. * * @param event the information associated with the drag over event - * + * * @see DropTargetAdapter * @see DropTargetEvent * @see DND#FEEDBACK_SELECT diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/TextTransfer.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/TextTransfer.java index c474ef3dc4..d7c81b5c91 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/TextTransfer.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/TextTransfer.java @@ -11,31 +11,31 @@ package org.eclipse.swt.dnd; import org.eclipse.swt.internal.cocoa.*; - + /** - * The class <code>TextTransfer</code> provides a platform specific mechanism - * for converting plain text represented as a java <code>String</code> + * The class <code>TextTransfer</code> provides a platform specific mechanism + * for converting plain text represented as a java <code>String</code> * to a platform specific representation of the data and vice versa. - * - * <p>An example of a java <code>String</code> containing plain text is shown + * + * <p>An example of a java <code>String</code> containing plain text is shown * below:</p> - * + * * <code><pre> * String textData = "Hello World"; * </code></pre> - * + * * <p>Note the <code>TextTransfer</code> does not change the content of the text * data. For a better integration with the platform, the application should convert * the line delimiters used in the text data to the standard line delimiter used by the * platform. * </p> - * + * * @see Transfer */ public class TextTransfer extends ByteArrayTransfer { static TextTransfer _instance = new TextTransfer(); - + static final String ID_NAME = OS.NSStringPboardType.getString(); static final int ID = registerType(ID_NAME); @@ -53,11 +53,11 @@ public static TextTransfer getInstance () { /** * This implementation of <code>javaToNative</code> converts plain text * represented by a java <code>String</code> to a platform specific representation. - * + * * @param object a java <code>String</code> containing text * @param transferData an empty <code>TransferData</code> object that will * be filled in on return with the platform specific format of the data - * + * * @see Transfer#nativeToJava */ @Override @@ -69,12 +69,12 @@ public void javaToNative (Object object, TransferData transferData) { } /** - * This implementation of <code>nativeToJava</code> converts a platform specific + * This implementation of <code>nativeToJava</code> converts a platform specific * representation of plain text to a java <code>String</code>. - * + * * @param transferData the platform specific representation of the data to be converted * @return a java <code>String</code> containing text if the conversion was successful; otherwise null - * + * * @see Transfer#javaToNative */ @Override diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/Transfer.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/Transfer.java index 85115a89cd..7aac5fdade 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/Transfer.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/Transfer.java @@ -10,17 +10,17 @@ *******************************************************************************/ package org.eclipse.swt.dnd; - + /** - * <code>Transfer</code> provides a mechanism for converting between a java - * representation of data and a platform specific representation of data and - * vice versa. It is used in data transfer operations such as drag and drop and + * <code>Transfer</code> provides a mechanism for converting between a java + * representation of data and a platform specific representation of data and + * vice versa. It is used in data transfer operations such as drag and drop and * clipboard copy/paste. * - * <p>You should only need to become familiar with this class if you are - * implementing a Transfer subclass and you are unable to subclass the + * <p>You should only need to become familiar with this class if you are + * implementing a Transfer subclass and you are unable to subclass the * ByteArrayTransfer class.</p> - * + * * @see ByteArrayTransfer * @see <a href="http://www.eclipse.org/swt/snippets/#dnd">Drag and Drop snippets</a> * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: DNDExample</a> @@ -31,10 +31,10 @@ public abstract class Transfer { static String[] TYPES = new String[4]; /** - * Returns a list of the platform specific data types that can be converted using + * Returns a list of the platform specific data types that can be converted using * this transfer agent. * - * <p>Only the data type fields of the <code>TransferData</code> objects are filled + * <p>Only the data type fields of the <code>TransferData</code> objects are filled * in.</p> * * @return a list of the data types that can be converted using this transfer agent @@ -42,47 +42,47 @@ static String[] TYPES = new String[4]; abstract public TransferData[] getSupportedTypes(); /** - * Returns true if the <code>TransferData</code> data type can be converted + * Returns true if the <code>TransferData</code> data type can be converted * using this transfer agent, or false otherwise (including if transferData is * <code>null</code>). * * @param transferData a platform specific description of a data type; only the data * type fields of the <code>TransferData</code> object need to be filled in * - * @return true if the transferData data type can be converted using this transfer + * @return true if the transferData data type can be converted using this transfer * agent */ abstract public boolean isSupportedType(TransferData transferData); /** - * Returns the platform specific ids of the data types that can be converted using + * Returns the platform specific ids of the data types that can be converted using * this transfer agent. - * - * @return the platform specific ids of the data types that can be converted using + * + * @return the platform specific ids of the data types that can be converted using * this transfer agent */ abstract protected int[] getTypeIds(); /** - * Returns the platform specific names of the data types that can be converted + * Returns the platform specific names of the data types that can be converted * using this transfer agent. - * - * @return the platform specific names of the data types that can be converted + * + * @return the platform specific names of the data types that can be converted * using this transfer agent. */ abstract protected String[] getTypeNames(); /** - * Converts a java representation of data to a platform specific representation of - * the data. + * Converts a java representation of data to a platform specific representation of + * the data. * * <p>On a successful conversion, the transferData.result field will be set as follows: * <ul> * <li>Windows: COM.S_OK * <li>GTK: 1 * </ul></p> - * - * <p>If this transfer agent is unable to perform the conversion, the transferData.result + * + * <p>If this transfer agent is unable to perform the conversion, the transferData.result * field will be set to a failure value as follows: * <ul> * <li>Windows: COM.DV_E_TYMED or COM.E_FAIL @@ -92,9 +92,9 @@ abstract protected String[] getTypeNames(); * @param object a java representation of the data to be converted; the type of * Object that is passed in is dependent on the <code>Transfer</code> subclass. * - * @param transferData an empty TransferData object; this object will be + * @param transferData an empty TransferData object; this object will be * filled in on return with the platform specific representation of the data - * + * * @exception org.eclipse.swt.SWTException <ul> * <li>ERROR_INVALID_DATA - if object does not contain data in a valid format or is <code>null</code></li> * </ul> @@ -103,13 +103,13 @@ abstract protected void javaToNative (Object object, TransferData transferData); /** * Converts a platform specific representation of data to a java representation. - * - * @param transferData the platform specific representation of the data to be + * + * @param transferData the platform specific representation of the data to be * converted * - * @return a java representation of the converted data if the conversion was + * @return a java representation of the converted data if the conversion was * successful; otherwise null. If transferData is <code>null</code> then - * <code>null</code> is returned. The type of Object that is returned is + * <code>null</code> is returned. The type of Object that is returned is * dependent on the <code>Transfer</code> subclass. */ abstract protected Object nativeToJava(TransferData transferData); @@ -117,11 +117,11 @@ abstract protected Object nativeToJava(TransferData transferData); /** * Registers a name for a data type and returns the associated unique identifier. * - * <p>You may register the same type more than once, the same unique identifier + * <p>You may register the same type more than once, the same unique identifier * will be returned if the type has been previously registered.</p> * - * <p>Note: On windows, do <b>not</b> call this method with pre-defined - * Clipboard Format types such as CF_TEXT or CF_BITMAP because the + * <p>Note: On windows, do <b>not</b> call this method with pre-defined + * Clipboard Format types such as CF_TEXT or CF_BITMAP because the * pre-defined identifier will not be returned</p> * * @param formatName the name of a data type @@ -149,11 +149,11 @@ public static int registerType(String formatName) { /** * Test that the object is of the correct format for this Transfer class. - * + * * @param object a java representation of the data to be converted - * + * * @return true if object is of the correct form for this transfer type - * + * * @since 3.1 */ protected boolean validate(Object object) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/TransferData.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/TransferData.java index 2b3ee68fe0..6073ee2b75 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/TransferData.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/TransferData.java @@ -12,19 +12,19 @@ package org.eclipse.swt.dnd; import org.eclipse.swt.internal.cocoa.*; - + /** * The <code>TransferData</code> class is a platform specific data structure for * describing the type and the contents of data being converted by a transfer agent. * - * <p>As an application writer, you do not need to know the specifics of - * TransferData. TransferData instances are passed to a subclass of Transfer - * and the Transfer object manages the platform specific issues. - * You can ask a Transfer subclass if it can handle this data by calling + * <p>As an application writer, you do not need to know the specifics of + * TransferData. TransferData instances are passed to a subclass of Transfer + * and the Transfer object manages the platform specific issues. + * You can ask a Transfer subclass if it can handle this data by calling * Transfer.isSupportedType(transferData).</p> * - * <p>You should only need to become familiar with the fields in this class if you - * are implementing a Transfer subclass and you are unable to subclass the + * <p>You should only need to become familiar with the fields in this class if you + * are implementing a Transfer subclass and you are unable to subclass the * ByteArrayTransfer class.</p> * * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> @@ -39,11 +39,11 @@ public class TransferData { * within the packages provided by SWT. It is not available on all * platforms and should never be accessed from application code. * </p> - * + * * @noreference This field is not intended to be referenced by clients. */ public int type; - + /** * The data being transferred. * The data field may contain multiple values. @@ -54,9 +54,9 @@ public class TransferData { * within the packages provided by SWT. It is not available on all * platforms and should never be accessed from application code. * </p> - * + * * @noreference This field is not intended to be referenced by clients. */ public NSObject data; - + } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/TreeDragSourceEffect.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/TreeDragSourceEffect.java index 55b7d369bb..a358cf847f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/TreeDragSourceEffect.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/TreeDragSourceEffect.java @@ -18,7 +18,7 @@ import org.eclipse.swt.widgets.*; /** * This class provides default implementations to display a source image * when a drag is initiated from a <code>Tree</code>. - * + * * <p>Classes that wish to provide their own source image for a <code>Tree</code> can * extend <code>TreeDragSourceEffect</code> class and override the <code>TreeDragSourceEffect.dragStart</code> * method and set the field <code>DragSourceEvent.image</code> with their own image.</p> @@ -29,14 +29,14 @@ import org.eclipse.swt.widgets.*; * @see DragSourceEffect * @see DragSourceEvent * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> - * + * * @since 3.3 */ public class TreeDragSourceEffect extends DragSourceEffect { Image dragSourceImage = null; /** - * Creates a new <code>TreeDragSourceEffect</code> to handle drag effect + * Creates a new <code>TreeDragSourceEffect</code> to handle drag effect * from the specified <code>Tree</code>. * * @param tree the <code>Tree</code> that the user clicks on to initiate the drag @@ -48,10 +48,10 @@ public class TreeDragSourceEffect extends DragSourceEffect { /** * This implementation of <code>dragFinished</code> disposes the image * that was created in <code>TreeDragSourceEffect.dragStart</code>. - * + * * Subclasses that override this method should call <code>super.dragFinished(event)</code> * to dispose the image in the default implementation. - * + * * @param event the information associated with the drag finished event */ @Override @@ -65,10 +65,10 @@ public class TreeDragSourceEffect extends DragSourceEffect { * image that will be used during the drag. The image should be disposed * when the drag is completed in the <code>TreeDragSourceEffect.dragFinished</code> * method. - * + * * Subclasses that override this method should call <code>super.dragStart(event)</code> * to use the image from the default implementation. - * + * * @param event the information associated with the drag start event */ @Override @@ -78,7 +78,7 @@ public class TreeDragSourceEffect extends DragSourceEffect { Image getDragSourceImage(DragSourceEvent event) { if (dragSourceImage != null) dragSourceImage.dispose(); - dragSourceImage = null; + dragSourceImage = null; NSPoint point = new NSPoint(); long /*int*/ ptr = OS.malloc(NSPoint.sizeof); OS.memmove(ptr, point, NSPoint.sizeof); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/TreeDropTargetEffect.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/TreeDropTargetEffect.java index c2355826a0..52abe2bf97 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/TreeDropTargetEffect.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/TreeDropTargetEffect.java @@ -14,21 +14,21 @@ import org.eclipse.swt.internal.cocoa.*; import org.eclipse.swt.widgets.*; /** - * This class provides a default drag under effect (eg. select, insert, scroll and expand) + * This class provides a default drag under effect (eg. select, insert, scroll and expand) * when a drag occurs over a <code>Tree</code>. - * + * * <p>Classes that wish to provide their own drag under effect for a <code>Tree</code> - * can extend the <code>TreeDropTargetEffect</code> class and override any applicable methods + * can extend the <code>TreeDropTargetEffect</code> class and override any applicable methods * in <code>TreeDropTargetEffect</code> to display their own drag under effect.</p> * * Subclasses that override any methods of this class must call the corresponding * <code>super</code> method to get the default drag under effect implementation. * - * <p>The feedback value is either one of the FEEDBACK constants defined in - * class <code>DND</code> which is applicable to instances of this class, - * or it must be built by <em>bitwise OR</em>'ing together + * <p>The feedback value is either one of the FEEDBACK constants defined in + * class <code>DND</code> which is applicable to instances of this class, + * or it must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more - * of those <code>DND</code> effect constants. + * of those <code>DND</code> effect constants. * </p> * <p> * <dl> @@ -39,20 +39,20 @@ import org.eclipse.swt.widgets.*; * Note: Only one of the styles FEEDBACK_SELECT, FEEDBACK_INSERT_BEFORE or * FEEDBACK_INSERT_AFTER may be specified. * </p> - * + * * @see DropTargetAdapter * @see DropTargetEvent * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> - * + * * @since 3.3 */ public class TreeDropTargetEffect extends DropTargetEffect { boolean shouldEnableScrolling; /** - * Creates a new <code>TreeDropTargetEffect</code> to handle the drag under effect on the specified + * Creates a new <code>TreeDropTargetEffect</code> to handle the drag under effect on the specified * <code>Tree</code>. - * + * * @param tree the <code>Tree</code> over which the user positions the cursor to drop the data */ public TreeDropTargetEffect(Tree tree) { @@ -69,14 +69,14 @@ public class TreeDropTargetEffect extends DropTargetEffect { /** * This implementation of <code>dragEnter</code> provides a default drag under effect * for the feedback specified in <code>event.feedback</code>. - * + * * For additional information see <code>DropTargetAdapter.dragEnter</code>. - * + * * Subclasses that override this method should call <code>super.dragEnter(event)</code> * to get the default drag under effect implementation. * * @param event the information associated with the drag enter event - * + * * @see DropTargetAdapter * @see DropTargetEvent */ @@ -87,14 +87,14 @@ public class TreeDropTargetEffect extends DropTargetEffect { /** * This implementation of <code>dragLeave</code> provides a default drag under effect * for the feedback specified in <code>event.feedback</code>. - * + * * For additional information see <code>DropTargetAdapter.dragLeave</code>. - * + * * Subclasses that override this method should call <code>super.dragLeave(event)</code> * to get the default drag under effect implementation. * * @param event the information associated with the drag leave event - * + * * @see DropTargetAdapter * @see DropTargetEvent */ @@ -111,14 +111,14 @@ public class TreeDropTargetEffect extends DropTargetEffect { /** * This implementation of <code>dragOver</code> provides a default drag under effect * for the feedback specified in <code>event.feedback</code>. - * + * * For additional information see <code>DropTargetAdapter.dragOver</code>. - * + * * Subclasses that override this method should call <code>super.dragOver(event)</code> * to get the default drag under effect implementation. * * @param event the information associated with the drag over event - * + * * @see DropTargetAdapter * @see DropTargetEvent * @see DND#FEEDBACK_SELECT @@ -128,7 +128,7 @@ public class TreeDropTargetEffect extends DropTargetEffect { */ @Override public void dragOver(DropTargetEvent event) { - int effect = checkEffect(event.feedback); + int effect = checkEffect(event.feedback); ((DropTarget)event.widget).feedback = effect; OS.objc_msgSend(control.view.id, OS.sel_setShouldExpandItem_, (effect & DND.FEEDBACK_EXPAND) == 0 ? 0 : 1); if ((effect & DND.FEEDBACK_SCROLL) == 0) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/URLTransfer.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/URLTransfer.java index be27d9c51b..867230764f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/URLTransfer.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/URLTransfer.java @@ -13,13 +13,13 @@ package org.eclipse.swt.dnd; import org.eclipse.swt.internal.cocoa.*; /** - * The class <code>URLTransfer</code> provides a platform specific mechanism - * for converting text in URL format represented as a java <code>String</code> + * The class <code>URLTransfer</code> provides a platform specific mechanism + * for converting text in URL format represented as a java <code>String</code> * to a platform specific representation of the data and vice versa. The string * must contain a fully specified url. - * + * * <p>An example of a java <code>String</code> containing a URL is shown below:</p> - * + * * <code><pre> * String url = "http://www.eclipse.org"; * </code></pre> @@ -49,11 +49,11 @@ public static URLTransfer getInstance () { /** * This implementation of <code>javaToNative</code> converts a URL * represented by a java <code>String</code> to a platform specific representation. - * + * * @param object a java <code>String</code> containing a URL * @param transferData an empty <code>TransferData</code> object that will * be filled in on return with the platform specific format of the data - * + * * @see Transfer#nativeToJava */ @Override @@ -68,13 +68,13 @@ public void javaToNative (Object object, TransferData transferData){ } /** - * This implementation of <code>nativeToJava</code> converts a platform + * This implementation of <code>nativeToJava</code> converts a platform * specific representation of a URL to a java <code>String</code>. - * + * * @param transferData the platform specific representation of the data to be converted * @return a java <code>String</code> containing a URL if the conversion was successful; * otherwise null - * + * * @see Transfer#javaToNative */ @Override diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java index 14587fb3b4..6217da9896 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java @@ -151,7 +151,7 @@ int createBaseWindow (nsIBaseWindow baseWindow) { /* * Feature of Mozilla on OSX. Mozilla replaces the OSX application menu whenever * a browser's base window is created. The workaround is to restore the previous - * menu after creating the base window. + * menu after creating the base window. */ NSApplication application = NSApplication.sharedApplication (); NSMenu mainMenu = application.mainMenu (); @@ -198,7 +198,7 @@ void handleFocus () { eventShell = null; listener = null; } - + }; eventShell = browser.getShell (); eventShell.getDisplay ().addFilter (SWT.FocusIn, listener); diff --git a/bundles/org.eclipse.swt/Eclipse SWT OpenGL/cocoa/org/eclipse/swt/opengl/GLCanvas.java b/bundles/org.eclipse.swt/Eclipse SWT OpenGL/cocoa/org/eclipse/swt/opengl/GLCanvas.java index e98b77ea30..0a804e3748 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT OpenGL/cocoa/org/eclipse/swt/opengl/GLCanvas.java +++ b/bundles/org.eclipse.swt/Eclipse SWT OpenGL/cocoa/org/eclipse/swt/opengl/GLCanvas.java @@ -17,7 +17,7 @@ import org.eclipse.swt.opengl.GLData; /** * GLCanvas is a widget capable of displaying OpenGL content. - * + * * @see GLData * @see <a href="http://www.eclipse.org/swt/snippets/#opengl">OpenGL snippets</a> * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> @@ -28,7 +28,7 @@ import org.eclipse.swt.opengl.GLData; public class GLCanvas extends Canvas { NSOpenGLContext context; NSOpenGLPixelFormat pixelFormat; - + static final int MAX_ATTRIBUTES = 32; static final String GLCONTEXT_KEY = "org.eclipse.swt.internal.cocoa.glcontext"; //$NON-NLS-1$ @@ -42,7 +42,7 @@ public class GLCanvas extends Canvas { * * @exception IllegalArgumentException * <ul><li>ERROR_NULL_ARGUMENT when the data is null - * <li>ERROR_UNSUPPORTED_DEPTH when the requested attributes cannot be provided</ul> + * <li>ERROR_UNSUPPORTED_DEPTH when the requested attributes cannot be provided</ul> * </ul> */ public GLCanvas (Composite parent, int style, GLData data) { @@ -52,67 +52,67 @@ public GLCanvas (Composite parent, int style, GLData data) { int pos = 0; if (data.doubleBuffer) attrib [pos++] = OS.NSOpenGLPFADoubleBuffer; - + if (data.stereo) attrib [pos++] = OS.NSOpenGLPFAStereo; /* * Feature in Cocoa: NSOpenGL/CoreOpenGL only supports specifying the total number of bits * in the size of the color component. If specified, the color size is the sum of the red, green - * and blue values in the GLData. + * and blue values in the GLData. */ if ((data.redSize + data.blueSize + data.greenSize) > 0) { attrib [pos++] = OS.NSOpenGLPFAColorSize; attrib [pos++] = data.redSize + data.greenSize + data.blueSize; } - + if (data.alphaSize > 0) { attrib [pos++] = OS.NSOpenGLPFAAlphaSize; attrib [pos++] = data.alphaSize; } - + if (data.depthSize > 0) { attrib [pos++] = OS.NSOpenGLPFADepthSize; attrib [pos++] = data.depthSize; } - + if (data.stencilSize > 0) { attrib [pos++] = OS.NSOpenGLPFAStencilSize; attrib [pos++] = data.stencilSize; } - + /* * Feature in Cocoa: NSOpenGL/CoreOpenGL only supports specifying the total number of bits * in the size of the color accumulator component. If specified, the color size is the sum of the red, green, - * blue and alpha accum values in the GLData. + * blue and alpha accum values in the GLData. */ if ((data.accumRedSize + data.accumBlueSize + data.accumGreenSize) > 0) { attrib [pos++] = OS.NSOpenGLPFAAccumSize; attrib [pos++] = data.accumRedSize + data.accumGreenSize + data.accumBlueSize + data.accumAlphaSize; } - + if (data.sampleBuffers > 0) { attrib [pos++] = OS.NSOpenGLPFASampleBuffers; attrib [pos++] = data.sampleBuffers; } - + if (data.samples > 0) { attrib [pos++] = OS.NSOpenGLPFASamples; attrib [pos++] = data.samples; } - + attrib [pos++] = 0; - + pixelFormat = (NSOpenGLPixelFormat)new NSOpenGLPixelFormat().alloc(); - - if (pixelFormat == null) { + + if (pixelFormat == null) { dispose (); SWT.error (SWT.ERROR_UNSUPPORTED_DEPTH); } pixelFormat.initWithAttributes(attrib); - + NSOpenGLContext ctx = data.shareContext != null ? data.shareContext.context : null; context = (NSOpenGLContext) new NSOpenGLContext().alloc(); - if (context == null) { + if (context == null) { dispose (); SWT.error (SWT.ERROR_UNSUPPORTED_DEPTH); } @@ -120,15 +120,15 @@ public GLCanvas (Composite parent, int style, GLData data) { context.setValues(new int[]{-1}, OS.NSOpenGLCPSurfaceOrder); setData(GLCONTEXT_KEY, context); NSNotificationCenter.defaultCenter().addObserver(view, OS.sel_updateOpenGLContext_, OS.NSViewGlobalFrameDidChangeNotification, view); - + Listener listener = new Listener () { public void handleEvent (Event event) { switch (event.type) { - + case SWT.Dispose: setData(GLCONTEXT_KEY, null); NSNotificationCenter.defaultCenter().removeObserver(view); - + if (context != null) { context.clearDrawable(); context.release(); @@ -145,7 +145,7 @@ public GLCanvas (Composite parent, int style, GLData data) { /** * Returns a GLData object describing the created context. - * + * * @return GLData description of the OpenGL context attributes * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> @@ -176,12 +176,12 @@ public GLData getGLData () { data.redSize = colorSize; data.greenSize = colorSize; data.blueSize = colorSize; - + pixelFormat.getValues(value, OS.NSOpenGLPFADepthSize, 0); data.depthSize = (int/*64*/)value [0]; pixelFormat.getValues(value, OS.NSOpenGLPFAStencilSize, 0); data.stencilSize = (int/*64*/)value [0]; - + /* * Feature(?) in Cocoa: NSOpenGL/CoreOpenGL doesn't support setting an accumulation buffer alpha, but * has an alpha if the color values for the accumulation buffer were set. Allocate the values evenly @@ -189,7 +189,7 @@ public GLData getGLData () { */ pixelFormat.getValues(value, OS.NSOpenGLPFAAccumSize, 0); - int accumColorSize = (int/*64*/)(value[0]) / 4; + int accumColorSize = (int/*64*/)(value[0]) / 4; data.accumRedSize = accumColorSize; data.accumGreenSize = accumColorSize; data.accumBlueSize = accumColorSize; @@ -205,7 +205,7 @@ public GLData getGLData () { /** * Returns a boolean indicating whether the receiver's OpenGL context * is the current context. - * + * * @return true if the receiver holds the current OpenGL context, * false otherwise * @exception SWTException <ul> @@ -222,7 +222,7 @@ public boolean isCurrent () { /** * Sets the OpenGL context associated with this GLCanvas to be the * current GL context. - * + * * @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> @@ -235,7 +235,7 @@ public void setCurrent () { /** * Swaps the front and back color buffers. - * + * * @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> diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/Lock.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/Lock.java index 7712dd0f6a..ea07b8d02c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/Lock.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/Lock.java @@ -20,7 +20,7 @@ public class Lock { * Locks the monitor and returns the lock count. If * the lock is owned by another thread, wait until * the lock is released. - * + * * @return the lock count */ public int lock() { diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/Platform.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/Platform.java index ca5c445141..7b7ed5b61e 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/Platform.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/Platform.java @@ -16,7 +16,7 @@ public class Platform { public static final Lock lock = new Lock (); public static boolean isLoadable () { - return Library.isLoadable (); + return Library.isLoadable (); } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPoint.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPoint.java index 767fa3e340..757671821c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPoint.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPoint.java @@ -18,6 +18,6 @@ public class NSPoint { @Override public String toString() { - return "NSPoint{" + x + "," + y + "}"; + return "NSPoint{" + x + "," + y + "}"; } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRect.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRect.java index 14d799c569..528bfc28e6 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRect.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRect.java @@ -24,6 +24,6 @@ public class NSRect { @Override public String toString() { - return "NSRect{" + x + "," + y + "," + width + "," + height + "}"; + return "NSRect{" + x + "," + y + "," + width + "," + height + "}"; } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSize.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSize.java index 7a5493152f..7744c19951 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSize.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSize.java @@ -16,9 +16,9 @@ public class NSSize { public double /*float*/ width; public double /*float*/ height; public static final int sizeof = OS.NSSize_sizeof(); - + @Override public String toString() { - return "NSSize{" + width + "," + height + "}"; + return "NSSize{" + width + "," + height + "}"; } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java index e7cd674b0a..fb2e9f57c0 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java @@ -16,7 +16,7 @@ public class OS extends C { static { Library.loadLibrary("swt-pi"); //$NON-NLS-1$ } - + /** * NOTE: For new code, use {@link #VERSION_MMB} and {@link #VERSION_MMB(int, int, int)} */ @@ -34,24 +34,24 @@ public class OS extends C { int bugFix = response [0]; VERSION_MMB = VERSION_MMB (major, minor, bugFix); } - + public static int VERSION_MMB (int major, int minor, int bugFix) { return (major << 16) + (minor << 8) + bugFix; } - + /* * Magic number explanation, from Cocoa's TextSizingExample: - * + * * "The first is called LargeNumberForText [1.0e7] and it was not arbitrarily chosen. * The actual value was chosen to be around the largest floating point value possible that can preserve at least pixel precision. [...] - * It is not wise to use bigger dimensions for text system objects because, even if you ever fill all that space, - * by the time you get to the far reaches, the letters won't have the precision necessary to look and act correctly. - * [...] Because the Cocoa text system respects this limit in various ways, a second constant, NotQuiteAsLargeNumberForText, is used for the - * field-like text views created by the FieldAspect class. This is simply half of LargeNumberForText; at sizes as large as LargeNumberForText, + * It is not wise to use bigger dimensions for text system objects because, even if you ever fill all that space, + * by the time you get to the far reaches, the letters won't have the precision necessary to look and act correctly. + * [...] Because the Cocoa text system respects this limit in various ways, a second constant, NotQuiteAsLargeNumberForText, is used for the + * field-like text views created by the FieldAspect class. This is simply half of LargeNumberForText; at sizes as large as LargeNumberForText, * the text system stops aligning text, for various reasons." */ public static final double /*float*/ MAX_TEXT_CONTAINER_SIZE = 0.5e7f; - + public static final int gestaltSystemVersion = ('s'<<24) + ('y'<<16) + ('s'<<8) + 'v'; public static final int gestaltSystemVersionMajor = ('s'<<24) + ('y'<<16) + ('s'<<8) + '1'; public static final int gestaltSystemVersionMinor = ('s'<<24) + ('y'<<16) + ('s'<<8) + '2'; @@ -77,8 +77,8 @@ public class OS extends C { public static final int kLSUnknownCreator = 0; public static final int kLSRolesAll = 0xFFFFFFFF; public static final int kAXUnderlineStyleNone = 0x0; - public static final int kAXUnderlineStyleSingle = 0x1; - public static final int kAXUnderlineStyleThick = 0x2; + public static final int kAXUnderlineStyleSingle = 0x1; + public static final int kAXUnderlineStyleThick = 0x2; public static final int kAXUnderlineStyleDouble = 0x9; public static final int kPMDestinationPrinter = 1; public static final int kPMDuplexNone = 0x0001; @@ -101,14 +101,14 @@ public class OS extends C { public static final long /*int*/ sel_systemSettingsChanged_ = sel_registerName("systemSettingsChanged:"); public static final long /*int*/ sel_panelDidEnd_returnCode_contextInfo_ = sel_registerName("panelDidEnd:returnCode:contextInfo:"); public static final long /*int*/ sel_updateOpenGLContext_ = sel_registerName("updateOpenGLContext:"); - + public static final long /*int*/ sel_overwriteExistingFileCheck = sel_registerName("_overwriteExistingFileCheck:"); public static final long /*int*/ sel_setShowsHiddenFiles_ = sel_registerName("setShowsHiddenFiles:"); public static final long /*int*/ sel_contextID = OS.sel_registerName("contextID"); public static final long /*int*/ sel__drawThemeProgressArea_ = OS.sel_registerName("_drawThemeProgressArea:"); - + public static final long /*int*/ sel__setDashboardBehavior = OS.sel_registerName("_setDashboardBehavior:to:"); public static final long /*int*/ sel__setNeedsToUseHeartBeatWindow_ = OS.sel_registerName("_setNeedsToUseHeartBeatWindow:"); @@ -117,21 +117,21 @@ public class OS extends C { public static final long /*int*/ sel_sharedHandler = sel_registerName("sharedHandler"); public static final long /*int*/ sel_startAuthentication = sel_registerName("startAuthentication:window:"); public static final long /*int*/ sel_setAllowsAnyHTTPSCertificate = sel_registerName("setAllowsAnyHTTPSCertificate:forHost:"); - + public static final long /*int*/ sel_accessibleHandle = sel_registerName("accessibleHandle"); public static final long /*int*/ sel_getImageView = sel_registerName("getImageView"); public static final long /*int*/ sel_clearDeferFlushing = sel_registerName("clearDeferFlushing"); - + public static final long /*int*/ sel_setShouldExpandItem_ = sel_registerName("setShouldExpandItem:"); public static final long /*int*/ sel_setShouldScrollClipView_ = sel_registerName("setShouldScrollClipView:"); - + /* These are not generated in order to avoid creating static methods on all classes */ public static final long /*int*/ sel_isSelectorExcludedFromWebScript_ = sel_registerName("isSelectorExcludedFromWebScript:"); public static final long /*int*/ sel_webScriptNameForSelector_ = sel_registerName("webScriptNameForSelector:"); - + public static final long /*int*/ sel_setColor_forAttribute_ = sel_registerName("setColor:forAttribute:"); - + public static final long /*int*/ sel_javaRunLoopMode = sel_registerName("javaRunLoopMode"); /* These are not generated in order to avoid attempting to create a java method called "null" */ @@ -145,7 +145,7 @@ public class OS extends C { public static final native long /*int*/ CALLBACK_NSTextAttachmentCell_cellSize(long /*int*/ func); public static final long /*int*/ protocol_NSTextAttachmentCell = objc_getProtocol("NSTextAttachmentCell"); public static final long /*int*/ sel_cellBaselineOffset = sel_registerName("cellBaselineOffset"); - + /*10.6 Accessibility Strings*/ /** @method flags=const dynamic no_gen*/ public static final native long /*int*/ NSAccessibilityRowIndexRangeAttribute(); @@ -159,7 +159,7 @@ public class OS extends C { /** @method flags=const dynamic no_gen*/ public static final native long /*int*/ NSAccessibilityCellRole(); public static final NSString NSAccessibilityCellRole = new NSString(NSAccessibilityCellRole()); - + /** 10.7 selectors and constants */ public static final long /*int*/ sel_isCompatibleWithOverlayScrollers = sel_registerName("isCompatibleWithOverlayScrollers"); public static final long /*int*/ sel_flashScrollers = sel_registerName("flashScrollers"); @@ -177,7 +177,7 @@ public class OS extends C { /* AWT application delegate. Remove these when JavaRuntimeSupport.framework has bridgesupport generated for it. */ public static final long /*int*/ class_JRSAppKitAWT = objc_getClass("JRSAppKitAWT"); public static final long /*int*/ sel_awtAppDelegate = sel_registerName("awtAppDelegate"); - + public static final long /*int*/ class_NSToolbarView = objc_getClass("NSToolbarView"); /** JNI natives */ @@ -189,7 +189,7 @@ public static final native long /*int*/ NewGlobalRef(Object object); * @param globalRef cast=(jobject) */ public static final native void DeleteGlobalRef(long /*int*/ globalRef); -/** @method flags=no_gen */ +/** @method flags=no_gen */ public static final native Object JNIGetObject(long /*int*/ globalRef); /** Carbon calls */ @@ -209,20 +209,20 @@ public static final native int GetCurrentEventButtonState(); /** @method flags=dynamic */ public static final native int GetDblTime(); /** @method flags=dynamic - @param inCreator cast=(OSType) - @param inType cast=(OSType) - @param inExtension cast=(CFStringRef) - @param inMIMEType cast=(CFStringRef) - @param inUsageFlags cast=(IconServicesUsageFlags) + @param inCreator cast=(OSType) + @param inType cast=(OSType) + @param inExtension cast=(CFStringRef) + @param inMIMEType cast=(CFStringRef) + @param inUsageFlags cast=(IconServicesUsageFlags) @param outIconRef cast=(IconRef *) */ public static final native int GetIconRefFromTypeInfo(int inCreator, int inType, long /*int*/ inExtension, long /*int*/ inMIMEType, int inUsageFlags, long /*int*/ outIconRef[]); -/** @method flags=dynamic +/** @method flags=dynamic @param context cast=(CGContextRef) */ public static final native long /*int*/ CGContextCopyPath(long /*int*/ context); /** @method flags=dynamic */ public static final native long /*int*/ TISCopyCurrentKeyboardInputSource(); -/** @method flags=dynamic - @param inputSource cast=(TISInputSourceRef) +/** @method flags=dynamic + @param inputSource cast=(TISInputSourceRef) @param propertyKey cast=(CFStringRef) */ public static final native long /*int*/ TISGetInputSourceProperty (long /*int*/ inputSource, long /*int*/ propertyKey); /** @method flags=no_gen */ @@ -277,7 +277,7 @@ public static final int kThemeCopyArrowCursor = 1; public static final int kThemeNotAllowedCursor = 18; public static final int kThemeAliasArrowCursor = 2; -/** @method flags=dynamic +/** @method flags=dynamic * @param iFile cast=(const FSRef *) * @param iContext cast=(ATSFontContext) * @param iFormat cast=(ATSFontFormat) @@ -291,7 +291,7 @@ public static final int kATSFontContextLocal = 2; public static final int kATSOptionFlagsDefault = 0; public static final int kATSFontFormatUnspecified = 0; -/** @method flags=dynamic +/** @method flags=dynamic * @param path cast=(const UInt8 *) * @param ref cast=(FSRef *) * @param isDirectory cast=(Boolean *) @@ -511,7 +511,7 @@ public static final native void JSStringRelease (long /*int*/ string); * @param certType cast=(CSSM_CERT_TYPE) * @param policyOID cast=(CSSM_OID *) * @param value cast=(CSSM_DATA *) - * @param policySearch cast=(SecPolicySearchRef *) + * @param policySearch cast=(SecPolicySearchRef *) */ public static final native int SecPolicySearchCreate(long /*int*/ certType, long /*int*/ policyOID, long /*int*/ value, long /*int*/ [] policySearch); @@ -521,10 +521,10 @@ public static final native int SecPolicySearchCreate(long /*int*/ certType, long */ public static final native int SecPolicySearchCopyNext(long /*int*/ searchRef, long /*int*/ [] policyRef); -/** +/** * @param certificates cast=(CFArrayRef) * @param policies cast=(CFTypeRef) - * @param trustRef cast=(SecTrustRef *) + * @param trustRef cast=(SecTrustRef *) */ public static final native int SecTrustCreateWithCertificates(long /*int*/ certificates, long /*int*/ policies, long /*int*/ [] trustRef); @@ -642,7 +642,7 @@ public static final native long /*int*/ object_getInstanceVariable(long /*int*/ public static final native long /*int*/ object_setInstanceVariable(long /*int*/ obj, byte[] name, long /*int*/ value); /** * @param obj cast=(id) - * @param clazz cast=(Class) + * @param clazz cast=(Class) */ public static final native long /*int*/ object_setClass(long /*int*/ obj, long /*int*/ clazz); public static final native long /*int*/ sel_registerName(String selectorName); diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTApplicationDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTApplicationDelegate.java index 71364148fa..2f0be75990 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTApplicationDelegate.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTApplicationDelegate.java @@ -14,7 +14,7 @@ public class SWTApplicationDelegate extends NSObject { public SWTApplicationDelegate() { super(0); } - + public SWTApplicationDelegate(long /*int*/ id) { super(id); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTCanvasView.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTCanvasView.java index ae122c5daa..f45ec719b4 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTCanvasView.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTCanvasView.java @@ -16,7 +16,7 @@ public class SWTCanvasView extends NSView { public SWTCanvasView() { super(0); } - + public SWTCanvasView(long /*int*/ id) { super(id); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTDragSourceDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTDragSourceDelegate.java index 9c8a7f2181..3f39061d19 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTDragSourceDelegate.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTDragSourceDelegate.java @@ -15,7 +15,7 @@ public class SWTDragSourceDelegate extends NSObject { public SWTDragSourceDelegate() { super(0); } - + public SWTDragSourceDelegate(long /*int*/ id) { super(id); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTPanelDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTPanelDelegate.java index 12de311e3a..22a9de86a0 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTPanelDelegate.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTPanelDelegate.java @@ -15,7 +15,7 @@ public class SWTPanelDelegate extends NSObject { public SWTPanelDelegate() { super(0); } - + public SWTPanelDelegate(long /*int*/ id) { super(id); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTPrintPanelDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTPrintPanelDelegate.java index dd6f684a9c..1a3980b76e 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTPrintPanelDelegate.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTPrintPanelDelegate.java @@ -15,7 +15,7 @@ public class SWTPrintPanelDelegate extends NSObject { public SWTPrintPanelDelegate() { super(0); } - + public SWTPrintPanelDelegate(long /*int*/ id) { super(id); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTScrollView.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTScrollView.java index a89e354b19..ba05fbaee2 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTScrollView.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTScrollView.java @@ -15,7 +15,7 @@ public class SWTScrollView extends NSScrollView { public SWTScrollView() { super(0); } - + public SWTScrollView(long /*int*/ id) { super(id); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTTabView.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTTabView.java index 8b03c9226b..270e226d3b 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTTabView.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTTabView.java @@ -15,7 +15,7 @@ public class SWTTabView extends NSTabView { public SWTTabView() { super(0); } - + public SWTTabView(long /*int*/ id) { super(id); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTView.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTView.java index 9e9758840a..140ecffe96 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTView.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTView.java @@ -16,7 +16,7 @@ public class SWTView extends NSView { public SWTView() { super(0); } - + public SWTView(long /*int*/ id) { super(id); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTWindowDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTWindowDelegate.java index b6d4342909..971ccaaa54 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTWindowDelegate.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTWindowDelegate.java @@ -15,7 +15,7 @@ public class SWTWindowDelegate extends NSObject { public SWTWindowDelegate() { super(0); } - + public SWTWindowDelegate(long /*int*/ id) { super(id); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/WebPolicyDecisionListener.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/WebPolicyDecisionListener.java index ffd1c819e5..708b2e2dc4 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/WebPolicyDecisionListener.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/WebPolicyDecisionListener.java @@ -23,7 +23,7 @@ public WebPolicyDecisionListener(long /*int*/ id) { public WebPolicyDecisionListener(id id) { super(id); } - + public void download() { OS.objc_msgSend(id, OS.sel_download); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/objc_super.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/objc_super.java index 2f00c95cb5..b67acfe0cb 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/objc_super.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/objc_super.java @@ -18,5 +18,5 @@ public class objc_super { public long /*int*/ receiver; /** @field accessor=swt_super_class,cast=(Class) */ public long /*int*/ super_class; - public static final int sizeof = OS.objc_super_sizeof(); + public static final int sizeof = OS.objc_super_sizeof(); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Printing/cocoa/org/eclipse/swt/printing/PrintDialog.java b/bundles/org.eclipse.swt/Eclipse SWT Printing/cocoa/org/eclipse/swt/printing/PrintDialog.java index 295f0ca404..8e0a994b86 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Printing/cocoa/org/eclipse/swt/printing/PrintDialog.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Printing/cocoa/org/eclipse/swt/printing/PrintDialog.java @@ -32,7 +32,7 @@ import org.eclipse.swt.internal.cocoa.*; public class PrintDialog extends Dialog { PrinterData printerData = new PrinterData(); int returnCode; - + // the following Callbacks are never freed static Callback dialogCallback5; static final byte[] SWT_OBJECT = {'S', 'W', 'T', '_', 'O', 'B', 'J', 'E', 'C', 'T', '\0'}; @@ -65,7 +65,7 @@ public PrintDialog (Shell parent) { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -116,9 +116,9 @@ static int checkStyle (Shell parent, int style) { * Setting the printer data to null is equivalent to * resetting all data fields to their default values. * </p> - * + * * @param data the data that will be used when the dialog is opened or null to use default data - * + * * @since 3.4 */ public void setPrinterData(PrinterData data) { @@ -129,9 +129,9 @@ public void setPrinterData(PrinterData data) { /** * Returns the printer data that will be used when the dialog * is opened. - * + * * @return the data that will be used when the dialog is opened - * + * * @since 3.4 */ public PrinterData getPrinterData() { @@ -190,7 +190,7 @@ public PrinterData open() { printInfo.setSelectionOnly (printerData.scope == PrinterData.SELECTION); } panel.setOptions(OS.NSPrintPanelShowsPageSetupAccessory | OS.NSPrintPanelShowsPrintSelection | panel.options()); - + Shell parent = getParent(); Display display = parent != null ? parent.getDisplay() : Display.getCurrent(); int response; @@ -289,11 +289,11 @@ static long /*int*/ dialogProc(long /*int*/ id, long /*int*/ sel, long /*int*/ a void initClasses () { String className = "SWTPrintPanelDelegate"; if (OS.objc_lookUpClass (className) != 0) return; - + dialogCallback5 = new Callback(getClass(), "dialogProc", 5); long /*int*/ dialogProc5 = dialogCallback5.getAddress(); - if (dialogProc5 == 0) SWT.error (SWT.ERROR_NO_MORE_CALLBACKS); - + if (dialogProc5 == 0) SWT.error (SWT.ERROR_NO_MORE_CALLBACKS); + byte[] types = {'*','\0'}; int size = C.PTR_SIZEOF, align = C.PTR_SIZEOF == 4 ? 2 : 3; long /*int*/ cls = OS.objc_allocateClassPair(OS.class_NSObject, className, 0); @@ -346,7 +346,7 @@ public int getStartPage() { * This value can be from 1 to the maximum number of pages for the platform. * Note that it is only valid if the scope is <code>PrinterData.PAGE_RANGE</code>. * </p> - * + * * @param startPage the startPage setting when the dialog is opened */ public void setStartPage(int startPage) { @@ -374,7 +374,7 @@ public int getEndPage() { * This value can be from 1 to the maximum number of pages for the platform. * Note that it is only valid if the scope is <code>PrinterData.PAGE_RANGE</code>. * </p> - * + * * @param endPage the end page setting when the dialog is opened */ public void setEndPage(int endPage) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT Printing/cocoa/org/eclipse/swt/printing/Printer.java b/bundles/org.eclipse.swt/Eclipse SWT Printing/cocoa/org/eclipse/swt/printing/Printer.java index 3b1ebd5763..0c04d16d4a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Printing/cocoa/org/eclipse/swt/printing/Printer.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Printing/cocoa/org/eclipse/swt/printing/Printer.java @@ -26,7 +26,7 @@ import org.eclipse.swt.internal.cocoa.*; * Alternatively, calling <code>new Printer()</code> will construct a * printer object for the user's default printer. * </p><p> - * Application code must explicitly invoke the <code>Printer.dispose()</code> + * Application code must explicitly invoke the <code>Printer.dispose()</code> * method to release the operating system resources managed by each instance * when those instances are no longer required. * </p> @@ -44,7 +44,7 @@ public final class Printer extends Device { NSView view; NSWindow window; boolean isGCCreated; - + static final String DRIVER = "Mac"; /** @@ -73,11 +73,11 @@ public static PrinterData[] getPrinterList() { /** * Returns a <code>PrinterData</code> object representing - * the default printer or <code>null</code> if there is no + * the default printer or <code>null</code> if there is no * default printer. * * @return the default printer data or null - * + * * @since 2.1 */ public static PrinterData getDefaultPrinterData() { @@ -91,13 +91,13 @@ public static PrinterData getDefaultPrinterData() { } finally { if (pool != null) pool.release(); } - + } /** * Constructs a new printer representing the default printer. * <p> - * Note: You must dispose the printer when it is no longer required. + * Note: You must dispose the printer when it is no longer required. * </p> * * @exception SWTError <ul> @@ -115,7 +115,7 @@ public Printer() { * object representing the desired printer. If the argument * is null, then the default printer will be used. * <p> - * Note: You must dispose the printer when it is no longer required. + * Note: You must dispose the printer when it is no longer required. * </p> * * @param data the printer data for the specified printer, or null to use the default printer @@ -153,7 +153,7 @@ public Printer(PrinterData data) { * <li>The bottom trim height is (y + height) pixels</li> * </ul> * </p> - * + * * @param x the x coordinate of the client area * @param y the y coordinate of the client area * @param width the width of the client area @@ -187,7 +187,7 @@ public Rectangle computeTrim(int x, int y, int width, int height) { } } -/** +/** * Creates the printer handle. * This method is called internally by the instance creation * mechanism of the <code>Device</code> class. @@ -221,7 +221,7 @@ protected void create(DeviceData deviceData) { } /* Updating printInfo from PMPrintSettings overrides values in the printInfo dictionary. */ printInfo.updateFromPMPrintSettings(); - NSMutableDictionary dict = printInfo.dictionary(); + NSMutableDictionary dict = printInfo.dictionary(); if (data.collate != false) dict.setValue(NSNumber.numberWithBool(data.collate), OS.NSPrintMustCollate); if (data.copyCount != 1) dict.setValue(NSNumber.numberWithInt(data.copyCount), OS.NSPrintCopies); dict.setValue(NSNumber.numberWithInt(data.orientation == PrinterData.LANDSCAPE ? OS.NSLandscapeOrientation : OS.NSPortraitOrientation), OS.NSPrintOrientation); @@ -258,7 +258,7 @@ protected void create(DeviceData deviceData) { } } -/** +/** * Destroys the printer handle. * This method is called internally by the dispose * mechanism of the <code>Device</code> class. @@ -283,7 +283,7 @@ protected void destroy() { } } -/** +/** * Invokes platform specific functionality to allocate a new GC handle. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public @@ -293,9 +293,9 @@ protected void destroy() { * application code. * </p> * - * @param data the platform specific GC data + * @param data the platform specific GC data * @return the platform specific GC handle - * + * * @noreference This method is not intended to be referenced by clients. */ @Override @@ -334,7 +334,7 @@ public long /*int*/ internal_new_GC(GCData data) { * If subclasses reimplement this method, they must * call the <code>super</code> implementation. * </p> - * + * * @see #create */ @Override @@ -348,7 +348,7 @@ protected void init () { } } -/** +/** * Invokes platform specific functionality to dispose a GC handle. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public @@ -359,8 +359,8 @@ protected void init () { * </p> * * @param hDC the platform specific GC handle - * @param data the platform specific GC data - * + * @param data the platform specific GC data + * * @noreference This method is not intended to be referenced by clients. */ @Override @@ -368,7 +368,7 @@ public void internal_dispose_GC(long /*int*/ hDC, GCData data) { if (data != null) isGCCreated = false; } -/** +/** * Releases any internal state prior to destroying this printer. * This method is called internally by the dispose * mechanism of the <code>Device</code> class. @@ -392,7 +392,7 @@ float scalingFactor() { * endJob. Calling startPage, endPage, or endJob before startJob * will result in undefined behavior. * </p> - * + * * @param jobName the name of the print job to start * @return true if the job started successfully and false otherwise. * @@ -455,7 +455,7 @@ public void endJob() { } /** - * Cancels a print job in progress. + * Cancels a print job in progress. * * @exception SWTException <ul> * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> @@ -479,7 +479,7 @@ static DeviceData checkNull (PrinterData data) { PrinterData defaultPrinter = getDefaultPrinterData(); if (defaultPrinter == null) SWT.error(SWT.ERROR_NO_HANDLES); data.driver = defaultPrinter.driver; - data.name = defaultPrinter.name; + data.name = defaultPrinter.name; } return data; } @@ -491,7 +491,7 @@ static DeviceData checkNull (PrinterData data) { * After calling startJob, this method may be called any number of times * along with a matching endPage. * </p> - * + * * @return true if the page started successfully and false otherwise. * * @exception SWTException <ul> @@ -574,21 +574,21 @@ public Point getDPI() { if (!NSThread.isMainThread()) pool = (NSAutoreleasePool) new NSAutoreleasePool().alloc().init(); try { long /*int*/ pmPrintSession = printInfo.PMPrintSession(); - long /*int*/ printer[] = new long /*int*/ [1]; + long /*int*/ printer[] = new long /*int*/ [1]; long /*int*/ err = OS.PMSessionGetCurrentPrinter(pmPrintSession, printer); - + if (err == OS.noErr) { long /*int*/ printSettings = printInfo.PMPrintSettings(); short[] destType = new short[1]; if (OS.PMSessionGetDestinationType(pmPrintSession, printSettings, destType) == OS.noErr) { if (destType[0] == OS.kPMDestinationPrinter) { PMResolution resolution = new PMResolution(); - + if (OS.PMPrinterGetOutputResolution(printer[0], printSettings, resolution) != OS.noErr) { int numberOfResolutions[] = new int[1]; if (OS.PMPrinterGetPrinterResolutionCount(printer[0], numberOfResolutions) == OS.noErr) { PMResolution tempResolution = new PMResolution(); - tempResolution.hRes = tempResolution.vRes = 300.0; + tempResolution.hRes = tempResolution.vRes = 300.0; for (int i = 1; i <= numberOfResolutions[0]; i++) { // PMPrinterGetIndexedPrinterResolution indexes are 1-based. if (OS.PMPrinterGetIndexedPrinterResolution(printer[0], i, tempResolution) == OS.noErr) { @@ -599,12 +599,12 @@ public Point getDPI() { } } } - + return new Point((int)resolution.hRes, (int)resolution.vRes); } } } - + return getIndependentDPI(); } finally { if (pool != null) pool.release(); @@ -652,7 +652,7 @@ public Rectangle getBounds() { * For a printer, this is the size of the printable area * of the page, in pixels. * </p> - * + * * @return the client area * * @exception SWTException <ul> @@ -680,7 +680,7 @@ public Rectangle getClientArea() { /** * Returns a <code>PrinterData</code> object representing the * target printer for this print job. - * + * * @return a PrinterData object describing the receiver */ public PrinterData getPrinterData() { diff --git a/bundles/org.eclipse.swt/Eclipse SWT Program/cocoa/org/eclipse/swt/program/Program.java b/bundles/org.eclipse.swt/Eclipse SWT Program/cocoa/org/eclipse/swt/program/Program.java index 4014b4008d..67af3ecb5b 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Program/cocoa/org/eclipse/swt/program/Program.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Program/cocoa/org/eclipse/swt/program/Program.java @@ -67,7 +67,7 @@ public static Program findProgram (String extension) { extension.getChars(0, chars.length, chars, 0); } else { chars = new char[extension.length() - 1]; - extension.getChars(1, extension.length(), chars, 0); + extension.getChars(1, extension.length(), chars, 0); } NSString ext = NSString.stringWithCharacters(chars, chars.length); if (ext != null) { @@ -257,7 +257,7 @@ static boolean isExecutable (String fileName) { * * @param fileName the file or program name or URL (http:// or https://) * @return <code>true</code> if the file is launched, otherwise <code>false</code> - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT when fileName is null</li> * </ul> @@ -278,11 +278,11 @@ public static boolean launch (String fileName) { * @param fileName the file name or program name or URL (http:// or https://) * @param workingDir the name of the working directory or null * @return <code>true</code> if the file is launched, otherwise <code>false</code> - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT when fileName is null</li> * </ul> - * + * * @since 3.6 */ public static boolean launch (String fileName, String workingDir) { @@ -308,12 +308,12 @@ public static boolean launch (String fileName, String workingDir) { /** * Executes the program with the file as the single argument * in the operating system. It is the responsibility of the - * programmer to ensure that the file contains valid data for + * programmer to ensure that the file contains valid data for * this program. * * @param fileName the file or program name * @return <code>true</code> if the file is launched, otherwise <code>false</code> - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT when fileName is null</li> * </ul> @@ -400,8 +400,8 @@ public boolean equals(Object other) { } /** - * Returns an integer hash code for the receiver. Any two - * objects that return <code>true</code> when passed to + * Returns an integer hash code for the receiver. Any two + * objects that return <code>true</code> when passed to * <code>equals</code> must return the same value for this * method. * diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/cocoa/org/eclipse/swt/browser/WebKit.java b/bundles/org.eclipse.swt/Eclipse SWT WebKit/cocoa/org/eclipse/swt/browser/WebKit.java index 33540550ca..1a4b462222 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/cocoa/org/eclipse/swt/browser/WebKit.java +++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/cocoa/org/eclipse/swt/browser/WebKit.java @@ -273,7 +273,7 @@ public void create (Composite parent, int style) { webView.setFrameLoadDelegate(delegate); webView.setResourceLoadDelegate(delegate); - webView.setUIDelegate(delegate); + webView.setUIDelegate(delegate); webView.setPolicyDelegate(delegate); webView.setDownloadDelegate(delegate); webView.setApplicationNameForUserAgent(NSString.stringWith(AGENT_STRING)); @@ -287,7 +287,7 @@ public void create (Composite parent, int style) { @Override public boolean back() { - html = null; + html = null; return webView.goBack(); } @@ -336,7 +336,7 @@ static long /*int*/ browserProc(long /*int*/ id, long /*int*/ sel, long /*int*/ } else if (sel == OS.sel_webView_setFrame_) { webKit.webView_setFrame(arg0, arg1); } else if (sel == OS.sel_webView_createWebViewWithRequest_) { - return webKit.webView_createWebViewWithRequest(arg0, arg1); + return webKit.webView_createWebViewWithRequest(arg0, arg1); } else if (sel == OS.sel_webView_setStatusBarVisible_) { webKit.webView_setStatusBarVisible(arg0, arg1 != 0); } else if (sel == OS.sel_webView_setResizable_) { @@ -461,7 +461,7 @@ boolean close (boolean showPrompters) { buffer.append ("if (str != null) { "); // $NON-NLS-1$ buffer.append ("var result = window.external.callRunBeforeUnloadConfirmPanelWithMessage(str);"); // $NON-NLS-1$ buffer.append ("if (!result) return false;}"); // $NON-NLS-1$ - } + } buffer.append ("} catch (e) {}}"); // $NON-NLS-1$ buffer.append ("try {for (var i = 0; i < win.frames.length; i++) {var result = "); // $NON-NLS-1$ buffer.append (functionName); @@ -606,7 +606,7 @@ public boolean setUrl(String url, String postData, String[] headers) { */ webView.setCustomUserAgent(NSString.stringWith(value)); } else { - request.setValue(NSString.stringWith(value), NSString.stringWith(key)); + request.setValue(NSString.stringWith(value), NSString.stringWith(key)); } } } @@ -679,13 +679,13 @@ void webView_didChangeLocationWithinPageForFrame(long /*int*/ sender, long /*int void webView_didFailProvisionalLoadWithError_forFrame(long /*int*/ sender, long /*int*/ error, long /*int*/ frame) { if (frame == webView.mainFrame().id) { /* - * Feature on WebKit. The identifier is used here as a marker for the events - * related to the top frame and the URL changes related to that top frame as + * Feature on WebKit. The identifier is used here as a marker for the events + * related to the top frame and the URL changes related to that top frame as * they should appear on the location bar of a browser. It is expected to reset - * the identifier to 0 when the event didFinishLoadingFromDataSource related to + * the identifier to 0 when the event didFinishLoadingFromDataSource related to * the identifierForInitialRequest event is received. However, WebKit fires * the didFinishLoadingFromDataSource event before the entire content of the - * top frame is loaded. It is possible to receive multiple willSendRequest + * top frame is loaded. It is possible to receive multiple willSendRequest * events in this interval, causing the Browser widget to send unwanted * Location.changing events. For this reason, the identifier is reset to 0 * when the top frame has either finished loading (didFinishLoadForFrame @@ -766,7 +766,7 @@ void webView_didFinishLoadForFrame(long /*int*/ sender, long /*int*/ frameID) { if (frameID == webView.mainFrame().id) { /* * If html is not null then there is html from a previous setText() call - * waiting to be set into the about:blank page once it has completed loading. + * waiting to be set into the about:blank page once it has completed loading. */ if (html != null) { if (getUrl().startsWith(ABOUT_BLANK)) { @@ -828,13 +828,13 @@ void webView_didFinishLoadForFrame(long /*int*/ sender, long /*int*/ frameID) { if (browser.isDisposed()) return; /* - * Feature on WebKit. The identifier is used here as a marker for the events - * related to the top frame and the URL changes related to that top frame as + * Feature on WebKit. The identifier is used here as a marker for the events + * related to the top frame and the URL changes related to that top frame as * they should appear on the location bar of a browser. It is expected to reset - * the identifier to 0 when the event didFinishLoadingFromDataSource related to + * the identifier to 0 when the event didFinishLoadingFromDataSource related to * the identifierForInitialRequest event is received. However, WebKit fires * the didFinishLoadingFromDataSource event before the entire content of the - * top frame is loaded. It is possible to receive multiple willSendRequest + * top frame is loaded. It is possible to receive multiple willSendRequest * events in this interval, causing the Browser widget to send unwanted * Location.changing events. For this reason, the identifier is reset to 0 * when the top frame has either finished loading (didFinishLoadForFrame @@ -889,7 +889,7 @@ void webView_didReceiveTitle_forFrame(long /*int*/ sender, long /*int*/ titleID, } void webView_didStartProvisionalLoadForFrame(long /*int*/ sender, long /*int*/ frameID) { - /* + /* * This code is intentionally commented. WebFrameLoadDelegate:didStartProvisionalLoadForFrame is * called before WebResourceLoadDelegate:willSendRequest and * WebFrameLoadDelegate:didCommitLoadForFrame. The resource count is reset when didCommitLoadForFrame @@ -927,7 +927,7 @@ void webView_didCommitLoadForFrame(long /*int*/ sender, long /*int*/ frameID) { boolean top = frameID == webView.mainFrame().id; if (top) { /* reset resource status variables */ - resourceCount = 0; + resourceCount = 0; this.url = url2; /* @@ -935,7 +935,7 @@ void webView_didCommitLoadForFrame(long /*int*/ sender, long /*int*/ frameID) { * twice, once for the initial navigate to about:blank, and once for the auto-navigate * to about:blank that WebKit does when loadHTMLString is invoked. If this is the * first webView_didCommitLoadForFrame callback received for a setText() invocation - * then do not send any events or re-install registered BrowserFunctions. + * then do not send any events or re-install registered BrowserFunctions. */ if (url2.startsWith(ABOUT_BLANK) && html != null) return; @@ -990,13 +990,13 @@ void webView_windowScriptObjectAvailable (long /*int*/ webView, long /*int*/ win void webView_resource_didFinishLoadingFromDataSource(long /*int*/ sender, long /*int*/ identifier, long /*int*/ dataSource) { /* - * Feature on WebKit. The identifier is used here as a marker for the events - * related to the top frame and the URL changes related to that top frame as + * Feature on WebKit. The identifier is used here as a marker for the events + * related to the top frame and the URL changes related to that top frame as * they should appear on the location bar of a browser. It is expected to reset - * the identifier to 0 when the event didFinishLoadingFromDataSource related to + * the identifier to 0 when the event didFinishLoadingFromDataSource related to * the identifierForInitialRequest event is received. However, WebKit fires * the didFinishLoadingFromDataSource event before the entire content of the - * top frame is loaded. It is possible to receive multiple willSendRequest + * top frame is loaded. It is possible to receive multiple willSendRequest * events in this interval, causing the Browser widget to send unwanted * Location.changing events. For this reason, the identifier is reset to 0 * when the top frame has either finished loading (didFinishLoadForFrame @@ -1008,13 +1008,13 @@ void webView_resource_didFinishLoadingFromDataSource(long /*int*/ sender, long / void webView_resource_didFailLoadingWithError_fromDataSource(long /*int*/ sender, long /*int*/ identifier, long /*int*/ error, long /*int*/ dataSource) { /* - * Feature on WebKit. The identifier is used here as a marker for the events - * related to the top frame and the URL changes related to that top frame as + * Feature on WebKit. The identifier is used here as a marker for the events + * related to the top frame and the URL changes related to that top frame as * they should appear on the location bar of a browser. It is expected to reset - * the identifier to 0 when the event didFinishLoadingFromDataSource related to + * the identifier to 0 when the event didFinishLoadingFromDataSource related to * the identifierForInitialRequest event is received. However, WebKit fires * the didFinishLoadingFromDataSource event before the entire content of the - * top frame is loaded. It is possible to receive multiple willSendRequest + * top frame is loaded. It is possible to receive multiple willSendRequest * events in this interval, causing the Browser widget to send unwanted * Location.changing events. For this reason, the identifier is reset to 0 * when the top frame has either finished loading (didFinishLoadForFrame @@ -1136,7 +1136,7 @@ boolean showAuthenticationDialog (final String[] user, final String[] password, password[0] = passwordText.getText(); result[0] = event.widget == buttons[1]; shell.close(); - } + } }; Composite composite = new Composite (shell, SWT.NONE); @@ -1182,7 +1182,7 @@ long /*int*/ webView_identifierForInitialRequest_fromDataSource(long /*int*/ sen if (frame.id == webView.mainFrame().id) this.identifier = identifier.id; } return identifier.id; - + } long /*int*/ webView_resource_willSendRequest_redirectResponse_fromDataSource(long /*int*/ sender, long /*int*/ identifier, long /*int*/ request, long /*int*/ redirectResponse, long /*int*/ dataSource) { @@ -1249,7 +1249,7 @@ void webViewShow(long /*int*/ sender) { * the address bar. The address bar is displayed * if the tool bar is displayed. There is no separate * notification for the address bar. - * + * * Feature of OSX. The menu bar is always displayed. * There is no notification to hide the menu bar. */ @@ -1466,7 +1466,7 @@ void webView_decidePolicyForNavigationAction_request_frame_decisionListener(long WebPolicyDecisionListener listener = new WebPolicyDecisionListener(listenerID); if (loadingText) { - /* + /* * WebKit is auto-navigating to about:blank in response to a loadHTMLString() * invocation. This navigate should always proceed without sending an event * since it is preceded by an explicit navigate to about:blank in setText(). @@ -1677,7 +1677,7 @@ void handleEvent(long /*int*/ evtId) { /* * Bug in WebKit. Spurious and redundant mousemove events are received in * various contexts, including following every MouseUp. The workaround is - * to not fire MouseMove events whose x and y values match the last MouseMove + * to not fire MouseMove events whose x and y values match the last MouseMove */ if (mouseEvent.x == lastMouseMoveX && mouseEvent.y == lastMouseMoveY) return; mouseEvent.type = SWT.MouseMove; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Color.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Color.java index f20e2675ce..f7de6cfea9 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Color.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Color.java @@ -16,10 +16,10 @@ import org.eclipse.swt.*; /** * Instances of this class manage the operating system resources that * implement SWT's RGB color model. To create a color you can either - * specify the individual color components as integers in the range - * 0 to 255 or provide an instance of an <code>RGB</code> or <code>RGBA</code>. + * specify the individual color components as integers in the range + * 0 to 255 or provide an instance of an <code>RGB</code> or <code>RGBA</code>. * <p> - * Application code must explicitly invoke the <code>Color.dispose()</code> + * Application code must explicitly invoke the <code>Color.dispose()</code> * method to release the operating system resources managed by each instance * when those instances are no longer required. * </p> @@ -33,7 +33,7 @@ import org.eclipse.swt.*; */ public final class Color extends Resource { /** - * the handle to the OS color resource + * the handle to the OS color resource * (Warning: This field is platform dependent) * <p> * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT @@ -41,7 +41,7 @@ public final class Color extends Resource { * within the packages provided by SWT. It is not available on all * platforms and should never be accessed from application code. * </p> - * + * * @noreference This field is not intended to be referenced by clients. */ public double /*float*/ [] handle; @@ -50,16 +50,16 @@ Color(Device device) { super(device); } -/** +/** * Constructs a new instance of this class given a device and the * desired red, green and blue values expressed as ints in the range * 0 to 255 (where 0 is black and 255 is full brightness). On limited * color devices, the color instance created by this call may not have * the same RGB values as the ones specified by the arguments. The - * RGB values on the returned instance will be the color values of + * RGB values on the returned instance will be the color values of * the operating system color. * <p> - * You must dispose the color when it is no longer required. + * You must dispose the color when it is no longer required. * </p> * * @param device the device on which to allocate the color @@ -80,16 +80,16 @@ public Color(Device device, int red, int green, int blue) { init(); } -/** +/** * Constructs a new instance of this class given a device and the * desired red, green, blue & alpha values expressed as ints in the range * 0 to 255 (where 0 is black and 255 is full brightness). On limited * color devices, the color instance created by this call may not have * the same RGB values as the ones specified by the arguments. The - * RGB values on the returned instance will be the color values of + * RGB values on the returned instance will be the color values of * the operating system color. * <p> - * You must dispose the color when it is no longer required. + * You must dispose the color when it is no longer required. * </p> * * @param device the device on which to allocate the color @@ -112,7 +112,7 @@ public Color(Device device, int red, int green, int blue, int alpha) { init(); } -/** +/** * Constructs a new instance of this class given a device and an * <code>RGB</code> describing the desired red, green and blue values. * On limited color devices, the color instance created by this call @@ -120,7 +120,7 @@ public Color(Device device, int red, int green, int blue, int alpha) { * argument. The RGB values on the returned instance will be the color * values of the operating system color. * <p> - * You must dispose the color when it is no longer required. + * You must dispose the color when it is no longer required. * </p> * * @param device the device on which to allocate the color @@ -141,7 +141,7 @@ public Color(Device device, RGB rgb) { init(); } -/** +/** * Constructs a new instance of this class given a device and an * <code>RGBA</code> describing the desired red, green, blue & alpha values. * On limited color devices, the color instance created by this call @@ -149,7 +149,7 @@ public Color(Device device, RGB rgb) { * argument. The RGBA values on the returned instance will be the color * values of the operating system color + alpha. * <p> - * You must dispose the color when it is no longer required. + * You must dispose the color when it is no longer required. * </p> * * @param device the device on which to allocate the color @@ -171,16 +171,16 @@ public Color(Device device, RGBA rgba) { init(); } -/** +/** * Constructs a new instance of this class given a device, an * <code>RGB</code> describing the desired red, green and blue values, - * alpha specifying the level of transparency. + * alpha specifying the level of transparency. * On limited color devices, the color instance created by this call * may not have the same RGB values as the ones specified by the * argument. The RGB values on the returned instance will be the color * values of the operating system color. * <p> - * You must dispose the color when it is no longer required. + * You must dispose the color when it is no longer required. * </p> * * @param device the device on which to allocate the color @@ -291,8 +291,8 @@ public int getRed() { } /** - * Returns an integer hash code for the receiver. Any two - * objects that return <code>true</code> when passed to + * Returns an integer hash code for the receiver. Any two + * objects that return <code>true</code> when passed to * <code>equals</code> must return the same value for this * method. * @@ -335,7 +335,7 @@ public RGBA getRGBA () { return new RGBA(getRed(), getGreen(), getBlue(), getAlpha()); } -/** +/** * Invokes platform specific functionality to allocate a new color. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public @@ -347,7 +347,7 @@ public RGBA getRGBA () { * * @param device the device on which to allocate the color * @param handle the handle for the color - * + * * @noreference This method is not intended to be referenced by clients. */ public static Color cocoa_new(Device device, double /*float*/ [] handle) { @@ -357,7 +357,7 @@ public static Color cocoa_new(Device device, double /*float*/ [] handle) { return color; } -/** +/** * Invokes platform specific functionality to allocate a new color. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public @@ -370,7 +370,7 @@ public static Color cocoa_new(Device device, double /*float*/ [] handle) { * @param device the device on which to allocate the color * @param handle the handle for the color * @param alpha the int for the alpha content in the color(Currently SWT honors extreme values for alpha ie. 0 or 255) - * + * * @noreference This method is not intended to be referenced by clients. */ public static Color cocoa_new(Device device, double /*float*/ [] handle, int alpha) { @@ -382,7 +382,7 @@ public static Color cocoa_new(Device device, double /*float*/ [] handle, int alp } /** - * Allocates the operating system resources associated + * Allocates the operating system resources associated * with the receiver. * * @param device the device on which to allocate the color diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Cursor.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Cursor.java index 1dba750be7..815ee8c812 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Cursor.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Cursor.java @@ -21,7 +21,7 @@ import org.eclipse.swt.*; * describing one of the standard operating system provided cursors * or the image and mask data for the desired appearance. * <p> - * Application code must explicitly invoke the <code>Cursor.dispose()</code> + * Application code must explicitly invoke the <code>Cursor.dispose()</code> * method to release the operating system resources managed by each instance * when those instances are no longer required. * </p> @@ -42,45 +42,45 @@ import org.eclipse.swt.*; * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public final class Cursor extends Resource { - + static final byte[] WAIT_SOURCE = new byte[] { - (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, - (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, - (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, - (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, - (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, - (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, - (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, - (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, - (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, - (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, - (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, - (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, - (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, - (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, - (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, - (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, }; - + static final byte[] SHADOWED_IBEAM_SOURCE = new byte[] { - (byte)0x55, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x55, (byte)0x55, (byte)0x55, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x55, (byte)0x55, (byte)0x55, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, - (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, - (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, - (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, - (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, - (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, - (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, - (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, - (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, - (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, - (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, - (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, - (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, - (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, - (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, - (byte)0x55, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x55, (byte)0x55, (byte)0x55, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x55, (byte)0x55, (byte)0x55, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x55, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x55, (byte)0x55, (byte)0x55, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x55, (byte)0x55, (byte)0x55, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x55, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x55, (byte)0x55, (byte)0x55, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xAA, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x55, (byte)0x55, (byte)0x55, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, }; - + /** * the handle to the OS cursor resource * (Warning: This field is platform dependent) @@ -90,7 +90,7 @@ public final class Cursor extends Resource { * within the packages provided by SWT. It is not available on all * platforms and should never be accessed from application code. * </p> - * + * * @noreference This field is not intended to be referenced by clients. */ public NSCursor handle; @@ -102,20 +102,20 @@ Cursor(Device device) { super(device); } -/** +/** * Constructs a new cursor given a device and a style * constant describing the desired cursor appearance. * <p> - * You must dispose the cursor when it is no longer required. + * You must dispose the cursor when it is no longer required. * </p> * NOTE: * It is recommended to use {@link org.eclipse.swt.widgets.Display#getSystemCursor(int)} - * instead of using this constructor. This way you can avoid the + * instead of using this constructor. This way you can avoid the * overhead of disposing the Cursor resource. * * @param device the device on which to allocate the cursor * @param style the style of cursor to allocate - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li> * <li>ERROR_INVALID_ARGUMENT - when an unknown style is specified</li> @@ -189,7 +189,7 @@ public Cursor(Device device, int style) { size.width = width; size.height = height; nsImage = nsImage.initWithSize(size); - nsImageRep = nsImageRep.initWithBitmapDataPlanes(0, width, height, 8, 4, true, false, OS.NSDeviceRGBColorSpace, + nsImageRep = nsImageRep.initWithBitmapDataPlanes(0, width, height, 8, 4, true, false, OS.NSDeviceRGBColorSpace, OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, width*4, 32); NSPoint point = new NSPoint(); if (style == SWT.CURSOR_WAIT) { @@ -212,7 +212,7 @@ public Cursor(Device device, int style) { } } -/** +/** * Constructs a new cursor given a device, image and mask * data describing the desired cursor appearance, and the x * and y coordinates of the <em>hotspot</em> (that is, the point @@ -223,7 +223,7 @@ public Cursor(Device device, int style) { * must be an ImageData representing an icon that specifies both * color data and mask data. * <p> - * You must dispose the cursor when it is no longer required. + * You must dispose the cursor when it is no longer required. * </p> * * @param device the device on which to allocate the cursor @@ -236,13 +236,13 @@ public Cursor(Device device, int style) { * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li> * <li>ERROR_NULL_ARGUMENT - if the source is null</li> * <li>ERROR_NULL_ARGUMENT - if the mask is null and the source does not have a mask</li> - * <li>ERROR_INVALID_ARGUMENT - if the source and the mask are not the same + * <li>ERROR_INVALID_ARGUMENT - if the source and the mask are not the same * size, or if the hotspot is outside the bounds of the image</li> * </ul> * @exception SWTError <ul> * <li>ERROR_NO_HANDLES - if a handle could not be obtained for cursor creation</li> * </ul> - * + * * @see #dispose() */ public Cursor(Device device, ImageData source, ImageData mask, int hotspotX, int hotspotY) { @@ -319,14 +319,14 @@ void createNSCursor(int hotspotX, int hotspotY, byte[] buffer, int width, int he nsImage.release(); } -/** +/** * Constructs a new cursor given a device, image data describing * the desired cursor appearance, and the x and y coordinates of * the <em>hotspot</em> (that is, the point within the area * covered by the cursor which is considered to be where the * on-screen pointer is "pointing"). * <p> - * You must dispose the cursor when it is no longer required. + * You must dispose the cursor when it is no longer required. * </p> * * @param device the device on which to allocate the cursor @@ -343,9 +343,9 @@ void createNSCursor(int hotspotX, int hotspotY, byte[] buffer, int width, int he * @exception SWTError <ul> * <li>ERROR_NO_HANDLES - if a handle could not be obtained for cursor creation</li> * </ul> - * + * * @see #dispose() - * + * * @since 3.0 */ public Cursor(Device device, ImageData source, int hotspotX, int hotspotY) { @@ -360,7 +360,7 @@ public Cursor(Device device, ImageData source, int hotspotX, int hotspotY) { if (palette.isDirect) { ImageData.blit(ImageData.BLIT_SRC, source.data, source.depth, source.bytesPerLine, source.getByteOrder(), 0, 0, source.width, source.height, palette.redMask, palette.greenMask, palette.blueMask, - ImageData.ALPHA_OPAQUE, null, 0, 0, 0, + ImageData.ALPHA_OPAQUE, null, 0, 0, 0, data, 32, source.width * 4, ImageData.MSB_FIRST, 0, 0, source.width, source.height, 0xFF0000, 0xFF00, 0xFF, false, false); } else { @@ -397,7 +397,7 @@ public Cursor(Device device, ImageData source, int hotspotX, int hotspotY) { } else if (source.alpha != -1) { byte alpha = (byte)source.alpha; for (int i=0; i<data.length; i+=4) { - data[i] = alpha; + data[i] = alpha; } } else if (source.alphaData != null) { byte[] alphaData = source.alphaData; @@ -440,8 +440,8 @@ public boolean equals (Object object) { } /** - * Returns an integer hash code for the receiver. Any two - * objects that return <code>true</code> when passed to + * Returns an integer hash code for the receiver. Any two + * objects that return <code>true</code> when passed to * <code>equals</code> must return the same value for this * method. * @@ -481,7 +481,7 @@ public String toString () { return "Cursor {" + handle + "}"; } -/** +/** * Invokes platform specific functionality to allocate a new cursor. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public @@ -493,7 +493,7 @@ public String toString () { * * @param device the device on which to allocate the color * @param handle the handle for the cursor - * + * * @noreference This method is not intended to be referenced by clients. */ public static Cursor cocoa_new(Device device, NSCursor handle) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Device.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Device.java index 0f47db142a..72857e0a75 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Device.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Device.java @@ -22,7 +22,7 @@ import org.eclipse.swt.internal.cocoa.*; * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public abstract class Device implements Drawable { - + /* Debugging */ public static boolean DEBUG; boolean debug = DEBUG; @@ -30,10 +30,10 @@ public abstract class Device implements Drawable { Error [] errors; Object [] objects; Object trackingLock; - + /* Disposed flag */ boolean disposed, warnings; - + Color COLOR_BLACK, COLOR_DARK_RED, COLOR_DARK_GREEN, COLOR_DARK_YELLOW, COLOR_DARK_BLUE; Color COLOR_DARK_MAGENTA, COLOR_DARK_CYAN, COLOR_GRAY, COLOR_DARK_GRAY, COLOR_RED, COLOR_TRANSPARENT; Color COLOR_GREEN, COLOR_YELLOW, COLOR_BLUE, COLOR_MAGENTA, COLOR_CYAN, COLOR_WHITE; @@ -42,10 +42,10 @@ public abstract class Device implements Drawable { Font systemFont; NSMutableParagraphStyle paragraphStyle; - + /* Device DPI */ Point dpi; - + /* * TEMPORARY CODE. When a graphics object is * created and the device parameter is null, @@ -62,7 +62,7 @@ public abstract class Device implements Drawable { try { Class.forName ("org.eclipse.swt.widgets.Display"); } catch (ClassNotFoundException e) {} - } + } /* * TEMPORARY CODE. @@ -77,12 +77,12 @@ static synchronized Device getDevice () { /** * Constructs a new instance of this class. * <p> - * You must dispose the device when it is no longer required. + * You must dispose the device when it is no longer required. * </p> * * @see #create * @see #init - * + * * @since 3.1 */ public Device() { @@ -92,7 +92,7 @@ public Device() { /** * Constructs a new instance of this class. * <p> - * You must dispose the device when it is no longer required. + * You must dispose the device when it is no longer required. * </p> * * @param data the DeviceData which describes the receiver @@ -289,7 +289,7 @@ public DeviceData getDeviceData () { /** * Returns a rectangle which describes the area of the * receiver which is capable of displaying data. - * + * * @return the client area * * @exception SWTException <ul> @@ -306,7 +306,7 @@ public Rectangle getClientArea () { /** * Returns the bit depth of the screen, which is the number of * bits it takes to represent the number of unique colors that - * the screen is currently capable of displaying. This number + * the screen is currently capable of displaying. This number * will typically be one of 1, 8, 15, 16, 24 or 32. * * @return the depth of the screen @@ -316,7 +316,7 @@ public Rectangle getClientArea () { * </ul> */ public int getDepth () { - checkDevice (); + checkDevice (); return (int)/*64*/OS.NSBitsPerPixelFromDepth(getPrimaryScreen().depth()); } @@ -518,7 +518,7 @@ public boolean getWarnings () { * If subclasses reimplement this method, they must * call the <code>super</code> implementation. * </p> - * + * * @see #create */ protected void init () { @@ -540,24 +540,24 @@ protected void init () { COLOR_MAGENTA = new Color (this, 0xFF,0,0xFF); COLOR_CYAN = new Color (this, 0,0xFF,0xFF); COLOR_WHITE = new Color (this, 0xFF,0xFF,0xFF); - + paragraphStyle = (NSMutableParagraphStyle)new NSMutableParagraphStyle().alloc().init(); paragraphStyle.setAlignment(OS.NSLeftTextAlignment); paragraphStyle.setLineBreakMode(OS.NSLineBreakByClipping); NSArray tabs = new NSArray(new NSArray().alloc().init()); paragraphStyle.setTabStops(tabs); tabs.release(); - + /* Initialize the system font slot */ boolean smallFonts = System.getProperty("org.eclipse.swt.internal.carbon.smallFonts") != null; - double /*float*/ systemFontSize = smallFonts ? NSFont.smallSystemFontSize() : NSFont.systemFontSize(); + double /*float*/ systemFontSize = smallFonts ? NSFont.smallSystemFontSize() : NSFont.systemFontSize(); Point dpi = this.dpi = getDPI(), screenDPI = getScreenDPI(); NSFont font = NSFont.systemFontOfSize(systemFontSize * dpi.y / screenDPI.y); font.retain(); systemFont = Font.cocoa_new(this, font); } -/** +/** * Invokes platform specific functionality to allocate a new GC handle. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public @@ -567,14 +567,14 @@ protected void init () { * application code. * </p> * - * @param data the platform specific GC data + * @param data the platform specific GC data * @return the platform specific GC handle - * + * * @noreference This method is not intended to be referenced by clients. */ public abstract long /*int*/ internal_new_GC (GCData data); -/** +/** * Invokes platform specific functionality to dispose a GC handle. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public @@ -585,8 +585,8 @@ public abstract long /*int*/ internal_new_GC (GCData data); * </p> * * @param hDC the platform specific GC handle - * @param data the platform specific GC data - * + * @param data the platform specific GC data + * * @noreference This method is not intended to be referenced by clients. */ public abstract void internal_dispose_GC (long /*int*/ hDC, GCData data); @@ -620,7 +620,7 @@ public boolean isDisposed () { * </ul> * * @see Font - * + * * @since 3.3 */ public boolean loadFont (String path) { @@ -629,7 +629,7 @@ public boolean loadFont (String path) { boolean result = false; NSString nsPath = NSString.stringWith(path); long /*int*/ fsRepresentation = nsPath.fileSystemRepresentation(); - + if (fsRepresentation != 0) { byte [] fsRef = new byte [80]; boolean [] isDirectory = new boolean[1]; @@ -735,7 +735,7 @@ void printErrors () { protected void release () { if (paragraphStyle != null) paragraphStyle.release(); paragraphStyle = null; - + if (systemFont != null) systemFont.dispose(); systemFont = null; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Font.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Font.java index 29a5d1bb7c..5ea2b84de6 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Font.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Font.java @@ -20,7 +20,7 @@ import org.eclipse.swt.*; * by providing a device and either name, size and style information * or a <code>FontData</code> object which encapsulates this data. * <p> - * Application code must explicitly invoke the <code>Font.dispose()</code> + * Application code must explicitly invoke the <code>Font.dispose()</code> * method to release the operating system resources managed by each instance * when those instances are no longer required. * </p> @@ -41,11 +41,11 @@ public final class Font extends Resource { * within the packages provided by SWT. It is not available on all * platforms and should never be accessed from application code. * </p> - * + * * @noreference This field is not intended to be referenced by clients. */ public NSFont handle; - + /** * the traits not supported to the OS font resource * (Warning: This field is platform dependent) @@ -55,17 +55,17 @@ public final class Font extends Resource { * within the packages provided by SWT. It is not available on all * platforms and should never be accessed from application code. * </p> - * + * * @noreference This field is not intended to be referenced by clients. */ public int extraTraits; - + /** * FontMetrics of this font. This has to be calculated by GC, so it's more * efficient to do it once and store it with the Font. */ FontMetrics metrics = null; - + static final double SYNTHETIC_BOLD = -2.5; static final double SYNTHETIC_ITALIC = 0.2; @@ -73,16 +73,16 @@ Font(Device device) { super(device); } -/** +/** * Constructs a new font given a device and font data * which describes the desired font's appearance. * <p> - * You must dispose the font when it is no longer required. + * You must dispose the font when it is no longer required. * </p> * * @param device the device to create the font on * @param fd the FontData that describes the desired font (must not be null) - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li> * <li>ERROR_NULL_ARGUMENT - if the fd argument is null</li> @@ -90,7 +90,7 @@ Font(Device device) { * @exception SWTError <ul> * <li>ERROR_NO_HANDLES - if a font could not be created from the given font data</li> * </ul> - * + * * @see #dispose() */ public Font(Device device, FontData fd) { @@ -106,17 +106,17 @@ public Font(Device device, FontData fd) { } } -/** +/** * Constructs a new font given a device and an array * of font data which describes the desired font's * appearance. * <p> - * You must dispose the font when it is no longer required. + * You must dispose the font when it is no longer required. * </p> * * @param device the device to create the font on * @param fds the array of FontData that describes the desired font (must not be null) - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li> * <li>ERROR_NULL_ARGUMENT - if the fds argument is null</li> @@ -126,9 +126,9 @@ public Font(Device device, FontData fd) { * @exception SWTError <ul> * <li>ERROR_NO_HANDLES - if a font could not be created from the given font data</li> * </ul> - * + * * @see #dispose() - * + * * @since 2.1 */ public Font(Device device, FontData[] fds) { @@ -149,19 +149,19 @@ public Font(Device device, FontData[] fds) { } } -/** +/** * Constructs a new font given a device, a font name, * the height of the desired font in points, and a font * style. * <p> - * You must dispose the font when it is no longer required. + * You must dispose the font when it is no longer required. * </p> * * @param device the device to create the font on * @param name the name of the font (must not be null) * @param height the font height in points * @param style a bit or combination of NORMAL, BOLD, ITALIC - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li> * <li>ERROR_NULL_ARGUMENT - if the name argument is null</li> @@ -170,7 +170,7 @@ public Font(Device device, FontData[] fds) { * @exception SWTError <ul> * <li>ERROR_NO_HANDLES - if a font could not be created from the given arguments</li> * </ul> - * + * * @see #dispose() */ public Font(Device device, String name, int height, int style) { @@ -236,8 +236,8 @@ public boolean equals(Object object) { /** * Returns an array of <code>FontData</code>s representing the receiver. - * On Windows, only one FontData will be returned per font. On X however, - * a <code>Font</code> object <em>may</em> be composed of multiple X + * On Windows, only one FontData will be returned per font. On X however, + * a <code>Font</code> object <em>may</em> be composed of multiple X * fonts. To support this case, we return an array of font data objects. * * @return an array of font data objects describing the receiver @@ -271,7 +271,7 @@ public FontData[] getFontData() { } } -/** +/** * Invokes platform specific functionality to allocate a new font. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public @@ -283,7 +283,7 @@ public FontData[] getFontData() { * * @param device the device on which to allocate the color * @param handle the handle for the font - * + * * @noreference This method is not intended to be referenced by clients. */ public static Font cocoa_new(Device device, NSFont handle) { @@ -293,8 +293,8 @@ public static Font cocoa_new(Device device, NSFont handle) { } /** - * Returns an integer hash code for the receiver. Any two - * objects that return <code>true</code> when passed to + * Returns an integer hash code for the receiver. Any two + * objects that return <code>true</code> when passed to * <code>equals</code> must return the same value for this * method. * diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/FontData.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/FontData.java index 6f3500e9dc..4223464989 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/FontData.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/FontData.java @@ -48,7 +48,7 @@ public final class FontData { * within the packages provided by SWT. It is not available on all * platforms and should never be accessed from application code. * </p> - * + * * @noreference This field is not intended to be referenced by clients. */ public String name; @@ -62,7 +62,7 @@ public final class FontData { * within the packages provided by SWT. It is not available on all * platforms and should never be accessed from application code. * </p> - * + * * @noreference This field is not intended to be referenced by clients. */ public float height; @@ -76,7 +76,7 @@ public final class FontData { * within the packages provided by SWT. It is not available on all * platforms and should never be accessed from application code. * </p> - * + * * @noreference This field is not intended to be referenced by clients. */ public int style; @@ -90,7 +90,7 @@ public final class FontData { * within the packages provided by SWT. It is not available on all * platforms and should never be accessed from application code. * </p> - * + * * @noreference This field is not intended to be referenced by clients. */ public String nsName; @@ -99,8 +99,8 @@ public final class FontData { * The locales of the font */ String lang, country, variant; - -/** + +/** * Constructs a new uninitialized font data. */ public FontData () { @@ -113,7 +113,7 @@ public FontData () { * method. * <p> * Note that the representation varies between platforms, - * and a FontData can only be created from a string that was + * and a FontData can only be created from a string that was * generated on the same platform. * </p> * @@ -133,16 +133,16 @@ public FontData(String string) { if (end == -1) SWT.error(SWT.ERROR_INVALID_ARGUMENT); String version1 = string.substring(start, end); try { - if (Integer.parseInt(version1) != 1) SWT.error(SWT.ERROR_INVALID_ARGUMENT); + if (Integer.parseInt(version1) != 1) SWT.error(SWT.ERROR_INVALID_ARGUMENT); } catch (NumberFormatException e) { SWT.error(SWT.ERROR_INVALID_ARGUMENT); } - + start = end + 1; end = string.indexOf('|', start); if (end == -1) SWT.error(SWT.ERROR_INVALID_ARGUMENT); String name = string.substring(start, end); - + start = end + 1; end = string.indexOf('|', start); if (end == -1) SWT.error(SWT.ERROR_INVALID_ARGUMENT); @@ -152,7 +152,7 @@ public FontData(String string) { } catch (NumberFormatException e) { SWT.error(SWT.ERROR_INVALID_ARGUMENT); } - + start = end + 1; end = string.indexOf('|', start); if (end == -1) SWT.error(SWT.ERROR_INVALID_ARGUMENT); @@ -183,9 +183,9 @@ public FontData(String string) { } } -/** +/** * Constructs a new font data given a font name, - * the height of the desired font in points, + * the height of the desired font in points, * and a font style. * * @param name the name of the font (must not be null) @@ -255,7 +255,7 @@ public int getHeight() { * given language/country locale, the variant portion of the * locale will determine the character set. * </p> - * + * * @return the <code>String</code> representing a Locale object * @since 3.0 */ @@ -273,14 +273,14 @@ public String getLocale () { if (variant != null) { buffer.append (variant); } - + String result = buffer.toString (); int length = result.length (); if (length > 0) { if (result.charAt (length - 1) == sep) { result = result.substring (0, length - 1); } - } + } return result; } @@ -298,12 +298,12 @@ public String getName() { } /** - * Returns the style of the receiver which is a bitwise OR of + * Returns the style of the receiver which is a bitwise OR of * one or more of the <code>SWT</code> constants NORMAL, BOLD * and ITALIC. * * @return the style of this <code>FontData</code> - * + * * @see #setStyle */ public int getStyle() { @@ -311,8 +311,8 @@ public int getStyle() { } /** - * Returns an integer hash code for the receiver. Any two - * objects that return <code>true</code> when passed to + * Returns an integer hash code for the receiver. Any two + * objects that return <code>true</code> when passed to * <code>equals</code> must return the same value for this * method. * @@ -335,7 +335,7 @@ public int hashCode () { * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the height is negative</li> * </ul> - * + * * @see #getHeight */ public void setHeight(int height) { @@ -361,7 +361,7 @@ public void setHeight(int height) { * given language/country locale, the variant portion of the * locale will determine the character set. * </p> - * + * * @param locale the <code>String</code> representing a Locale object * @see java.util.Locale#toString */ @@ -371,7 +371,7 @@ public void setLocale(String locale) { char sep = '_'; int length = locale.length(); int firstSep, secondSep; - + firstSep = locale.indexOf(sep); if (firstSep == -1) { firstSep = secondSep = length; @@ -382,7 +382,7 @@ public void setLocale(String locale) { if (firstSep > 0) lang = locale.substring(0, firstSep); if (secondSep > firstSep + 1) country = locale.substring(firstSep + 1, secondSep); if (length > secondSep + 1) variant = locale.substring(secondSep + 1); - } + } } /** @@ -399,7 +399,7 @@ public void setLocale(String locale) { * </p> * <p> * On platforms that do not support font foundries, only the face name - * (for example, "courier") is used in <code>setName()</code> and + * (for example, "courier") is used in <code>setName()</code> and * <code>getName()</code>. * </p> * @@ -418,7 +418,7 @@ public void setName(String name) { /** * Sets the style of the receiver to the argument which must - * be a bitwise OR of one or more of the <code>SWT</code> + * be a bitwise OR of one or more of the <code>SWT</code> * constants NORMAL, BOLD and ITALIC. All other style bits are * ignored. * @@ -433,7 +433,7 @@ public void setStyle(int style) { /** * Returns a string representation of the receiver which is suitable - * for constructing an equivalent instance using the + * for constructing an equivalent instance using the * <code>FontData(String)</code> constructor. * * @return a string representation of the FontData diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/FontMetrics.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/FontMetrics.java index ce992d490f..1f550484d3 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/FontMetrics.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/FontMetrics.java @@ -59,7 +59,7 @@ public boolean equals (Object object) { /** * Returns the ascent of the font described by the receiver. A - * font's <em>ascent</em> is the distance from the baseline to the + * font's <em>ascent</em> is the distance from the baseline to the * top of actual characters, not including any of the leading area, * measured in pixels. * @@ -92,7 +92,7 @@ public int getDescent() { } /** - * Returns the height of the font described by the receiver, + * Returns the height of the font described by the receiver, * measured in pixels. A font's <em>height</em> is the sum of * its ascent, descent and leading area. * @@ -118,8 +118,8 @@ public int getLeading() { } /** - * Returns an integer hash code for the receiver. Any two - * objects that return <code>true</code> when passed to + * Returns an integer hash code for the receiver. Any two + * objects that return <code>true</code> when passed to * <code>equals</code> must return the same value for this * method. * @@ -141,8 +141,8 @@ String getName () { @Override public String toString() { - return getName() + - "{" + return getName() + + "{" + " ascent=" + ascent + " descent=" + descent + " averageCharWidth=" + averageCharWidth diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java index 218862eb60..5222eeeaee 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java @@ -15,20 +15,20 @@ import org.eclipse.swt.internal.*; import org.eclipse.swt.internal.cocoa.*; /** - * Class <code>GC</code> is where all of the drawing capabilities that are - * supported by SWT are located. Instances are used to draw on either an + * Class <code>GC</code> is where all of the drawing capabilities that are + * supported by SWT are located. Instances are used to draw on either an * <code>Image</code>, a <code>Control</code>, or directly on a <code>Display</code>. * <dl> * <dt><b>Styles:</b></dt> * <dd>LEFT_TO_RIGHT, RIGHT_TO_LEFT</dd> * </dl> - * + * * <p> * The SWT drawing coordinate system is the two-dimensional space with the origin * (0,0) at the top left corner of the drawing area and with (x,y) values increasing * to the right and downward respectively. * </p> - * + * * <p> * The result of drawing on an image that was created with an indexed * palette using a color that is not in the palette is platform specific. @@ -36,15 +36,15 @@ import org.eclipse.swt.internal.cocoa.*; * the color itself. This happens because the allocated image might use * a direct palette on platforms that do not support indexed palette. * </p> - * + * * <p> - * Application code must explicitly invoke the <code>GC.dispose()</code> + * Application code must explicitly invoke the <code>GC.dispose()</code> * method to release the operating system resources managed by each instance * when those instances are no longer required. This is <em>particularly</em> * important on Windows95 and Windows98 where the operating system has a limited * number of device contexts available. * </p> - * + * * <p> * Note: Only one of LEFT_TO_RIGHT and RIGHT_TO_LEFT may be specified. * </p> @@ -64,11 +64,11 @@ public final class GC extends Resource { * within the packages provided by SWT. It is not available on all * platforms and should never be accessed from application code. * </p> - * + * * @noreference This field is not intended to be referenced by clients. */ public NSGraphicsContext handle; - + Drawable drawable; GCData data; @@ -77,7 +77,7 @@ public final class GC extends Resource { byte[] types; double /*float*/[] points; double /*float*/ [] point; - + static final int TAB_COUNT = 32; final static int FOREGROUND = 1 << 0; @@ -108,13 +108,13 @@ public final class GC extends Resource { GC() { } -/** +/** * Constructs a new instance of this class which has been * configured to draw on the specified drawable. Sets the * foreground color, background color and font in the GC * to match those in the drawable. * <p> - * You must dispose the graphics context when it is no longer required. + * You must dispose the graphics context when it is no longer required. * </p> * @param drawable the drawable to draw on * @exception IllegalArgumentException <ul> @@ -135,18 +135,18 @@ public GC(Drawable drawable) { this(drawable, 0); } -/** +/** * Constructs a new instance of this class which has been * configured to draw on the specified drawable. Sets the * foreground color, background color and font in the GC * to match those in the drawable. * <p> - * You must dispose the graphics context when it is no longer required. + * You must dispose the graphics context when it is no longer required. * </p> - * + * * @param drawable the drawable to draw on * @param style the style of GC to construct - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the drawable is null</li> * <li>ERROR_NULL_ARGUMENT - if there is no current device</li> @@ -159,9 +159,9 @@ public GC(Drawable drawable) { * <li>ERROR_NO_HANDLES if a handle could not be obtained for GC creation</li> * <li>ERROR_THREAD_INVALID_ACCESS if not called from the thread that created the drawable</li> * </ul> - * + * * @see #dispose() - * + * * @since 2.1.2 */ public GC(Drawable drawable, int style) { @@ -188,7 +188,7 @@ static int checkStyle (int style) { return style & (SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT); } -/** +/** * Invokes platform specific functionality to allocate a new graphics context. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public @@ -281,9 +281,9 @@ NSAutoreleasePool checkGC (int mask) { int state = data.state; if ((state & mask) == mask) return pool; - state = (state ^ mask) & mask; + state = (state ^ mask) & mask; data.state |= mask; - + if ((state & FOREGROUND) != 0) { Pattern pattern = data.foregroundPattern; if (pattern != null) { @@ -408,7 +408,7 @@ NSAutoreleasePool checkGC (int mask) { * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the image is null</li> - * <li>ERROR_INVALID_ARGUMENT - if the image is not a bitmap or has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the image is not a bitmap or has been disposed</li> * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> @@ -425,7 +425,7 @@ public void copyArea(Image image, int x, int y) { NSSize srcSize = data.image.handle.size(); int imgHeight = (int)srcSize.height; int destWidth = (int)srcSize.width - x, destHeight = (int)srcSize.height - y; - int srcWidth = destWidth, srcHeight = destHeight; + int srcWidth = destWidth, srcHeight = destHeight; NSGraphicsContext context = NSGraphicsContext.graphicsContextWithBitmapImageRep(image.getRepresentation()); NSGraphicsContext.static_saveGraphicsState(); NSGraphicsContext.setCurrentContext(context); @@ -541,7 +541,7 @@ public void copyArea(Image image, int x, int y) { } OS.free(displays); OS.free(countPtr); - } + } } finally { uncheckGC(pool); } @@ -610,8 +610,8 @@ public void copyArea(int srcX, int srcY, int width, int height, int destX, int d * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * - * @since 3.1 + * + * @since 3.1 */ public void copyArea(int srcX, int srcY, int width, int height, int destX, int destY, boolean paint) { if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); @@ -683,14 +683,14 @@ public void copyArea(int srcX, int srcY, int width, int height, int destX, int d view.setNeedsDisplayInRect(damage); } } - + NSRect srcRect = new NSRect(); srcRect.x = srcX; srcRect.y = srcY; srcRect.width = width; srcRect.height = height; OS.NSIntersectionRect(visibleRect, visibleRect, srcRect); - + if (!OS.NSEqualRects(visibleRect, srcRect)) { if (srcRect.x != visibleRect.x) { damage.x = srcRect.x + deltaX; @@ -698,7 +698,7 @@ public void copyArea(int srcX, int srcY, int width, int height, int destX, int d damage.width = visibleRect.x - srcRect.x; damage.height = srcRect.height; view.setNeedsDisplayInRect(damage); - } + } if (visibleRect.x + visibleRect.width != srcRect.x + srcRect.width) { damage.x = srcRect.x + visibleRect.width + deltaX; damage.y = srcRect.y + deltaY; @@ -723,7 +723,7 @@ public void copyArea(int srcX, int srcY, int width, int height, int destX, int d } } return; - } + } } finally { uncheckGC(pool); } @@ -746,8 +746,8 @@ static long /*int*/ createCGPathRef(NSBezierPath nsPath) { break; case OS.NSLineToBezierPathElement: OS.memmove(pt, points, NSPoint.sizeof); - OS.CGPathAddLineToPoint(cgPath, 0, pt[0], pt[1]); - break; + OS.CGPathAddLineToPoint(cgPath, 0, pt[0], pt[1]); + break; case OS.NSCurveToBezierPathElement: OS.memmove(pt, points, NSPoint.sizeof * 3); OS.CGPathAddCurveToPoint(cgPath, 0, pt[0], pt[1], pt[2], pt[3], pt[4], pt[5]); @@ -907,7 +907,7 @@ NSBezierPath createNSBezierPath (long /*int*/ cgPath) { types = null; points = null; nsPoint = null; - return bezierPath; + return bezierPath; } @Override @@ -932,7 +932,7 @@ void destroy() { data.path = data.clipPath = data.visiblePath = null; data.transform = data.inverseTransform = null; data.fg = data.bg = null; - + /* Dispose the GC */ if (drawable != null) drawable.internal_dispose_GC(handle.id, data); handle.restoreGraphicsState(); @@ -945,18 +945,18 @@ void destroy() { } /** - * Draws the outline of a circular or elliptical arc + * Draws the outline of a circular or elliptical arc * within the specified rectangular area. * <p> - * The resulting arc begins at <code>startAngle</code> and extends + * The resulting arc begins at <code>startAngle</code> and extends * for <code>arcAngle</code> degrees, using the current color. * Angles are interpreted such that 0 degrees is at the 3 o'clock * position. A positive value indicates a counter-clockwise rotation * while a negative value indicates a clockwise rotation. * </p><p> - * The center of the arc is the center of the rectangle whose origin - * is (<code>x</code>, <code>y</code>) and whose size is specified by the - * <code>width</code> and <code>height</code> arguments. + * The center of the arc is the center of the rectangle whose origin + * is (<code>x</code>, <code>y</code>) and whose size is specified by the + * <code>width</code> and <code>height</code> arguments. * </p><p> * The resulting arc covers an area <code>width + 1</code> pixels wide * by <code>height + 1</code> pixels tall. @@ -1011,7 +1011,7 @@ public void drawArc(int x, int y, int width, int height, int startAngle, int arc } } -/** +/** * Draws a rectangle, based on the specified arguments, which has * the appearance of the platform's <em>focus rectangle</em> if the * platform supports such a notion, and otherwise draws a simple @@ -1157,8 +1157,8 @@ void drawImage(Image srcImage, int srcX, int srcY, int srcWidth, int srcHeight, } } -/** - * Draws a line, using the foreground color, between the points +/** + * Draws a line, using the foreground color, between the points * (<code>x1</code>, <code>y1</code>) and (<code>x2</code>, <code>y2</code>). * * @param x1 the first point's x coordinate @@ -1199,15 +1199,15 @@ public void drawLine(int x1, int y1, int x2, int y2) { } } -/** +/** * Draws the outline of an oval, using the foreground color, * within the specified rectangular area. * <p> - * The result is a circle or ellipse that fits within the - * rectangle specified by the <code>x</code>, <code>y</code>, - * <code>width</code>, and <code>height</code> arguments. - * </p><p> - * The oval covers an area that is <code>width + 1</code> + * The result is a circle or ellipse that fits within the + * rectangle specified by the <code>x</code>, <code>y</code>, + * <code>width</code>, and <code>height</code> arguments. + * </p><p> + * The oval covers an area that is <code>width + 1</code> * pixels wide and <code>height + 1</code> pixels tall. * </p> * @@ -1252,14 +1252,14 @@ public void drawOval(int x, int y, int width, int height) { } } -/** +/** * Draws the path described by the parameter. * <p> * This operation requires the operating system's advanced * graphics subsystem which may not be available on some * platforms. * </p> - * + * * @param path the path to draw * * @exception IllegalArgumentException <ul> @@ -1270,9 +1270,9 @@ public void drawOval(int x, int y, int width, int height) { * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li> * </ul> - * + * * @see Path - * + * * @since 3.1 */ public void drawPath(Path path) { @@ -1301,7 +1301,7 @@ public void drawPath(Path path) { } } -/** +/** * Draws a pixel, using the foreground color, at the specified * point (<code>x</code>, <code>y</code>). * <p> @@ -1315,7 +1315,7 @@ public void drawPath(Path path) { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @since 3.0 */ public void drawPoint(int x, int y) { @@ -1336,9 +1336,9 @@ public void drawPoint(int x, int y) { } } -/** +/** * Draws the closed polygon which is defined by the specified array - * of integer coordinates, using the receiver's foreground color. The array + * of integer coordinates, using the receiver's foreground color. The array * contains alternating x and y values which are considered to represent * points which are the vertices of the polygon. Lines are drawn between * each consecutive pair, and between the first pair and last pair in the @@ -1348,7 +1348,7 @@ public void drawPoint(int x, int y) { * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT if pointArray is null</li> - * </ul> + * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> @@ -1385,9 +1385,9 @@ public void drawPolygon(int[] pointArray) { } } -/** +/** * Draws the polyline which is defined by the specified array - * of integer coordinates, using the receiver's foreground color. The array + * of integer coordinates, using the receiver's foreground color. The array * contains alternating x and y values which are considered to represent * points which are the corners of the polyline. Lines are drawn between * each consecutive pair, but not between the first pair and last pair in @@ -1397,7 +1397,7 @@ public void drawPolygon(int[] pointArray) { * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the point array is null</li> - * </ul> + * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> @@ -1433,11 +1433,11 @@ public void drawPolyline(int[] pointArray) { } } -/** +/** * Draws the outline of the rectangle specified by the arguments, * using the receiver's foreground color. The left and right edges - * of the rectangle are at <code>x</code> and <code>x + width</code>. - * The top and bottom edges are at <code>y</code> and <code>y + height</code>. + * of the rectangle are at <code>x</code> and <code>x + width</code>. + * The top and bottom edges are at <code>y</code> and <code>y + height</code>. * * @param x the x coordinate of the rectangle to be drawn * @param y the y coordinate of the rectangle to be drawn @@ -1480,18 +1480,18 @@ public void drawRectangle(int x, int y, int width, int height) { } } -/** +/** * Draws the outline of the specified rectangle, using the receiver's * foreground color. The left and right edges of the rectangle are at - * <code>rect.x</code> and <code>rect.x + rect.width</code>. The top - * and bottom edges are at <code>rect.y</code> and - * <code>rect.y + rect.height</code>. + * <code>rect.x</code> and <code>rect.x + rect.width</code>. The top + * and bottom edges are at <code>rect.y</code> and + * <code>rect.y + rect.height</code>. * * @param rect the rectangle to draw * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the rectangle is null</li> - * </ul> + * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> @@ -1502,12 +1502,12 @@ public void drawRectangle(Rectangle rect) { drawRectangle (rect.x, rect.y, rect.width, rect.height); } -/** - * Draws the outline of the round-cornered rectangle specified by +/** + * Draws the outline of the round-cornered rectangle specified by * the arguments, using the receiver's foreground color. The left and - * right edges of the rectangle are at <code>x</code> and <code>x + width</code>. + * right edges of the rectangle are at <code>x</code> and <code>x + width</code>. * The top and bottom edges are at <code>y</code> and <code>y + height</code>. - * The <em>roundness</em> of the corners is specified by the + * The <em>roundness</em> of the corners is specified by the * <code>arcWidth</code> and <code>arcHeight</code> arguments, which * are respectively the width and height of the ellipse used to draw * the corners. @@ -1551,7 +1551,7 @@ public void drawRoundRectangle(int x, int y, int width, int height, int arcWidth } } -/** +/** * Draws the given string, using the receiver's current font and * foreground color. No tab expansion or carriage return processing * will be performed. The background of the rectangular area where @@ -1564,7 +1564,7 @@ public void drawRoundRectangle(int x, int y, int width, int height, int arcWidth * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the string is null</li> - * </ul> + * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> @@ -1573,7 +1573,7 @@ public void drawString (String string, int x, int y) { drawString(string, x, y, false); } -/** +/** * Draws the given string, using the receiver's current font and * foreground color. No tab expansion or carriage return processing * will be performed. If <code>isTransparent</code> is <code>true</code>, @@ -1588,7 +1588,7 @@ public void drawString (String string, int x, int y) { * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the string is null</li> - * </ul> + * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> @@ -1597,7 +1597,7 @@ public void drawString(String string, int x, int y, boolean isTransparent) { drawText(string, x, y, isTransparent ? SWT.DRAW_TRANSPARENT : 0); } -/** +/** * Draws the given string, using the receiver's current font and * foreground color. Tab expansion and carriage return processing * are performed. The background of the rectangular area where @@ -1610,7 +1610,7 @@ public void drawString(String string, int x, int y, boolean isTransparent) { * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the string is null</li> - * </ul> + * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> @@ -1619,7 +1619,7 @@ public void drawText(String string, int x, int y) { drawText(string, x, y, SWT.DRAW_DELIMITER | SWT.DRAW_TAB); } -/** +/** * Draws the given string, using the receiver's current font and * foreground color. Tab expansion and carriage return processing * are performed. If <code>isTransparent</code> is <code>true</code>, @@ -1634,7 +1634,7 @@ public void drawText(String string, int x, int y) { * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the string is null</li> - * </ul> + * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> @@ -1645,7 +1645,7 @@ public void drawText(String string, int x, int y, boolean isTransparent) { drawText(string, x, y, flags); } -/** +/** * Draws the given string, using the receiver's current font and * foreground color. Tab expansion, line delimiter and mnemonic * processing are performed according to the specified flags. If @@ -1674,7 +1674,7 @@ public void drawText(String string, int x, int y, boolean isTransparent) { * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the string is null</li> - * </ul> + * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> @@ -1754,15 +1754,15 @@ public boolean equals(Object object) { * the specified rectangular area, with the receiver's background * color. * <p> - * The resulting arc begins at <code>startAngle</code> and extends + * The resulting arc begins at <code>startAngle</code> and extends * for <code>arcAngle</code> degrees, using the current color. * Angles are interpreted such that 0 degrees is at the 3 o'clock * position. A positive value indicates a counter-clockwise rotation * while a negative value indicates a clockwise rotation. * </p><p> - * The center of the arc is the center of the rectangle whose origin - * is (<code>x</code>, <code>y</code>) and whose size is specified by the - * <code>width</code> and <code>height</code> arguments. + * The center of the arc is the center of the rectangle whose origin + * is (<code>x</code>, <code>y</code>) and whose size is specified by the + * <code>width</code> and <code>height</code> arguments. * </p><p> * The resulting arc covers an area <code>width + 1</code> pixels wide * by <code>height + 1</code> pixels tall. @@ -1832,7 +1832,7 @@ public void fillArc(int x, int y, int width, int height, int startAngle, int arc * (inverts direction of gradient if horizontal) * @param height the height of the rectangle to be filled, may be negative * (inverts direction of gradient if vertical) - * @param vertical if true sweeps from top to bottom, else + * @param vertical if true sweeps from top to bottom, else * sweeps from left to right * * @exception SWTException <ul> @@ -1885,7 +1885,7 @@ public void fillGradientRectangle(int x, int y, int width, int height, boolean v } } -/** +/** * Fills the interior of an oval, within the specified * rectangular area, with the receiver's background * color. @@ -1946,8 +1946,8 @@ void fillPattern(NSBezierPath path, Pattern pattern) { double /*float*/ difx = end.x - start.x; double /*float*/ dify = end.y - start.y; if (difx == 0 && dify == 0) { - double /*float*/ [] color = pattern.color1; - NSColor.colorWithDeviceRed(color[0], color[1], color[2], data.alpha / 255f).setFill(); + double /*float*/ [] color = pattern.color1; + NSColor.colorWithDeviceRed(color[0], color[1], color[2], data.alpha / 255f).setFill(); path.fill(); handle.restoreGraphicsState(); return; @@ -2012,7 +2012,7 @@ void fillPattern(NSBezierPath path, Pattern pattern) { handle.restoreGraphicsState(); } -/** +/** * Fills the path described by the parameter. * <p> * This operation requires the operating system's advanced @@ -2030,9 +2030,9 @@ void fillPattern(NSBezierPath path, Pattern pattern) { * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li> * </ul> - * + * * @see Path - * + * * @since 3.1 */ public void fillPath(Path path) { @@ -2056,7 +2056,7 @@ public void fillPath(Path path) { } } -/** +/** * Fills the interior of the closed polygon which is defined by the * specified array of integer coordinates, using the receiver's * background color. The array contains alternating x and y values @@ -2073,7 +2073,7 @@ public void fillPath(Path path) { * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> * - * @see #drawPolygon + * @see #drawPolygon */ public void fillPolygon(int[] pointArray) { if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); @@ -2106,9 +2106,9 @@ public void fillPolygon(int[] pointArray) { } } -/** +/** * Fills the interior of the rectangle specified by the arguments, - * using the receiver's background color. + * using the receiver's background color. * * @param x the x coordinate of the rectangle to be filled * @param y the y coordinate of the rectangle to be filled @@ -2153,9 +2153,9 @@ public void fillRectangle(int x, int y, int width, int height) { } } -/** +/** * Fills the interior of the specified rectangle, using the receiver's - * background color. + * background color. * * @param rect the rectangle to be filled * @@ -2174,9 +2174,9 @@ public void fillRectangle(Rectangle rect) { fillRectangle(rect.x, rect.y, rect.width, rect.height); } -/** - * Fills the interior of the round-cornered rectangle specified by - * the arguments, using the receiver's background color. +/** + * Fills the interior of the round-cornered rectangle specified by + * the arguments, using the receiver's background color. * * @param x the x coordinate of the rectangle to be filled * @param y the y coordinate of the rectangle to be filled @@ -2257,13 +2257,13 @@ void flush () { * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */ -public int getAdvanceWidth(char ch) { +public int getAdvanceWidth(char ch) { if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); //NOT DONE return stringExtent(new String(new char[]{ch})).x; } -/** +/** * Returns the background color. * * @return the receiver's background color @@ -2277,7 +2277,7 @@ public Color getBackground() { return Color.cocoa_new (data.device, data.background); } -/** +/** * Returns the background pattern. The default value is * <code>null</code>. * @@ -2286,14 +2286,14 @@ public Color getBackground() { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see Pattern - * + * * @since 3.1 */ -public Pattern getBackgroundPattern() { +public Pattern getBackgroundPattern() { if (handle == null) SWT.error(SWT.ERROR_WIDGET_DISPOSED); - return data.backgroundPattern; + return data.backgroundPattern; } /** @@ -2316,9 +2316,9 @@ public Pattern getBackgroundPattern() { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see #setAdvanced - * + * * @since 3.1 */ public boolean getAdvanced() { @@ -2335,7 +2335,7 @@ public boolean getAdvanced() { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @since 3.1 */ public int getAlpha() { @@ -2354,9 +2354,9 @@ public int getAlpha() { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see #getTextAntialias - * + * * @since 3.1 */ public int getAntialias() { @@ -2366,7 +2366,7 @@ public int getAntialias() { /** * Returns the width of the specified character in the font - * selected into the receiver. + * selected into the receiver. * <p> * The width is defined as the space taken up by the actual * character, not including the leading and tailing whitespace @@ -2386,7 +2386,7 @@ public int getCharWidth(char ch) { return stringExtent(new String(new char[]{ch})).x; } -/** +/** * Returns the bounding rectangle of the receiver's clipping * region. If no clipping region is set, the return value * will be a rectangle which covers the entire bounds of the @@ -2448,7 +2448,7 @@ public Rectangle getClipping() { } } -/** +/** * Sets the region managed by the argument to the current * clipping region of the receiver. * @@ -2457,12 +2457,12 @@ public Rectangle getClipping() { * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the region is null</li> * <li>ERROR_INVALID_ARGUMENT - if the region is disposed</li> - * </ul> + * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */ -public void getClipping(Region region) { +public void getClipping(Region region) { if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if (region == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (region.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); @@ -2532,7 +2532,7 @@ public void getClipping(Region region) { } } -/** +/** * Returns the receiver's fill rule, which will be one of * <code>SWT.FILL_EVEN_ODD</code> or <code>SWT.FILL_WINDING</code>. * @@ -2541,7 +2541,7 @@ public void getClipping(Region region) { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @since 3.1 */ public int getFillRule() { @@ -2549,7 +2549,7 @@ public int getFillRule() { return data.fillRule; } -/** +/** * Returns the font currently being used by the receiver * to draw and measure text. * @@ -2596,16 +2596,16 @@ public FontMetrics getFontMetrics() { int avgWidth = (int) Math.ceil(rect.width) / s.length(); int ascent = (int)layoutManager.defaultBaselineOffsetForFont(data.font.handle); int height = (int)layoutManager.defaultLineHeightForFont(data.font.handle); - data.font.metrics = FontMetrics.cocoa_new(ascent, height - ascent, avgWidth, 0, height); + data.font.metrics = FontMetrics.cocoa_new(ascent, height - ascent, avgWidth, 0, height); } - + return data.font.metrics; } finally { uncheckGC(pool); } } -/** +/** * Returns the receiver's foreground color. * * @return the color used for drawing foreground things @@ -2614,12 +2614,12 @@ public FontMetrics getFontMetrics() { * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */ -public Color getForeground() { +public Color getForeground() { if (handle == null) SWT.error(SWT.ERROR_WIDGET_DISPOSED); - return Color.cocoa_new(data.device, data.foreground); + return Color.cocoa_new(data.device, data.foreground); } -/** +/** * Returns the foreground pattern. The default value is * <code>null</code>. * @@ -2628,17 +2628,17 @@ public Color getForeground() { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see Pattern - * + * * @since 3.1 */ -public Pattern getForegroundPattern() { +public Pattern getForegroundPattern() { if (handle == null) SWT.error(SWT.ERROR_WIDGET_DISPOSED); - return data.foregroundPattern; + return data.foregroundPattern; } -/** +/** * Returns the GCData. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public @@ -2653,23 +2653,23 @@ public Pattern getForegroundPattern() { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see GCData - * + * * @noreference This method is not intended to be referenced by clients. - * + * * @since 3.2 */ -public GCData getGCData() { +public GCData getGCData() { if (handle == null) SWT.error(SWT.ERROR_WIDGET_DISPOSED); NSAutoreleasePool pool = checkGC(TRANSFORM | CLIPPING); uncheckGC(pool); - return data; + return data; } -/** +/** * Returns the receiver's interpolation setting, which will be one of - * <code>SWT.DEFAULT</code>, <code>SWT.NONE</code>, + * <code>SWT.DEFAULT</code>, <code>SWT.NONE</code>, * <code>SWT.LOW</code> or <code>SWT.HIGH</code>. * * @return the receiver's interpolation setting @@ -2677,7 +2677,7 @@ public GCData getGCData() { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @since 3.1 */ public int getInterpolation() { @@ -2692,7 +2692,7 @@ public int getInterpolation() { return SWT.DEFAULT; } -/** +/** * Returns the receiver's line attributes. * * @return the line attributes used for drawing lines @@ -2700,8 +2700,8 @@ public int getInterpolation() { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * - * @since 3.3 + * + * @since 3.3 */ public LineAttributes getLineAttributes() { if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); @@ -2713,7 +2713,7 @@ public LineAttributes getLineAttributes() { return new LineAttributes(data.lineWidth, data.lineCap, data.lineJoin, data.lineStyle, dashes, data.lineDashesOffset, data.lineMiterLimit); } -/** +/** * Returns the receiver's line cap style, which will be one * of the constants <code>SWT.CAP_FLAT</code>, <code>SWT.CAP_ROUND</code>, * or <code>SWT.CAP_SQUARE</code>. @@ -2723,15 +2723,15 @@ public LineAttributes getLineAttributes() { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * - * @since 3.1 + * + * @since 3.1 */ public int getLineCap() { if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); return data.lineCap; } -/** +/** * Returns the receiver's line dash style. The default value is * <code>null</code>. * @@ -2740,8 +2740,8 @@ public int getLineCap() { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * - * @since 3.1 + * + * @since 3.1 */ public int[] getLineDash() { if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); @@ -2750,10 +2750,10 @@ public int[] getLineDash() { for (int i = 0; i < lineDashes.length; i++) { lineDashes[i] = (int)data.lineDashes[i]; } - return lineDashes; + return lineDashes; } -/** +/** * Returns the receiver's line join style, which will be one * of the constants <code>SWT.JOIN_MITER</code>, <code>SWT.JOIN_ROUND</code>, * or <code>SWT.JOIN_BEVEL</code>. @@ -2763,15 +2763,15 @@ public int[] getLineDash() { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * - * @since 3.1 + * + * @since 3.1 */ public int getLineJoin() { if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); return data.lineJoin; } -/** +/** * Returns the receiver's line style, which will be one * of the constants <code>SWT.LINE_SOLID</code>, <code>SWT.LINE_DASH</code>, * <code>SWT.LINE_DOT</code>, <code>SWT.LINE_DASHDOT</code> or @@ -2788,13 +2788,13 @@ public int getLineStyle() { return data.lineStyle; } -/** +/** * Returns the width that will be used when drawing lines * for all of the figure drawing operations (that is, - * <code>drawLine</code>, <code>drawRectangle</code>, + * <code>drawLine</code>, <code>drawRectangle</code>, * <code>drawPolyline</code>, and so forth. * - * @return the receiver's line width + * @return the receiver's line width * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> @@ -2812,15 +2812,15 @@ public int getLineWidth() { * not match</em> the value which was provided to the constructor * when the receiver was created. This can occur when the underlying * operating system does not support a particular combination of - * requested styles. + * requested styles. * </p> * * @return the style bits - * + * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @since 2.1.2 */ public int getStyle () { @@ -2839,9 +2839,9 @@ public int getStyle () { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see #getAntialias - * + * * @since 3.1 */ public int getTextAntialias() { @@ -2849,12 +2849,12 @@ public int getTextAntialias() { return data.textAntialias; } -/** +/** * Sets the parameter to the transform that is currently being * used by the receiver. * * @param transform the destination to copy the transform into - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the parameter is null</li> * <li>ERROR_INVALID_ARGUMENT - if the parameter has been disposed</li> @@ -2862,9 +2862,9 @@ public int getTextAntialias() { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see Transform - * + * * @since 3.1 */ public void getTransform (Transform transform) { @@ -2880,7 +2880,7 @@ public void getTransform (Transform transform) { } } -/** +/** * Returns <code>true</code> if this GC is drawing in the mode * where the resulting color in the destination is the * <em>exclusive or</em> of the color values in the source @@ -2900,8 +2900,8 @@ public boolean getXORMode() { } /** - * Returns an integer hash code for the receiver. Any two - * objects that return <code>true</code> when passed to + * Returns an integer hash code for the receiver. Any two + * objects that return <code>true</code> when passed to * <code>equals</code> must return the same value for this * method. * @@ -2996,7 +2996,7 @@ void initCGContext(long /*int*/ cgContext) { * Returns <code>true</code> if the receiver has a clipping * region set into it, and <code>false</code> otherwise. * If this method returns false, the receiver will draw on all - * available space in the destination. If it returns true, + * available space in the destination. If it returns true, * it will draw only in the area that is covered by the region * that can be accessed with <code>getClipping(region)</code>. * @@ -3034,7 +3034,7 @@ boolean isIdentity(float[] transform) { /** * Sets the receiver to always use the operating system's advanced graphics * subsystem for all graphics operations if the argument is <code>true</code>. - * If the argument is <code>false</code>, the advanced graphics subsystem is + * If the argument is <code>false</code>, the advanced graphics subsystem is * no longer used, advanced graphics state is cleared and the normal graphics * subsystem is used from now on. * <p> @@ -3059,7 +3059,7 @@ boolean isIdentity(float[] transform) { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see #setAlpha * @see #setAntialias * @see #setBackgroundPattern @@ -3070,7 +3070,7 @@ boolean isIdentity(float[] transform) { * @see #setTextAntialias * @see #setTransform * @see #getAdvanced - * + * * @since 3.1 */ public void setAdvanced(boolean advanced) { @@ -3101,21 +3101,21 @@ public void setAdvanced(boolean advanced) { * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li> * </ul> - * + * * @see #getAdvanced * @see #setAdvanced - * + * * @since 3.1 */ public void setAlpha(int alpha) { if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); data.alpha = alpha & 0xFF; data.state &= ~(BACKGROUND | FOREGROUND | FOREGROUND_FILL); - + } /** - * Sets the receiver's anti-aliasing value to the parameter, + * Sets the receiver's anti-aliasing value to the parameter, * which must be one of <code>SWT.DEFAULT</code>, <code>SWT.OFF</code> * or <code>SWT.ON</code>. Note that this controls anti-aliasing for all * <em>non-text drawing</em> operations. @@ -3135,11 +3135,11 @@ public void setAlpha(int alpha) { * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li> * </ul> - * + * * @see #getAdvanced * @see #setAdvanced * @see #setTextAntialias - * + * * @since 3.1 */ public void setAntialias(int antialias) { @@ -3185,14 +3185,14 @@ public void setBackground(Color color) { data.state &= ~BACKGROUND; } -/** +/** * Sets the background pattern. The default value is <code>null</code>. * <p> * This operation requires the operating system's advanced * graphics subsystem which may not be available on some * platforms. * </p> - * + * * @param pattern the new background pattern * * @exception IllegalArgumentException <ul> @@ -3202,11 +3202,11 @@ public void setBackground(Color color) { * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li> * </ul> - * + * * @see Pattern * @see #getAdvanced * @see #setAdvanced - * + * * @since 3.1 */ public void setBackgroundPattern(Pattern pattern) { @@ -3260,27 +3260,27 @@ public void setClipping(int x, int y, int width, int height) { /** * Sets the area of the receiver which can be changed * by drawing operations to the path specified - * by the argument. + * by the argument. * <p> * This operation requires the operating system's advanced * graphics subsystem which may not be available on some * platforms. * </p> - * + * * @param path the clipping path. - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the path has been disposed</li> - * </ul> + * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li> * </ul> - * + * * @see Path * @see #getAdvanced * @see #setAdvanced - * + * * @since 3.1 */ public void setClipping(Path path) { @@ -3325,10 +3325,10 @@ public void setClipping(Rectangle rect) { * original value. * * @param region the clipping region or <code>null</code> - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the region has been disposed</li> - * </ul> + * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> @@ -3359,7 +3359,7 @@ void setClipping(NSBezierPath path) { data.state &= ~CLIPPING; } -/** +/** * Sets the receiver's fill rule to the parameter, which must be one of * <code>SWT.FILL_EVEN_ODD</code> or <code>SWT.FILL_WINDING</code>. * @@ -3368,11 +3368,11 @@ void setClipping(NSBezierPath path) { * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the rule is not one of <code>SWT.FILL_EVEN_ODD</code> * or <code>SWT.FILL_WINDING</code></li> - * </ul> + * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @since 3.1 */ public void setFillRule(int rule) { @@ -3387,7 +3387,7 @@ public void setFillRule(int rule) { data.path.setWindingRule(rule == SWT.FILL_WINDING ? OS.NSNonZeroWindingRule : OS.NSEvenOddWindingRule); } -/** +/** * Sets the font which will be used by the receiver * to draw and measure text to the argument. If the * argument is null, then a default font appropriate @@ -3423,7 +3423,7 @@ public void setFont(Font font) { * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */ -public void setForeground(Color color) { +public void setForeground(Color color) { if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if (color == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (color.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); @@ -3434,7 +3434,7 @@ public void setForeground(Color color) { data.state &= ~(FOREGROUND | FOREGROUND_FILL); } -/** +/** * Sets the foreground pattern. The default value is <code>null</code>. * <p> * This operation requires the operating system's advanced @@ -3450,11 +3450,11 @@ public void setForeground(Color color) { * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li> * </ul> - * + * * @see Pattern * @see #getAdvanced * @see #setAdvanced - * + * * @since 3.1 */ public void setForegroundPattern(Pattern pattern) { @@ -3465,30 +3465,30 @@ public void setForegroundPattern(Pattern pattern) { data.state &= ~(FOREGROUND | FOREGROUND_FILL); } -/** +/** * Sets the receiver's interpolation setting to the parameter, which - * must be one of <code>SWT.DEFAULT</code>, <code>SWT.NONE</code>, + * must be one of <code>SWT.DEFAULT</code>, <code>SWT.NONE</code>, * <code>SWT.LOW</code> or <code>SWT.HIGH</code>. * <p> * This operation requires the operating system's advanced * graphics subsystem which may not be available on some * platforms. * </p> - * + * * @param interpolation the new interpolation setting * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the rule is not one of <code>SWT.DEFAULT</code>, + * <li>ERROR_INVALID_ARGUMENT - if the rule is not one of <code>SWT.DEFAULT</code>, * <code>SWT.NONE</code>, <code>SWT.LOW</code> or <code>SWT.HIGH</code> - * </ul> + * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li> * </ul> - * + * * @see #getAdvanced * @see #setAdvanced - * + * * @since 3.1 */ public void setInterpolation(int interpolation) { @@ -3522,11 +3522,11 @@ public void setInterpolation(int interpolation) { * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li> * </ul> - * + * * @see LineAttributes * @see #getAdvanced * @see #setAdvanced - * + * * @since 3.3 */ public void setLineAttributes(LineAttributes attributes) { @@ -3604,11 +3604,11 @@ public void setLineAttributes(LineAttributes attributes) { } float dashOffset = attributes.dashOffset; if (dashOffset != data.lineDashesOffset) { - mask |= LINE_STYLE; + mask |= LINE_STYLE; } float miterLimit = attributes.miterLimit; if (miterLimit != data.lineMiterLimit) { - mask |= LINE_MITERLIMIT; + mask |= LINE_MITERLIMIT; } if (mask == 0) return; data.lineWidth = lineWidth; @@ -3621,21 +3621,21 @@ public void setLineAttributes(LineAttributes attributes) { data.state &= ~mask; } -/** +/** * Sets the receiver's line cap style to the argument, which must be one * of the constants <code>SWT.CAP_FLAT</code>, <code>SWT.CAP_ROUND</code>, * or <code>SWT.CAP_SQUARE</code>. * * @param cap the cap style to be used for drawing lines - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the style is not valid</li> - * </ul> + * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * - * @since 3.1 + * + * @since 3.1 */ public void setLineCap(int cap) { if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); @@ -3652,22 +3652,22 @@ public void setLineCap(int cap) { data.state &= ~LINE_CAP; } -/** +/** * Sets the receiver's line dash style to the argument. The default * value is <code>null</code>. If the argument is not <code>null</code>, * the receiver's line style is set to <code>SWT.LINE_CUSTOM</code>, otherwise * it is set to <code>SWT.LINE_SOLID</code>. * * @param dashes the dash style to be used for drawing lines - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if any of the values in the array is less than or equal 0</li> - * </ul> + * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * - * @since 3.1 + * + * @since 3.1 */ public void setLineDash(int[] dashes) { if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); @@ -3693,7 +3693,7 @@ public void setLineDash(int[] dashes) { data.state &= ~LINE_STYLE; } -/** +/** * Sets the receiver's line join style to the argument, which must be one * of the constants <code>SWT.JOIN_MITER</code>, <code>SWT.JOIN_ROUND</code>, * or <code>SWT.JOIN_BEVEL</code>. @@ -3706,8 +3706,8 @@ public void setLineDash(int[] dashes) { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * - * @since 3.1 + * + * @since 3.1 */ public void setLineJoin(int join) { if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); @@ -3724,7 +3724,7 @@ public void setLineJoin(int join) { data.state &= ~LINE_JOIN; } -/** +/** * Sets the receiver's line style to the argument, which must be one * of the constants <code>SWT.LINE_SOLID</code>, <code>SWT.LINE_DASH</code>, * <code>SWT.LINE_DOT</code>, <code>SWT.LINE_DASHDOT</code> or @@ -3759,10 +3759,10 @@ public void setLineStyle(int lineStyle) { data.state &= ~LINE_STYLE; } -/** +/** * Sets the width that will be used when drawing lines * for all of the figure drawing operations (that is, - * <code>drawLine</code>, <code>drawRectangle</code>, + * <code>drawLine</code>, <code>drawRectangle</code>, * <code>drawPolyline</code>, and so forth. * <p> * Note that line width of zero is used as a hint to @@ -3781,7 +3781,7 @@ public void setLineWidth(int lineWidth) { if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if (data.lineWidth == lineWidth) return; data.lineWidth = lineWidth; - data.state &= ~(LINE_WIDTH | DRAW_OFFSET); + data.state &= ~(LINE_WIDTH | DRAW_OFFSET); } void setPatternPhase(Pattern pattern) { @@ -3803,7 +3803,7 @@ void setPatternPhase(Pattern pattern) { handle.setPatternPhase(phase); } -/** +/** * If the argument is <code>true</code>, puts the receiver * in a drawing mode where the resulting color in the destination * is the <em>exclusive or</em> of the color values in the source @@ -3821,7 +3821,7 @@ void setPatternPhase(Pattern pattern) { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @deprecated this functionality is not supported on some platforms */ @Deprecated @@ -3831,7 +3831,7 @@ public void setXORMode(boolean xor) { } /** - * Sets the receiver's text anti-aliasing value to the parameter, + * Sets the receiver's text anti-aliasing value to the parameter, * which must be one of <code>SWT.DEFAULT</code>, <code>SWT.OFF</code> * or <code>SWT.ON</code>. Note that this controls anti-aliasing only * for all <em>text drawing</em> operations. @@ -3840,7 +3840,7 @@ public void setXORMode(boolean xor) { * graphics subsystem which may not be available on some * platforms. * </p> - * + * * @param antialias the anti-aliasing setting * * @exception IllegalArgumentException <ul> @@ -3851,11 +3851,11 @@ public void setXORMode(boolean xor) { * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li> * </ul> - * + * * @see #getAdvanced * @see #setAdvanced * @see #setAntialias - * + * * @since 3.1 */ public void setTextAntialias(int antialias) { @@ -3880,9 +3880,9 @@ public void setTextAntialias(int antialias) { * graphics subsystem which may not be available on some * platforms. * </p> - * + * * @param transform the transform to set - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the parameter has been disposed</li> * </ul> @@ -3890,11 +3890,11 @@ public void setTextAntialias(int antialias) { * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li> * </ul> - * + * * @see Transform * @see #getAdvanced * @see #setAdvanced - * + * * @since 3.1 */ public void setTransform(Transform transform) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java index b5d05cce78..b42bd5bc73 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java @@ -10,11 +10,11 @@ *******************************************************************************/ package org.eclipse.swt.graphics; - + import org.eclipse.swt.internal.cocoa.*; import org.eclipse.swt.*; import java.io.*; - + /** * Instances of this class are graphics which have been prepared * for display on a specific device. That is, they are ready @@ -26,7 +26,7 @@ import java.io.*; * pixels are specified as being transparent when drawn. Examples * of file formats that support transparency are GIF and PNG. * </p><p> - * There are two primary ways to use <code>Images</code>. + * There are two primary ways to use <code>Images</code>. * The first is to load a graphic file from disk and create an * <code>Image</code> from it. This is done using an <code>Image</code> * constructor, for example: @@ -39,8 +39,8 @@ import java.io.*; * SWT. It is possible to get more control over the mapping of * colors as the image is being created, using code of the form: * <pre> - * ImageData data = new ImageData("C:\\graphic.bmp"); - * RGB[] rgbs = data.getRGBs(); + * ImageData data = new ImageData("C:\\graphic.bmp"); + * RGB[] rgbs = data.getRGBs(); * // At this point, rgbs contains specifications of all * // the colors contained within this image. You may * // allocate as many of these colors as you wish by @@ -53,7 +53,7 @@ import java.io.*; * loading process should use the support provided in class * <code>ImageLoader</code>. * </p><p> - * Application code must explicitly invoke the <code>Image.dispose()</code> + * Application code must explicitly invoke the <code>Image.dispose()</code> * method to release the operating system resources managed by each instance * when those instances are no longer required. * </p> @@ -76,11 +76,11 @@ public final class Image extends Resource implements Drawable { * within the packages provided by SWT. It is not available on all * platforms and should never be accessed from application code. * </p> - * + * * @noreference This field is not intended to be referenced by clients. */ public int type; - + /** * the handle to the OS image resource * (Warning: This field is platform dependent) @@ -90,16 +90,16 @@ public final class Image extends Resource implements Drawable { * within the packages provided by SWT. It is not available on all * platforms and should never be accessed from application code. * </p> - * + * * @noreference This field is not intended to be referenced by clients. */ public NSImage handle; - + /** * specifies the transparent pixel */ int transparentPixel = -1; - + /** * The GC the image is currently selected in. */ @@ -109,22 +109,22 @@ public final class Image extends Resource implements Drawable { * The alpha data of the image. */ byte[] alphaData; - + /** * The global alpha value to be used for every pixel. */ int alpha = -1; - + /** * The width of the image. */ int width = -1; - + /** * The height of the image. */ int height = -1; - + /** * Specifies the default scanline padding. */ @@ -138,7 +138,7 @@ public final class Image extends Resource implements Drawable { /** * ImageDataProvider to provide ImageData at various Zoom levels */ - ImageDataProvider imageDataProvider; + ImageDataProvider imageDataProvider; Image(Device device) { super(device); @@ -162,7 +162,7 @@ Image(Device device) { * images larger than 16M. * </p> * <p> - * You must dispose the image when it is no longer required. + * You must dispose the image when it is no longer required. * </p> * * @param device the device on which to create the image @@ -176,7 +176,7 @@ Image(Device device) { * @exception SWTError <ul> * <li>ERROR_NO_HANDLES if a handle could not be obtained for image creation</li> * </ul> - * + * * @see #dispose() */ public Image(Device device, int width, int height) { @@ -204,7 +204,7 @@ public Image(Device device, int width, int height) { * <dd>the result is a copy of srcImage which has a <em>gray scale</em> look</dd> * </dl> * <p> - * You must dispose the image when it is no longer required. + * You must dispose the image when it is no longer required. * </p> * * @param device the device on which to create the image @@ -224,7 +224,7 @@ public Image(Device device, int width, int height) { * @exception SWTError <ul> * <li>ERROR_NO_HANDLES if a handle could not be obtained for image creation</li> * </ul> - * + * * @see #dispose() */ public Image(Device device, Image srcImage, int flag) { @@ -259,7 +259,7 @@ public Image(Device device, Image srcImage, int flag) { alphaData = new byte[srcImage.alphaData.length]; System.arraycopy(srcImage.alphaData, 0, alphaData, 0, alphaData.length); } - + long /*int*/ srcData = srcRep.bitmapData(); long /*int*/ format = srcRep.bitmapFormat(); long /*int*/ bpp = srcRep.bitsPerPixel(); @@ -323,7 +323,7 @@ public Image(Device device, Image srcImage, int flag) { } break; } - case SWT.IMAGE_GRAY: { + case SWT.IMAGE_GRAY: { byte[] line = new byte[(int)/*64*/bpr]; for (int y=0; y<height; y++) { OS.memmove(line, data + (y * bpr), bpr); @@ -366,7 +366,7 @@ public Image(Device device, Image srcImage, int flag) { * images larger than 16M. * </p> * <p> - * You must dispose the image when it is no longer required. + * You must dispose the image when it is no longer required. * </p> * * @param device the device on which to create the image @@ -380,7 +380,7 @@ public Image(Device device, Image srcImage, int flag) { * @exception SWTError <ul> * <li>ERROR_NO_HANDLES if a handle could not be obtained for image creation</li> * </ul> - * + * * @see #dispose() */ public Image(Device device, Rectangle bounds) { @@ -400,7 +400,7 @@ public Image(Device device, Rectangle bounds) { * Constructs an instance of this class from the given * <code>ImageData</code>. * <p> - * You must dispose the image when it is no longer required. + * You must dispose the image when it is no longer required. * </p> * * @param device the device on which to create the image @@ -416,7 +416,7 @@ public Image(Device device, Rectangle bounds) { * @exception SWTError <ul> * <li>ERROR_NO_HANDLES if a handle could not be obtained for image creation</li> * </ul> - * + * * @see #dispose() */ public Image(Device device, ImageData data) { @@ -432,7 +432,7 @@ public Image(Device device, ImageData data) { } /** - * Constructs an instance of this class, whose type is + * Constructs an instance of this class, whose type is * <code>SWT.ICON</code>, from the two given <code>ImageData</code> * objects. The two images must be the same size. Pixel transparency * in either image will be ignored. @@ -443,7 +443,7 @@ public Image(Device device, ImageData data) { * transparent. * </p> * <p> - * You must dispose the image when it is no longer required. + * You must dispose the image when it is no longer required. * </p> * * @param device the device on which to create the icon @@ -458,7 +458,7 @@ public Image(Device device, ImageData data) { * @exception SWTError <ul> * <li>ERROR_NO_HANDLES if a handle could not be obtained for image creation</li> * </ul> - * + * * @see #dispose() */ public Image(Device device, ImageData source, ImageData mask) { @@ -490,7 +490,7 @@ public Image(Device device, ImageData source, ImageData mask) { * <p> * This constructor is provided for convenience when loading a single * image only. If the stream contains multiple images, only the first - * one will be loaded. To load multiple images, use + * one will be loaded. To load multiple images, use * <code>ImageLoader.load()</code>. * </p><p> * This constructor may be used to load a resource as follows: @@ -512,7 +512,7 @@ public Image(Device device, ImageData source, ImageData mask) { * } * </pre> * <p> - * You must dispose the image when it is no longer required. + * You must dispose the image when it is no longer required. * </p> * * @param device the device on which to create the image @@ -531,7 +531,7 @@ public Image(Device device, ImageData source, ImageData mask) { * @exception SWTError <ul> * <li>ERROR_NO_HANDLES if a handle could not be obtained for image creation</li> * </ul> - * + * * @see #dispose() */ public Image(Device device, InputStream stream) { @@ -556,7 +556,7 @@ public Image(Device device, InputStream stream) { * a single image only. If the specified file contains * multiple images, only the first one will be used. * <p> - * You must dispose the image when it is no longer required. + * You must dispose the image when it is no longer required. * </p> * * @param device the device on which to create the image @@ -575,7 +575,7 @@ public Image(Device device, InputStream stream) { * @exception SWTError <ul> * <li>ERROR_NO_HANDLES if a handle could not be obtained for image creation</li> * </ul> - * + * * @see #dispose() */ public Image(Device device, String filename) { @@ -712,18 +712,18 @@ void createAlpha () { if ((format & OS.NSAlphaFirstBitmapFormat) != 0) { for (int i=0; i<dataSize; i+=4) { int pixel = ((srcData[i+1] & 0xFF) << 16) | ((srcData[i+2] & 0xFF) << 8) | (srcData[i+3] & 0xFF); - srcData[i] = (byte)(pixel == transparentPixel ? 0 : 0xFF); + srcData[i] = (byte)(pixel == transparentPixel ? 0 : 0xFF); } } else { for (int i=0; i<dataSize; i+=4) { int pixel = ((srcData[i+0] & 0xFF) << 16) | ((srcData[i+1] & 0xFF) << 8) | (srcData[i+2] & 0xFF); - srcData[i] = (byte)(pixel == transparentPixel ? 0 : 0xFF); + srcData[i] = (byte)(pixel == transparentPixel ? 0 : 0xFF); } } } else if (alpha != -1) { byte a = (byte)this.alpha; for (int i=(format & OS.NSAlphaFirstBitmapFormat) != 0 ? 0 : 3; i<dataSize; i+=4) { - srcData[i] = a; + srcData[i] = a; } } else { long /*int*/ width = imageRep.pixelsWide(); @@ -862,7 +862,7 @@ public ImageData getImageData() { long /*int*/ dataSize = height * bpr; byte[] srcData = new byte[(int)/*64*/dataSize]; OS.memmove(srcData, bitmapData, dataSize); - + PaletteData palette; if (bpp == 32 && (bitmapFormat & OS.NSAlphaFirstBitmapFormat) == 0) { palette = new PaletteData(0xFF000000, 0xFF0000, 0xFF00); @@ -918,7 +918,7 @@ public ImageData getImageData() { } } -/** +/** * Invokes platform specific functionality to allocate a new image. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public @@ -972,8 +972,8 @@ NSBitmapImageRep getRepresentation () { } /** - * Returns an integer hash code for the receiver. Any two - * objects that return <code>true</code> when passed to + * Returns an integer hash code for the receiver. Any two + * objects that return <code>true</code> when passed to * <code>equals</code> must return the same value for this * method. * @@ -1049,7 +1049,7 @@ private NSBitmapImageRep createRepresentaion(ImageData imageData) { if (palette.isDirect) { ImageData.blit(ImageData.BLIT_SRC, imageData.data, imageData.depth, imageData.bytesPerLine, imageData.getByteOrder(), 0, 0, imageData.width, imageData.height, palette.redMask, palette.greenMask, palette.blueMask, - ImageData.ALPHA_OPAQUE, null, 0, 0, 0, + ImageData.ALPHA_OPAQUE, null, 0, 0, 0, buffer, 32, bpr, ImageData.MSB_FIRST, 0, 0, imageData.width, imageData.height, 0xFF0000, 0xFF00, 0xFF, false, false); } else { @@ -1071,7 +1071,7 @@ private NSBitmapImageRep createRepresentaion(ImageData imageData) { buffer, 32, bpr, ImageData.MSB_FIRST, 0, 0, imageData.width, imageData.height, 0xFF0000, 0xFF00, 0xFF, false, false); } - + /* Initialize transparency */ int transparency = imageData.getTransparencyType(); boolean hasAlpha = transparency != SWT.TRANSPARENCY_NONE; @@ -1090,7 +1090,7 @@ private NSBitmapImageRep createRepresentaion(ImageData imageData) { RGB rgb = rgbs[imageData.transparentPixel]; transRed = rgb.red; transGreen = rgb.green; - transBlue = rgb.blue; + transBlue = rgb.blue; } } transparentPixel = transRed << 16 | transGreen << 8 | transBlue; @@ -1113,7 +1113,7 @@ private NSBitmapImageRep createRepresentaion(ImageData imageData) { this.alpha = imageData.alpha; byte a = (byte)this.alpha; for (int dataIndex=0; dataIndex<buffer.length; dataIndex+=4) { - buffer[dataIndex] = a; + buffer[dataIndex] = a; } } else if (imageData.alphaData != null) { hasAlpha = true; @@ -1138,12 +1138,12 @@ private NSBitmapImageRep createRepresentaion(ImageData imageData) { void initNative(String filename) { NSAutoreleasePool pool = null; NSImage nativeImage = null; - + if (!NSThread.isMainThread()) pool = (NSAutoreleasePool) new NSAutoreleasePool().alloc().init(); try { nativeImage = new NSImage(); nativeImage.alloc(); - + // initByReferencingFile returns null if the file can't be found or is // not an image. nativeImage = nativeImage.initWithContentsOfFile(NSString.stringWith(filename)); @@ -1153,7 +1153,7 @@ void initNative(String filename) { // that is not natively supported as well. return; } - + NSImageRep nativeRep = nativeImage.bestRepresentationForDevice(null); if (!nativeRep.isKindOfClass(OS.class_NSBitmapImageRep)) { return; @@ -1161,7 +1161,7 @@ void initNative(String filename) { width = (int)/*64*/nativeRep.pixelsWide(); height = (int)/*64*/nativeRep.pixelsHigh(); - + boolean hasAlpha = nativeRep.hasAlpha(); int bpr = width * 4; handle = (NSImage)new NSImage().alloc(); @@ -1187,7 +1187,7 @@ void initNative(String filename) { nativeRep.drawInRect(rect); NSGraphicsContext.static_restoreGraphicsState(); OS.CGContextRelease(ctx); - + if (hasAlpha) { /* Compute the alpha values */ long /*int*/ bitmapBytesPerRow = width; @@ -1202,7 +1202,7 @@ void initNative(String filename) { OS.memmove(alphaData, alphaBitmapData, bitmapByteCount); OS.free(alphaBitmapData); OS.CGContextRelease(alphaBitmapCtx); - + /* Merge the alpha values with the pixels */ byte[] srcData = new byte[height * bpr]; OS.memmove(srcData, rep.bitmapData(), srcData.length); @@ -1216,7 +1216,7 @@ void initNative(String filename) { } } OS.memmove(rep.bitmapData(), srcData, srcData.length); - + // If the alpha has only 0 or 255 (-1) for alpha values, compute the transparent pixel color instead // of a continuous alpha range. int transparentOffset = -1, i = 0; @@ -1232,10 +1232,10 @@ void initNative(String filename) { int green = (int) (color.greenComponent() * 255); int blue = (int) (color.blueComponent() * 255); this.transparentPixel = (red << 16) | (green << 8) | blue; - + /* * If the image has opaque pixels that have the same color as the transparent - * pixel, create an alpha image instead of using transparent pixel. + * pixel, create an alpha image instead of using transparent pixel. */ for (int j = 0; j < srcData.length; j+=4) { if (srcData [j] != 0) { @@ -1246,10 +1246,10 @@ void initNative(String filename) { } } } - } + } if (this.transparentPixel == -1) this.alphaData = alphaData; } - + // For compatibility, images created from .ico files are treated as SWT.ICON format, even though // they are no different than other bitmaps in Cocoa. if (filename.toLowerCase().endsWith(".ico")) { @@ -1264,7 +1264,7 @@ void initNative(String filename) { } -/** +/** * Invokes platform specific functionality to allocate a new GC handle. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public @@ -1274,9 +1274,9 @@ void initNative(String filename) { * application code. * </p> * - * @param data the platform specific GC data + * @param data the platform specific GC data * @return the platform specific GC handle - * + * * @noreference This method is not intended to be referenced by clients. */ public long /*int*/ internal_new_GC (GCData data) { @@ -1291,7 +1291,7 @@ public long /*int*/ internal_new_GC (GCData data) { // Can't perform transforms on image reps with alpha. imageRep.setAlpha(false); - + NSGraphicsContext context = NSGraphicsContext.graphicsContextWithBitmapImageRep(imageRep); NSGraphicsContext flippedContext = NSGraphicsContext.graphicsContextWithGraphicsPort(context.graphicsPort(), true); context = flippedContext; @@ -1322,7 +1322,7 @@ public long /*int*/ internal_new_GC (GCData data) { } } -/** +/** * Invokes platform specific functionality to dispose a GC handle. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public @@ -1334,7 +1334,7 @@ public long /*int*/ internal_new_GC (GCData data) { * * @param hDC the platform specific GC handle * @param data the platform specific GC data - * + * * @noreference This method is not intended to be referenced by clients. */ public void internal_dispose_GC (long /*int*/ hDC, GCData data) { @@ -1350,7 +1350,7 @@ public void internal_dispose_GC (long /*int*/ hDC, GCData data) { */ NSBitmapImageRep imageRep = getRepresentation(); imageRep.bitmapData(); - + NSGraphicsContext contextObj = new NSGraphicsContext(context); contextObj.release(); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Path.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Path.java index 62ce07f30d..824e597c5a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Path.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Path.java @@ -19,7 +19,7 @@ import org.eclipse.swt.internal.cocoa.*; * described using lines, rectangles, arcs, cubic or quadratic bezier curves, * glyphs, or other paths. * <p> - * Application code must explicitly invoke the <code>Path.dispose()</code> + * Application code must explicitly invoke the <code>Path.dispose()</code> * method to release the operating system resources managed by each instance * when those instances are no longer required. * </p> @@ -31,11 +31,11 @@ import org.eclipse.swt.internal.cocoa.*; * @see <a href="http://www.eclipse.org/swt/snippets/#path">Path, Pattern snippets</a> * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: GraphicsExample</a> * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> - * + * * @since 3.1 */ public class Path extends Resource { - + /** * the OS resource for the Path * (Warning: This field is platform dependent) @@ -45,7 +45,7 @@ public class Path extends Resource { * within the packages provided by SWT. It is not available on all * platforms and should never be accessed from application code. * </p> - * + * * @noreference This field is not intended to be referenced by clients. */ public NSBezierPath handle; @@ -60,11 +60,11 @@ public class Path extends Resource { * platforms. * </p> * <p> - * You must dispose the path when it is no longer required. + * You must dispose the path when it is no longer required. * </p> - * + * * @param device the device on which to allocate the path - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the device is null and there is no current device</li> * </ul> @@ -74,7 +74,7 @@ public class Path extends Resource { * @exception SWTError <ul> * <li>ERROR_NO_HANDLES if a handle for the path could not be obtained</li> * </ul> - * + * * @see #dispose() */ public Path (Device device) { @@ -104,13 +104,13 @@ public Path (Device device) { * platforms. * </p> * <p> - * You must dispose the path when it is no longer required. + * You must dispose the path when it is no longer required. * </p> - * + * * @param device the device on which to allocate the path * @param path the path to make a copy * @param flatness the flatness value - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the device is null and there is no current device</li> * <li>ERROR_NULL_ARGUMENT - if the path is null</li> @@ -122,7 +122,7 @@ public Path (Device device) { * @exception SWTError <ul> * <li>ERROR_NO_HANDLES if a handle for the path could not be obtained</li> * </ul> - * + * * @see #dispose() * @since 3.4 */ @@ -141,7 +141,7 @@ public Path (Device device, Path path, float flatness) { NSBezierPath.setDefaultFlatness(flatness); handle = path.handle.bezierPathByFlatteningPath(); handle.retain(); - NSBezierPath.setDefaultFlatness(defaultFlatness); + NSBezierPath.setDefaultFlatness(defaultFlatness); } if (handle == null) SWT.error(SWT.ERROR_NO_HANDLES); init(); @@ -158,12 +158,12 @@ public Path (Device device, Path path, float flatness) { * platforms. * </p> * <p> - * You must dispose the path when it is no longer required. + * You must dispose the path when it is no longer required. * </p> - * + * * @param device the device on which to allocate the path * @param data the data for the path - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the device is null and there is no current device</li> * <li>ERROR_NULL_ARGUMENT - if the data is null</li> @@ -174,7 +174,7 @@ public Path (Device device, Path path, float flatness) { * @exception SWTError <ul> * <li>ERROR_NO_HANDLES if a handle for the path could not be obtained</li> * </ul> - * + * * @see #dispose() * @since 3.4 */ @@ -194,15 +194,15 @@ public Path (Device device, PathData data) { * Adds to the receiver a circular or elliptical arc that lies within * the specified rectangular area. * <p> - * The resulting arc begins at <code>startAngle</code> and extends + * The resulting arc begins at <code>startAngle</code> and extends * for <code>arcAngle</code> degrees. * Angles are interpreted such that 0 degrees is at the 3 o'clock * position. A positive value indicates a counter-clockwise rotation * while a negative value indicates a clockwise rotation. * </p><p> - * The center of the arc is the center of the rectangle whose origin - * is (<code>x</code>, <code>y</code>) and whose size is specified by the - * <code>width</code> and <code>height</code> arguments. + * The center of the arc is the center of the rectangle whose origin + * is (<code>x</code>, <code>y</code>) and whose size is specified by the + * <code>width</code> and <code>height</code> arguments. * </p><p> * The resulting arc covers an area <code>width + 1</code> pixels wide * by <code>height + 1</code> pixels tall. @@ -238,7 +238,7 @@ public void addArc(float x, float y, float width, float height, float startAngle if (closed = (Math.abs(arcAngle) >= 360)) { handle.closePath(); } - } finally { + } finally { if (pool != null) pool.release(); } } @@ -258,7 +258,7 @@ void appendBezierPath (NSBezierPath path) { if (closed) { handle.moveToPoint(pt1); } else { - handle.lineToPoint(pt1); + handle.lineToPoint(pt1); } break; case OS.NSLineToBezierPathElement: @@ -378,7 +378,7 @@ public void addString(String string, float x, float y, Font font) { range.length = str.length(); /* * Feature in Cocoa. Adding attributes directly to a NSTextStorage causes - * output to the console and eventually a segmentation fault when printing + * output to the console and eventually a segmentation fault when printing * on a thread other than the main thread. The fix is to add attributes to * a separate NSMutableAttributedString and add it to text storage when done. */ @@ -505,8 +505,8 @@ public boolean contains(float x, float y, GC gc, boolean outline) { OS.CGContextStrokePath(context); OS.CGContextRelease(context); OS.memmove(buffer, pixel, 4); - OS.free(pixel); - return buffer[0] != 0xFFFFFFFF; + OS.free(pixel); + return buffer[0] != 0xFFFFFFFF; } else { NSPoint point = new NSPoint(); point.x = x; @@ -565,7 +565,7 @@ void destroy() { * receiver (i.e. the bounding box). * * @param bounds the array to hold the result - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the parameter is null</li> * <li>ERROR_INVALID_ARGUMENT - if the parameter is too small to hold the bounding box</li> @@ -596,7 +596,7 @@ public void getBounds(float[] bounds) { * describe the current point of the path. * * @param point the array to hold the result - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the parameter is null</li> * <li>ERROR_INVALID_ARGUMENT - if the parameter is too small to hold the end point</li> @@ -622,13 +622,13 @@ public void getCurrentPoint(float[] point) { /** * Returns a device independent representation of the receiver. - * + * * @return the PathData for the receiver - * + * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see PathData */ public PathData getPathData() { @@ -808,7 +808,7 @@ public void quadTo(float cx, float cy, float x, float y) { ct1.y = current.y + 2 * (cy - current.y) / 3; NSPoint ct2 = new NSPoint(); ct2.x = ct1.x + (x - current.x) / 3; - ct2.y = ct1.y + (y - current.y) / 3; + ct2.y = ct1.y + (y - current.y) / 3; NSPoint pt = new NSPoint(); pt.x = x; pt.y = y; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Pattern.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Pattern.java index 3e61c32d3d..0c7b2db628 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Pattern.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Pattern.java @@ -17,7 +17,7 @@ import org.eclipse.swt.internal.cocoa.*; * Instances of this class represent patterns to use while drawing. Patterns * can be specified either as bitmaps or gradients. * <p> - * Application code must explicitly invoke the <code>Pattern.dispose()</code> + * Application code must explicitly invoke the <code>Pattern.dispose()</code> * method to release the operating system resources managed by each instance * when those instances are no longer required. * </p> @@ -25,7 +25,7 @@ import org.eclipse.swt.internal.cocoa.*; * This class requires the operating system's advanced graphics subsystem * which may not be available on some platforms. * </p> - * + * * @see <a href="http://www.eclipse.org/swt/snippets/#path">Path, Pattern snippets</a> * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: GraphicsExample</a> * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> @@ -49,12 +49,12 @@ public class Pattern extends Resource { * platforms. * </p> * <p> - * You must dispose the pattern when it is no longer required. + * You must dispose the pattern when it is no longer required. * </p> - * + * * @param device the device on which to allocate the pattern * @param image the image that the pattern will draw - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the device is null and there is no current device, or the image is null</li> * <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li> @@ -65,7 +65,7 @@ public class Pattern extends Resource { * @exception SWTError <ul> * <li>ERROR_NO_HANDLES if a handle for the pattern could not be obtained</li> * </ul> - * + * * @see #dispose() */ public Pattern(Device device, Image image) { @@ -94,9 +94,9 @@ public Pattern(Device device, Image image) { * platforms. * </p> * <p> - * You must dispose the pattern when it is no longer required. + * You must dispose the pattern when it is no longer required. * </p> - * + * * @param device the device on which to allocate the pattern * @param x1 the x coordinate of the starting corner of the gradient * @param y1 the y coordinate of the starting corner of the gradient @@ -104,9 +104,9 @@ public Pattern(Device device, Image image) { * @param y2 the y coordinate of the ending corner of the gradient * @param color1 the starting color of the gradient * @param color2 the ending color of the gradient - * + * * @exception IllegalArgumentException <ul> - * <li>ERROR_NULL_ARGUMENT - if the device is null and there is no current device, + * <li>ERROR_NULL_ARGUMENT - if the device is null and there is no current device, * or if either color1 or color2 is null</li> * <li>ERROR_INVALID_ARGUMENT - if either color1 or color2 has been disposed</li> * </ul> @@ -116,7 +116,7 @@ public Pattern(Device device, Image image) { * @exception SWTError <ul> * <li>ERROR_NO_HANDLES if a handle for the pattern could not be obtained</li> * </ul> - * + * * @see #dispose() */ public Pattern(Device device, float x1, float y1, float x2, float y2, Color color1, Color color2) { @@ -132,9 +132,9 @@ public Pattern(Device device, float x1, float y1, float x2, float y2, Color colo * platforms. * </p> * <p> - * You must dispose the pattern when it is no longer required. + * You must dispose the pattern when it is no longer required. * </p> - * + * * @param device the device on which to allocate the pattern * @param x1 the x coordinate of the starting corner of the gradient * @param y1 the y coordinate of the starting corner of the gradient @@ -144,9 +144,9 @@ public Pattern(Device device, float x1, float y1, float x2, float y2, Color colo * @param alpha1 the starting alpha value of the gradient * @param color2 the ending color of the gradient * @param alpha2 the ending alpha value of the gradient - * + * * @exception IllegalArgumentException <ul> - * <li>ERROR_NULL_ARGUMENT - if the device is null and there is no current device, + * <li>ERROR_NULL_ARGUMENT - if the device is null and there is no current device, * or if either color1 or color2 is null</li> * <li>ERROR_INVALID_ARGUMENT - if either color1 or color2 has been disposed</li> * </ul> @@ -156,9 +156,9 @@ public Pattern(Device device, float x1, float y1, float x2, float y2, Color colo * @exception SWTError <ul> * <li>ERROR_NO_HANDLES if a handle for the pattern could not be obtained</li> * </ul> - * + * * @see #dispose() - * + * * @since 3.2 */ public Pattern(Device device, float x1, float y1, float x2, float y2, Color color1, int alpha1, Color color2, int alpha2) { @@ -225,5 +225,5 @@ public String toString() { if (isDisposed()) return "Pattern {*DISPOSED*}"; return "Pattern {" + (color != null ? color.id : gradient.id) + "}"; } - + } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Region.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Region.java index a071af29b9..9fcb9b9d53 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Region.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Region.java @@ -20,11 +20,11 @@ import org.eclipse.swt.*; * system that are aggregates of the areas covered by a number * of polygons. * <p> - * Application code must explicitly invoke the <code>Region.dispose()</code> + * Application code must explicitly invoke the <code>Region.dispose()</code> * method to release the operating system resources managed by each instance * when those instances are no longer required. * </p> - * + * * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: GraphicsExample</a> * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ @@ -38,7 +38,7 @@ public final class Region extends Resource { * within the packages provided by SWT. It is not available on all * platforms and should never be accessed from application code. * </p> - * + * * @noreference This field is not intended to be referenced by clients. */ public long /*int*/ handle; @@ -46,13 +46,13 @@ public final class Region extends Resource { /** * Constructs a new empty region. * <p> - * You must dispose the region when it is no longer required. + * You must dispose the region when it is no longer required. * </p> - * + * * @exception SWTError <ul> * <li>ERROR_NO_HANDLES if a handle could not be obtained for region creation</li> * </ul> - * + * * @see #dispose() */ public Region() { @@ -62,7 +62,7 @@ public Region() { /** * Constructs a new empty region. * <p> - * You must dispose the region when it is no longer required. + * You must dispose the region when it is no longer required. * </p> * * @param device the device on which to allocate the region @@ -75,7 +75,7 @@ public Region() { * </ul> * * @see #dispose() - * + * * @since 3.0 */ public Region(Device device) { @@ -96,7 +96,7 @@ Region(Device device, long /*int*/ handle) { this.handle = handle; } -/** +/** * Invokes platform specific functionality to allocate a new region. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public @@ -109,7 +109,7 @@ Region(Device device, long /*int*/ handle) { * @param device the device on which to allocate the region * @param handle the handle for the region * @return a new region object containing the specified device and handle - * + * * @noreference This method is not intended to be referenced by clients. */ public static Region cocoa_new(Device device, long /*int*/ handle) { @@ -136,7 +136,7 @@ static long /*int*/ polyToRgn(int[] poly, int length) { x1 = x2; y1 = y2; } - int x2 = poly[0], y2 = poly[1]; + int x2 = poly[0], y2 = poly[1]; if (y1 != y2 && ((y1 <= y && y < y2) || (y2 <= y && y < y1))) { inter[count++] = (int)((((y - y1) / (float)(y2 - y1)) * (x2 - x1)) + x1 + 0.5f); } @@ -211,7 +211,7 @@ public void add (int[] pointArray) { if (pool != null) pool.release(); } } - + void add(int[] pointArray, int count) { count = count / 2 * 2; if (count <= 2) return; @@ -268,7 +268,7 @@ public void add(Rectangle rect) { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @since 3.1 */ public void add(int x, int y, int width, int height) { @@ -496,8 +496,8 @@ long /*int*/ regionToRects(long /*int*/ message, long /*int*/ rgn, long /*int*/ } /** - * Returns an integer hash code for the receiver. Any two - * objects that return <code>true</code> when passed to + * Returns an integer hash code for the receiver. Any two + * objects that return <code>true</code> when passed to * <code>equals</code> must return the same value for this * method. * @@ -523,7 +523,7 @@ public int hashCode() { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @since 3.0 */ public void intersect(Rectangle rect) { @@ -547,7 +547,7 @@ public void intersect(Rectangle rect) { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @since 3.1 */ public void intersect(int x, int y, int width, int height) { @@ -581,7 +581,7 @@ public void intersect(int x, int y, int width, int height) { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @since 3.0 */ public void intersect(Region region) { @@ -698,7 +698,7 @@ public boolean isEmpty() { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @since 3.0 */ public void subtract (int[] pointArray) { @@ -729,7 +729,7 @@ public void subtract (int[] pointArray) { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @since 3.0 */ public void subtract(Rectangle rect) { @@ -753,7 +753,7 @@ public void subtract(Rectangle rect) { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @since 3.1 */ public void subtract(int x, int y, int width, int height) { @@ -787,7 +787,7 @@ public void subtract(int x, int y, int width, int height) { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @since 3.0 */ public void subtract(Region region) { @@ -813,7 +813,7 @@ public void subtract(Region region) { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @since 3.1 */ public void translate (int x, int y) { @@ -839,7 +839,7 @@ public void translate (int x, int y) { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @since 3.1 */ public void translate (Point pt) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/TextLayout.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/TextLayout.java index 186246dc7b..ade5c4e27e 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/TextLayout.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/TextLayout.java @@ -22,19 +22,19 @@ import org.eclipse.swt.*; * navigation, hit testing, text wrapping, alignment, tab expansion * line breaking, etc. These are aspects required for rendering internationalized text. * </p><p> - * Application code must explicitly invoke the <code>TextLayout#dispose()</code> + * Application code must explicitly invoke the <code>TextLayout#dispose()</code> * method to release the operating system resources managed by each instance * when those instances are no longer required. * </p> - * + * * @see <a href="http://www.eclipse.org/swt/snippets/#textlayout">TextLayout, TextStyle snippets</a> * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: CustomControlExample, StyledText tab</a> * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> - * + * * @since 3.0 */ public final class TextLayout extends Resource { - + NSTextStorage textStorage; NSLayoutManager layoutManager; NSTextContainer textContainer; @@ -50,20 +50,20 @@ public final class TextLayout extends Resource { char[] segmentsChars; int wrapWidth; int orientation; - + int[] lineOffsets; NSRect[] lineBounds; - + // the following Callbacks are never freed static Callback textLayoutCallback2; static final byte[] SWT_OBJECT = {'S', 'W', 'T', '_', 'O', 'B', 'J', 'E', 'C', 'T', '\0'}; - + static final int TAB_COUNT = 32; static final int UNDERLINE_THICK = 1 << 16; static final RGB LINK_FOREGROUND = new RGB (0, 51, 153); int[] invalidOffsets; static final char LTR_MARK = '\u200E', RTL_MARK = '\u200F'; - + static class StyleItem { TextStyle style; int start; @@ -74,19 +74,19 @@ public final class TextLayout extends Resource { return "StyleItem {" + start + ", " + style + "}"; } } - -/** + +/** * Constructs a new instance of this class on the given device. * <p> - * You must dispose the text layout when it is no longer required. + * You must dispose the text layout when it is no longer required. * </p> - * + * * @param device the device on which to allocate the text layout - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li> * </ul> - * + * * @see #dispose() */ public TextLayout (Device device) { @@ -115,7 +115,7 @@ float[] computePolyline(int left, int top, int right, int bottom) { } int length = ((2 * peaks) + 1) * 2; if (length < 0) return new float[0]; - + float[] coordinates = new float[length]; for (int i = 0; i < peaks; i++) { int index = 4 * i; @@ -140,7 +140,7 @@ void computeRuns() { /* * Bug in Cocoa. Adding attributes directly to a NSTextStorage causes - * output to the console and eventually a segmentation fault when printing + * output to the console and eventually a segmentation fault when printing * on a thread other than the main thread. The fix is to add attributes to * a separate NSMutableAttributedString and set it to text storage when done. */ @@ -210,7 +210,7 @@ void computeRuns() { for (int i = 0; i < stylesCount - 1; i++) { StyleItem run = styles[i]; if (run.style == null) continue; - TextStyle style = run.style; + TextStyle style = run.style; range.location = textLength != 0 ? translateOffset(run.start) : 0; range.length = translateOffset(styles[i + 1].start) - range.location; Font font = style.font; @@ -279,7 +279,7 @@ void computeRuns() { string = string.initWithCharacters(buffer, buffer.length); attrStr.replaceCharactersInRange(range, string); string.release(); - + run.jniRef = OS.NewGlobalRef(run); if (run.jniRef == 0) SWT.error(SWT.ERROR_NO_HANDLES); run.cell = (SWTTextAttachmentCell) new SWTTextAttachmentCell().alloc().init(); @@ -312,7 +312,7 @@ void computeRuns() { } textStorage.setAttributedString(attrStr); attrStr.release(); - + int numberOfLines; layoutManager.glyphRangeForTextContainer(textContainer); long /*int*/ numberOfGlyphs = layoutManager.numberOfGlyphs(), index; @@ -362,7 +362,7 @@ void destroy() { /** * Draws the receiver's text using the specified GC at the specified * point. - * + * * @param gc the GC to draw * @param x the x coordinate of the top left corner of the rectangular area where the text is to be drawn * @param y the y coordinate of the top left corner of the rectangular area where the text is to be drawn @@ -381,7 +381,7 @@ public void draw(GC gc, int x, int y) { /** * Draws the receiver's text using the specified GC at the specified * point. - * + * * @param gc the GC to draw * @param x the x coordinate of the top left corner of the rectangular area where the text is to be drawn * @param y the y coordinate of the top left corner of the rectangular area where the text is to be drawn @@ -425,7 +425,7 @@ public void draw(GC gc, int x, int y, int selectionStart, int selectionEnd, Colo * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the gc is null</li> * </ul> - * + * * @since 3.3 */ public void draw(GC gc, int x, int y, int selectionStart, int selectionEnd, Color selectionForeground, Color selectionBackground, int flags) { @@ -511,9 +511,9 @@ public void draw(GC gc, int x, int y, int selectionStart, int selectionEnd, Colo TextStyle style = run.style; if (style == null) continue; boolean drawUnderline = style.underline && !isUnderlineSupported(style); - drawUnderline = drawUnderline && (j + 1 == stylesCount || !style.isAdherentUnderline(styles[j + 1].style)); + drawUnderline = drawUnderline && (j + 1 == stylesCount || !style.isAdherentUnderline(styles[j + 1].style)); boolean drawBorder = style.borderStyle != SWT.NONE; - drawBorder = drawBorder && (j + 1 == stylesCount || !style.isAdherentBorder(styles[j + 1].style)); + drawBorder = drawBorder && (j + 1 == stylesCount || !style.isAdherentBorder(styles[j + 1].style)); if (!drawUnderline && !drawBorder) continue; int end = j + 1 < stylesCount ? translateOffset(styles[j + 1].start - 1) : length; for (int i = 0; i < lineOffsets.length - 1; i++) { @@ -674,7 +674,7 @@ void freeRuns() { } } -/** +/** * Returns the receiver's horizontal text alignment, which will be one * of <code>SWT.LEFT</code>, <code>SWT.CENTER</code> or * <code>SWT.RIGHT</code>. @@ -698,14 +698,14 @@ public int getAlignment() { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see #getDescent() * @see #setDescent(int) * @see #setAscent(int) * @see #getLineMetrics(int) */ public int getAscent () { - checkLayout(); + checkLayout(); return ascent; } @@ -713,13 +713,13 @@ public int getAscent () { * Returns the bounds of the receiver. The width returned is either the * width of the longest line or the width set using {@link TextLayout#setWidth(int)}. * To obtain the text bounds of a line use {@link TextLayout#getLineBounds(int)}. - * + * * @return the bounds of the receiver - * + * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see #setWidth(int) * @see #getLineBounds(int) */ @@ -748,11 +748,11 @@ public Rectangle getBounds() { * bounds is the smallest rectangle that encompasses all characters * in the range. The start and end offsets are inclusive and will be * clamped if out of range. - * + * * @param start the start offset * @param end the end offset * @return the bounds of the character range - * + * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> @@ -800,18 +800,18 @@ public Rectangle getBounds(int start, int end) { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see #getAscent() * @see #setAscent(int) * @see #setDescent(int) * @see #getLineMetrics(int) */ public int getDescent () { - checkLayout(); + checkLayout(); return descent; } -/** +/** * Returns the default font currently being used by the receiver * to draw and measure text. * @@ -830,15 +830,15 @@ public Font getFont () { * Returns the receiver's indent. * * @return the receiver's indent -* +* * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> -* +* * @since 3.2 */ public int getIndent () { - checkLayout(); + checkLayout(); return indent; } @@ -846,11 +846,11 @@ public int getIndent () { * Returns the receiver's justification. * * @return the receiver's justification -* +* * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> -* +* * @since 3.2 */ public boolean getJustify () { @@ -862,10 +862,10 @@ public boolean getJustify () { * Returns the embedding level for the specified character offset. The * embedding level is usually used to determine the directionality of a * character in bidirectional text. - * + * * @param offset the character offset * @return the embedding level - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the character offset is out of range</li> * </ul> @@ -897,9 +897,9 @@ public int getLevel(int offset) { * Returns the line offsets. Each value in the array is the * offset for the first character in a line except for the last * value, which contains the length of the text. - * + * * @return the line offsets - * + * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> @@ -923,10 +923,10 @@ public int[] getLineOffsets() { /** * Returns the index of the line that contains the specified * character offset. - * + * * @param offset the character offset * @return the line index - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the character offset is out of range</li> * </ul> @@ -956,10 +956,10 @@ public int getLineIndex(int offset) { /** * Returns the bounds of the line for the specified line index. - * + * * @param lineIndex the line index - * @return the line bounds - * + * @return the line bounds + * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the line index is out of range</li> * </ul> @@ -987,7 +987,7 @@ public Rectangle getLineBounds(int lineIndex) { * by wrapping. * * @return the line count - * + * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> @@ -997,7 +997,7 @@ public int getLineCount() { NSAutoreleasePool pool = null; if (!NSThread.isMainThread()) pool = (NSAutoreleasePool) new NSAutoreleasePool().alloc().init(); try { - computeRuns(); + computeRuns(); return lineOffsets.length - 1; } finally { if (pool != null) pool.release(); @@ -1006,10 +1006,10 @@ public int getLineCount() { /** * Returns the font metrics for the specified line index. - * + * * @param lineIndex the line index - * @return the font metrics - * + * @return the font metrics + * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the line index is out of range</li> * </ul> @@ -1046,15 +1046,15 @@ public FontMetrics getLineMetrics (int lineIndex) { * Returns the location for the specified character offset. The * <code>trailing</code> argument indicates whether the offset * corresponds to the leading or trailing edge of the cluster. - * + * * @param offset the character offset * @param trailing the trailing flag * @return the location of the character offset - * + * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see #getOffset(Point, int[]) * @see #getOffset(int, int, int[]) */ @@ -1103,12 +1103,12 @@ public Point getLocation(int offset, boolean trailing) { /** * Returns the next offset for the specified offset and movement - * type. The movement is one of <code>SWT.MOVEMENT_CHAR</code>, + * type. The movement is one of <code>SWT.MOVEMENT_CHAR</code>, * <code>SWT.MOVEMENT_CLUSTER</code>, <code>SWT.MOVEMENT_WORD</code>, * <code>SWT.MOVEMENT_WORD_END</code> or <code>SWT.MOVEMENT_WORD_START</code>. - * + * * @param offset the start offset - * @param movement the movement type + * @param movement the movement type * @return the next offset * * @exception IllegalArgumentException <ul> @@ -1117,7 +1117,7 @@ public Point getLocation(int offset, boolean trailing) { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see #getPreviousOffset(int, int) */ public int getNextOffset (int offset, int movement) { @@ -1200,18 +1200,18 @@ int _getOffset (int offset, int movement, boolean forward) { } /** - * Returns the character offset for the specified point. - * For a typical character, the trailing argument will be filled in to + * Returns the character offset for the specified point. + * For a typical character, the trailing argument will be filled in to * indicate whether the point is closer to the leading edge (0) or - * the trailing edge (1). When the point is over a cluster composed - * of multiple characters, the trailing argument will be filled with the + * the trailing edge (1). When the point is over a cluster composed + * of multiple characters, the trailing argument will be filled with the * position of the character in the cluster that is closest to * the point. - * + * * @param point the point * @param trailing the trailing buffer * @return the character offset - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the trailing length is less than <code>1</code></li> * <li>ERROR_NULL_ARGUMENT - if the point is null</li> @@ -1219,7 +1219,7 @@ int _getOffset (int offset, int movement, boolean forward) { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see #getLocation(int, boolean) */ public int getOffset(Point point, int[] trailing) { @@ -1229,26 +1229,26 @@ public int getOffset(Point point, int[] trailing) { } /** - * Returns the character offset for the specified point. - * For a typical character, the trailing argument will be filled in to + * Returns the character offset for the specified point. + * For a typical character, the trailing argument will be filled in to * indicate whether the point is closer to the leading edge (0) or - * the trailing edge (1). When the point is over a cluster composed - * of multiple characters, the trailing argument will be filled with the + * the trailing edge (1). When the point is over a cluster composed + * of multiple characters, the trailing argument will be filled with the * position of the character in the cluster that is closest to * the point. - * + * * @param x the x coordinate of the point * @param y the y coordinate of the point * @param trailing the trailing buffer * @return the character offset - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the trailing length is less than <code>1</code></li> * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see #getLocation(int, boolean) */ public int getOffset(int x, int y, int[] trailing) { @@ -1291,7 +1291,7 @@ public int getOffset(int x, int y, int[] trailing) { * Returns the orientation of the receiver. * * @return the orientation style - * + * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> @@ -1303,12 +1303,12 @@ public int getOrientation() { /** * Returns the previous offset for the specified offset and movement - * type. The movement is one of <code>SWT.MOVEMENT_CHAR</code>, + * type. The movement is one of <code>SWT.MOVEMENT_CHAR</code>, * <code>SWT.MOVEMENT_CLUSTER</code> or <code>SWT.MOVEMENT_WORD</code>, * <code>SWT.MOVEMENT_WORD_END</code> or <code>SWT.MOVEMENT_WORD_START</code>. - * + * * @param offset the start offset - * @param movement the movement type + * @param movement the movement type * @return the previous offset * * @exception IllegalArgumentException <ul> @@ -1317,7 +1317,7 @@ public int getOrientation() { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see #getNextOffset(int, int) */ public int getPreviousOffset (int offset, int movement) { @@ -1334,14 +1334,14 @@ public int getPreviousOffset (int offset, int movement) { * Gets the ranges of text that are associated with a <code>TextStyle</code>. * * @return the ranges, an array of offsets representing the start and end of each - * text style. + * text style. * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see #getStyles() - * + * * @since 3.2 */ public int[] getRanges () { @@ -1384,7 +1384,7 @@ public int[] getSegments() { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @since 3.6 */ public char[] getSegmentsChars () { @@ -1435,7 +1435,7 @@ String getSegmentsText() { * </ul> */ public int getSpacing () { - checkLayout(); + checkLayout(); return spacing; } @@ -1473,9 +1473,9 @@ public TextStyle getStyle (int offset) { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see #getRanges() - * + * * @since 3.2 */ public TextStyle[] getStyles () { @@ -1528,7 +1528,7 @@ public String getText () { * Returns the text direction of the receiver. * * @return the text direction value - * + * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> @@ -1557,28 +1557,28 @@ public int getWidth () { * Returns the receiver's wrap indent. * * @return the receiver's wrap indent -* +* * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> -* +* * @since 3.6 */ public int getWrapIndent () { - checkLayout(); + checkLayout(); return wrapIndent; } void initClasses () { String className = "SWTTextAttachmentCell"; if (OS.objc_lookUpClass(className) != 0) return; - + textLayoutCallback2 = new Callback(getClass(), "textLayoutProc", 2); long /*int*/ proc2 = textLayoutCallback2.getAddress(); if (proc2 == 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS); long /*int*/ cellBaselineOffsetProc = OS.CALLBACK_cellBaselineOffset(proc2); long /*int*/ cellSizeProc = OS.CALLBACK_NSTextAttachmentCell_cellSize(proc2); - + byte[] types = {'*','\0'}; int size = C.PTR_SIZEOF, align = C.PTR_SIZEOF == 4 ? 2 : 3; long /*int*/ cls = OS.objc_allocateClassPair(OS.class_NSCell, className, 0); @@ -1626,12 +1626,12 @@ boolean isUnderlineSupported (TextStyle style) { * alignment. * </p> * - * @param alignment the new alignment + * @param alignment the new alignment * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see #setWidth(int) */ public void setAlignment (int alignment) { @@ -1666,7 +1666,7 @@ public void setAlignment (int alignment) { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see #setDescent(int) * @see #getLineMetrics(int) */ @@ -1698,7 +1698,7 @@ public void setAscent (int ascent) { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see #setAscent(int) * @see #getLineMetrics(int) */ @@ -1716,7 +1716,7 @@ public void setDescent (int descent) { } } -/** +/** * Sets the default font which will be used by the receiver * to draw and measure text. If the * argument is null, then a default font appropriate @@ -1749,17 +1749,17 @@ public void setFont (Font font) { } /** - * Sets the indent of the receiver. This indent is applied to the first line of - * each paragraph. + * Sets the indent of the receiver. This indent is applied to the first line of + * each paragraph. * * @param indent new indent - * + * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see #setWrapIndent(int) - * + * * @since 3.2 */ public void setIndent (int indent) { @@ -1778,16 +1778,16 @@ public void setIndent (int indent) { /** * Sets the wrap indent of the receiver. This indent is applied to all lines - * in the paragraph except the first line. + * in the paragraph except the first line. * * @param wrapIndent new wrap indent - * + * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see #setIndent(int) - * + * * @since 3.6 */ public void setWrapIndent (int wrapIndent) { @@ -1806,14 +1806,14 @@ public void setWrapIndent (int wrapIndent) { /** * Sets the justification of the receiver. Note that the receiver's - * width must be set in order to use justification. + * width must be set in order to use justification. * * @param justify new justify - * + * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @since 3.2 */ public void setJustify (boolean justify) { @@ -1834,7 +1834,7 @@ public void setJustify (boolean justify) { * of <code>SWT.LEFT_TO_RIGHT</code> or <code>SWT.RIGHT_TO_LEFT</code>. * * @param orientation new orientation style - * + * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> @@ -1859,25 +1859,25 @@ public void setOrientation(int orientation) { /** * Sets the offsets of the receiver's text segments. Text segments are used to * override the default behavior of the bidirectional algorithm. - * Bidirectional reordering can happen within a text segment but not + * Bidirectional reordering can happen within a text segment but not * between two adjacent segments. * <p> - * Each text segment is determined by two consecutive offsets in the - * <code>segments</code> arrays. The first element of the array should + * Each text segment is determined by two consecutive offsets in the + * <code>segments</code> arrays. The first element of the array should * always be zero and the last one should always be equals to length of * the text. * </p> * <p> * When segments characters are set, the segments are the offsets where * the characters are inserted in the text. - * <p> - * + * <p> + * * @param segments the text segments offset - * + * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see #setSegmentsChars(char[]) */ public void setSegments(int[] segments) { @@ -1903,20 +1903,20 @@ public void setSegments(int[] segments) { } /** - * Sets the characters to be used in the segments boundaries. The segments + * Sets the characters to be used in the segments boundaries. The segments * are set by calling <code>setSegments(int[])</code>. The application can * use this API to insert Unicode Control Characters in the text to control - * the display of the text and bidi reordering. The characters are not + * the display of the text and bidi reordering. The characters are not * accessible by any other API in <code>TextLayout</code>. - * - * @param segmentsChars the segments characters + * + * @param segmentsChars the segments characters * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see #setSegments(int[]) - * + * * @since 3.6 */ public void setSegmentsChars(char[] segmentsChars) { @@ -1945,7 +1945,7 @@ public void setSegmentsChars(char[] segmentsChars) { * Sets the line spacing of the receiver. The line spacing * is the space left between lines. * - * @param spacing the new line spacing + * @param spacing the new line spacing * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the spacing is negative</li> @@ -1972,11 +1972,11 @@ public void setSpacing (int spacing) { * Sets the style of the receiver for the specified range. Styles previously * set for that range will be overwritten. The start and end offsets are * inclusive and will be clamped if out of range. - * + * * @param style the style * @param start the start offset * @param end the end offset - * + * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> @@ -2019,14 +2019,14 @@ public void setStyle (TextStyle style, int start, int end) { modifyEnd++; } if (modifyStart == modifyEnd) { - int styleStart = styles[modifyStart].start; + int styleStart = styles[modifyStart].start; int styleEnd = styles[modifyEnd + 1].start - 1; if (styleStart == start && styleEnd == end) { styles[modifyStart].style = style; return; } if (styleStart != start && styleEnd != end) { - int newLength = stylesCount + 2; + int newLength = stylesCount + 2; if (newLength > styles.length) { int newSize = Math.min(newLength + 1024, Math.max(64, newLength * 2)); StyleItem[] newStyles = new StyleItem[newSize]; @@ -2037,7 +2037,7 @@ public void setStyle (TextStyle style, int start, int end) { StyleItem item = new StyleItem(); item.start = start; item.style = style; - styles[modifyStart + 1] = item; + styles[modifyStart + 1] = item; item = new StyleItem(); item.start = end + 1; item.style = styles[modifyStart].style; @@ -2071,9 +2071,9 @@ public void setStyle (TextStyle style, int start, int end) { * Sets the receiver's tab list. Each value in the tab list specifies * the space in pixels from the origin of the text layout to the respective * tab stop. The last tab stop width is repeated continuously. - * + * * @param tabs the new tab list - * + * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> @@ -2103,11 +2103,11 @@ public void setTabs(int[] tabs) { /** * Sets the receiver's text. *<p> - * Note: Setting the text also clears all the styles. This method - * returns without doing anything if the new text is the same as + * Note: Setting the text also clears all the styles. This method + * returns without doing anything if the new text is the same as * the current text. * </p> - * + * * @param text the new text * * @exception IllegalArgumentException <ul> @@ -2146,7 +2146,7 @@ public void setText (String text) { * </p> * * @param textDirection the new text direction - * + * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> @@ -2161,7 +2161,7 @@ public void setTextDirection (int textDirection) { * text should be wrapped and aligned. The default value is * <code>-1</code> which means wrapping is disabled. * - * @param width the new width + * @param width the new width * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the width is <code>0</code> or less than <code>-1</code></li> @@ -2169,7 +2169,7 @@ public void setTextDirection (int textDirection) { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see #setAlignment(int) */ public void setWidth (int width) { @@ -2244,7 +2244,7 @@ int translateOffset (int offset) { } for (int i = 0; i < nSegments && offset - i >= segments[i]; i++) { offset++; - } + } return offset; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Transform.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Transform.java index 8866875ec1..3de4316976 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Transform.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Transform.java @@ -14,10 +14,10 @@ import org.eclipse.swt.*; import org.eclipse.swt.internal.cocoa.*; /** - * Instances of this class represent transformation matrices for + * Instances of this class represent transformation matrices for * points expressed as (x, y) pairs of floating point numbers. * <p> - * Application code must explicitly invoke the <code>Transform.dispose()</code> + * Application code must explicitly invoke the <code>Transform.dispose()</code> * method to release the operating system resources managed by each instance * when those instances are no longer required. * </p> @@ -25,10 +25,10 @@ import org.eclipse.swt.internal.cocoa.*; * This class requires the operating system's advanced graphics subsystem * which may not be available on some platforms. * </p> - * + * * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: GraphicsExample</a> * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> - * + * * @since 3.1 */ public class Transform extends Resource { @@ -41,11 +41,11 @@ public class Transform extends Resource { * within the packages provided by SWT. It is not available on all * platforms and should never be accessed from application code. * </p> - * + * * @noreference This field is not intended to be referenced by clients. */ public NSAffineTransform handle; - + /** * Constructs a new identity Transform. * <p> @@ -54,11 +54,11 @@ public class Transform extends Resource { * platforms. * </p> * <p> - * You must dispose the transform when it is no longer required. + * You must dispose the transform when it is no longer required. * </p> - * + * * @param device the device on which to allocate the Transform - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li> * </ul> @@ -68,7 +68,7 @@ public class Transform extends Resource { * @exception SWTError <ul> * <li>ERROR_NO_HANDLES if a handle for the Transform could not be obtained</li> * </ul> - * + * * @see #dispose() */ public Transform (Device device) { @@ -76,7 +76,7 @@ public Transform (Device device) { } /** - * Constructs a new Transform given an array of elements that represent the + * Constructs a new Transform given an array of elements that represent the * matrix that describes the transformation. * <p> * This operation requires the operating system's advanced @@ -84,12 +84,12 @@ public Transform (Device device) { * platforms. * </p> * <p> - * You must dispose the transform when it is no longer required. + * You must dispose the transform when it is no longer required. * </p> - * + * * @param device the device on which to allocate the Transform * @param elements an array of floats that describe the transformation matrix - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device, or the elements array is null</li> * <li>ERROR_INVALID_ARGUMENT - if the elements array is too small to hold the matrix values</li> @@ -100,7 +100,7 @@ public Transform (Device device) { * @exception SWTError <ul> * <li>ERROR_NO_HANDLES if a handle for the Transform could not be obtained</li> * </ul> - * + * * @see #dispose() */ public Transform(Device device, float[] elements) { @@ -108,7 +108,7 @@ public Transform(Device device, float[] elements) { } /** - * Constructs a new Transform given all of the elements that represent the + * Constructs a new Transform given all of the elements that represent the * matrix that describes the transformation. * <p> * This operation requires the operating system's advanced @@ -116,9 +116,9 @@ public Transform(Device device, float[] elements) { * platforms. * </p> * <p> - * You must dispose the transform when it is no longer required. + * You must dispose the transform when it is no longer required. * </p> - * + * * @param device the device on which to allocate the Transform * @param m11 the first element of the first row of the matrix * @param m12 the second element of the first row of the matrix @@ -126,7 +126,7 @@ public Transform(Device device, float[] elements) { * @param m22 the second element of the second row of the matrix * @param dx the third element of the first row of the matrix * @param dy the third element of the second row of the matrix - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li> * </ul> @@ -136,7 +136,7 @@ public Transform(Device device, float[] elements) { * @exception SWTError <ul> * <li>ERROR_NO_HANDLES if a handle for the Transform could not be obtained</li> * </ul> - * + * * @see #dispose() */ public Transform (Device device, float m11, float m12, float m21, float m22, float dx, float dy) { @@ -201,12 +201,12 @@ public void getElements(float[] elements) { /** * Modifies the receiver such that the matrix it represents becomes the - * identity matrix. + * identity matrix. * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @since 3.4 */ public void identity() { @@ -225,7 +225,7 @@ public void identity() { /** * Modifies the receiver such that the matrix it represents becomes - * the mathematical inverse of the matrix it previously represented. + * the mathematical inverse of the matrix it previously represented. * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> @@ -283,10 +283,10 @@ public boolean isIdentity() { /** * Modifies the receiver such that the matrix it represents becomes the * the result of multiplying the matrix it previously represented by the - * argument. + * argument. * * @param matrix the matrix to multiply the receiver by - * + * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> @@ -316,7 +316,7 @@ public void multiply(Transform matrix) { * while a negative value indicates a counter-clockwise rotation. * * @param angle the angle to rotate the transformation by - * + * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> @@ -335,10 +335,10 @@ public void rotate(float angle) { /** * Modifies the receiver so that it represents a transformation that is * equivalent to its previous transformation scaled by (scaleX, scaleY). - * + * * @param scaleX the amount to scale in the X direction * @param scaleY the amount to scale in the Y direction - * + * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> @@ -357,14 +357,14 @@ public void scale(float scaleX, float scaleY) { /** * Modifies the receiver to represent a new transformation given all of * the elements that represent the matrix that describes that transformation. - * + * * @param m11 the first element of the first row of the matrix * @param m12 the second element of the first row of the matrix * @param m21 the first element of the second row of the matrix * @param m22 the second element of the second row of the matrix * @param dx the third element of the first row of the matrix * @param dy the third element of the second row of the matrix - * + * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> @@ -390,14 +390,14 @@ public void setElements(float m11, float m12, float m21, float m22, float dx, fl /** * Modifies the receiver so that it represents a transformation that is * equivalent to its previous transformation sheared by (shearX, shearY). - * + * * @param shearX the shear factor in the X direction * @param shearY the shear factor in the Y direction - * + * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @since 3.4 */ public void shear(float shearX, float shearY) { @@ -418,7 +418,7 @@ public void shear(float shearX, float shearY) { } } -/** +/** * Given an array containing points described by alternating x and y values, * modify that array such that each point has been replaced with the result of * applying the transformation represented by the receiver to that point. @@ -427,7 +427,7 @@ public void shear(float shearX, float shearY) { * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the point array is null</li> - * </ul> + * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> @@ -444,8 +444,8 @@ public void transform(float[] pointArray) { point.x = pointArray[j]; point.y = pointArray[j + 1]; point = handle.transformPoint(point); - pointArray[j] = (float)/*64*/point.x; - pointArray[j + 1] = (float)/*64*/point.y; + pointArray[j] = (float)/*64*/point.x; + pointArray[j + 1] = (float)/*64*/point.y; } } finally { if (pool != null) pool.release(); @@ -455,10 +455,10 @@ public void transform(float[] pointArray) { /** * Modifies the receiver so that it represents a transformation that is * equivalent to its previous transformation translated by (offsetX, offsetY). - * + * * @param offsetX the distance to translate in the X direction * @param offsetY the distance to translate in the Y direction - * + * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Button.java index c7d276b04d..4b7bc86d7a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Button.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Button.java @@ -18,7 +18,7 @@ import org.eclipse.swt.internal.cocoa.*; /** * Instances of this class represent a selectable user interface object that - * issues notification when pressed and released. + * issues notification when pressed and released. * <dl> * <dt><b>Styles:</b></dt> * <dd>ARROW, CHECK, PUSH, RADIO, TOGGLE, FLAT, WRAP</dd> @@ -27,7 +27,7 @@ import org.eclipse.swt.internal.cocoa.*; * <dd>Selection</dd> * </dl> * <p> - * Note: Only one of the styles ARROW, CHECK, PUSH, RADIO, and TOGGLE + * Note: Only one of the styles ARROW, CHECK, PUSH, RADIO, and TOGGLE * may be specified. * </p><p> * Note: Only one of the styles LEFT, RIGHT, and CENTER may be specified. @@ -37,7 +37,7 @@ import org.eclipse.swt.internal.cocoa.*; * </p><p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> - * + * * @see <a href="http://www.eclipse.org/swt/snippets/#button">Button snippets</a> * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a> * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> @@ -47,21 +47,21 @@ public class Button extends Control { String text; Image image; boolean grayed; - + static final int EXTRA_HEIGHT = 2; static final int EXTRA_WIDTH = 6; static final int IMAGE_GAP = 2; static final int SMALL_BUTTON_HEIGHT = 28; static final int REGULAR_BUTTON_HEIGHT = 32; static final int MAX_SIZE = 40000; - + /** * Constructs a new instance of this class given its parent * and a style value describing its behavior and appearance. * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -108,7 +108,7 @@ public Button (Composite parent, int style) { * </p> * <p> * When the <code>SWT.RADIO</code> style bit is set, the <code>widgetSelected</code> method is - * also called when the receiver loses selection because another item in the same radio group + * also called when the receiver loses selection because another item in the same radio group * was selected by the user. During <code>widgetSelected</code> the application can use * <code>getSelection()</code> to determine the current selected state of the receiver. * </p> @@ -143,7 +143,7 @@ NSSize cellSizeForBounds (long /*int*/ id, long /*int*/ sel, NSRect cellFrame) { size.width += imageSize.width + IMAGE_GAP; size.height = Math.max(size.height, imageSize.height); } - + if (((style & (SWT.PUSH|SWT.TOGGLE)) !=0) && (style & (SWT.FLAT|SWT.WRAP)) == 0) { if (image != null) { NSCell cell = new NSCell(id); @@ -152,7 +152,7 @@ NSSize cellSizeForBounds (long /*int*/ id, long /*int*/ sel, NSRect cellFrame) { // TODO: Why is this necessary? size.width += EXTRA_WIDTH; } - + if ((style & SWT.WRAP) != 0 && text.length() != 0 && cellFrame.width < MAX_SIZE) { NSCell cell = new NSCell (id); NSRect titleRect = cell.titleRectForBounds(cellFrame); @@ -252,7 +252,7 @@ void createHandle () { } else if ((style & SWT.CHECK) != 0) { type = OS.NSSwitchButton; } else if ((style & SWT.RADIO) != 0) { - type = OS.NSRadioButton; + type = OS.NSRadioButton; } else if ((style & SWT.TOGGLE) != 0) { type = OS.NSPushOnPushOffButton; if ((style & SWT.FLAT) != 0) { @@ -308,7 +308,7 @@ void drawImageWithFrameInView (long /*int*/ id, long /*int*/ sel, long /*int*/ i * Feature in Cocoa. Images touch the edge of rounded buttons * when set to small size. The fix to subclass the button cell * and offset the image drawing. - * This workaround is not required for OSX 10.9 and later as + * This workaround is not required for OSX 10.9 and later as * the problem doesn't happen there. */ if (OS.VERSION_MMB < OS.VERSION_MMB(10, 9, 0)) { @@ -398,7 +398,7 @@ boolean drawsBackground() { @Override void drawWidget (long /*int*/ id, NSGraphicsContext context, NSRect rect) { - if ((style & SWT.ARROW) != 0) { + if ((style & SWT.ARROW) != 0) { NSRect frame = view.frame(); int arrowSize = Math.min((int)frame.height, (int)frame.width) / 2; context.saveGraphicsState(); @@ -410,13 +410,13 @@ void drawWidget (long /*int*/ id, NSGraphicsContext context, NSRect rect) { p2.y = p1.y; NSPoint p3 = new NSPoint(); p3.y = arrowSize / 2; - + NSBezierPath path = NSBezierPath.bezierPath(); path.moveToPoint(p1); path.lineToPoint(p2); path.lineToPoint(p3); path.closePath(); - + NSAffineTransform transform = NSAffineTransform.transform(); if ((style & SWT.LEFT) != 0) { transform.rotateByDegrees(90); @@ -429,7 +429,7 @@ void drawWidget (long /*int*/ id, NSGraphicsContext context, NSRect rect) { transform = NSAffineTransform.transform(); transform.translateXBy(frame.width / 2, frame.height / 2); path.transformUsingAffineTransform(transform); - + NSColor color = isEnabled() ? NSColor.blackColor() : NSColor.disabledControlTextColor(); color.set(); path.fill(); @@ -447,12 +447,12 @@ NSRect focusRingMaskBoundsForFrame (long /*int*/ id, long /*int*/ sel, NSRect ce * Returns a value which describes the position of the * text or image in the receiver. The value will be one of * <code>LEFT</code>, <code>RIGHT</code> or <code>CENTER</code> - * unless the receiver is an <code>ARROW</code> button, in + * unless the receiver is an <code>ARROW</code> button, in * which case, the alignment will indicate the direction of - * the arrow (one of <code>LEFT</code>, <code>RIGHT</code>, + * the arrow (one of <code>LEFT</code>, <code>RIGHT</code>, * <code>UP</code> or <code>DOWN</code>). * - * @return the alignment + * @return the alignment * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> @@ -485,7 +485,7 @@ public int getAlignment () { * <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.4 */ public boolean getGrayed() { @@ -571,7 +571,7 @@ long /*int*/ nextState(long /*int*/ id, long /*int*/ sel) { return ((NSButton)view).state() == OS.NSMixedState ? OS.NSOffState : OS.NSMixedState; } - return super.nextState(id, sel); + return super.nextState(id, sel); } @Override @@ -660,12 +660,12 @@ void sendSelection () { * Controls how text, images and arrows will be displayed * in the receiver. The argument should be one of * <code>LEFT</code>, <code>RIGHT</code> or <code>CENTER</code> - * unless the receiver is an <code>ARROW</code> button, in + * unless the receiver is an <code>ARROW</code> button, in * which case, the argument indicates the direction of - * the arrow (one of <code>LEFT</code>, <code>RIGHT</code>, + * the arrow (one of <code>LEFT</code>, <code>RIGHT</code>, * <code>UP</code> or <code>DOWN</code>). * - * @param alignment the new alignment + * @param alignment the new alignment * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> @@ -680,7 +680,7 @@ public void setAlignment (int alignment) { void _setAlignment (int alignment) { if ((style & SWT.ARROW) != 0) { - if ((style & (SWT.UP | SWT.DOWN | SWT.LEFT | SWT.RIGHT)) == 0) return; + if ((style & (SWT.UP | SWT.DOWN | SWT.LEFT | SWT.RIGHT)) == 0) return; style &= ~(SWT.UP | SWT.DOWN | SWT.LEFT | SWT.RIGHT); style |= alignment & (SWT.UP | SWT.DOWN | SWT.LEFT | SWT.RIGHT); return; @@ -715,7 +715,7 @@ void setBackgroundImage(NSImage image) { void setBounds (int x, int y, int width, int height, boolean move, boolean resize) { if ((style & (SWT.PUSH | SWT.TOGGLE)) != 0 && (style & (SWT.FLAT | SWT.WRAP)) == 0) { int heightThreshold = REGULAR_BUTTON_HEIGHT; - + NSCell cell = ((NSControl)view).cell(); if (cell != null && cell.controlSize() == OS.NSSmallControlSize) { heightThreshold = SMALL_BUTTON_HEIGHT; @@ -744,7 +744,7 @@ void setForeground (double /*float*/ [] color) { } /** - * Sets the grayed state of the receiver. This state change + * Sets the grayed state of the receiver. This state change * only applies if the control was created with the SWT.CHECK * style. * @@ -754,7 +754,7 @@ void setForeground (double /*float*/ [] color) { * <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.4 */ public void setGrayed(boolean grayed) { @@ -786,7 +786,7 @@ public void setGrayed(boolean grayed) { * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li> - * </ul> + * </ul> * @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> @@ -812,7 +812,7 @@ public void setImage (Image image) { } else { ((NSButton)view).setAttributedTitle(createString()); } - + if (image != null) { if ((style & (SWT.PUSH | SWT.TOGGLE)) != 0 && (style & (SWT.FLAT | SWT.WRAP)) == 0) { NSCell cell = ((NSButton)view).cell(); @@ -841,7 +841,7 @@ boolean setRadioSelection (boolean value){ } /** - * Sets the selection state of the receiver, if it is of type <code>CHECK</code>, + * Sets the selection state of the receiver, if it is of type <code>CHECK</code>, * <code>RADIO</code>, or <code>TOGGLE</code>. * * <p> @@ -914,7 +914,7 @@ NSRect titleRectForBounds (long /*int*/ id, long /*int*/ sel, NSRect cellFrame) NSRect rect = super.titleRectForBounds(id, sel, cellFrame); if (image != null && ((style & (SWT.CHECK|SWT.RADIO)) !=0)) { NSSize imageSize = image.handle.size(); - rect.x += imageSize.width + IMAGE_GAP; + rect.x += imageSize.width + IMAGE_GAP; rect.width -= (imageSize.width + IMAGE_GAP); rect.width = Math.max(0f, rect.width); } @@ -934,8 +934,8 @@ void updateAlignment () { if ((style & (SWT.PUSH | SWT.TOGGLE)) != 0) { if (text.length() != 0 && image != null) { widget.setImagePosition(OS.NSImageLeft); - } else { - widget.setImagePosition(text.length() != 0 ? OS.NSNoImage : OS.NSImageOnly); + } else { + widget.setImagePosition(text.length() != 0 ? OS.NSNoImage : OS.NSImageOnly); } } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Canvas.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Canvas.java index f28e2af66c..27f048d200 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Canvas.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Canvas.java @@ -45,8 +45,8 @@ public class Canvas extends Composite { NSBezierPath visiblePath; static NSMutableArray supportedPboardTypes; - - static { + + static { // This array is leaked. supportedPboardTypes = NSMutableArray.arrayWithCapacity(1); supportedPboardTypes.retain(); @@ -68,7 +68,7 @@ long /*int*/ attributedSubstringFromRange (long /*int*/ id, long /*int*/ sel, lo void sendFocusEvent(int type) { if (caret != null) { if (type == SWT.FocusIn) { - caret.setFocus(); + caret.setFocus(); } else { caret.killFocus(); } @@ -83,7 +83,7 @@ void sendFocusEvent(int type) { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -113,9 +113,9 @@ long /*int*/ characterIndexForPoint (long /*int*/ id, long /*int*/ sel, long /*i return super.characterIndexForPoint (id, sel, point); } -/** +/** * Fills the interior of the rectangle specified by the arguments, - * with the receiver's background. + * with the receiver's background. * * @param gc the gc where the rectangle is to be filled * @param x the x coordinate of the rectangle to be filled @@ -131,7 +131,7 @@ long /*int*/ characterIndexForPoint (long /*int*/ id, long /*int*/ sel, long /*i * <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.2 */ public void drawBackground (GC gc, int x, int y, int width, int height) { @@ -205,7 +205,7 @@ void drawWidget (long /*int*/ id, NSGraphicsContext context, NSRect rect) { OS.CGContextTranslateCTM (ctx, 0, -(size.height + 2 * destRect.origin.y)); OS.CGContextSetBlendMode (ctx, OS.kCGBlendModeDifference); OS.CGContextDrawImage (ctx, destRect, cgImage); - OS.CGImageRelease(cgImage); + OS.CGImageRelease(cgImage); } else { CGRect drawRect = new CGRect(); drawRect.origin.x = caret.x; @@ -260,7 +260,7 @@ public Caret getCaret () { * <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.4 */ public IME getIME () { @@ -305,7 +305,7 @@ boolean readSelectionFromPasteboard(long /*int*/ id, long /*int*/ sel, long /*in NSPasteboard pboard = new NSPasteboard(pasteboard); NSArray availableTypes = pboard.types(); NSString type; - + for (long /*int*/ i = 0; i < supportedPboardTypes.count(); i++) { if (result) break; type = new NSString(supportedPboardTypes.objectAtIndex(i)); @@ -370,7 +370,7 @@ void resetVisibleRegion () { } /** - * Scrolls a rectangular area of the receiver by first copying + * Scrolls a rectangular area of the receiver by first copying * the source area to the destination and then causing the area * of the source which is not covered by the destination to * be repainted. Children that intersect the rectangle are @@ -464,7 +464,7 @@ public void scroll (int destX, int destY, int x, int y, int width, int height, b damage.width = visibleRect.x - srcRect.x; damage.height = srcRect.height; view.setNeedsDisplayInRect(damage); - } + } if (visibleRect.x + visibleRect.width != srcRect.x + srcRect.width) { damage.x = srcRect.x + visibleRect.width + deltaX; damage.y = srcRect.y + deltaY; @@ -494,7 +494,7 @@ public void scroll (int destX, int destY, int x, int y, int width, int height, b for (int i=0; i<children.length; i++) { Control child = children [i]; Rectangle rect = child.getBounds (); - if (Math.min(x + width, rect.x + rect.width) >= Math.max (x, rect.x) && + if (Math.min(x + width, rect.x + rect.width) >= Math.max (x, rect.x) && Math.min(y + height, rect.y + rect.height) >= Math.max (y, rect.y)) { child.setLocation (rect.x + deltaX, rect.y + deltaY); } @@ -570,7 +570,7 @@ void setOpenGLContext(Object value) { /** * Sets the receiver's IME. - * + * * @param ime the new IME for the receiver, may be null * * @exception IllegalArgumentException <ul> @@ -580,7 +580,7 @@ void setOpenGLContext(Object value) { * <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.4 */ public void setIME (IME ime) { @@ -615,7 +615,7 @@ long /*int*/ validRequestorForSendType(long /*int*/ id, long /*int*/ sel, long / if (attributes != null) { boolean canReturn = attributes.containsObject(OS.NSAccessibilitySelectedTextAttribute); boolean canSend = acc.internal_accessibilityIsAttributeSettable(OS.NSAccessibilitySelectedTextAttribute, ACC.CHILDID_SELF); - boolean canHandlePBoardType = supportedPboardTypes.containsObject(new id(sendType)) && supportedPboardTypes.containsObject(new id(returnType)); + boolean canHandlePBoardType = supportedPboardTypes.containsObject(new id(sendType)) && supportedPboardTypes.containsObject(new id(returnType)); if (canReturn && canSend && canHandlePBoardType) { id selection = acc.internal_accessibilityAttributeValue(OS.NSAccessibilitySelectedTextAttribute, ACC.CHILDID_SELF); if (selection != null) { @@ -626,7 +626,7 @@ long /*int*/ validRequestorForSendType(long /*int*/ id, long /*int*/ sel, long / } } } - + return super.validRequestorForSendType(id, sel, sendType, returnType); } @@ -636,7 +636,7 @@ void updateOpenGLContext(long /*int*/ id, long /*int*/ sel, long /*int*/ notific } @Override -void viewWillMoveToWindow(long /*int*/ id, long /*int*/ sel, long /*int*/ arg0) { +void viewWillMoveToWindow(long /*int*/ id, long /*int*/ sel, long /*int*/ arg0) { super.viewWillMoveToWindow(id, sel, arg0); if (glcontext != null && id == view.id && arg0 != 0) { Widget newShell = display.getWidget(new NSWindow(arg0).contentView()); @@ -657,7 +657,7 @@ boolean writeSelectionToPasteboard(long /*int*/ id, long /*int*/ sel, long /*int NSArray types = new NSArray(typesObj); NSMutableArray typesToDeclare = NSMutableArray.arrayWithCapacity(2); NSString type; - + for (long /*int*/ i = 0; i < supportedPboardTypes.count(); i++) { type = new NSString(supportedPboardTypes.objectAtIndex(i)); if (types.containsObject(type)) typesToDeclare.addObject(type); @@ -673,7 +673,7 @@ boolean writeSelectionToPasteboard(long /*int*/ id, long /*int*/ sel, long /*int return result; } - + boolean writeSelectionToPasteboard(NSPasteboard pboard, NSString type) { boolean result = false; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Caret.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Caret.java index a9ffeeb00e..0eb2f96c5c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Caret.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Caret.java @@ -28,7 +28,7 @@ import org.eclipse.swt.graphics.*; * <p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> - * + * * @see <a href="http://www.eclipse.org/swt/snippets/#caret">Caret snippets</a> * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample, Canvas tab</a> * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> @@ -43,14 +43,14 @@ public class Caret extends Widget { Font font; static final int DEFAULT_WIDTH = 1; - + /** * Constructs a new instance of this class given its parent * and a style value describing its behavior and appearance. * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -299,7 +299,7 @@ void releaseWidget () { /** * Sets the receiver's size and location to the rectangular - * area specified by the arguments. The <code>x</code> and + * area specified by the arguments. The <code>x</code> and * <code>y</code> arguments are relative to the receiver's * parent (or its display if its parent is null). * @@ -327,7 +327,7 @@ public void setBounds (int x, int y, int width, int height) { /** * Sets the receiver's size and location to the rectangular - * area specified by the argument. The <code>x</code> and + * area specified by the argument. The <code>x</code> and * <code>y</code> fields of the rectangle are relative to * the receiver's parent (or its display if its parent is null). * @@ -359,7 +359,7 @@ void setFocus () { * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the font has been disposed</li> - * </ul> + * </ul> * @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> @@ -382,7 +382,7 @@ public void setFont (Font font) { * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li> - * </ul> + * </ul> * @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> @@ -472,7 +472,7 @@ public void setSize (Point size) { /** * Marks the receiver as visible if the argument is <code>true</code>, - * and marks it invisible otherwise. + * and marks it invisible otherwise. * <p> * If one of the receiver's ancestors is not visible or some * other condition makes the receiver not visible, marking diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ColorDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ColorDialog.java index c6c732cf2d..4f118aa01f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ColorDialog.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ColorDialog.java @@ -27,7 +27,7 @@ import org.eclipse.swt.internal.cocoa.*; * <p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> - * + * * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample, Dialog tab</a> * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * @noextend This class is not intended to be subclassed by clients. @@ -64,7 +64,7 @@ public ColorDialog(Shell parent) { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -112,7 +112,7 @@ public RGB getRGB() { * if no custom colors were selected. * * @return the array of RGBs, which may be null - * + * * @since 3.8 */ public RGB[] getRGBs() { @@ -132,7 +132,7 @@ public RGB[] getRGBs() { * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ -public RGB open() { +public RGB open() { NSColorPanel panel = NSColorPanel.sharedColorPanel(); Display display = parent != null ? parent.getDisplay() : Display.getCurrent(); if (rgb != null) { @@ -221,7 +221,7 @@ public void setRGB(RGB rgb) { * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if an RGB in the rgbs array is null</li> * </ul> - * + * * @since 3.8 */ public void setRGBs(RGB[] rgbs) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Combo.java index 7d6b10be84..e5e0fa1c39 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Combo.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Combo.java @@ -19,7 +19,7 @@ import org.eclipse.swt.internal.cocoa.*; /** * Instances of this class are controls that allow the user - * to choose an item from a list of items, or optionally + * to choose an item from a list of items, or optionally * enter a new value by typing it into an editable text * field. Often, <code>Combo</code>s are used in the same place * where a single selection <code>List</code> widget could @@ -32,7 +32,7 @@ import org.eclipse.swt.internal.cocoa.*; * which access one versus the other (compare for example, * <code>clearSelection()</code> and <code>deselectAll()</code>). * The API documentation is careful to indicate either "the - * receiver's list" or the "the receiver's text field" to + * receiver's list" or the "the receiver's text field" to * distinguish between the two cases. * </p><p> * Note that although this class is a subclass of <code>Composite</code>, @@ -71,7 +71,7 @@ public class Combo extends Composite { * that the text field in an instance of this class can hold */ public static final int LIMIT; - + /* * These values can be different on different platforms. * Therefore they are not initialized in the declaration @@ -80,7 +80,7 @@ public class Combo extends Composite { static { LIMIT = 0x7FFFFFFF; } - + /** * Constructs a new instance of this class given its parent @@ -88,7 +88,7 @@ public class Combo extends Composite { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -232,11 +232,11 @@ public void addModifyListener (ModifyListener listener) { * Adds a segment listener. * <p> * A <code>SegmentEvent</code> is sent whenever text content is being modified or - * a segment listener is added or removed. You can + * a segment listener is added or removed. You can * customize the appearance of text by indicating certain characters to be inserted * at certain text offsets. This may be used for bidi purposes, e.g. when * adjacent segments of right-to-left text should not be reordered relative to - * each other. + * each other. * E.g., multiple Java string literals in a right-to-left language * should generally remain in logical order to each other, that is, the * way they are stored. @@ -318,7 +318,7 @@ public void addSelectionListener(SelectionListener listener) { * * @see VerifyListener * @see #removeVerifyListener - * + * * @since 3.1 */ public void addVerifyListener (VerifyListener listener) { @@ -375,7 +375,7 @@ protected void checkSubclass () { * text field is editable, this has the effect of placing the * i-beam at the start of the text. * <p> - * Note: To clear the selected items in the receiver's list, + * Note: To clear the selected items in the receiver's list, * use <code>deselectAll()</code>. * </p> * @@ -437,7 +437,7 @@ public Point computeSize (int wHint, int hHint, boolean changed) { cell.release (); } ignoreSetObject = false; - + /* * Attempting to create an NSComboBox with a height > 27 spews a * very long warning message to stdout and draws the combo incorrectly. @@ -454,8 +454,8 @@ public Point computeSize (int wHint, int hHint, boolean changed) { } } } else { - /* - * In a SWT.READ_ONLY Combo with single item, but no selection, + /* + * In a SWT.READ_ONLY Combo with single item, but no selection, * the width of the cell returned by cellSize() is smaller than expected. * Get the correct width by setting and resetting the selected item. */ @@ -492,7 +492,7 @@ public Point computeSize (int wHint, int hHint, boolean changed) { * <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 2.1 */ public void copy () { @@ -566,7 +566,7 @@ void comboBoxWillPopUp(long /*int*/ id, long /*int*/ sel, long /*int*/ notificat * <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 2.1 */ public void cut () { @@ -600,7 +600,7 @@ Color defaultBackground () { @Override NSFont defaultNSFont() { - if ((style & SWT.READ_ONLY) != 0) return display.popUpButtonFont; + if ((style & SWT.READ_ONLY) != 0) return display.popUpButtonFont; return display.comboBoxFont; } @@ -616,7 +616,7 @@ void deregister() { } /** - * Deselects the item at the given zero-relative index in the receiver's + * Deselects the item at the given zero-relative index in the receiver's * list. If the item at the index was already deselected, it remains * deselected. Indices that are out of range are ignored. * @@ -683,12 +683,12 @@ boolean dragDetect(int x, int y, boolean filter, boolean[] consume) { if (consume != null) consume[0] = true; return true; } - } + } } } return false; } - + return super.dragDetect(x, y, filter, consume); } @@ -715,7 +715,7 @@ NSRect focusRingMaskBoundsForFrame (long /*int*/ id, long /*int*/ sel, NSRect ce * <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.8 */ public int getCaretPosition() { @@ -733,7 +733,7 @@ public int getCaretPosition() { * <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.8 */ public Point getCaretLocation() { @@ -837,11 +837,11 @@ public int getItemHeight () { /** * Returns a (possibly empty) array of <code>String</code>s which are - * the items in the receiver's list. + * the items in the receiver's list. * <p> * Note: This is not the actual structure used by the receiver * to maintain its list of items, so modifying the array will - * not affect the receiver. + * not affect the receiver. * </p> * * @return the items in the receiver's list @@ -875,7 +875,7 @@ public String [] getItems () { * <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.4 */ public boolean getListVisible () { @@ -897,12 +897,12 @@ int getMininumHeight () { * Returns the orientation of the receiver. * * @return the orientation style - * + * * @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 2.1.2 */ @Override @@ -1027,9 +1027,9 @@ public int getTextHeight () { * text field is capable of holding. If this has not been changed * by <code>setTextLimit()</code>, it will be the constant * <code>Combo.LIMIT</code>. - * + * * @return the text limit - * + * * @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> @@ -1056,7 +1056,7 @@ public int getTextLimit () { * <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.0 */ public int getVisibleItemCount () { @@ -1067,10 +1067,10 @@ public int getVisibleItemCount () { return (int)/*64*/((NSComboBox)view).numberOfVisibleItems(); } } - + /** * Searches the receiver's list starting at the first item - * (index 0) until an item is found that is equal to the + * (index 0) until an item is found that is equal to the * argument, and returns the index of that item. If no item * is found, returns -1. * @@ -1090,7 +1090,7 @@ public int indexOf (String string) { } /** - * Searches the receiver's list starting at the given, + * Searches the receiver's list starting at the given, * zero-relative index until an item is found that is equal * to the argument, and returns the index of that item. If * no item is found or the starting index is out of range, @@ -1163,7 +1163,7 @@ void mouseDown(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) { * <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 2.1 */ public void paste () { @@ -1239,7 +1239,7 @@ public void remove (int index) { /** * Removes the items from the receiver's list which are - * between the given zero-relative start and end + * between the given zero-relative start and end * indices (inclusive). * * @param start the start of the range @@ -1268,7 +1268,7 @@ public void remove (int start, int end) { /** * Searches the receiver's list starting at the first item - * until an item is found that is equal to the argument, + * until an item is found that is equal to the argument, * and removes that item from the list. * * @param string the item to remove @@ -1352,7 +1352,7 @@ public void removeModifyListener (ModifyListener listener) { * @see SegmentEvent * @see SegmentListener * @see #addSegmentListener - * + * * @since 3.103 */ public void removeSegmentListener (SegmentListener listener) { @@ -1402,7 +1402,7 @@ public void removeSelectionListener (SelectionListener listener) { * * @see VerifyListener * @see #addVerifyListener - * + * * @since 3.1 */ public void removeVerifyListener (VerifyListener listener) { @@ -1413,7 +1413,7 @@ public void removeVerifyListener (VerifyListener listener) { } /** - * Selects the item at the given zero-relative index in the receiver's + * Selects the item at the given zero-relative index in the receiver's * list. If the item at the index was already selected, it remains * selected. Indices that are out of range are ignored. * @@ -1604,7 +1604,7 @@ public void setItem (int index, String string) { * Feature in Cocoa. Setting the attributed title on an NSMenuItem * also sets the title, but clearing the attributed title does not * clear the title. The fix is to explicitly set the title to an - * empty string in this case. + * empty string in this case. */ if (string.length() == 0) nsItem.setTitle(NSString.string()); } else { @@ -1673,7 +1673,7 @@ public void setItems (String... items) { * <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.4 */ public void setListVisible (boolean visible) { @@ -1690,12 +1690,12 @@ public void setListVisible (boolean visible) { * <p> * * @param orientation new orientation style - * + * * @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 2.1.2 */ @Override @@ -1713,7 +1713,7 @@ void setOrientation () { * Sets the selection in the receiver's text field to the * range specified by the argument whose x coordinate is the * start of the selection and whose y coordinate is the end - * of the selection. + * of the selection. * * @param selection a point representing the new selection start and end * @@ -1746,14 +1746,14 @@ public void setSelection (Point selection) { * Sets the contents of the receiver's text field to the * given string. * <p> - * This call is ignored when the receiver is read only and + * This call is ignored when the receiver is read only and * the given string is not in the receiver's list. * </p> * <p> * Note: The text field in a <code>Combo</code> is typically * only capable of displaying a single line of text. Thus, * setting the text to a string containing line breaks or - * other special characters will probably cause it to + * other special characters will probably cause it to * display incorrectly. * </p><p> * Also note, if control characters like '\n', '\t' etc. are used @@ -1815,7 +1815,7 @@ void setText (String string, boolean notify) { * <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> - * + * * @see #LIMIT */ public void setTextLimit (int limit) { @@ -1838,14 +1838,14 @@ public void setTextLimit (int limit) { * <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.0 */ public void setVisibleItemCount (int count) { checkWidget (); if (count < 0) return; if ((style & SWT.READ_ONLY) != 0) { - //TODO + //TODO } else { ((NSComboBox)view).setNumberOfVisibleItems(count); } @@ -1880,7 +1880,7 @@ boolean shouldChangeTextInRange_replacementString(long /*int*/ id, long /*int*/ text = fieldEditor.string().getString(); sendEvent (SWT.Modify); result = false; - } + } } if (result) { char[] chars = new char[text.length()]; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Composite.java index 980413e334..385b232c24 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Composite.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Composite.java @@ -50,7 +50,7 @@ public class Composite extends Scrollable { Layout layout; Control[] tabList; int layoutCount, backgroundMode; - + Composite () { /* Do nothing */ } @@ -61,7 +61,7 @@ Composite () { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -161,7 +161,7 @@ long /*int*/ accessibilityAttributeValue (long /*int*/ id, long /*int*/ sel, lon NSString role = new NSString(superValue); if (!role.isEqualToString(OS.NSAccessibilityUnknownRole)) return superValue; } - + NSString role = NSString.stringWith("SWTComposite"); return role.id; } else if (nsAttributeName.isEqualToString (OS.NSAccessibilityRoleDescriptionAttribute)) { @@ -169,36 +169,36 @@ long /*int*/ accessibilityAttributeValue (long /*int*/ id, long /*int*/ sel, lon NSString role = new NSString(superValue); if (!role.isEqualToString(OS.NSAccessibilityUnknownSubrole)) return superValue; } - + NSString roleDescription = NSString.stringWith("generic container view"); return roleDescription.id; } } } - + return superValue; } @Override -boolean accessibilityIsIgnored(long /*int*/ id, long /*int*/ sel) { +boolean accessibilityIsIgnored(long /*int*/ id, long /*int*/ sel) { if (id == accessibleHandle()) { // If a Composite or subclass has an Accessible it should not be ignored. if (accessible != null) return accessible.internal_accessibilityIsIgnored(ACC.CHILDID_SELF); } - + return super.accessibilityIsIgnored(id, sel); } /** - * Clears any data that has been cached by a Layout for all widgets that - * are in the parent hierarchy of the changed control up to and including the + * Clears any data that has been cached by a Layout for all widgets that + * are in the parent hierarchy of the changed control up to and including the * receiver. If an ancestor does not have a layout, it is skipped. - * + * * @param changed an array of controls that changed state and require a recalculation of size - * + * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the changed array is null any of its controls are null or have been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the changed array is null any of its controls are null or have been disposed</li> * <li>ERROR_INVALID_PARENT - if any control in changed is not in the widget tree of the receiver</li> * </ul> * @exception SWTException <ul> @@ -310,20 +310,20 @@ void createHandle () { } } -/** +/** * Fills the interior of the rectangle specified by the arguments, - * with the receiver's background. + * with the receiver's background. * * <p>The <code>offsetX</code> and <code>offsetY</code> are used to map from * the <code>gc</code> origin to the origin of the parent image background. This is useful * to ensure proper alignment of the image background.</p> - * + * * @param gc the gc where the rectangle is to be filled * @param x the x coordinate of the rectangle to be filled * @param y the y coordinate of the rectangle to be filled * @param width the width of the rectangle to be filled * @param height the height of the rectangle to be filled - * @param offsetX the image background x offset + * @param offsetX the image background x offset * @param offsetY the image background y offset * * @exception IllegalArgumentException <ul> @@ -334,7 +334,7 @@ void createHandle () { * <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.6 */ public void drawBackground(GC gc, int x, int y, int width, int height, int offsetX, int offsetY) { @@ -442,7 +442,7 @@ void fixTabList (Control control) { * </ul> * * @see SWT - * + * * @since 3.2 */ public int getBackgroundMode () { @@ -458,11 +458,11 @@ public int getBackgroundMode () { * <p> * Note: This is not the actual structure used by the receiver * to maintain its list of children, so modifying the array will - * not affect the receiver. + * not affect the receiver. * </p> * * @return an array of children - * + * * @see Control#moveAbove * @see Control#moveBelow * @@ -502,7 +502,7 @@ public Layout getLayout () { * <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> - * + * * @see #setLayoutDeferred(boolean) * @see #isLayoutDeferred() * @@ -522,7 +522,7 @@ public boolean getLayoutDeferred () { * <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> - * + * * @see #setTabList */ public Control [] getTabList () { @@ -561,7 +561,7 @@ void invalidateChildrenVisibleRegion () { } /** - * Returns <code>true</code> if the receiver or any ancestor + * Returns <code>true</code> if the receiver or any ancestor * up to and including the receiver's nearest ancestor shell * has deferred the performing of layouts. Otherwise, <code>false</code> * is returned. @@ -572,10 +572,10 @@ void invalidateChildrenVisibleRegion () { * <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> - * + * * @see #setLayoutDeferred(boolean) * @see #getLayoutDeferred() - * + * * @since 3.1 */ public boolean isLayoutDeferred () { @@ -625,7 +625,7 @@ void keyDown (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) { /** * If the receiver has a layout, asks the layout to <em>lay out</em> - * (that is, set the size and location of) the receiver's children. + * (that is, set the size and location of) the receiver's children. * If the receiver does not have a layout, do nothing. * <p> * Use of this method is discouraged since it is the least-efficient @@ -644,7 +644,7 @@ void keyDown (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) { * exposed, then the parent will paint. If no child is * affected, the parent will not paint. * </p> - * + * * @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> @@ -657,11 +657,11 @@ public void layout () { /** * If the receiver has a layout, asks the layout to <em>lay out</em> - * (that is, set the size and location of) the receiver's children. + * (that is, set the size and location of) the receiver's children. * If the argument is <code>true</code> the layout must not rely * on any information it has cached about the immediate children. If it * is <code>false</code> the layout may (potentially) optimize the - * work it is doing by assuming that none of the receiver's + * work it is doing by assuming that none of the receiver's * children has changed state since the last layout. * If the receiver does not have a layout, do nothing. * <p> @@ -672,11 +672,11 @@ public void layout () { * this method. * </p> * <p> - * If a child is resized as a result of a call to layout, the + * If a child is resized as a result of a call to layout, the * resize event will invoke the layout of the child. The layout - * will cascade down through all child widgets in the receiver's widget - * tree until a child is encountered that does not resize. Note that - * a layout due to a resize will not flush any cached information + * will cascade down through all child widgets in the receiver's widget + * tree until a child is encountered that does not resize. Note that + * a layout due to a resize will not flush any cached information * (same as <code>layout(false)</code>). * </p> * <p> @@ -701,20 +701,20 @@ public void layout (boolean changed) { /** * If the receiver has a layout, asks the layout to <em>lay out</em> - * (that is, set the size and location of) the receiver's children. + * (that is, set the size and location of) the receiver's children. * If the changed argument is <code>true</code> the layout must not rely * on any information it has cached about its children. If it * is <code>false</code> the layout may (potentially) optimize the - * work it is doing by assuming that none of the receiver's + * work it is doing by assuming that none of the receiver's * children has changed state since the last layout. * If the all argument is <code>true</code> the layout will cascade down * through all child widgets in the receiver's widget tree, regardless of - * whether the child has changed size. The changed argument is applied to + * whether the child has changed size. The changed argument is applied to * all layouts. If the all argument is <code>false</code>, the layout will - * <em>not</em> cascade down through all child widgets in the receiver's widget - * tree. However, if a child is resized as a result of a call to layout, the - * resize event will invoke the layout of the child. Note that - * a layout due to a resize will not flush any cached information + * <em>not</em> cascade down through all child widgets in the receiver's widget + * tree. However, if a child is resized as a result of a call to layout, the + * resize event will invoke the layout of the child. Note that + * a layout due to a resize will not flush any cached information * (same as <code>layout(false)</code>). * </p> * <p> @@ -749,11 +749,11 @@ public void layout (boolean changed, boolean all) { } /** - * Forces a lay out (that is, sets the size and location) of all widgets that - * are in the parent hierarchy of the changed control up to and including the - * receiver. The layouts in the hierarchy must not rely on any information - * cached about the changed control or any of its ancestors. The layout may - * (potentially) optimize the work it is doing by assuming that none of the + * Forces a lay out (that is, sets the size and location) of all widgets that + * are in the parent hierarchy of the changed control up to and including the + * receiver. The layouts in the hierarchy must not rely on any information + * cached about the changed control or any of its ancestors. The layout may + * (potentially) optimize the work it is doing by assuming that none of the * peers of the changed control have changed state since the last layout. * If an ancestor does not have a layout, skip it. * <p> @@ -769,11 +769,11 @@ public void layout (boolean changed, boolean all) { * exposed, then the parent will paint. If no child is * affected, the parent will not paint. * </p> - * + * * @param changed a control that has had a state change which requires a recalculation of its size - * + * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the changed array is null any of its controls are null or have been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the changed array is null any of its controls are null or have been disposed</li> * <li>ERROR_INVALID_PARENT - if any control in changed is not in the widget tree of the receiver</li> * </ul> * @exception SWTException <ul> @@ -790,9 +790,9 @@ public void layout (Control [] changed) { } /** - * Forces a lay out (that is, sets the size and location) of all widgets that - * are in the parent hierarchy of the changed control up to and including the - * receiver. + * Forces a lay out (that is, sets the size and location) of all widgets that + * are in the parent hierarchy of the changed control up to and including the + * receiver. * <p> * The parameter <code>flags</code> may be a combination of: * <dl> @@ -806,7 +806,7 @@ public void layout (Control [] changed) { * </p> * <p> * When the <code>changed</code> array is specified, the flags <code>SWT.ALL</code> - * and <code>SWT.CHANGED</code> have no effect. In this case, the layouts in the + * and <code>SWT.CHANGED</code> have no effect. In this case, the layouts in the * hierarchy must not rely on any information cached about the changed control or * any of its ancestors. The layout may (potentially) optimize the * work it is doing by assuming that none of the peers of the changed @@ -817,7 +817,7 @@ public void layout (Control [] changed) { * When the <code>changed</code> array is not specified, the flag <code>SWT.ALL</code> * indicates that the whole widget tree should be laid out. And the flag * <code>SWT.CHANGED</code> indicates that the layouts should flush any cached - * information for all controls that are laid out. + * information for all controls that are laid out. * </p> * <p> * The <code>SWT.DEFER</code> flag always causes the layout to be deferred by @@ -832,12 +832,12 @@ public void layout (Control [] changed) { * exposed, then the parent will paint. If no child is * affected, the parent will not paint. * </p> - * + * * @param changed a control that has had a state change which requires a recalculation of its size * @param flags the flags specifying how the layout should happen - * + * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if any of the controls in changed is null or has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if any of the controls in changed is null or has been disposed</li> * <li>ERROR_INVALID_PARENT - if any control in changed is not in the widget tree of the receiver</li> * </ul> * @exception SWTException <ul> @@ -1008,7 +1008,7 @@ void scrollWheel (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) { if ((hooks(SWT.Gesture) || filters (SWT.Gesture))) { if (deltaX != 0 || deltaY != 0) { if (!gestureEvent(id, theEvent, SWT.GESTURE_PAN)) { - handled = true; + handled = true; } } } @@ -1025,7 +1025,7 @@ void scrollWheel (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) { int selection = Math.max (0, (int)(0.5f + bar.getSelection () - bar.getIncrement () * deltaY)); bar.setSelection (selection); Event event = new Event (); - event.detail = deltaY > 0 ? SWT.PAGE_UP : SWT.PAGE_DOWN; + event.detail = deltaY > 0 ? SWT.PAGE_UP : SWT.PAGE_DOWN; bar.sendSelectionEvent (SWT.Selection, event, true); handled = true; } @@ -1043,7 +1043,7 @@ void scrollWheel (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) { int selection = Math.max (0, (int)(0.5f + bar.getSelection () - bar.getIncrement () * deltaX)); bar.setSelection (selection); Event event = new Event (); - event.detail = deltaX > 0 ? SWT.PAGE_UP : SWT.PAGE_DOWN; + event.detail = deltaX > 0 ? SWT.PAGE_UP : SWT.PAGE_DOWN; bar.sendSelectionEvent (SWT.Selection, event, true); handled = true; } @@ -1073,7 +1073,7 @@ void scrollWheel (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) { * </ul> * * @see SWT - * + * * @since 3.2 */ public void setBackgroundMode (int mode) { @@ -1117,7 +1117,7 @@ public void setLayout (Layout layout) { * No layout of any kind can occur in the receiver or any of its * children until the flag is set to false. * Layout operations that occurred while the flag was - * <code>true</code> are remembered and when the flag is set to + * <code>true</code> are remembered and when the flag is set to * <code>false</code>, the layout operations are performed in an * optimized manner. Nested calls to this method are stacked. * @@ -1127,7 +1127,7 @@ public void setLayout (Layout layout) { * <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> - * + * * @see #layout(boolean) * @see #layout(Control[]) * @@ -1177,7 +1177,7 @@ boolean setTabGroupFocus () { * @param tabList the ordered list of controls representing the tab order or null * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if a widget in the tabList is null or has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if a widget in the tabList is null or has been disposed</li> * <li>ERROR_INVALID_PARENT - if widget in the tabList is not in the same widget tree</li> * </ul> * @exception SWTException <ul> @@ -1197,7 +1197,7 @@ public void setTabList (Control [] tabList) { Control [] newList = new Control [tabList.length]; System.arraycopy (tabList, 0, newList, 0, tabList.length); tabList = newList; - } + } this.tabList = tabList; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java index da4f00eb6c..239d518d3b 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java @@ -36,7 +36,7 @@ import org.eclipse.swt.internal.cocoa.*; * IMPORTANT: This class is intended to be subclassed <em>only</em> * within the SWT implementation. * </p> - * + * * @see <a href="http://www.eclipse.org/swt/snippets/#control">Control snippets</a> * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a> * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> @@ -44,7 +44,7 @@ import org.eclipse.swt.internal.cocoa.*; */ public abstract class Control extends Widget implements Drawable { /** - * the handle to the OS resource + * the handle to the OS resource * (Warning: This field is platform dependent) * <p> * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT @@ -52,7 +52,7 @@ public abstract class Control extends Widget implements Drawable { * within the packages provided by SWT. It is not available on all * platforms and should never be accessed from application code. * </p> - * + * * @noreference This field is not intended to be referenced by clients. */ public NSView view; @@ -70,15 +70,15 @@ public abstract class Control extends Widget implements Drawable { long /*int*/ visibleRgn; Accessible accessible; boolean touchEnabled; - + final static int CLIPPING = 1 << 10; final static int VISIBLE_REGION = 1 << 12; - + /** * Magic number comes from experience. There's no API for this value in Cocoa or Carbon. */ static final int DEFAULT_DRAG_HYSTERESIS = 5; - + Control () { /* Do nothing */ } @@ -89,7 +89,7 @@ Control () { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -129,12 +129,12 @@ boolean acceptsFirstMouse (long /*int*/ id, long /*int*/ sel, long /*int*/ theEv @Override long /*int*/ accessibleHandle() { long /*int*/ returnValue = view.id; - + if (view instanceof NSControl) { if (((NSControl) view).cell() != null) { returnValue = ((NSControl) view).cell().id; } - + } return returnValue; } @@ -170,24 +170,24 @@ long /*int*/ accessibilityActionNames(long /*int*/ id, long /*int*/ sel) { @Override long /*int*/ accessibilityAttributeNames(long /*int*/ id, long /*int*/ sel) { - + long /*int*/ returnValue = 0; - + if (handleIsAccessible(id) && accessible != null) { // See if the accessible is defining the attribute set for the control. id value = accessible.internal_accessibilityAttributeNames(ACC.CHILDID_SELF); returnValue = (value != null ? value.id : 0); - + // If not, ask Cocoa for the set for this control. if (returnValue == 0) returnValue = super.accessibilityAttributeNames(id, sel); - + // Add relationship attributes. returnValue = accessible.internal_addRelationAttributes(returnValue); } // If the SWT accessibility didn't give us anything get the default for the view/cell. if (returnValue == 0) returnValue = super.accessibilityAttributeNames(id, sel); - + return returnValue; } @@ -195,7 +195,7 @@ long /*int*/ accessibilityAttributeNames(long /*int*/ id, long /*int*/ sel) { * @param id NSView/NSCell that makes up this control. Could be the view itself. * @return true if id is something whose accessible properties can be augmented * or overridden by the SWT Accessible. false if the Cocoa defaults for the control should - * be used. + * be used. */ boolean handleIsAccessible(long /*int*/ id) { return id == accessibleHandle(); @@ -258,7 +258,7 @@ long /*int*/ accessibilityAttributeValue(long /*int*/ id, long /*int*/ sel, long NSString attribute = new NSString(arg0); long /*int*/ returnValue = 0; id returnObject = null; - + if (handleIsAccessible(id) && accessible != null) { returnObject = accessible.internal_accessibilityAttributeValue(attribute, ACC.CHILDID_SELF); } @@ -267,7 +267,7 @@ long /*int*/ accessibilityAttributeValue(long /*int*/ id, long /*int*/ sel, long // superclass handle it. if (returnObject == null) { returnValue = super.accessibilityAttributeValue(id, sel, arg0); - + // Feature in Cocoa: SWT doesn't use setToolTip for tooltip support, so if the // help attribute was requested return toolTipText. if (returnObject == null) { @@ -275,25 +275,25 @@ long /*int*/ accessibilityAttributeValue(long /*int*/ id, long /*int*/ sel, long if (toolTipText != null) returnValue = NSString.stringWith(toolTipText).id; } } - + } else { returnValue = returnObject.id; } - + return returnValue; } @Override long /*int*/ accessibilityAttributeValue_forParameter(long /*int*/ id, long /*int*/ sel, long /*int*/ arg0, long /*int*/ arg1) { NSString attribute = new NSString(arg0); - + id returnValue = null; - + if (handleIsAccessible(id) && accessible != null) { id parameter = new id(arg1); returnValue = accessible.internal_accessibilityAttributeValue_forParameter(attribute, parameter, ACC.CHILDID_SELF); } - + // If we had an accessible and it didn't handle the attribute request, let the // superclass handle it. if (returnValue == null) @@ -371,7 +371,7 @@ public void addControlListener(ControlListener listener) { * * @see DragDetectListener * @see #removeDragDetectListener - * + * * @since 3.3 */ public void addDragDetectListener (DragDetectListener listener) { @@ -423,7 +423,7 @@ public void addFocusListener(FocusListener listener) { * <b>Warning</b>: This API is currently only implemented on Windows and Cocoa. * SWT doesn't send Gesture or Touch events on GTK. * </p> - * + * * @param listener the listener which should be notified * * @exception IllegalArgumentException <ul> @@ -437,7 +437,7 @@ public void addFocusListener(FocusListener listener) { * @see GestureListener * @see #removeGestureListener * @see #setTouchEnabled - * + * * @since 3.7 */ public void addGestureListener (GestureListener listener) { @@ -696,7 +696,7 @@ void addTraits(NSMutableDictionary dict, Font font) { * one of the messages defined in the <code>TouchListener</code> * interface. * <p> - * NOTE: You must also call <code>setTouchEnabled(true)</code> to + * NOTE: You must also call <code>setTouchEnabled(true)</code> to * specify that touch events should be sent, which will cause gesture * events to not be sent. * </p> @@ -704,7 +704,7 @@ void addTraits(NSMutableDictionary dict, Font font) { * <b>Warning</b>: This API is currently only implemented on Windows and Cocoa. * SWT doesn't send Gesture or Touch events on GTK. * </p> - * + * * @param listener the listener which should be notified * * @exception IllegalArgumentException <ul> @@ -718,7 +718,7 @@ void addTraits(NSMutableDictionary dict, Font font) { * @see TouchListener * @see #removeTouchListener * @see #setTouchEnabled - * + * * @since 3.7 */ public void addTouchListener (TouchListener listener) { @@ -834,7 +834,7 @@ void cancelOperation(long /*int*/ id, long /*int*/ sel, long /*int*/ sender) { void checkBackground () { Shell shell = getShell (); if (this == shell) return; - state &= ~PARENT_BACKGROUND; + state &= ~PARENT_BACKGROUND; Composite composite = parent; do { int mode = composite.backgroundMode; @@ -848,7 +848,7 @@ void checkBackground () { control = control.parent; } while (control != composite); } - state |= PARENT_BACKGROUND; + state |= PARENT_BACKGROUND; return; } if (composite == shell) break; @@ -875,8 +875,8 @@ void checkToolTip (Widget target) { * best be displayed at. The width hint and height hint arguments * allow the caller to ask a control questions such as "Given a particular * width, how high does the control need to be to show all of the contents?" - * To indicate that the caller does not wish to constrain a particular - * dimension, the constant <code>SWT.DEFAULT</code> is passed for the hint. + * To indicate that the caller does not wish to constrain a particular + * dimension, the constant <code>SWT.DEFAULT</code> is passed for the hint. * </p> * * @param wHint the width hint (can be <code>SWT.DEFAULT</code>) @@ -906,14 +906,14 @@ public Point computeSize (int wHint, int hHint) { * best be displayed at. The width hint and height hint arguments * allow the caller to ask a control questions such as "Given a particular * width, how high does the control need to be to show all of the contents?" - * To indicate that the caller does not wish to constrain a particular - * dimension, the constant <code>SWT.DEFAULT</code> is passed for the hint. + * To indicate that the caller does not wish to constrain a particular + * dimension, the constant <code>SWT.DEFAULT</code> is passed for the hint. * </p><p> * If the changed flag is <code>true</code>, it indicates that the receiver's * <em>contents</em> have changed, therefore any caches that a layout manager * containing the control may have been keeping need to be flushed. When the * control is resized, the changed flag will be <code>false</code>, so layout - * manager caches can be retained. + * manager caches can be retained. * </p> * * @param wHint the width hint (can be <code>SWT.DEFAULT</code>) @@ -1074,7 +1074,7 @@ void doCommandBySelector (long /*int*/ id, long /*int*/ sel, long /*int*/ select NSEvent nsEvent = NSApplication.sharedApplication ().currentEvent (); if (nsEvent != null && nsEvent.type () == OS.NSKeyDown) { /* - * Feature in Cocoa. Pressing Alt+UpArrow invokes doCommandBySelector + * Feature in Cocoa. Pressing Alt+UpArrow invokes doCommandBySelector * twice, with selectors moveBackward and moveToBeginningOfParagraph * (Alt+DownArrow behaves similarly). In order to avoid sending * multiple events for these keys, do not send a KeyDown if we already sent one @@ -1100,7 +1100,7 @@ void doCommandBySelector (long /*int*/ id, long /*int*/ sel, long /*int*/ select * Detects a drag and drop gesture. This method is used * to detect a drag gesture when called from within a mouse * down listener. - * + * * <p>By default, a drag is detected when the gesture * occurs anywhere within the client area of a control. * Some controls, such as tables and trees, override this @@ -1113,7 +1113,7 @@ void doCommandBySelector (long /*int*/ id, long /*int*/ sel, long /*int*/ select * </p> * * @param event the mouse down event - * + * * @return <code>true</code> if the gesture occurred, and <code>false</code> otherwise. * * @exception IllegalArgumentException <ul> @@ -1123,13 +1123,13 @@ void doCommandBySelector (long /*int*/ id, long /*int*/ sel, long /*int*/ select * <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> - * + * * @see DragDetectListener * @see #addDragDetectListener - * + * * @see #getDragDetect * @see #setDragDetect - * + * * @since 3.3 */ public boolean dragDetect (Event event) { @@ -1142,7 +1142,7 @@ public boolean dragDetect (Event event) { * Detects a drag and drop gesture. This method is used * to detect a drag gesture when called from within a mouse * down listener. - * + * * <p>By default, a drag is detected when the gesture * occurs anywhere within the client area of a control. * Some controls, such as tables and trees, override this @@ -1155,7 +1155,7 @@ public boolean dragDetect (Event event) { * </p> * * @param event the mouse down event - * + * * @return <code>true</code> if the gesture occurred, and <code>false</code> otherwise. * * @exception IllegalArgumentException <ul> @@ -1165,13 +1165,13 @@ public boolean dragDetect (Event event) { * <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> - * + * * @see DragDetectListener * @see #addDragDetectListener - * + * * @see #getDragDetect * @see #setDragDetect - * + * * @since 3.3 */ public boolean dragDetect (MouseEvent event) { @@ -1190,15 +1190,15 @@ boolean dragDetect (int x, int y, boolean filter, boolean [] consume) { /** * Feature in Cocoa. Mouse drag events do not account for hysteresis. * As soon as the mouse drags a mouse dragged event is fired. Fix is to - * check for another mouse drag event that is at least 5 pixels away - * from the start of the drag. + * check for another mouse drag event that is at least 5 pixels away + * from the start of the drag. */ NSApplication application = NSApplication.sharedApplication(); boolean dragging = false; long /*int*/ eventType = OS.NSLeftMouseDown; double /*float*/ dragX = x; double /*float*/ dragY = y; - + /** * To check for an actual drag we need to pull off mouse moved and mouse up events * to detect if the user dragged outside of a 10 x 10 box centered on the mouse down location. @@ -1218,7 +1218,7 @@ boolean dragDetect (int x, int y, boolean filter, boolean [] consume) { break; } eventType = event.type(); - + if (eventType == OS.NSLeftMouseDragged) { dragEvents.addObject(event); NSPoint windowLoc = event.locationInWindow(); @@ -1235,7 +1235,7 @@ boolean dragDetect (int x, int y, boolean filter, boolean [] consume) { } } - // Push back any events we took out of the queue so the control can receive them. + // Push back any events we took out of the queue so the control can receive them. if (mouseUpEvent != null) application.postEvent(mouseUpEvent, true); if (dragEvents.count() > 0) { @@ -1287,10 +1287,10 @@ void enableWidget (boolean enabled) { boolean equals(double /*float*/ [] color1, double /*float*/ [] color2) { if (color1 == color2) return true; if (color1 == null) return color2 == null; - if (color2 == null) return color1 == null; + if (color2 == null) return color1 == null; for (int i = 0; i < color1.length; i++) { if (color1 [i] != color2 [i]) return false; - } + } return true; } @@ -1458,11 +1458,11 @@ public boolean forceFocus () { if (isDisposed ()) return false; shell.setSavedFocus (this); /* - * Feature in Cocoa. If the window is inactive when forceFocus is called bringToTop - * eventually calls makeKeyAndOrderFront. This activates the window immediately, but unlike other platforms, + * Feature in Cocoa. If the window is inactive when forceFocus is called bringToTop + * eventually calls makeKeyAndOrderFront. This activates the window immediately, but unlike other platforms, * it also immediately fire notifications that the window was activated, as opposed to posting an event * to be handled on the next pass of readAndDispatch(). - * + * * Shell#windowDidBecomeKey will call Decorations#restoreFocus, so the saved focus must be set * before the window is activated or the wrong control will get focus. */ @@ -1506,13 +1506,13 @@ boolean gestureEvent(long /*int*/ id, long /*int*/ eventPtr, int detail) { } else if (detail == SWT.GESTURE_END) { display.gestureActive = false; } - - switch (detail) { + + switch (detail) { case SWT.GESTURE_SWIPE: event.xDirection = (int) -nsEvent.deltaX(); event.yDirection = (int) -nsEvent.deltaY(); break; - case SWT.GESTURE_ROTATE: { + case SWT.GESTURE_ROTATE: { display.rotation += nsEvent.rotation(); event.rotation = display.rotation; break; @@ -1550,10 +1550,10 @@ boolean gestureEvent(long /*int*/ id, long /*int*/ eventPtr, int detail) { * <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> - * + * * @see Accessible#addAccessibleListener * @see Accessible#addAccessibleControlListener - * + * * @since 2.0 */ public Accessible getAccessible () { @@ -1580,7 +1580,7 @@ public Color getBackground () { checkWidget(); if (backgroundAlpha == 0) { Color color = Color.cocoa_new (display, background, 0); - return color; + return color; } else { Control control = findBackgroundControl (); @@ -1602,7 +1602,7 @@ Color getBackgroundColor () { * <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.2 */ public Image getBackgroundImage () { @@ -1648,15 +1648,15 @@ public Rectangle getBounds () { /** * Returns <code>true</code> if the receiver is detecting - * drag gestures, and <code>false</code> otherwise. + * drag gestures, and <code>false</code> otherwise. * * @return the receiver's drag detect state - * + * * @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.3 */ public boolean getDragDetect () { @@ -1682,7 +1682,7 @@ boolean getDrawing () { * <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.3 */ public Cursor getCursor () { @@ -1702,7 +1702,7 @@ public Cursor getCursor () { * <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> - * + * * @see #isEnabled */ public boolean getEnabled () { @@ -1762,8 +1762,8 @@ public Object getLayoutData () { /** * Returns a point describing the receiver's location relative * to its parent (or its display if its parent is null), unless - * the receiver is a shell. In this case, the point is - * relative to the display. + * the receiver is a shell. In this case, the point is + * relative to the display. * * @return the receiver's location * @@ -1804,14 +1804,14 @@ int getMininumHeight () { /** * Returns the receiver's monitor. - * + * * @return the receiver's monitor - * + * * @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.0 */ public Monitor getMonitor () { @@ -1841,7 +1841,7 @@ public Monitor getMonitor () { if (index == -1 || distance < value) { index = i; value = distance; - } + } } return monitors [index]; } @@ -1851,12 +1851,12 @@ public Monitor getMonitor () { * constants <code>SWT.LEFT_TO_RIGHT</code> or <code>SWT.RIGHT_TO_LEFT</code>. * * @return the orientation style - * + * * @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 getOrientation () { @@ -1914,12 +1914,12 @@ NSBezierPath getPath(long /*int*/ region) { return path; } -/** +/** * Returns the region that defines the shape of the control, * or null if the control has the default shape. * * @return the region that defines the shape of the shell (or null) - * + * * @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> @@ -1976,12 +1976,12 @@ public Point getSize () { * constants <code>SWT.LEFT_TO_RIGHT</code> or <code>SWT.RIGHT_TO_LEFT</code>. * * @return the text direction style - * + * * @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.102 */ public int getTextDirection() { @@ -2024,7 +2024,7 @@ public String getToolTipText () { * <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> - * + * * @see #setTouchEnabled * @see Display#getTouchEnabled * @@ -2135,7 +2135,7 @@ boolean insertText (long /*int*/ id, long /*int*/ sel, long /*int*/ string) { } } -/** +/** * Invokes platform specific functionality to allocate a new GC handle. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public @@ -2145,9 +2145,9 @@ boolean insertText (long /*int*/ id, long /*int*/ sel, long /*int*/ string) { * application code. * </p> * - * @param data the platform specific GC data + * @param data the platform specific GC data * @return the platform specific GC handle - * + * * @noreference This method is not intended to be referenced by clients. */ public long /*int*/ internal_new_GC (GCData data) { @@ -2195,7 +2195,7 @@ public long /*int*/ internal_new_GC (GCData data) { Control control = findBackgroundControl (); if (control == null) control = this; data.background = control.getBackgroundColor ().handle; - data.font = font != null ? font : defaultFont (); + data.font = font != null ? font : defaultFont (); } if (graphicsContext != null) { return graphicsContext.id; @@ -2203,7 +2203,7 @@ public long /*int*/ internal_new_GC (GCData data) { return 0; } -/** +/** * Invokes platform specific functionality to dispose a GC handle. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public @@ -2214,8 +2214,8 @@ public long /*int*/ internal_new_GC (GCData data) { * </p> * * @param hDC the platform specific GC handle - * @param data the platform specific GC data - * + * @param data the platform specific GC data + * * @noreference This method is not intended to be referenced by clients. */ public void internal_dispose_GC (long /*int*/ hDC, GCData data) { @@ -2287,7 +2287,7 @@ boolean isDrawing () { * <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> - * + * * @see #getEnabled */ public boolean isEnabled () { @@ -2455,7 +2455,7 @@ void keyDown (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) { if (!sendKeyEvent (nsEvent, SWT.KeyDown)) return; if (consume [0]) return; } - + return; } } @@ -2525,7 +2525,7 @@ void scrollWheel (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) { if ((hooks(SWT.Gesture) || filters(SWT.Gesture))) { if (nsEvent.deltaY() != 0 || nsEvent.deltaX() != 0) { if (!gestureEvent(id, theEvent, SWT.GESTURE_PAN)) { - handled = true; + handled = true; } } } @@ -2546,7 +2546,7 @@ void scrollWheel (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) { } } } - if (!handled) super.scrollWheel(id, sel, theEvent); + if (!handled) super.scrollWheel(id, sel, theEvent); } boolean isEventView (long /*int*/ id) { @@ -2570,7 +2570,7 @@ boolean mouseEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent, in boolean runEnterExit = false; Control runEnterExitControl = null; - + switch (nsType) { case OS.NSLeftMouseDown: if (nsEvent.clickCount() == 1 && (nsEvent.modifierFlags() & OS.NSControlKeyMask) == 0 && (state & DRAG_DETECT) != 0 && hooks (SWT.DragDetect)) { @@ -2677,13 +2677,13 @@ void moved () { * @param control the sibling control (or null) * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the control has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the control has been disposed</li> * </ul> * @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> - * + * * @see Control#moveBelow * @see Composite#getChildren */ @@ -2706,13 +2706,13 @@ public void moveAbove (Control control) { * @param control the sibling control (or null) * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the control has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the control has been disposed</li> * </ul> * @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> - * + * * @see Control#moveAbove * @see Composite#getChildren */ @@ -2755,11 +2755,11 @@ public void pack () { * <em>contents</em> have changed, therefore any caches that a layout manager * containing the control may have been keeping need to be flushed. When the * control is resized, the changed flag will be <code>false</code>, so layout - * manager caches can be retained. + * manager caches can be retained. * </p> * * @param changed whether or not the receiver's contents have changed - * + * * @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> @@ -2778,7 +2778,7 @@ NSView paintView () { /** * Prints the receiver and all children. - * + * * @param gc the gc where the drawing occurs * @return <code>true</code> if the operation was successful and <code>false</code> otherwise * @@ -2790,14 +2790,14 @@ NSView paintView () { * <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.4 */ public boolean print (GC gc) { checkWidget (); if (gc == null) error (SWT.ERROR_NULL_ARGUMENT); if (gc.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT); - + NSGraphicsContext.static_saveGraphicsState(); NSGraphicsContext.setCurrentContext(gc.handle); NSAffineTransform transform = NSAffineTransform.transform (); @@ -2859,7 +2859,7 @@ void redraw (boolean children) { /** * Causes the rectangular area of the receiver specified by - * the arguments to be marked as needing to be redrawn. + * the arguments to be marked as needing to be redrawn. * The next time a paint request is processed, that area of * the receiver will be painted, including the background. * If the <code>all</code> flag is <code>true</code>, any @@ -3024,7 +3024,7 @@ public void removeControlListener (ControlListener listener) { * * @see DragDetectListener * @see #addDragDetectListener - * + * * @since 3.3 */ public void removeDragDetectListener(DragDetectListener listener) { @@ -3075,7 +3075,7 @@ public void removeFocusListener(FocusListener listener) { * * @see GestureListener * @see #addGestureListener - * + * * @since 3.7 */ public void removeGestureListener (GestureListener listener) { @@ -3293,12 +3293,12 @@ public void removePaintListener(PaintListener listener) { void removeRelation () { if (!isDescribedByLabel()) return; NSObject accessibleElement = focusView(); - + if (accessibleElement instanceof NSControl) { NSControl viewAsControl = (NSControl) accessibleElement; if (viewAsControl.cell() != null) accessibleElement = viewAsControl.cell(); } - + accessibleElement.accessibilitySetOverrideValue(accessibleElement, OS.NSAccessibilityTitleUIElementAttribute); } @@ -3319,7 +3319,7 @@ void removeRelation () { * * @see TouchListener * @see #addTouchListener - * + * * @since 3.7 */ public void removeTouchListener(TouchListener listener) { @@ -3462,7 +3462,7 @@ boolean sendMouseEvent (NSEvent nsEvent, int type, boolean send) { NSView view = eventView (); if (nsEvent == null || nsEvent.type() == OS.NSMouseMoved) { NSWindow window = view.window(); - windowPoint = window.convertScreenToBase(NSEvent.mouseLocation()); + windowPoint = window.convertScreenToBase(NSEvent.mouseLocation()); } else { windowPoint = nsEvent.locationInWindow(); } @@ -3484,11 +3484,11 @@ boolean sendMouseEvent (NSEvent nsEvent, int type, boolean send) { } Touch touchStateFromNSTouch(NSTouch touch) { - TouchSource source = display.findTouchSource(touch); + TouchSource source = display.findTouchSource(touch); long /*int*/ osPhase = touch.phase(); long identity = OS.objc_msgSend(touch.id, OS.sel_identity); int state = 0; - + switch ((int)osPhase) { case OS.NSTouchPhaseBegan: state = SWT.TOUCHSTATE_DOWN; @@ -3502,13 +3502,13 @@ Touch touchStateFromNSTouch(NSTouch touch) { break; } - display.touchCounter++; + display.touchCounter++; boolean primary = false; NSPoint normalizedPos = touch.normalizedPosition(); double normalizedX = normalizedPos.x; double normalizedY = 1 - normalizedPos.y; if (display.currentTouches().count() == 1) display.primaryIdentifier = identity; - if (display.primaryIdentifier == identity) primary = true; + if (display.primaryIdentifier == identity) primary = true; NSSize deviceSize = touch.deviceSize(); int deviceX = (int) (normalizedX * deviceSize.width); int deviceY = (int) (normalizedY * deviceSize.height); @@ -3550,7 +3550,7 @@ void setBackground () { * @param color the new color (or null) * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> @@ -3590,14 +3590,14 @@ private void _setBackground (Color color) { * @param image the new image (or null) * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> - * <li>ERROR_INVALID_ARGUMENT - if the argument is not a bitmap</li> + * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the argument is not a bitmap</li> * </ul> * @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.2 */ public void setBackgroundImage (Image image) { @@ -3618,9 +3618,9 @@ void setBackgroundColor (NSColor nsColor) { /** * Sets the receiver's size and location to the rectangular - * area specified by the arguments. The <code>x</code> and + * area specified by the arguments. The <code>x</code> and * <code>y</code> arguments are relative to the receiver's - * parent (or its display if its parent is null), unless + * parent (or its display if its parent is null), unless * the receiver is a shell. In this case, the <code>x</code> * and <code>y</code> arguments are relative to the display. * <p> @@ -3676,7 +3676,7 @@ void setBounds (int x, int y, int width, int height, boolean move, boolean resiz /** * Sets the receiver's size and location to the rectangular - * area specified by the argument. The <code>x</code> and + * area specified by the argument. The <code>x</code> and * <code>y</code> fields of the rectangle are relative to * the receiver's parent (or its display if its parent is null). * <p> @@ -3743,7 +3743,7 @@ void setClipRegion (NSView view) { * @param cursor the new cursor (or null) * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> @@ -3777,13 +3777,13 @@ void setDefaultFont () { * <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.3 */ public void setDragDetect (boolean dragDetect) { checkWidget (); if (dragDetect) { - state |= DRAG_DETECT; + state |= DRAG_DETECT; } else { state &= ~DRAG_DETECT; } @@ -3823,7 +3823,7 @@ public void setEnabled (boolean enabled) { } /** - * Causes the receiver to have the <em>keyboard focus</em>, + * Causes the receiver to have the <em>keyboard focus</em>, * such that all keyboard events will be delivered to it. Focus * reassignment will respect applicable platform constraints. * @@ -3850,7 +3850,7 @@ public boolean setFocus () { * @param font the new font (or null) * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> @@ -3859,7 +3859,7 @@ public boolean setFocus () { */ public void setFont (Font font) { checkWidget(); - if (font != null) { + if (font != null) { if (font.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT); } this.font = font; @@ -3882,7 +3882,7 @@ void setFont (NSFont font) { * @param color the new color (or null) * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> @@ -3933,15 +3933,15 @@ void setFrameSize (long /*int*/ id, long /*int*/ sel, NSSize size) { boolean oldResizing = (state & RESIZING) != 0; state |= RESIZING; resized (); - if (!oldResizing) state &= ~RESIZING; + if (!oldResizing) state &= ~RESIZING; } } /** * Sets the layout data associated with the receiver to the argument. - * + * * @param layoutData the new layout data for 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> @@ -3955,9 +3955,9 @@ public void setLayoutData (Object layoutData) { /** * Sets the receiver's location to the point specified by * the arguments which are relative to the receiver's - * parent (or its display if its parent is null), unless - * the receiver is a shell. In this case, the point is - * relative to the display. + * parent (or its display if its parent is null), unless + * the receiver is a shell. In this case, the point is + * relative to the display. * * @param x the new x coordinate for the receiver * @param y the new y coordinate for the receiver @@ -3975,9 +3975,9 @@ public void setLocation (int x, int y) { /** * Sets the receiver's location to the point specified by * the arguments which are relative to the receiver's - * parent (or its display if its parent is null), unless - * the receiver is a shell. In this case, the point is - * relative to the display. + * parent (or its display if its parent is null), unless + * the receiver is a shell. In this case, the point is + * relative to the display. * * @param location the new location for the receiver * @@ -4010,7 +4010,7 @@ public void setLocation (Point location) { * @exception IllegalArgumentException <ul> * <li>ERROR_MENU_NOT_POP_UP - the menu is not a pop up menu</li> * <li>ERROR_INVALID_PARENT - if the menu is not in the same widget tree</li> - * <li>ERROR_INVALID_ARGUMENT - if the menu has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the menu has been disposed</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> @@ -4037,12 +4037,12 @@ public void setMenu (Menu menu) { * <p> * * @param orientation new orientation style - * + * * @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 void setOrientation (int orientation) { @@ -4059,7 +4059,7 @@ public void setOrientation (int orientation) { * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> - * <li>ERROR_NULL_ARGUMENT - if the parent is <code>null</code></li> + * <li>ERROR_NULL_ARGUMENT - if the parent is <code>null</code></li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> @@ -4108,7 +4108,7 @@ public boolean setParent (Composite parent) { * <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> - * + * * @see #redraw(int, int, int, int, boolean) * @see #update() */ @@ -4136,7 +4136,7 @@ public void setRedraw (boolean redraw) { * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the region has been disposed</li> - * </ul> + * </ul> * @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> @@ -4245,17 +4245,17 @@ boolean setTabItemFocus () { * </p> * * @param textDirection the base text direction style - * + * * @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> - * + * * @see SWT#LEFT_TO_RIGHT * @see SWT#RIGHT_TO_LEFT * @see SWT#AUTO_TEXT_DIRECTION * @see SWT#FLIP_TEXT_DIRECTION - * + * * @since 3.102 */ public void setTextDirection(int textDirection) { @@ -4264,17 +4264,17 @@ public void setTextDirection(int textDirection) { /** * Sets the receiver's tool tip text to the argument, which - * may be null indicating that the default tool tip for the + * may be null indicating that the default tool tip for the * control will be shown. For a control that has a default * tool tip, such as the Tree control on Windows, setting * the tool tip text to an empty string replaces the default, * causing no tool tip text to be shown. * <p> * The mnemonic indicator (character '&') is not displayed in a tool tip. - * To display a single '&' in the tool tip, the character '&' can be + * To display a single '&' in the tool tip, the character '&' can be * escaped by doubling it in the string. * </p> - * + * * @param string the new tool tip text (or null) * * @exception SWTException <ul> @@ -4293,9 +4293,9 @@ public void setToolTipText (String string) { * Setting this to <code>false</code> causes the receiver to send gesture events * instead. No exception is thrown if a touch-based input device is not * detected (this can be determined with <code>Display#getTouchEnabled()</code>). - * + * * @param enabled the new touch-enabled state - * + * * @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> @@ -4312,7 +4312,7 @@ public void setTouchEnabled(boolean enabled) { /** * Marks the receiver as visible if the argument is <code>true</code>, - * and marks it invisible otherwise. + * and marks it invisible otherwise. * <p> * If one of the receiver's ancestors is not visible or some * other condition makes the receiver not visible, marking @@ -4344,7 +4344,7 @@ public void setVisible (boolean visible) { sendEvent (SWT.Show); if (isDisposed ()) return; } - + /* * Feature in the Macintosh. If the receiver has focus, hiding * the receiver causes no control to have focus. Also, the focus @@ -4426,7 +4426,7 @@ void setZOrder (Control sibling, boolean above) { parent.contentView().addSubview(topView, above ? OS.NSWindowAbove : OS.NSWindowBelow, otherView); topView.release(); invalidateVisibleRegion(); - + /* determine the receiver's new index in the parent */ if (sibling != null) { if (above) { @@ -4501,7 +4501,7 @@ String tooltipText () { * NOTE: To properly map a rectangle or a corner of a rectangle on a right-to-left platform, use * {@link Display#map(Control, Control, Rectangle)}. * </p> - * + * * @param x the x coordinate to be translated * @param y the y coordinate to be translated * @return the translated coordinates @@ -4510,7 +4510,7 @@ String tooltipText () { * <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 2.1 */ public Point toControl (int x, int y) { @@ -4526,7 +4526,7 @@ public Point toControl (int x, int y) { * NOTE: To properly map a rectangle or a corner of a rectangle on a right-to-left platform, use * {@link Display#map(Control, Control, Rectangle)}. * </p> - * + * * @param point the point to be translated (must not be null) * @return the translated coordinates * @@ -4552,7 +4552,7 @@ public Point toControl (Point point) { * NOTE: To properly map a rectangle or a corner of a rectangle on a right-to-left platform, use * {@link Display#map(Control, Control, Rectangle)}. * </p> - * + * * @param x the x coordinate to be translated * @param y the y coordinate to be translated * @return the translated coordinates @@ -4561,7 +4561,7 @@ public Point toControl (Point point) { * <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 2.1 */ public Point toDisplay (int x, int y) { @@ -4577,7 +4577,7 @@ public Point toDisplay (int x, int y) { * NOTE: To properly map a rectangle or a corner of a rectangle on a right-to-left platform, use * {@link Display#map(Control, Control, Rectangle)}. * </p> - * + * * @param point the point to be translated (must not be null) * @return the translated coordinates * @@ -4619,10 +4619,10 @@ boolean touchEvent(long /*int*/ id, long /*int*/ sel, long /*int*/ eventPtr) { long /*int*/ touchCount = allTouchesSet.count(); Touch touches[] = new Touch[(int)/*64*/touchCount]; int currTouchIndex = 0; - + // Process removed/cancelled touches first. NSArray endedTouches = nsEvent.touchesMatchingPhase(OS.NSTouchPhaseEnded | OS.NSTouchPhaseCancelled, null).allObjects(); - + for (int i = 0; i < endedTouches.count(); i++) { NSTouch touch = new NSTouch(endedTouches.objectAtIndex(i).id); NSObject identity = new NSObject(OS.objc_msgSend(touch.id, OS.sel_identity)); @@ -4630,24 +4630,24 @@ boolean touchEvent(long /*int*/ id, long /*int*/ sel, long /*int*/ eventPtr) { if (endedTouch != null) currentTouches.removeObject(endedTouch); touches[currTouchIndex++] = touchStateFromNSTouch(touch); } - + if (currentTouches.count() == 0) display.touchCounter = 0; - // Process touches in progress or starting. + // Process touches in progress or starting. NSArray activeTouches = nsEvent.touchesMatchingPhase(OS.NSTouchPhaseBegan | OS.NSTouchPhaseMoved | OS.NSTouchPhaseStationary, null).allObjects(); - + for (int i = 0; i < activeTouches.count(); i++) { NSTouch touch = new NSTouch(activeTouches.objectAtIndex(i).id); NSObject identity = new NSObject(OS.objc_msgSend(touch.id, OS.sel_identity)); NSTouch activeTouch = findTouchWithId(currentTouches, identity); if (activeTouch == null) currentTouches.addObject(touch); touches[currTouchIndex++] = touchStateFromNSTouch(touch); - } + } if (activeTouches.count() != currentTouches.count()) { /** * Bug in Cocoa. Under some situations we don't get the NSTouchPhaseEnded/Cancelled notification. Most commonly this happens - * if a 4-finger gesture occurs and the application switcher appears. Workaround is to generate a TOUCHSTATE_UP for the + * if a 4-finger gesture occurs and the application switcher appears. Workaround is to generate a TOUCHSTATE_UP for the * orphaned touch. */ for (long /*int*/ j = currentTouches.count() - 1; j >= 0 ; j--) { @@ -4669,7 +4669,7 @@ boolean touchEvent(long /*int*/ id, long /*int*/ sel, long /*int*/ eventPtr) { } } } - + event.touches = touches; postEvent (SWT.Touch, event); return true; @@ -4770,24 +4770,24 @@ boolean traverseMnemonic (char key) { /** * Performs a platform traversal action corresponding to a <code>KeyDown</code> event. - * + * * <p>Valid traversal values are * <code>SWT.TRAVERSE_NONE</code>, <code>SWT.TRAVERSE_MNEMONIC</code>, * <code>SWT.TRAVERSE_ESCAPE</code>, <code>SWT.TRAVERSE_RETURN</code>, - * <code>SWT.TRAVERSE_TAB_NEXT</code>, <code>SWT.TRAVERSE_TAB_PREVIOUS</code>, + * <code>SWT.TRAVERSE_TAB_NEXT</code>, <code>SWT.TRAVERSE_TAB_PREVIOUS</code>, * <code>SWT.TRAVERSE_ARROW_NEXT</code>, <code>SWT.TRAVERSE_ARROW_PREVIOUS</code>, * <code>SWT.TRAVERSE_PAGE_NEXT</code> and <code>SWT.TRAVERSE_PAGE_PREVIOUS</code>. * If <code>traversal</code> is <code>SWT.TRAVERSE_NONE</code> then the Traverse * event is created with standard values based on the KeyDown event. If * <code>traversal</code> is one of the other traversal constants then the Traverse * event is created with this detail, and its <code>doit</code> is taken from the - * KeyDown event. + * KeyDown event. * </p> * * @param traversal the type of traversal, or <code>SWT.TRAVERSE_NONE</code> to compute * this from <code>event</code> * @param event the KeyDown event - * + * * @return <code>true</code> if the traversal succeeded * * @exception IllegalArgumentException <ul> @@ -4808,24 +4808,24 @@ public boolean traverse (int traversal, Event event) { /** * Performs a platform traversal action corresponding to a <code>KeyDown</code> event. - * + * * <p>Valid traversal values are * <code>SWT.TRAVERSE_NONE</code>, <code>SWT.TRAVERSE_MNEMONIC</code>, * <code>SWT.TRAVERSE_ESCAPE</code>, <code>SWT.TRAVERSE_RETURN</code>, - * <code>SWT.TRAVERSE_TAB_NEXT</code>, <code>SWT.TRAVERSE_TAB_PREVIOUS</code>, + * <code>SWT.TRAVERSE_TAB_NEXT</code>, <code>SWT.TRAVERSE_TAB_PREVIOUS</code>, * <code>SWT.TRAVERSE_ARROW_NEXT</code>, <code>SWT.TRAVERSE_ARROW_PREVIOUS</code>, * <code>SWT.TRAVERSE_PAGE_NEXT</code> and <code>SWT.TRAVERSE_PAGE_PREVIOUS</code>. * If <code>traversal</code> is <code>SWT.TRAVERSE_NONE</code> then the Traverse * event is created with standard values based on the KeyDown event. If * <code>traversal</code> is one of the other traversal constants then the Traverse * event is created with this detail, and its <code>doit</code> is taken from the - * KeyDown event. + * KeyDown event. * </p> * * @param traversal the type of traversal, or <code>SWT.TRAVERSE_NONE</code> to compute * this from <code>event</code> * @param event the KeyDown event - * + * * @return <code>true</code> if the traversal succeeded * * @exception IllegalArgumentException <ul> @@ -4941,8 +4941,8 @@ boolean traverse (int traversal, char character, int keyCode, int keyLocation, i /** * Based on the argument, perform one of the expected platform * traversal action. The argument should be one of the constants: - * <code>SWT.TRAVERSE_ESCAPE</code>, <code>SWT.TRAVERSE_RETURN</code>, - * <code>SWT.TRAVERSE_TAB_NEXT</code>, <code>SWT.TRAVERSE_TAB_PREVIOUS</code>, + * <code>SWT.TRAVERSE_ESCAPE</code>, <code>SWT.TRAVERSE_RETURN</code>, + * <code>SWT.TRAVERSE_TAB_NEXT</code>, <code>SWT.TRAVERSE_TAB_PREVIOUS</code>, * <code>SWT.TRAVERSE_ARROW_NEXT</code>, <code>SWT.TRAVERSE_ARROW_PREVIOUS</code>, * <code>SWT.TRAVERSE_PAGE_NEXT</code> and <code>SWT.TRAVERSE_PAGE_PREVIOUS</code>. * @@ -4974,7 +4974,7 @@ boolean traverse (Event event) { case SWT.TRAVERSE_TAB_PREVIOUS: return traverseGroup (false); case SWT.TRAVERSE_ARROW_NEXT: return traverseItem (true); case SWT.TRAVERSE_ARROW_PREVIOUS: return traverseItem (false); - case SWT.TRAVERSE_MNEMONIC: return traverseMnemonic (event); + case SWT.TRAVERSE_MNEMONIC: return traverseMnemonic (event); case SWT.TRAVERSE_PAGE_NEXT: return traversePage (true); case SWT.TRAVERSE_PAGE_PREVIOUS: return traversePage (false); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DateTime.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DateTime.java index 4d2e18bf44..6143c0f30a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DateTime.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DateTime.java @@ -36,7 +36,7 @@ import org.eclipse.swt.internal.cocoa.*; * </p><p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> - * + * * @see <a href="http://www.eclipse.org/swt/snippets/#datetime">DateTime snippets</a> * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a> * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> @@ -47,7 +47,7 @@ import org.eclipse.swt.internal.cocoa.*; public class DateTime extends Composite { static final int MIN_YEAR = 1752; // Gregorian switchover in North America: September 19, 1752 static final int MAX_YEAR = 9999; - + /* Emulated DROP_DOWN calendar fields for DATE */ NSButton buttonView; Shell popupShell; @@ -55,14 +55,14 @@ public class DateTime extends Composite { int savedYear, savedMonth, savedDay; Listener clickListener; - + /** * Constructs a new instance of this class given its parent * and a style value describing its behavior and appearance. * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -196,7 +196,7 @@ void createHandle () { widget.setTarget(widget); widget.setAction(OS.sel_sendSelection); view = widget; - + if ((this.style & SWT.DROP_DOWN) != 0) { NSButton buttonWidget = (NSButton)new SWTButton().alloc(); buttonWidget.init(); @@ -246,7 +246,7 @@ void createPopupShell(int year, int month, int day) { hideCalendar(); } }); - + addListener (SWT.Dispose, new Listener() { public void handleEvent(Event event) { if (popupShell != null && !popupShell.isDisposed ()) { @@ -257,7 +257,7 @@ void createPopupShell(int year, int month, int day) { addListener(SWT.FocusOut, new Listener() { public void handleEvent(Event event) { hideCalendar(); - display.removeFilter(SWT.MouseDown, clickListener); + display.removeFilter(SWT.MouseDown, clickListener); } }); if (year != -1) popupCalendar.setDate(year, month, day); @@ -280,7 +280,7 @@ void deregister() { void disposePopupShell() { popupShell.dispose (); - popupShell = null; + popupShell = null; popupCalendar = null; } @@ -314,7 +314,7 @@ void showCalendar() { popupShell.setBounds (x, y, width, height); popupShell.setVisible (true); if (isFocusControl()) popupCalendar.setFocus (); - display.addFilter(SWT.MouseDown, clickListener); + display.addFilter(SWT.MouseDown, clickListener); } void hideCalendar() { @@ -323,7 +323,7 @@ void hideCalendar() { if (!isDisposed () && isFocusControl()) { setFocus(); } - display.removeFilter(SWT.MouseDown, clickListener); + display.removeFilter(SWT.MouseDown, clickListener); } int getBezelInset() { @@ -547,7 +547,7 @@ public void removeSelectionListener (SelectionListener listener) { if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; eventTable.unhook (SWT.Selection, listener); - eventTable.unhook (SWT.DefaultSelection, listener); + eventTable.unhook (SWT.DefaultSelection, listener); } @Override @@ -610,8 +610,8 @@ void sendVerticalSelection () { @Override void setBackgroundColor(NSColor nsColor) { /* - * Bug in Cocoa: NSDatePicker background turns black when a nsColor - * with full transparency (alpha = 0) is set as its background color. + * Bug in Cocoa: NSDatePicker background turns black when a nsColor + * with full transparency (alpha = 0) is set as its background color. * Hence, don't set the background color in that case. */ if (nsColor != null && nsColor.alphaComponent () == 0) return; @@ -656,7 +656,7 @@ public void setDate (int year, int month, int day) { * Sets the receiver's date, or day of the month, to the specified day. * <p> * The first day of the month is 1, and the last day depends on the month and year. - * If the specified day is not valid for the receiver's month and year, then it is ignored. + * If the specified day is not valid for the receiver's month and year, then it is ignored. * </p> * * @param day a positive integer beginning with 1 @@ -665,7 +665,7 @@ public void setDate (int year, int month, int day) { * <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> - * + * * @see #setDate */ public void setDay (int day) { @@ -741,7 +741,7 @@ public void setMinutes (int minutes) { * Sets the receiver's month. * <p> * The first month of the year is 0, and the last month is 11. - * If the specified month is not valid for the receiver's day and year, then it is ignored. + * If the specified month is not valid for the receiver's day and year, then it is ignored. * </p> * * @param month an integer between 0 and 11 @@ -750,7 +750,7 @@ public void setMinutes (int minutes) { * <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> - * + * * @see #setDate */ public void setMonth (int month) { @@ -817,7 +817,7 @@ public void setTime (int hours, int minutes, int seconds) { * Sets the receiver's year. * <p> * The first year is 1752 and the last year is 9999. - * If the specified year is not valid for the receiver's day and month, then it is ignored. + * If the specified year is not valid for the receiver's day and month, then it is ignored. * </p> * * @param year an integer between 1752 and 9999 @@ -826,7 +826,7 @@ public void setTime (int hours, int minutes, int seconds) { * <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> - * + * * @see #setDate */ public void setYear (int year) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Decorations.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Decorations.java index b0246b5818..0b02f4f2cc 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Decorations.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Decorations.java @@ -27,14 +27,14 @@ import org.eclipse.swt.internal.cocoa.*; * Instead, the class <code>Shell</code> should be used. * </p> * <p> - * Instances are always displayed in one of the maximized, + * Instances are always displayed in one of the maximized, * minimized or normal states: * <ul> * <li> * When an instance is marked as <em>maximized</em>, the * window manager will typically resize it to fill the * entire visible area of the display, and the instance - * is usually put in a state where it can not be resized + * is usually put in a state where it can not be resized * (even if it has style <code>RESIZE</code>) until it is * no longer maximized. * </li><li> @@ -72,13 +72,13 @@ import org.eclipse.swt.internal.cocoa.*; * <dt><code>SHELL_TRIM</code></dt> * <dd> * the result of combining the constants which are required - * to produce a typical application top level shell: (that + * to produce a typical application top level shell: (that * is, <code>CLOSE | TITLE | MIN | MAX | RESIZE</code>) * </dd> * <dt><code>DIALOG_TRIM</code></dt> * <dd> * the result of combining the constants which are required - * to produce a typical application dialog shell: (that + * to produce a typical application dialog shell: (that * is, <code>TITLE | CLOSE | BORDER</code>) * </dd> * </dl> @@ -102,7 +102,7 @@ public class Decorations extends Canvas { boolean minimized, maximized; Control savedFocus; Button defaultButton; - + Decorations () { /* Do nothing */ } @@ -113,7 +113,7 @@ Decorations () { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -235,7 +235,7 @@ public Button getDefaultButton () { } /** - * Returns the receiver's image if it had previously been + * Returns the receiver's image if it had previously been * set using <code>setImage()</code>. The image is typically * displayed by the window manager when the instance is * marked as iconified, and may also be displayed somewhere @@ -247,7 +247,7 @@ public Button getDefaultButton () { * access to a window manager provided, "default" image * even if one exists. * </p> - * + * * @return the image * * @exception SWTException <ul> @@ -261,7 +261,7 @@ public Image getImage () { } /** - * Returns the receiver's images if they had previously been + * Returns the receiver's images if they had previously been * set using <code>setImages()</code>. Images are typically * displayed by the window manager when the instance is * marked as iconified, and may also be displayed somewhere @@ -270,21 +270,21 @@ public Image getImage () { * chooses the icon with the "best" attributes. It is expected * that the array will contain the same icon rendered at different * sizes, with different depth and transparency attributes. - * + * * <p> * Note: This method will return an empty array if called before * <code>setImages()</code> is called. It does not provide * access to a window manager provided, "default" image * even if one exists. * </p> - * + * * @return the images * * @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.0 */ public Image [] getImages () { @@ -297,7 +297,7 @@ public Image [] getImages () { /** * Returns <code>true</code> if the receiver is currently - * maximized, and false otherwise. + * maximized, and false otherwise. * <p> * * @return the maximized state @@ -332,7 +332,7 @@ public Menu getMenuBar () { /** * Returns <code>true</code> if the receiver is currently - * minimized, and false otherwise. + * minimized, and false otherwise. * <p> * * @return the minimized state @@ -357,7 +357,7 @@ String getNameText () { /** * Returns the receiver's text, which is the string that the * window manager will typically display as the receiver's - * <em>title</em>. If the text has not previously been set, + * <em>title</em>. If the text has not previously been set, * returns an empty string. * * @return the text @@ -398,7 +398,7 @@ void releaseChildren (boolean destroy) { if (menuBar != null) { menuBar.dispose (); menuBar = null; - } + } Display display = this.display; super.releaseChildren (destroy); Menu [] menus = display.getMenus (this); @@ -451,7 +451,7 @@ void saveFocus () { * If the argument is not null, sets the receiver's default * button to the argument, and if the argument is null, sets * the receiver's default button to the first button which - * was set as the receiver's default button (called the + * was set as the receiver's default button (called the * <em>saved default button</em>). If no default button had * previously been set, or the saved default button was * disposed, the receiver's default button will be set to @@ -464,7 +464,7 @@ void saveFocus () { * @param button the new default button * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the button has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the button has been disposed</li> * <li>ERROR_INVALID_PARENT - if the control is not in the same widget tree</li> * </ul> * @exception SWTException <ul> @@ -495,11 +495,11 @@ public void setDefaultButton (Button button) { * manager when the instance is marked as iconified, and * may also be displayed somewhere in the trim when the * instance is in normal or maximized states. - * + * * @param image the new image (or null) * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> @@ -526,7 +526,7 @@ public void setImage (Image image) { * the "best" attributes. It is expected that the array will * contain the same icon rendered at different sizes, with * different depth and transparency attributes. - * + * * @param images the new image array * * @exception IllegalArgumentException <ul> @@ -537,7 +537,7 @@ public void setImage (Image image) { * <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.0 */ public void setImages (Image [] images) { @@ -598,7 +598,7 @@ public void setMaximized (boolean maximized) { * @param menu the new menu bar * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the menu has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the menu has been disposed</li> * <li>ERROR_INVALID_PARENT - if the menu is not in the same widget tree</li> * </ul> * @exception SWTException <ul> @@ -652,7 +652,7 @@ void setSavedFocus (Control control) { /** * Sets the receiver's text, which is the string that the * window manager will typically display as the receiver's - * <em>title</em>, to the argument, which must not be null. + * <em>title</em>, to the argument, which must not be null. * <p> * Note: If control characters like '\n', '\t' etc. are used * in the string, then the behavior is platform dependent. @@ -677,7 +677,7 @@ public void setText (String string) { void sort (Image [] images) { /* Shell Sort from K&R, pg 108 */ int length = images.length; - if (length <= 1) return; + if (length <= 1) return; ImageData [] datas = new ImageData [length]; for (int i = 0; i < length; i++) { datas [i] = images [i].getImageData (); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DirectoryDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DirectoryDialog.java index 86d7dc56a9..002e202ebf 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DirectoryDialog.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DirectoryDialog.java @@ -27,7 +27,7 @@ import org.eclipse.swt.internal.cocoa.*; * <p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> - * + * * @see <a href="http://www.eclipse.org/swt/snippets/#directorydialog">DirectoryDialog snippets</a> * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample, Dialog tab</a> * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> @@ -59,7 +59,7 @@ public DirectoryDialog (Shell parent) { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -90,7 +90,7 @@ public DirectoryDialog (Shell parent, int style) { * the directories it shows. * * @return the filter path - * + * * @see #setFilterPath */ public String getFilterPath () { @@ -125,8 +125,8 @@ public String open () { NSOpenPanel panel = NSOpenPanel.openPanel(); Display display = parent != null ? parent.getDisplay() : Display.getCurrent(); - /* - * This line is intentionally commented. Don't show hidden files forcefully, + /* + * This line is intentionally commented. Don't show hidden files forcefully, * instead allow Directory dialog to use the system preference. */ // OS.objc_msgSend(panel.id, OS.sel_setShowsHiddenFiles_, true); @@ -163,7 +163,7 @@ public String open () { * visible on the dialog while it is open. * * @param string the message - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the string is null</li> * </ul> diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java index 661a27816a..340e42e889 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java @@ -48,12 +48,12 @@ import org.eclipse.swt.internal.cocoa.*; * <code>Widget</code> and its subclasses), may only be called * from the thread. (To support multi-threaded user-interface * applications, class <code>Display</code> provides inter-thread - * communication methods which allow threads other than the + * communication methods which allow threads other than the * user-interface thread to request that it perform operations * on their behalf.) * </li> * <li> - * The thread is not allowed to construct other + * The thread is not allowed to construct other * <code>Display</code>s until that display has been disposed. * (Note that, this is in addition to the restriction mentioned * above concerning platform support for multiple displays. Thus, @@ -62,8 +62,8 @@ import org.eclipse.swt.internal.cocoa.*; * </li> * </ul> * Enforcing these attributes allows SWT to be implemented directly - * on the underlying operating system's event model. This has - * numerous benefits including smaller footprint, better use of + * on the underlying operating system's event model. This has + * numerous benefits including smaller footprint, better use of * resources, safer memory management, clearer program logic, * better performance, and fewer overall operating system threads * required. The down side however, is that care must be taken @@ -97,7 +97,7 @@ import org.eclipse.swt.internal.cocoa.*; */ @SuppressWarnings({"rawtypes", "unchecked"}) public class Display extends Device { - + static byte[] types = {'*','\0'}; static int size = C.PTR_SIZEOF, align = C.PTR_SIZEOF == 4 ? 2 : 3; @@ -122,25 +122,25 @@ public class Display extends Device { Synchronizer synchronizer; Thread thread; boolean allowTimers = true, runAsyncMessages = true; - + /* AWT Invoke Later */ static final String RUN_AWT_INVOKE_LATER_KEY = "org.eclipse.swt.internal.runAWTInvokeLater"; //$NON-NLS-1$ GCData[] contexts; Caret currentCaret; - + boolean sendEvent; int clickCountButton, clickCount; int blinkTime; Control currentControl, trackingControl, tooltipControl, ignoreFocusControl; Widget tooltipTarget; - + NSMutableArray isPainting, needsDisplay, needsDisplayInRect, runLoopModes; - + NSDictionary markedAttributes; - + /* Fonts */ boolean smallFonts; NSFont buttonFont, popUpButtonFont, textFieldFont, secureTextFieldFont; @@ -151,7 +151,7 @@ public class Display extends Device { Shell [] modalShells; Dialog modalDialog; NSPanel modalPanel; - + Menu menuBar; Menu[] menus, popups; /* Menu items with ESC key as accelerator need to be handled differently on Cocoa */ @@ -163,11 +163,11 @@ public class Display extends Device { boolean isEmbedded; static boolean launched = false; int systemUIMode, systemUIOptions; - + /* Focus */ Control focusControl, currentFocusControl; int focusEvent; - + NSWindow screenWindow, keyWindow; NSAutoreleasePool[] pools; @@ -175,10 +175,10 @@ public class Display extends Device { int[] screenID = new int[32]; NSPoint[] screenCascade = new NSPoint[32]; - + long /*int*/ runLoopObserver; Callback observerCallback; - + boolean lockCursor = true; static final String LOCK_CURSOR = "org.eclipse.swt.internal.lockCursor"; //$NON-NLS-1$ long /*int*/ oldCursorSetProc; @@ -195,7 +195,7 @@ public class Display extends Device { /* Display Shutdown */ Runnable [] disposeList; - + /* Deferred Layout list */ Composite[] layoutDeferred; int layoutDeferredCount; @@ -204,17 +204,17 @@ public class Display extends Device { Tray tray; TrayItem currentTrayItem; Menu trayItemMenu; - + /* Main menu bar and application menu */ Menu appMenuBar, appMenu; /* TaskBar */ TaskBar taskBar; - + /* System Resources */ Image errorImage, infoImage, warningImage; Cursor [] cursors = new Cursor [SWT.CURSOR_HAND + 1]; - + /* System Colors */ double /*float*/ [][] colors; double /*float*/ [] alternateSelectedControlTextColor, selectedControlTextColor; @@ -227,7 +227,7 @@ public class Display extends Device { {58, SWT.ALT}, {56, SWT.SHIFT}, {59, SWT.CONTROL}, - {55, SWT.COMMAND}, + {55, SWT.COMMAND}, {61, SWT.ALT}, {62, SWT.CONTROL}, {60, SWT.SHIFT}, @@ -250,8 +250,8 @@ public class Display extends Device { {117, SWT.DEL}, {53, SWT.ESC}, {76, SWT.LF}, - {48, SWT.TAB}, - + {48, SWT.TAB}, + /* Functions Keys */ {122, SWT.F1}, {120, SWT.F2}, @@ -273,7 +273,7 @@ public class Display extends Device { {79, SWT.F18}, {80, SWT.F19}, // {??, SWT.F20}, - + /* Numeric Keypad Keys */ {67, SWT.KEYPAD_MULTIPLY}, {69, SWT.KEYPAD_ADD}, @@ -301,7 +301,7 @@ public class Display extends Device { // {??, SWT.BREAK}, // {??, SWT.PRINT_SCREEN}, {114, SWT.HELP}, - + }; static String APP_NAME; @@ -312,40 +312,40 @@ public class Display extends Device { static final byte[] SWT_IMAGE = {'S', 'W', 'T', '_', 'I', 'M', 'A', 'G', 'E', '\0'}; static final byte[] SWT_ROW = {'S', 'W', 'T', '_', 'R', 'O', 'W', '\0'}; static final byte[] SWT_COLUMN = {'S', 'W', 'T', '_', 'C', 'O', 'L', 'U', 'M', 'N', '\0'}; - + static final String SET_MODAL_DIALOG = "org.eclipse.swt.internal.modalDialog"; //$NON-NLS-1$ /* Multiple Displays. */ static Display Default; static Display [] Displays = new Display [4]; - + /* Skinning support */ static final int GROW_SIZE = 1024; Widget [] skinList = new Widget [GROW_SIZE]; int skinCount; - + /* Package Name */ static final String PACKAGE_PREFIX = "org.eclipse.swt.widgets."; - + /* Timer */ Runnable timerList []; NSTimer nsTimers []; SWTWindowDelegate timerDelegate; static SWTApplicationDelegate applicationDelegate; static NSObject currAppDelegate; - + /* Settings */ boolean runSettings; SWTWindowDelegate settingsDelegate; static final int DEFAULT_BUTTON_INTERVAL = 30; - + /* Display Data */ Object data; String [] keys; Object [] values; static Map/*<NSObject, LONG>*/ dynamicObjectMap; - + /* * TEMPORARY CODE. Install the runnable that * gets the current display. This code will @@ -362,7 +362,7 @@ public class Display extends Device { } }; } - + /* * TEMPORARY CODE. */ @@ -426,7 +426,7 @@ void addContext (GCData context) { * powerful and dangerous. They should generally be avoided for * performance, debugging and code maintenance reasons. * </p> - * + * * @param eventType the type of event to listen for * @param listener the listener which should be notified when the event occurs * @@ -442,8 +442,8 @@ void addContext (GCData context) { * @see SWT * @see #removeFilter * @see #removeListener - * - * @since 3.0 + * + * @since 3.0 */ public void addFilter (int eventType, Listener listener) { checkDevice (); @@ -483,8 +483,8 @@ void addLayoutDeferred (Composite comp) { * @see Listener * @see SWT * @see #removeListener - * - * @since 2.0 + * + * @since 2.0 */ public void addListener (int eventType, Listener listener) { checkDevice (); @@ -556,7 +556,7 @@ void addSkinnableWidget (Widget widget) { void addWidget (NSObject view, Widget widget) { if (view == null) return; long /*int*/ ivar = OS.object_setInstanceVariable (view.id, SWT_OBJECT, widget.jniRef); - + if (ivar == 0) { if (dynamicObjectMap == null) { dynamicObjectMap = new HashMap(); @@ -568,13 +568,13 @@ void addWidget (NSObject view, Widget widget) { /** * Causes the <code>run()</code> method of the runnable to - * be invoked by the user-interface thread at the next - * reasonable opportunity. The caller of this method continues + * be invoked by the user-interface thread at the next + * reasonable opportunity. The caller of this method continues * to run in parallel, and is not notified when the * runnable has completed. Specifying <code>null</code> as the * runnable simply wakes the user-interface thread when run. * <p> - * Note that at the time the runnable is invoked, widgets + * Note that at the time the runnable is invoked, widgets * that have the receiver as their display may have been * disposed. Therefore, it is necessary to check for this * case inside the runnable before accessing the widget. @@ -585,7 +585,7 @@ void addWidget (NSObject view, Widget widget) { * @exception SWTException <ul> * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see #syncExec */ public void asyncExec (Runnable runnable) { @@ -598,7 +598,7 @@ public void asyncExec (Runnable runnable) { /** * Causes the system hardware to emit a short sound * (if it supports this capability). - * + * * @exception SWTException <ul> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> @@ -693,7 +693,7 @@ protected void checkSubclass () { * Constructs a new instance of this class. * <p> * Note: The resulting display is marked as the <em>current</em> - * display. If this is the first display which has been + * display. If this is the first display which has been * constructed since the application started, it is also * marked as the <em>default</em> display. * </p> @@ -714,7 +714,7 @@ public Display () { /** * Constructs a new instance of this class using the parameter. - * + * * @param data the device data */ public Display (DeviceData data) { @@ -737,9 +737,9 @@ static String convertToLf(String text) { char Lf = '\n'; int length = text.length (); if (length == 0) return text; - - /* Check for an LF or CR/LF. Assume the rest of the string - * is formated that way. This will not work if the string + + /* Check for an LF or CR/LF. Assume the rest of the string + * is formated that way. This will not work if the string * contains mixed delimiters. */ int i = text.indexOf (Lf, 0); if (i == -1 || i == 0) return text; @@ -793,7 +793,7 @@ void clearPool () { * </ul> * * @see Device#dispose - * + * * @since 2.0 */ public void close () { @@ -833,12 +833,12 @@ void createDisplay (DeviceData data) { } NSThread nsthread = NSThread.currentThread(); - + if (!NSThread.isMainThread()) { System.out.println ("***WARNING: Display must be created on main thread due to Cocoa restrictions."); //$NON-NLS-1$ error(SWT.ERROR_THREAD_INVALID_ACCESS); } - + NSMutableDictionary dictionary = nsthread.threadDictionary(); NSString key = NSString.stringWith("SWT_NSAutoreleasePool"); NSNumber id = new NSNumber(dictionary.objectForKey(key)); @@ -853,7 +853,7 @@ void createDisplay (DeviceData data) { * the current process to be the front process in order for * windows to come to the front by default. The fix is call * both GetCurrentProcess() and SetFrontProcess(). - * + * * NOTE: It is not actually necessary to use the process * serial number returned by GetCurrentProcess() in the * call to SetFrontProcess() (ie. kCurrentProcess can be @@ -908,7 +908,7 @@ void createDisplay (DeviceData data) { OS.objc_registerClassPair(cls); } applicationClass = OS.object_setClass(application.id, cls); - + className = "SWTApplicationDelegate"; if (OS.objc_lookUpClass (className) == 0) { long /*int*/ appProc3 = applicationCallback3.getAddress(); @@ -936,7 +936,7 @@ void createDisplay (DeviceData data) { int[] bufferMode = new int[1], bufferOptions = new int[1]; OS.GetSystemUIMode(bufferMode, bufferOptions); systemUIMode = bufferMode[0]; - systemUIOptions = bufferOptions[0]; + systemUIOptions = bufferOptions[0]; } void createMainMenu () { @@ -944,62 +944,62 @@ void createMainMenu () { NSString emptyStr = NSString.string(); NSMenu mainMenu = (NSMenu)new NSMenu().alloc(); mainMenu.initWithTitle(emptyStr); - + NSMenuItem menuItem; NSMenu appleMenu; NSString format = NSString.stringWith("%@ %@"), title; - + NSMenuItem appItem = menuItem = mainMenu.addItemWithTitle(emptyStr, 0, emptyStr); appleMenu = (NSMenu)new NSMenu().alloc(); - appleMenu.initWithTitle(emptyStr); + appleMenu.initWithTitle(emptyStr); OS.objc_msgSend(application.id, OS.sel_registerName("setAppleMenu:"), appleMenu.id); - + title = new NSString(OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithFormat_, format.id, NSString.stringWith(SWT.getMessage("About")).id, appName.id)); menuItem = appleMenu.addItemWithTitle(title, OS.sel_orderFrontStandardAboutPanel_, emptyStr); menuItem.setTarget(applicationDelegate); - + appleMenu.addItem(NSMenuItem.separatorItem()); - + title = NSString.stringWith(SWT.getMessage("Preferences...")); menuItem = appleMenu.addItemWithTitle(title, 0, NSString.stringWith(",")); - /* + /* * Through the magic of nib decompilation, the prefs item must have a tag of 42 * or else the AWT won't be able to find it. */ menuItem.setTag(42); appleMenu.addItem(NSMenuItem.separatorItem()); - + title = NSString.stringWith(SWT.getMessage("Services")); menuItem = appleMenu.addItemWithTitle(title, 0, emptyStr); NSMenu servicesMenu = (NSMenu)new NSMenu().alloc(); servicesMenu.initWithTitle(emptyStr); appleMenu.setSubmenu(servicesMenu, menuItem); - servicesMenu.release(); + servicesMenu.release(); application.setServicesMenu(servicesMenu); - + appleMenu.addItem(NSMenuItem.separatorItem()); - + title = new NSString(OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithFormat_, format.id, NSString.stringWith(SWT.getMessage("Hide")).id, appName.id)); menuItem = appleMenu.addItemWithTitle(title, OS.sel_hide_, NSString.stringWith("h")); menuItem.setTarget(applicationDelegate); - + title = NSString.stringWith(SWT.getMessage("Hide Others")); menuItem = appleMenu.addItemWithTitle(title, OS.sel_hideOtherApplications_, NSString.stringWith("h")); menuItem.setKeyEquivalentModifierMask(OS.NSCommandKeyMask | OS.NSAlternateKeyMask); menuItem.setTarget(applicationDelegate); - + title = NSString.stringWith(SWT.getMessage("Show All")); menuItem = appleMenu.addItemWithTitle(title, OS.sel_unhideAllApplications_, emptyStr); menuItem.setTarget(applicationDelegate); - + appleMenu.addItem(NSMenuItem.separatorItem()); - + title = new NSString(OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithFormat_, format.id, NSString.stringWith(SWT.getMessage("Quit")).id, appName.id)); menuItem = appleMenu.addItemWithTitle(title, OS.sel_applicationShouldTerminate_, NSString.stringWith("q")); menuItem.setTarget(applicationDelegate); - + mainMenu.setSubmenu(appleMenu, appItem); appleMenu.release(); application.setMainMenu(mainMenu); @@ -1063,7 +1063,7 @@ void destroyDisplay () { * is ignored. * * @param runnable code to run at dispose time. - * + * * @exception SWTException <ul> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> @@ -1123,7 +1123,7 @@ boolean filters (int eventType) { * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @noreference This method is not intended to be referenced by clients. */ public Widget findWidget (long /*int*/ handle) { @@ -1150,9 +1150,9 @@ public Widget findWidget (long /*int*/ handle) { * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @noreference This method is not intended to be referenced by clients. - * + * * @since 3.1 */ public Widget findWidget (long /*int*/ handle, long /*int*/ id) { @@ -1174,9 +1174,9 @@ public Widget findWidget (long /*int*/ handle, long /*int*/ id) { * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @noreference This method is not intended to be referenced by clients. - * + * * @since 3.3 */ public Widget findWidget (Widget widget, long /*int*/ id) { @@ -1189,7 +1189,7 @@ public Widget findWidget (Widget widget, long /*int*/ id) { * user-interface thread for, or null if the given thread * is not a user-interface thread for any display. Specifying * <code>null</code> as the thread will return <code>null</code> - * for the display. + * for the display. * * @param thread the user-interface thread * @return the display for the given thread @@ -1220,9 +1220,9 @@ TouchSource findTouchSource(NSTouch touch) { } index++; } - + if (source != null) return source; - + if (index == length) { TouchSource [] newList = new TouchSource [length + 4]; System.arraycopy(touchSources, 0, newList, 0, length); @@ -1255,7 +1255,7 @@ public Shell getActiveShell () { if (widget instanceof Shell) { return (Shell)widget; } - + // Embedded shell test: If the NSWindow isn't an SWTWindow walk up the // hierarchy from the hit view to see if some view maps to a Shell. NSPoint windowLocation = window.mouseLocationOutsideOfEventStream(); @@ -1332,7 +1332,7 @@ int getCaretBlinkTime () { /** * Returns a rectangle which describes the area of the * receiver which is capable of displaying data. - * + * * @return the client area * * @exception SWTException <ul> @@ -1398,7 +1398,7 @@ public Point getCursorLocation () { * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @since 3.0 */ public Point [] getCursorSizes () { @@ -1459,7 +1459,7 @@ public Object getData (String key) { * Returns the application defined, display specific data * associated with the receiver, or null if it has not been * set. The <em>display specific data</em> is a single, - * unnamed field that is stored with every display. + * unnamed field that is stored with every display. * <p> * Applications may put arbitrary objects in this field. If * the object stored in the display specific data needs to @@ -1497,7 +1497,7 @@ public Object getData () { * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @since 2.1 */ public int getDismissalAlignment () { @@ -1519,7 +1519,7 @@ public int getDismissalAlignment () { */ public int getDoubleClickTime () { checkDevice (); - return OS.GetDblTime () * 1000 / 60; + return OS.GetDblTime () * 1000 / 60; } /** @@ -1578,7 +1578,7 @@ Control _getFocusControl (NSWindow window) { * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @since 3.0 */ public boolean getHighContrast () { @@ -1596,7 +1596,7 @@ public boolean getHighContrast () { * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see Device#getDepth */ public int getIconDepth () { @@ -1612,16 +1612,16 @@ public int getIconDepth () { * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see Decorations#setImages(Image[]) - * + * * @since 3.0 */ public Point [] getIconSizes () { checkDevice (); - return new Point [] { - new Point (16, 16), new Point (32, 32), - new Point (64, 64), new Point (128, 128)}; + return new Point [] { + new Point (16, 16), new Point (32, 32), + new Point (64, 64), new Point (128, 128)}; } int getLastEventTime () { @@ -1666,9 +1666,9 @@ NSPanel getModalPanel () { /** * Returns an array of monitors attached to the device. - * + * * @return the array of monitors - * + * * @since 3.0 */ public Monitor [] getMonitors () { @@ -1703,9 +1703,9 @@ NSRect getPrimaryFrame () { /** * Returns the primary monitor for that device. - * + * * @return the primary monitor - * + * * @since 3.0 */ public Monitor getPrimaryMonitor () { @@ -1764,12 +1764,12 @@ static boolean getSheetEnabled () { * Gets the synchronizer used by the display. * * @return the receiver's synchronizer - * + * * @exception SWTException <ul> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @since 3.4 */ public Synchronizer getSynchronizer () { @@ -1787,7 +1787,7 @@ public Synchronizer getSynchronizer () { * </p> * * @return the receiver's sync-interface thread - * + * * @exception SWTException <ul> * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> * </ul> @@ -1823,7 +1823,7 @@ public Color getSystemColor (int id) { checkDevice (); Color color = getWidgetColor (id); if (color != null) return color; - return super.getSystemColor (id); + return super.getSystemColor (id); } Color getWidgetColor (int id) { @@ -1858,7 +1858,7 @@ double /*float*/ [] getWidgetColorRGB (int id) { case SWT.COLOR_LIST_BACKGROUND: color = NSColor.textBackgroundColor(); break; case SWT.COLOR_LIST_SELECTION_TEXT: color = NSColor.selectedTextColor(); break; case SWT.COLOR_LIST_SELECTION: color = NSColor.selectedTextBackgroundColor(); break; - case SWT.COLOR_LINK_FOREGROUND: + case SWT.COLOR_LINK_FOREGROUND: NSTextView textView = (NSTextView)new NSTextView().alloc(); textView.init (); NSDictionary dict = textView.linkTextAttributes(); @@ -1878,7 +1878,7 @@ double /*float*/ [] getNSColorRGB (NSColor color) { } if (color == null) return null; double /*float*/[] components = new double /*float*/[(int)/*64*/color.numberOfComponents()]; - color.getComponents(components); + color.getComponents(components); return new double /*float*/ []{components[0], components[1], components[2], components[3]}; } @@ -1889,7 +1889,7 @@ double /*float*/ [] getNSColorRGB (NSColor color) { * not be free'd because it was allocated by the system, * not the application. A value of <code>null</code> will * be returned if the supplied constant is not an SWT cursor - * constant. + * constant. * * @param id the SWT cursor constant * @return the corresponding cursor or <code>null</code> @@ -1921,7 +1921,7 @@ double /*float*/ [] getNSColorRGB (NSColor color) { * @see SWT#CURSOR_IBEAM * @see SWT#CURSOR_NO * @see SWT#CURSOR_HAND - * + * * @since 3.0 */ public Cursor getSystemCursor (int id) { @@ -1957,7 +1957,7 @@ NSImage getSystemImageForID(int osType) { * not the application. A value of <code>null</code> will * be returned either if the supplied constant is not an * SWT icon constant or if the platform does not define an - * image that corresponds to the constant. + * image that corresponds to the constant. * * @param id the SWT icon constant * @return the corresponding image or <code>null</code> @@ -1972,13 +1972,13 @@ NSImage getSystemImageForID(int osType) { * @see SWT#ICON_QUESTION * @see SWT#ICON_WARNING * @see SWT#ICON_WORKING - * + * * @since 3.0 */ public Image getSystemImage (int id) { checkDevice (); switch(id) { - case SWT.ICON_ERROR: { + case SWT.ICON_ERROR: { if (errorImage != null) return errorImage; NSImage img = getSystemImageForID(OS.kAlertStopIcon); return errorImage = Image.cocoa_new (this, SWT.ICON, img); @@ -2004,7 +2004,7 @@ public Image getSystemImage (int id) { * <code>null</code> if there is no application menu bar for the platform. * * @return the application menu bar, or <code>null</code> - * + * * @exception SWTException <ul> * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> * </ul> @@ -2024,7 +2024,7 @@ public Menu getMenuBar () { * <code>null</code> on platforms where no menu is provided for the application. * * @return the system menu, or <code>null</code> - * + * * @exception SWTException <ul> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> @@ -2054,7 +2054,7 @@ public Menu getSystemMenu () { * 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> @@ -2072,7 +2072,7 @@ public Tray getSystemTray () { * when there is no system taskBar available for the platform. * * @return the system taskBar or <code>null</code> - * + * * @exception SWTException <ul> * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> * </ul> @@ -2090,7 +2090,7 @@ public TaskBar getSystemTaskBar () { * Returns the user-interface thread for the receiver. * * @return the receiver's user-interface thread - * + * * @exception SWTException <ul> * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> * </ul> @@ -2102,7 +2102,7 @@ public Thread getThread () { } } -/** +/** * Returns a boolean indicating whether a touch-aware input device is * attached to the system and is ready for use. * @@ -2112,7 +2112,7 @@ public Thread getThread () { * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @since 3.7 */ public boolean getTouchEnabled() { @@ -2170,7 +2170,7 @@ boolean hasDefaultButton () { * <p> * This method is called after <code>create</code>. * </p> - * + * * @see #create */ @Override @@ -2179,14 +2179,14 @@ protected void init () { initClasses (); initColors (); initFonts (); - + /* * Create an application delegate for app-level notifications. The AWT may have already set a delegate; * if so, hold on to it so messages can be forwarded to it. */ if (applicationDelegate == null) { applicationDelegate = (SWTApplicationDelegate)new SWTApplicationDelegate().alloc().init(); - + if (currAppDelegate == null) { if (OS.class_JRSAppKitAWT != 0) { long /*int*/ currDelegatePtr = OS.objc_msgSend(OS.class_JRSAppKitAWT, OS.sel_awtAppDelegate); @@ -2200,12 +2200,12 @@ protected void init () { // TODO: register for notification to find out when AWT finishes loading. Waiting on new value from Apple. } } - + /* * Feature in Cocoa: NSApplication.finishLaunching() adds an apple menu to the menu bar that isn't accessible via NSMenu. * If Display objects are created and disposed of multiple times in a single process, another apple menu is added to the menu bar. * It must be called or the dock icon will continue to bounce. So, it should only be called once per process, not just once per - * creation of a Display. Use a static so creation of additional Display objects won't affect the menu bar. + * creation of a Display. Use a static so creation of additional Display objects won't affect the menu bar. */ if (!Display.launched) { application.finishLaunching(); @@ -2219,10 +2219,10 @@ protected void init () { } }); } - + /* * Call init to force the AWT delegate to re-attach itself to the application menu. - * The Preferences item must have a tag of 42 or the AWT delegate won't be able to find it. + * The Preferences item must have a tag of 42 or the AWT delegate won't be able to find it. * Reset it to what we want it to be after the delegate is set up. */ NSMenu appleMenu = application.mainMenu().itemAtIndex(0).submenu(); @@ -2230,9 +2230,9 @@ protected void init () { if (prefsItem != null) prefsItem.setTag(42); if (currAppDelegate != null) { currAppDelegate.init(); - } + } if (prefsItem != null) prefsItem.setTag(SWT.ID_PREFERENCES); - + observerCallback = new Callback (this, "observerProc", 3); //$NON-NLS-1$ long /*int*/ observerProc = observerCallback.getAddress (); if (observerProc == 0) error (SWT.ERROR_NO_MORE_CALLBACKS); @@ -2249,32 +2249,32 @@ protected void init () { OS.CFRunLoopAddObserver (OS.CFRunLoopGetCurrent (), runLoopObserver, mode); } } - + cursorSetCallback = new Callback(this, "cursorSetProc", 2); long /*int*/ cursorSetProc = cursorSetCallback.getAddress(); if (cursorSetProc == 0) error (SWT.ERROR_NO_MORE_CALLBACKS); long /*int*/ method = OS.class_getInstanceMethod(OS.class_NSCursor, OS.sel_set); if (method != 0) oldCursorSetProc = OS.method_setImplementation(method, cursorSetProc); - + timerDelegate = (SWTWindowDelegate)new SWTWindowDelegate().alloc().init(); settingsDelegate = (SWTWindowDelegate)new SWTWindowDelegate().alloc().init(); NSNotificationCenter defaultCenter = NSNotificationCenter.defaultCenter(); defaultCenter.addObserver(settingsDelegate, OS.sel_systemSettingsChanged_, OS.NSSystemColorsDidChangeNotification, null); defaultCenter.addObserver(settingsDelegate, OS.sel_systemSettingsChanged_, OS.NSApplicationDidChangeScreenParametersNotification, null); - + NSTextView textView = (NSTextView)new NSTextView().alloc(); textView.init (); markedAttributes = textView.markedTextAttributes (); markedAttributes.retain (); textView.release (); - + NSUserDefaults defaults = NSUserDefaults.standardUserDefaults(); defaults.setInteger(0, NSString.stringWith(OS.VERSION >= 0x1080 ? "NSScrollAnimationEnabled" : "AppleScrollAnimationEnabled")); id blink = defaults.objectForKey(NSString.stringWith("NSTextInsertionPointBlinkPeriod")); if (blink != null) blinkTime = (int)new NSNumber(blink).integerValue(); if (blinkTime == 0) blinkTime = 560; - + isPainting = (NSMutableArray)new NSMutableArray().alloc(); isPainting = isPainting.initWithCapacity(12); } @@ -2313,7 +2313,7 @@ void addEventMethods (long /*int*/ cls, long /*int*/ proc2, long /*int*/ proc3, OS.class_addMethod(cls, OS.sel_swipeWithEvent_, proc3, "@:@"); OS.class_addMethod(cls, OS.sel_rotateWithEvent_, proc3, "@:@"); OS.class_addMethod(cls, OS.sel_magnifyWithEvent_, proc3, "@:@"); - + } if (proc2 != 0) { OS.class_addMethod(cls, OS.sel_resignFirstResponder, proc2, "@:"); @@ -2330,13 +2330,13 @@ void addEventMethods (long /*int*/ cls, long /*int*/ proc2, long /*int*/ proc3, OS.class_addMethod(cls, OS.sel_drawRect_, drawRectProc, "@:{NSRect}"); } if (hitTestProc != 0) { - OS.class_addMethod(cls, OS.sel_hitTest_, hitTestProc, "@:{NSPoint}"); + OS.class_addMethod(cls, OS.sel_hitTest_, hitTestProc, "@:{NSPoint}"); } } void addFrameMethods(long /*int*/ cls, long /*int*/ setFrameOriginProc, long /*int*/ setFrameSizeProc) { - OS.class_addMethod(cls, OS.sel_setFrameOrigin_, setFrameOriginProc, "@:{NSPoint}"); - OS.class_addMethod(cls, OS.sel_setFrameSize_, setFrameSizeProc, "@:{NSSize}"); + OS.class_addMethod(cls, OS.sel_setFrameOrigin_, setFrameOriginProc, "@:{NSPoint}"); + OS.class_addMethod(cls, OS.sel_setFrameSize_, setFrameSizeProc, "@:{NSSize}"); } void addAccessibilityMethods(long /*int*/ cls, long /*int*/ proc2, long /*int*/ proc3, long /*int*/ proc4, long /*int*/ accessibilityHitTestProc) { @@ -2347,8 +2347,8 @@ void addAccessibilityMethods(long /*int*/ cls, long /*int*/ proc2, long /*int*/ OS.class_addMethod(cls, OS.sel_accessibilityIsIgnored, proc2, "@:"); OS.class_addMethod(cls, OS.sel_accessibilityAttributeValue_, proc3, "@:@"); OS.class_addMethod(cls, OS.sel_accessibilityHitTest_, accessibilityHitTestProc, "@:{NSPoint}"); - OS.class_addMethod(cls, OS.sel_accessibilityAttributeValue_forParameter_, proc4, "@:@@"); - OS.class_addMethod(cls, OS.sel_accessibilityPerformAction_, proc3, "@:@"); + OS.class_addMethod(cls, OS.sel_accessibilityAttributeValue_forParameter_, proc4, "@:@@"); + OS.class_addMethod(cls, OS.sel_accessibilityPerformAction_, proc3, "@:@"); OS.class_addMethod(cls, OS.sel_accessibilityActionDescription_, proc3, "@:@"); OS.class_addMethod(cls, OS.sel_accessibilityIsAttributeSettable_, proc3, "@:@"); OS.class_addMethod(cls, OS.sel_accessibilitySetValue_forAttribute_, proc4, "@:@@"); @@ -2357,7 +2357,7 @@ void addAccessibilityMethods(long /*int*/ cls, long /*int*/ proc2, long /*int*/ long /*int*/ registerCellSubclass(long /*int*/ cellClass, int size, int align, byte[] types) { String cellClassName = OS.class_getName(cellClass); - long /*int*/ cls = OS.objc_allocateClassPair(cellClass, "SWTAccessible" + cellClassName, 0); + long /*int*/ cls = OS.objc_allocateClassPair(cellClass, "SWTAccessible" + cellClassName, 0); OS.class_addIvar(cls, SWT_OBJECT, size, (byte)align, types); OS.objc_registerClassPair(cls); return cls; @@ -2384,7 +2384,7 @@ long /*int*/ createWindowSubclass(long /*int*/ baseClass, String newClass, boole OS.class_addMethod(cls, OS.sel_view_stringForToolTip_point_userData_, view_stringForToolTip_point_userDataProc, "@:@i{NSPoint}@"); addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); OS.objc_registerClassPair(cls); - return cls; + return cls; } long /*int*/ createMenuSubclass(long /*int*/ baseClass, String newClass, boolean isDynamic) { @@ -2399,7 +2399,7 @@ long /*int*/ createMenuSubclass(long /*int*/ baseClass, String newClass, boolean OS.class_addMethod(cls, OS.sel_menu_willHighlightItem_, proc4, "@:@@"); OS.class_addMethod(cls, OS.sel_menuNeedsUpdate_, proc3, "@:@"); OS.objc_registerClassPair(cls); - return cls; + return cls; } long /*int*/ createMenuItemSubclass(long /*int*/ baseClass, String newClass, boolean isDynamic) { @@ -2410,22 +2410,22 @@ long /*int*/ createMenuItemSubclass(long /*int*/ baseClass, String newClass, boo if (!isDynamic) OS.class_addIvar(cls, SWT_OBJECT, size, (byte)align, types); OS.class_addMethod(cls, OS.sel_sendSelection, proc2, "@:"); OS.objc_registerClassPair(cls); - return cls; + return cls; } void initClasses () { if (OS.objc_lookUpClass ("SWTView") != 0) return; - + Class clazz = getClass (); dialogCallback3 = new Callback(clazz, "dialogProc", 3); long /*int*/ dialogProc3 = dialogCallback3.getAddress(); if (dialogProc3 == 0) error (SWT.ERROR_NO_MORE_CALLBACKS); dialogCallback4 = new Callback(clazz, "dialogProc", 4); long /*int*/ dialogProc4 = dialogCallback4.getAddress(); - if (dialogProc4 == 0) error (SWT.ERROR_NO_MORE_CALLBACKS); + if (dialogProc4 == 0) error (SWT.ERROR_NO_MORE_CALLBACKS); dialogCallback5 = new Callback(clazz, "dialogProc", 5); long /*int*/ dialogProc5 = dialogCallback5.getAddress(); - if (dialogProc5 == 0) error (SWT.ERROR_NO_MORE_CALLBACKS); + if (dialogProc5 == 0) error (SWT.ERROR_NO_MORE_CALLBACKS); windowCallback3 = new Callback(clazz, "windowProc", 3); long /*int*/ proc3 = windowCallback3.getAddress(); if (proc3 == 0) error (SWT.ERROR_NO_MORE_CALLBACKS); @@ -2441,7 +2441,7 @@ void initClasses () { windowCallback6 = new Callback(clazz, "windowProc", 6); long /*int*/ proc6 = windowCallback6.getAddress(); if (proc6 == 0) error (SWT.ERROR_NO_MORE_CALLBACKS); - + long /*int*/ isFlippedProc = OS.isFlipped_CALLBACK(); long /*int*/ drawRectProc = OS.CALLBACK_drawRect_(proc3); long /*int*/ drawInteriorWithFrameInViewProc = OS.CALLBACK_drawInteriorWithFrame_inView_ (proc4); @@ -2462,7 +2462,7 @@ void initClasses () { long /*int*/ setMarkedText_selectedRangeProc = OS.CALLBACK_setMarkedText_selectedRange_(proc4); long /*int*/ attributedSubstringFromRangeProc = OS.CALLBACK_attributedSubstringFromRange_(proc3); long /*int*/ characterIndexForPointProc = OS.CALLBACK_characterIndexForPoint_(proc3); - long /*int*/ firstRectForCharacterRangeProc = OS.CALLBACK_firstRectForCharacterRange_(proc3); + long /*int*/ firstRectForCharacterRangeProc = OS.CALLBACK_firstRectForCharacterRange_(proc3); long /*int*/ textWillChangeSelectionProc = OS.CALLBACK_textView_willChangeSelectionFromCharacterRange_toCharacterRange_(proc5); long /*int*/ accessibilityHitTestProc = OS.CALLBACK_accessibilityHitTest_(proc3); long /*int*/ shouldChangeTextInRange_replacementString_Proc = OS.CALLBACK_shouldChangeTextInRange_replacementString_(proc4); @@ -2481,7 +2481,7 @@ void initClasses () { String className; long /*int*/ cls; - + className = "SWTBox"; cls = OS.objc_allocateClassPair(OS.class_NSBox, className, 0); OS.class_addIvar(cls, SWT_OBJECT, size, (byte)align, types); @@ -2489,7 +2489,7 @@ void initClasses () { addFrameMethods(cls, setFrameOriginProc, setFrameSizeProc); addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); OS.objc_registerClassPair(cls); - + className = "SWTButton"; cls = OS.objc_allocateClassPair(OS.class_NSButton, className, 0); OS.class_addIvar(cls, SWT_OBJECT, size, (byte)align, types); @@ -2499,15 +2499,15 @@ void initClasses () { addFrameMethods(cls, setFrameOriginProc, setFrameSizeProc); OS.objc_registerClassPair(cls); OS.class_addMethod(OS.object_getClass(cls), OS.sel_cellClass, proc2, "@:"); //$NON-NLS-1$ - + cls = registerCellSubclass(NSButton.cellClass(), size, align, types); - addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); + addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); OS.class_addMethod(cls, OS.sel_nextState, proc2, "@:"); className = "SWTButtonCell"; cls = OS.objc_allocateClassPair (OS.class_NSButtonCell, className, 0); OS.class_addIvar (cls, SWT_OBJECT, size, (byte)align, types); - addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); + addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); OS.class_addMethod (cls, OS.sel_drawImage_withFrame_inView_, drawImageWithFrameInViewProc, "@:@{NSRect}@"); OS.class_addMethod (cls, OS.sel_drawTitle_withFrame_inView_, drawTitleWithFrameInViewProc, "@:@{NSRect}@"); OS.class_addMethod(cls, OS.sel_drawInteriorWithFrame_inView_, drawInteriorWithFrameInViewProc, "@:{NSRect}@"); @@ -2565,9 +2565,9 @@ void initClasses () { addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); OS.objc_registerClassPair(cls); OS.class_addMethod(OS.object_getClass(cls), OS.sel_cellClass, proc2, "@:"); //$NON-NLS-1$ - + cls = registerCellSubclass(NSComboBox.cellClass(), size, align, types); - addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); + addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); OS.class_addMethod(cls, OS.sel_setObjectValue_, proc3, "@:@"); className = "SWTDatePicker"; @@ -2580,10 +2580,10 @@ void initClasses () { addFrameMethods(cls, setFrameOriginProc, setFrameSizeProc); addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); OS.objc_registerClassPair(cls); - + className = "SWTEditorView"; cls = OS.objc_allocateClassPair(OS.class_NSTextView, className, 0); - //TODO hitTestProc should be set Control.setRegion()? + //TODO hitTestProc should be set Control.setRegion()? addEventMethods(cls, 0, proc3, drawRectProc, 0, 0); OS.class_addMethod(cls, OS.sel_insertText_, proc3, "@:@"); OS.class_addMethod(cls, OS.sel_doCommandBySelector_, proc3, "@::"); @@ -2601,7 +2601,7 @@ void initClasses () { OS.class_addMethod(OS.object_getClass(cls), OS.sel_cellClass, proc2, "@:"); //$NON-NLS-1$ cls = registerCellSubclass(NSImageView.cellClass(), size, align, types); - addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); + addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); className = "SWTImageTextCell"; cls = OS.objc_allocateClassPair (OS.class_NSTextFieldCell, className, 0); @@ -2684,14 +2684,14 @@ void initClasses () { addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); OS.objc_registerClassPair(cls); OS.class_addMethod(OS.object_getClass(cls), OS.sel_cellClass, proc2, "@:"); //$NON-NLS-1$ - + // NSPopUpButtonCell cls = registerCellSubclass(NSPopUpButton.cellClass(), size, align, types); addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); if (OS.VERSION_MMB >= OS.VERSION_MMB(10, 10, 0)) { OS.class_addMethod(cls, OS.sel_focusRingMaskBoundsForFrame_inView_, focusRingMaskBoundsForFrameProc, "@:{NSRect}@"); } - + className = "SWTProgressIndicator"; cls = OS.objc_allocateClassPair(OS.class_NSProgressIndicator, className, 0); OS.class_addIvar(cls, SWT_OBJECT, size, (byte)align, types); @@ -2700,7 +2700,7 @@ void initClasses () { addEventMethods(cls, proc2, proc3, drawRectProc, hitTestProc, setNeedsDisplayInRectProc); addFrameMethods(cls, setFrameOriginProc, setFrameSizeProc); addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); - OS.objc_registerClassPair(cls); + OS.objc_registerClassPair(cls); className = "SWTScroller"; cls = OS.objc_allocateClassPair(OS.class_NSScroller, className, 0); @@ -2715,7 +2715,7 @@ void initClasses () { long /*int*/ metaClass = OS.objc_getMetaClass(className); OS.class_addMethod(metaClass, OS.sel_isCompatibleWithOverlayScrollers, isFlippedProc, "@:"); } - + className = "SWTScrollView"; cls = OS.objc_allocateClassPair(OS.class_NSScrollView, className, 0); OS.class_addIvar(cls, SWT_OBJECT, size, (byte)align, types); @@ -2743,9 +2743,9 @@ void initClasses () { OS.class_addMethod(cls, OS.sel_sendCancelSelection, proc2, "@:"); OS.objc_registerClassPair(cls); OS.class_addMethod(OS.object_getClass(cls), OS.sel_cellClass, proc2, "@:"); //$NON-NLS-1$ - + cls = registerCellSubclass(NSSearchField.cellClass(), size, align, types); - addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); + addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); // Don't subclass NSSecureTextFieldCell -- you'll get an NSException from [NSSecureTextField setCellClass:]! className = "SWTSecureTextField"; @@ -2758,19 +2758,19 @@ void initClasses () { OS.class_addMethod(cls, OS.sel_textViewDidChangeSelection_, proc3, "@:@"); OS.class_addMethod(cls, OS.sel_textView_willChangeSelectionFromCharacterRange_toCharacterRange_, textWillChangeSelectionProc, "@:@{NSRange}{NSRange}"); OS.objc_registerClassPair(cls); - + long /*int*/ nsSecureTextViewClass = OS.objc_lookUpClass("NSSecureTextView"); if (nsSecureTextViewClass != 0) { className = "SWTSecureEditorView"; cls = OS.objc_allocateClassPair(nsSecureTextViewClass, className, 0); - //TODO hitTestProc and drawRectProc should be set Control.setRegion()? + //TODO hitTestProc and drawRectProc should be set Control.setRegion()? addEventMethods(cls, 0, proc3, drawRectProc, 0, 0); OS.class_addMethod(cls, OS.sel_insertText_, proc3, "@:@"); OS.class_addMethod(cls, OS.sel_doCommandBySelector_, proc3, "@::"); OS.class_addMethod(cls, OS.sel_shouldChangeTextInRange_replacementString_, shouldChangeTextInRange_replacementString_Proc, "@:{NSRange}@"); OS.objc_registerClassPair(cls); } - + className = "SWTSlider"; cls = OS.objc_allocateClassPair(OS.class_NSSlider, className, 0); OS.class_addIvar(cls, SWT_OBJECT, size, (byte)align, types); @@ -2778,11 +2778,11 @@ void initClasses () { addEventMethods(cls, proc2, proc3, drawRectProc, hitTestProc, setNeedsDisplayInRectProc); addFrameMethods(cls, setFrameOriginProc, setFrameSizeProc); addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); - OS.objc_registerClassPair(cls); + OS.objc_registerClassPair(cls); OS.class_addMethod(OS.object_getClass(cls), OS.sel_cellClass, proc2, "@:"); //$NON-NLS-1$ - + cls = registerCellSubclass(NSSlider.cellClass(), size, align, types); - addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); + addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); className = "SWTStepper"; cls = OS.objc_allocateClassPair(OS.class_NSStepper, className, 0); @@ -2795,7 +2795,7 @@ void initClasses () { OS.class_addMethod(OS.object_getClass(cls), OS.sel_cellClass, proc2, "@:"); //$NON-NLS-1$ cls = registerCellSubclass(NSStepper.cellClass(), size, align, types); - addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); + addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); className = "SWTTableHeaderCell"; cls = OS.objc_allocateClassPair (OS.class_NSTableHeaderCell, className, 0); @@ -2812,7 +2812,7 @@ void initClasses () { OS.class_addMethod(cls, OS.sel_menuForEvent_, proc3, "@:@"); OS.class_addMethod(cls, OS.sel_headerRectOfColumn_, headerRectOfColumnProc, "@:i"); OS.class_addMethod(cls, OS.sel_columnAtPoint_, columnAtPointProc, "@:{NSPoint}"); - //TODO hitTestProc and drawRectProc should be set Control.setRegion()? + //TODO hitTestProc and drawRectProc should be set Control.setRegion()? OS.objc_registerClassPair(cls); className = "SWTTableView"; @@ -2855,7 +2855,7 @@ void initClasses () { addFrameMethods(cls, setFrameOriginProc, setFrameSizeProc); addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); OS.objc_registerClassPair(cls); - + className = "SWTTabViewItem"; cls = OS.objc_allocateClassPair(OS.class_NSTabViewItem, className, 0); OS.class_addIvar(cls, SWT_OBJECT, size, (byte)align, types); @@ -2863,7 +2863,7 @@ void initClasses () { OS.class_addMethod(cls, OS.sel_drawLabel_inRect_, drawLabelInRectProc, "@::{NSRect}"); addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); OS.objc_registerClassPair(cls); - + className = "SWTTextView"; cls = OS.objc_allocateClassPair(OS.class_NSTextView, className, 0); OS.class_addIvar(cls, SWT_OBJECT, size, (byte)align, types); @@ -2879,7 +2879,7 @@ void initClasses () { OS.class_addMethod(cls, OS.sel_drawViewBackgroundInRect_, drawViewBackgroundInRectProc, "@:{NSRect}"); OS.class_addMethod(cls, OS.sel_shouldDrawInsertionPoint, proc2, "@:"); OS.objc_registerClassPair(cls); - + className = "SWTTextField"; cls = OS.objc_allocateClassPair(OS.class_NSTextField, className, 0); OS.class_addIvar(cls, SWT_OBJECT, size, (byte)align, types); @@ -2893,10 +2893,10 @@ void initClasses () { OS.class_addMethod(cls, OS.sel_textView_willChangeSelectionFromCharacterRange_toCharacterRange_, textWillChangeSelectionProc, "@:@{NSRange}{NSRange}"); OS.objc_registerClassPair(cls); OS.class_addMethod(OS.object_getClass(cls), OS.sel_cellClass, proc2, "@:"); //$NON-NLS-1$ - + cls = registerCellSubclass(NSTextField.cellClass(), size, align, types); OS.class_addMethod(cls, OS.sel_drawInteriorWithFrame_inView_, drawInteriorWithFrameInViewProc, "@:{NSRect}@"); - addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); + addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); className = "SWTTreeItem"; cls = OS.objc_allocateClassPair(OS.class_NSObject, className, 0); @@ -2915,10 +2915,10 @@ void initClasses () { addFrameMethods(cls, setFrameOriginProc, setFrameSizeProc); addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); OS.objc_registerClassPair(cls); - + className = "SWTWindow"; createWindowSubclass(OS.class_NSWindow, className, false); - + className = "SWTPanel"; cls = OS.objc_allocateClassPair(OS.class_NSPanel, className, 0); OS.class_addIvar(cls, SWT_OBJECT, size, (byte)align, types); @@ -2931,7 +2931,7 @@ void initClasses () { OS.class_addMethod(cls, OS.sel_view_stringForToolTip_point_userData_, view_stringForToolTip_point_userDataProc, "@:@i{NSPoint}@"); addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); OS.objc_registerClassPair(cls); - + className = "SWTToolbar"; cls = OS.objc_allocateClassPair(OS.class_NSToolbar, className, 0); OS.class_addIvar(cls, SWT_OBJECT, size, (byte)align, types); @@ -2941,7 +2941,7 @@ void initClasses () { OS.class_addMethod(cls, OS.sel_toolbarSelectableItemIdentifiers_, proc3, "@:@"); addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); OS.objc_registerClassPair(cls); - + className = "SWTToolbarView"; cls = OS.objc_allocateClassPair(OS.class_NSToolbarView, className, 0); /** @@ -2950,7 +2950,7 @@ void initClasses () { addEventMethods(cls, proc2, proc3, drawRectProc, hitTestProc, setNeedsDisplayInRectProc); addFrameMethods(cls, setFrameOriginProc, setFrameSizeProc); OS.objc_registerClassPair(cls); - + className = "SWTWindowDelegate"; cls = OS.objc_allocateClassPair(OS.class_NSObject, className, 0); OS.class_addIvar(cls, SWT_OBJECT, size, (byte)align, types); @@ -2964,7 +2964,7 @@ void initClasses () { OS.class_addMethod(cls, OS.sel_systemSettingsChanged_, proc3, "@:@"); OS.class_addMethod(cls, OS.sel_windowDidMiniaturize_, proc3, "@:@"); OS.class_addMethod(cls, OS.sel_windowDidDeminiaturize_, proc3, "@:@"); - OS.objc_registerClassPair(cls); + OS.objc_registerClassPair(cls); } NSFont getFont (long /*int*/ cls, long /*int*/ sel) { @@ -2979,7 +2979,7 @@ NSFont getFont (long /*int*/ cls, long /*int*/ sel) { } else { result = NSFont.systemFontOfSize (NSFont.systemFontSizeForControlSize (OS.NSRegularControlSize)); } - result.retain (); + result.retain (); OS.objc_msgSend (widget, OS.sel_release); return result; } @@ -3000,7 +3000,7 @@ void initColors (boolean ignoreColorChange) { initColors (); } } - + void initColors () { colors = new double /*float*/ [SWT.COLOR_LINK_FOREGROUND + 1][]; colors[SWT.COLOR_INFO_FOREGROUND] = getWidgetColorRGB(SWT.COLOR_INFO_FOREGROUND); @@ -3049,7 +3049,7 @@ void initFonts () { progressIndicatorFont = getFont (OS.class_NSProgressIndicator, OS.sel_font); } -/** +/** * Invokes platform specific functionality to allocate a new GC handle. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public @@ -3059,16 +3059,16 @@ void initFonts () { * application code. * </p> * - * @param data the platform specific GC data + * @param data the platform specific GC data * @return the platform specific GC handle - * + * * @exception SWTException <ul> * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> * </ul> * @exception SWTError <ul> * <li>ERROR_NO_HANDLES if a handle could not be obtained for gc creation</li> * </ul> - * + * * @noreference This method is not intended to be referenced by clients. */ @Override @@ -3100,7 +3100,7 @@ public long /*int*/ internal_new_GC (GCData data) { return context.id; } -/** +/** * Invokes platform specific functionality to dispose a GC handle. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public @@ -3111,8 +3111,8 @@ public long /*int*/ internal_new_GC (GCData data) { * </p> * * @param hDC the platform specific GC handle - * @param data the platform specific GC data - * + * @param data the platform specific GC data + * * @noreference This method is not intended to be referenced by clients. */ @Override @@ -3143,7 +3143,7 @@ boolean isValidThread () { /** * Generate a low level system event. - * + * * <code>post</code> is used to generate low level keyboard * and mouse events. The intent is to enable automated UI * testing by simulating the input from the user. Most @@ -3186,11 +3186,11 @@ boolean isValidThread () { * <li>(in) count the number of lines or pages to scroll * </ul> * </dl> - * + * * @param event the event to be generated - * + * * @return true if the event was generated or false otherwise - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the event is null</li> * </ul> @@ -3199,7 +3199,7 @@ boolean isValidThread () { * </ul> * * @since 3.0 - * + * */ public boolean post(Event event) { synchronized (Device.class) { @@ -3219,7 +3219,7 @@ public boolean post(Event event) { long /*int*/ uchrPtr = 0; long /*int*/ currentKbd = OS.TISCopyCurrentKeyboardInputSource(); long /*int*/ uchrCFData = OS.TISGetInputSourceProperty(currentKbd, OS.kTISPropertyUnicodeKeyLayoutData()); - + if (uchrCFData == 0) return false; uchrPtr = OS.CFDataGetBytePtr(uchrCFData); if (uchrPtr == 0) return false; @@ -3256,7 +3256,7 @@ public boolean post(Event event) { if (vKey == -1 && event.character == 0) { vKey = 127; } - + if (vKey != -1) { if (OS.VERSION < 0x1060) { returnValue = OS.CGPostKeyboardEvent((short)0, vKey, type == SWT.KeyDown) == OS.noErr; @@ -3267,7 +3267,7 @@ public boolean post(Event event) { break; } case SWT.MouseDown: - case SWT.MouseMove: + case SWT.MouseMove: case SWT.MouseUp: { CGPoint mouseCursorPosition = new CGPoint (); @@ -3309,12 +3309,12 @@ public boolean post(Event event) { break; } case SWT.MouseWheel: { - // CG does not support scrolling a page at a time. Technically that is a page up/down, but not a scroll-wheel event. + // CG does not support scrolling a page at a time. Technically that is a page up/down, but not a scroll-wheel event. eventRef = OS.CGEventCreateScrollWheelEvent(eventSource, OS.kCGScrollEventUnitLine, 1, event.count); break; } - } - + } + // returnValue is true if we called CGPostKeyboardEvent (10.5 only). if (returnValue == false) { if (eventRef != 0) { @@ -3327,8 +3327,8 @@ public boolean post(Event event) { returnValue = true; } } - - if (eventSource != 0) OS.CFRelease(eventSource); + + if (eventSource != 0) OS.CFRelease(eventSource); return returnValue; } } @@ -3364,7 +3364,7 @@ void postEvent (Event event) { * systems are mirrored, special care needs to be taken * when mapping coordinates from one control to another * to ensure the result is correctly mirrored. - * + * * Mapping a point that is the origin of a rectangle and * then adding the width and height is not equivalent to * mapping the rectangle. When one control is mirrored @@ -3374,26 +3374,26 @@ void postEvent (Event event) { * instead of just one point causes both the origin and * the corner of the rectangle to be mapped. * </p> - * + * * @param from the source <code>Control</code> or <code>null</code> * @param to the destination <code>Control</code> or <code>null</code> - * @param point to be mapped - * @return point with mapped coordinates - * + * @param point to be mapped + * @return point with mapped coordinates + * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the point is null</li> - * <li>ERROR_INVALID_ARGUMENT - if the Control from or the Control to have been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the Control from or the Control to have been disposed</li> * </ul> * @exception SWTException <ul> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @since 2.1.2 */ public Point map (Control from, Control to, Point point) { checkDevice (); - if (point == null) error (SWT.ERROR_NULL_ARGUMENT); + if (point == null) error (SWT.ERROR_NULL_ARGUMENT); return map (from, to, point.x, point.y); } @@ -3406,7 +3406,7 @@ public Point map (Control from, Control to, Point point) { * systems are mirrored, special care needs to be taken * when mapping coordinates from one control to another * to ensure the result is correctly mirrored. - * + * * Mapping a point that is the origin of a rectangle and * then adding the width and height is not equivalent to * mapping the rectangle. When one control is mirrored @@ -3416,21 +3416,21 @@ public Point map (Control from, Control to, Point point) { * instead of just one point causes both the origin and * the corner of the rectangle to be mapped. * </p> - * + * * @param from the source <code>Control</code> or <code>null</code> * @param to the destination <code>Control</code> or <code>null</code> * @param x coordinates to be mapped * @param y coordinates to be mapped * @return point with mapped coordinates - * + * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the Control from or the Control to have been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the Control from or the Control to have been disposed</li> * </ul> * @exception SWTException <ul> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @since 2.1.2 */ public Point map (Control from, Control to, int x, int y) { @@ -3487,7 +3487,7 @@ public Point map (Control from, Control to, int x, int y) { * systems are mirrored, special care needs to be taken * when mapping coordinates from one control to another * to ensure the result is correctly mirrored. - * + * * Mapping a point that is the origin of a rectangle and * then adding the width and height is not equivalent to * mapping the rectangle. When one control is mirrored @@ -3497,26 +3497,26 @@ public Point map (Control from, Control to, int x, int y) { * instead of just one point causes both the origin and * the corner of the rectangle to be mapped. * </p> - * + * * @param from the source <code>Control</code> or <code>null</code> * @param to the destination <code>Control</code> or <code>null</code> * @param rectangle to be mapped * @return rectangle with mapped coordinates - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the rectangle is null</li> - * <li>ERROR_INVALID_ARGUMENT - if the Control from or the Control to have been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the Control from or the Control to have been disposed</li> * </ul> * @exception SWTException <ul> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @since 2.1.2 */ public Rectangle map (Control from, Control to, Rectangle rectangle) { checkDevice (); - if (rectangle == null) error (SWT.ERROR_NULL_ARGUMENT); + if (rectangle == null) error (SWT.ERROR_NULL_ARGUMENT); return map (from, to, rectangle.x, rectangle.y, rectangle.width, rectangle.height); } @@ -3529,7 +3529,7 @@ public Rectangle map (Control from, Control to, Rectangle rectangle) { * systems are mirrored, special care needs to be taken * when mapping coordinates from one control to another * to ensure the result is correctly mirrored. - * + * * Mapping a point that is the origin of a rectangle and * then adding the width and height is not equivalent to * mapping the rectangle. When one control is mirrored @@ -3539,7 +3539,7 @@ public Rectangle map (Control from, Control to, Rectangle rectangle) { * instead of just one point causes both the origin and * the corner of the rectangle to be mapped. * </p> - * + * * @param from the source <code>Control</code> or <code>null</code> * @param to the destination <code>Control</code> or <code>null</code> * @param x coordinates to be mapped @@ -3547,15 +3547,15 @@ public Rectangle map (Control from, Control to, Rectangle rectangle) { * @param width coordinates to be mapped * @param height coordinates to be mapped * @return rectangle with mapped coordinates - * + * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the Control from or the Control to have been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the Control from or the Control to have been disposed</li> * </ul> * @exception SWTException <ul> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @since 2.1.2 */ public Rectangle map (Control from, Control to, int x, int y, int width, int height) { @@ -3640,7 +3640,7 @@ boolean performKeyEquivalent(NSWindow window, NSEvent nsEvent) { selector = OS.sel_selectAll_; break; } - + if (selector != 0) { NSApplication.sharedApplication().sendAction(selector, null, NSApplication.sharedApplication()); return true; @@ -3723,7 +3723,7 @@ static void register (Display display) { * Releases any internal resources back to the operating * system and clears all fields except the device handle. * <p> - * Disposes all shells which are currently open on the display. + * Disposes all shells which are currently open on the display. * After this method has been invoked, all related related shells * will answer <code>true</code> when sent the message * <code>isDisposed()</code>. @@ -3739,7 +3739,7 @@ static void register (Display display) { * The handle is needed by <code>destroy</code>. * </p> * This method is called before <code>destroy</code>. - * + * * @see Device#dispose * @see #destroy */ @@ -3773,15 +3773,15 @@ protected void release () { super.release (); } -void releaseDisplay () { +void releaseDisplay () { /* Release the System Images */ if (errorImage != null) errorImage.dispose (); if (infoImage != null) infoImage.dispose (); if (warningImage != null) warningImage.dispose (); errorImage = infoImage = warningImage = null; - + currentCaret = null; - + /* Release Timers */ if (hoverTimer != null) timerExec(-1, hoverTimer); hoverTimer = null; @@ -3798,13 +3798,13 @@ void releaseDisplay () { nsTimers = null; if (timerDelegate != null) timerDelegate.release(); timerDelegate = null; - + /* Release the System Cursors */ for (int i = 0; i < cursors.length; i++) { if (cursors [i] != null) cursors [i].dispose (); } cursors = null; - + /* Release default fonts */ if (buttonFont != null) buttonFont.release (); if (popUpButtonFont != null) popUpButtonFont.release (); @@ -3825,28 +3825,28 @@ void releaseDisplay () { searchFieldFont = comboBoxFont = sliderFont = scrollerFont; textViewFont = tableViewFont = outlineViewFont = datePickerFont = null; boxFont = tabViewFont = progressIndicatorFont = null; - + /* Release Dock image */ if (dockImage != null) dockImage.release(); dockImage = null; if (screenWindow != null) screenWindow.release(); screenWindow = null; - + if (needsDisplay != null) needsDisplay.release(); if (needsDisplayInRect != null) needsDisplayInRect.release(); if (isPainting != null) isPainting.release(); if (runLoopModes != null) runLoopModes.release(); needsDisplay = needsDisplayInRect = isPainting = runLoopModes = null; - + modalShells = null; modalDialog = null; menuBar = null; menus = null; - + if (markedAttributes != null) markedAttributes.release(); markedAttributes = null; - + if (oldCursorSetProc != 0) { long /*int*/ method = OS.class_getInstanceMethod(OS.class_NSCursor, OS.sel_set); OS.method_setImplementation(method, oldCursorSetProc); @@ -3859,7 +3859,7 @@ void releaseDisplay () { settingsDelegate.release(); } settingsDelegate = null; - + // Clear the menu bar if we created it. if (!isEmbedded) { //remove all existing menu items except the application menu @@ -3870,12 +3870,12 @@ void releaseDisplay () { count--; } } - + if (dynamicObjectMap != null) { dynamicObjectMap.clear(); dynamicObjectMap = null; } - + // The autorelease pool is cleaned up when we call NSApplication.terminate(). if (application != null && applicationClass != 0) { @@ -3883,7 +3883,7 @@ void releaseDisplay () { } application = null; applicationClass = 0; - + if (runLoopObserver != 0) { OS.CFRunLoopObserverInvalidate (runLoopObserver); OS.CFRelease (runLoopObserver); @@ -3928,7 +3928,7 @@ void removeContext (GCData context) { * @see SWT * @see #addFilter * @see #addListener - * + * * @since 3.0 */ public void removeFilter (int eventType, Listener listener) { @@ -3958,8 +3958,8 @@ public void removeFilter (int eventType, Listener listener) { * @see Listener * @see SWT * @see #addListener - * - * @since 2.0 + * + * @since 2.0 */ public void removeListener (int eventType, Listener listener) { checkDevice (); @@ -3972,7 +3972,7 @@ Widget removeWidget (NSObject view) { if (view == null) return null; long /*int*/ [] jniRef = new long /*int*/ [1]; long /*int*/ iVar = OS.object_getInstanceVariable(view.id, SWT_OBJECT, jniRef); - + if (iVar == 0) { if (dynamicObjectMap != null) { LONG dynJNIRef = (LONG) dynamicObjectMap.get(view); @@ -4025,7 +4025,7 @@ boolean runAWTInvokeLater() { long /*int*/ cls = OS.objc_lookUpClass("JNFRunLoop"); if (cls == 0) return false; long /*int*/ mode = OS.objc_msgSend(cls, OS.sel_javaRunLoopMode); - if (mode == 0) return false; + if (mode == 0) return false; NSString javaRunLoopMode = new NSString(mode); allowTimers = runAsyncMessages = false; NSRunLoop.currentRunLoop().runMode(javaRunLoopMode, NSDate.distantFuture()); @@ -4052,7 +4052,7 @@ boolean runDeferredEvents () { * be re-enterant need not be synchronized. */ while (eventQueue != null) { - + /* Take an event off the queue */ Event event = eventQueue [0]; if (event == null) break; @@ -4093,7 +4093,7 @@ boolean runDeferredLayouts () { if (!comp.isDisposed()) comp.setLayoutDeferred (false); } return true; - } + } return false; } @@ -4105,7 +4105,7 @@ NSArray runLoopModes() { runLoopModes.addObject(OS.NSModalPanelRunLoopMode); runLoopModes.retain(); } - + runLoopModes.retain(); runLoopModes.autorelease(); return runLoopModes; @@ -4153,16 +4153,16 @@ boolean runPopups () { boolean runSettings () { if (!runSettings) return false; runSettings = false; - + boolean ignoreColorChange = false; /** * Feature in Cocoa: When dark mode is enabled on OSX version >= 10.10 and a SWT TrayItem (NSStatusItem) is present in the menubar, - * changing the OSX appearance or changing the configuration of attached displays causes the textColor and textBackground color to change. - * This sets the text foreground of several widgets as white and hence text is invisible. The workaround is to detect this case and prevent + * changing the OSX appearance or changing the configuration of attached displays causes the textColor and textBackground color to change. + * This sets the text foreground of several widgets as white and hence text is invisible. The workaround is to detect this case and prevent * the update of LIST_FOREGROUND, LIST_BACKGROUND and COLOR_WIDGET_FOREGROUND colors. */ if (OS.VERSION_MMB >= OS.VERSION_MMB (10, 10, 0) && tray != null && tray.itemCount > 0) { - /* + /* * osxMode will be "Dark" when in OSX dark mode. Otherwise, it'll be null. */ NSString osxMode = NSUserDefaults.standardUserDefaults ().stringForKey (NSString.stringWith ("AppleInterfaceStyle")); @@ -4171,7 +4171,7 @@ boolean runSettings () { } } initColors (ignoreColorChange); - + sendEvent (SWT.Settings, null); Shell [] shells = getShells (); for (int i=0; i<shells.length; i++) { @@ -4186,8 +4186,8 @@ boolean runSettings () { boolean runSkin () { if (skinCount > 0) { - Widget [] oldSkinWidgets = skinList; - int count = skinCount; + Widget [] oldSkinWidgets = skinList; + int count = skinCount; skinList = new Widget[GROW_SIZE]; skinCount = 0; if (eventTable != null && eventTable.hooks(SWT.Skin)) { @@ -4203,10 +4203,10 @@ boolean runSkin () { } } return true; - } + } return false; } - + boolean runTimers () { if (timerList == null) return false; boolean result = false; @@ -4323,9 +4323,9 @@ static NSString getApplicationName() { * Returns the application name. * * @return the application name - * + * * @see #setAppName(String) - * + * * @since 3.6 */ public static String getAppName () { @@ -4336,9 +4336,9 @@ public static String getAppName () { * Returns the application version. * * @return the application version - * + * * @see #setAppVersion(String) - * + * * @since 3.6 */ public static String getAppVersion () { @@ -4351,9 +4351,9 @@ public static String getAppVersion () { * The application name can be used in several ways, * depending on the platform and tools being used. * Accessibility tools could ask for the application - * name. On Windows, if the application name is set + * name. On Windows, if the application name is set * to any value other than "SWT" (case insensitive), - * it is used to set the application user model ID + * it is used to set the application user model ID * which is used by the OS for taskbar grouping. * @see <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd378459%28v=vs.85%29.aspx#HOW">AppUserModelID (Windows)</a> * </p><p> @@ -4370,7 +4370,7 @@ public static void setAppName (String name) { * Sets the application version to the argument. * * @param version the new app version - * + * * @since 3.6 */ public static void setAppVersion (String version) { @@ -4398,7 +4398,7 @@ Runnable caretTimer = new Runnable () { currentCaret = null; } } - + } }; @@ -4451,12 +4451,12 @@ void setCursor (Control control) { * * @param x the new x coordinate for the cursor * @param y the new y coordinate for the cursor - * + * * @exception SWTException <ul> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @since 2.1 */ public void setCursorLocation (int x, int y) { @@ -4474,13 +4474,13 @@ public void setCursorLocation (int x, int y) { * program to move the on-screen pointer location.</b> * * @param point new position - * + * * @exception SWTException <ul> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * <li>ERROR_NULL_ARGUMENT - if the point is null * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @since 2.0 */ public void setCursorLocation (Point point) { @@ -4517,7 +4517,7 @@ public void setCursorLocation (Point point) { public void setData (String key, Object value) { checkDevice (); if (key == null) error (SWT.ERROR_NULL_ARGUMENT); - + if (key.equals (ADD_WIDGET_KEY)) { Object [] data = (Object [])value; NSObject object = (NSObject)data [0]; @@ -4528,19 +4528,19 @@ public void setData (String key, Object value) { addWidget (object, widget); } } - + if (key.equals(SET_MODAL_DIALOG)) { setModalDialog (value != null ? (Dialog) value : null); } - + if (key.equals (MOZILLA_RUNNING)) { mozillaRunning = ((Boolean)value).booleanValue (); } - + if (key.equals (LOCK_CURSOR)) { lockCursor = ((Boolean)value).booleanValue (); } - + if (key.equals(RUN_AWT_INVOKE_LATER_KEY)) { if (value != null) { value = new Boolean (runAWTInvokeLater()); @@ -4568,7 +4568,7 @@ public void setData (String key, Object value) { } return; } - + /* Add the key/value pair */ if (keys == null) { keys = new String [] {key}; @@ -4592,7 +4592,7 @@ public void setData (String key, Object value) { } void setMenuBar (Menu menu) { - // If passed a null menu bar don't clear out the menu bar, but switch back to the + // If passed a null menu bar don't clear out the menu bar, but switch back to the // application menu bar instead, if it exists. If the app menu bar is already active // we jump out without harming the current menu bar. if (menu == null) menu = appMenuBar; @@ -4618,7 +4618,7 @@ void setMenuBar (Menu menu) { for (int i = 0; i < items.length; i++) { MenuItem item = items[i]; NSMenuItem nsItem = item.nsItem; - + /* * Bug in cocoa. Cocoa does not seem to detect the help * menu for languages other than english. The fix is to detect @@ -4626,19 +4626,19 @@ void setMenuBar (Menu menu) { */ if (OS.VERSION >= 0x1060) { NSMenu submenu = nsItem.submenu(); - if (submenu != null && submenu.title().getString().equals(SWT.getMessage("SWT_Help"))) { + if (submenu != null && submenu.title().getString().equals(SWT.getMessage("SWT_Help"))) { application.setHelpMenu(submenu); } } nsItem.setMenu(null); menubar.addItem(nsItem); - + /* * Bug in Cocoa: Calling NSMenuItem.setEnabled() for menu item of a menu bar only * works when the menu bar is the current menu bar. The underline OS menu does get * enabled/disable when that menu is set later on. The fix is to toggle the - * item enabled state to force the underline menu to be updated. + * item enabled state to force the underline menu to be updated. */ boolean enabled = menu.getEnabled () && item.getEnabled (); nsItem.setEnabled(!enabled); @@ -4678,7 +4678,7 @@ void setModalShell (Shell shell) { * Sets the application defined, display specific data * associated with the receiver, to the argument. * The <em>display specific data</em> is a single, - * unnamed field that is stored with every display. + * unnamed field that is stored with every display. * <p> * Applications may put arbitrary objects in this field. If * the object stored in the display specific data needs to @@ -4767,17 +4767,17 @@ int sourceProc (int info) { /** * Causes the <code>run()</code> method of the runnable to - * be invoked by the user-interface thread at the next + * be invoked by the user-interface thread at the next * reasonable opportunity. The thread which calls this method * is suspended until the runnable completes. Specifying <code>null</code> * as the runnable simply wakes the user-interface thread. * <p> - * Note that at the time the runnable is invoked, widgets + * Note that at the time the runnable is invoked, widgets * that have the receiver as their display may have been * disposed. Therefore, it is necessary to check for this * case inside the runnable before accessing the widget. * </p> - * + * * @param runnable code to run on the user-interface thread or <code>null</code> * * @exception SWTException <ul> @@ -4802,7 +4802,7 @@ public void syncExec (Runnable runnable) { * number of milliseconds have elapsed. If milliseconds is less * than zero, the runnable is not executed. * <p> - * Note that at the time the runnable is invoked, widgets + * Note that at the time the runnable is invoked, widgets * that have the receiver as their display may have been * disposed. Therefore, it is necessary to check for this * case inside the runnable before accessing the widget. @@ -4847,7 +4847,7 @@ public void timerExec (int milliseconds, Runnable runnable) { } return; } - } + } if (milliseconds < 0) return; index = 0; while (index < timerList.length) { @@ -4906,11 +4906,11 @@ long /*int*/ timerProc (long /*int*/ id, long /*int*/ sel, long /*int*/ timerID) * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see Control#update() */ public void update () { - checkDevice (); + checkDevice (); Shell [] shells = getShells (); for (int i=0; i<shells.length; i++) { Shell shell = shells [i]; @@ -4935,7 +4935,7 @@ void updateQuitMenu () { break; } } - + NSMenu mainmenu = application.mainMenu(); NSMenuItem appitem = mainmenu.itemAtIndex(0); if (appitem != null) { @@ -4943,7 +4943,7 @@ void updateQuitMenu () { // Normally this would be sel_terminate_ but we changed it so terminate: doesn't kill the app. long /*int*/ quitIndex = sm.indexOfItemWithTarget(applicationDelegate, OS.sel_applicationShouldTerminate_); - + if (quitIndex != -1) { NSMenuItem quitItem = sm.itemAtIndex(quitIndex); quitItem.setEnabled(enabled); @@ -4953,14 +4953,14 @@ void updateQuitMenu () { /** - * If the receiver's user-interface thread was <code>sleep</code>ing, + * If the receiver's user-interface thread was <code>sleep</code>ing, * causes it to be awakened and start running again. Note that this * method may be called from any thread. - * + * * @exception SWTException <ul> * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> * </ul> - * + * * @see #sleep */ public void wake () { @@ -4995,7 +4995,7 @@ Control findControl (boolean checkTrim, NSView[] hitView) { hitWindowNumber = OS.HIWindowGetCGWindowID(outWindow[0]); } } - + NSWindow window = application.windowWithWindowNumber(hitWindowNumber); if (window != null) { NSView contentView = window.contentView(); @@ -5028,7 +5028,7 @@ Control findControl (boolean checkTrim, NSView[] hitView) { } void finishLaunching (long /*int*/ id, long /*int*/ sel) { - /* + /* * [NSApplication finishLaunching] cannot run multiple times otherwise * multiple main menus are added. */ @@ -5138,9 +5138,9 @@ void applicationSendTrackingEvent (NSEvent nsEvent, Control trackingControl) { void applicationSendEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ event) { NSEvent nsEvent = new NSEvent(event); NSWindow window = nsEvent.window (); - + if (performKeyEquivalent(window, nsEvent)) return; - + int type = (int)/*64*/nsEvent.type (); boolean activate = false, down = false; switch (type) { @@ -5186,7 +5186,7 @@ void applicationSendEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ event break; } if (type != OS.NSAppKitDefined) sendEvent = true; - + /* * Feature in Cocoa. The help key triggers context-sensitive help but doesn't get forwarded to the window as a key event. * If the event is destined for the key window, is the help key, and is an NSKeyDown, send it directly to the window first. @@ -5212,13 +5212,13 @@ void applicationSendEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ event void applicationWillFinishLaunching (long /*int*/ id, long /*int*/ sel, long /*int*/ notification) { boolean loaded = false; - + /* * Bug in AWT: If the AWT starts up first when the VM was started on the first thread it assumes that * a Carbon-based SWT will be used, so it calls NSApplicationLoad(). This causes the Carbon menu * manager to create an application menu that isn't accessible via NSMenu. It is, however, accessible - * via the Carbon menu manager, so find and delete the menu items it added. - * + * via the Carbon menu manager, so find and delete the menu items it added. + * * Note that this code will continue to work if Apple does change this. GetIndMenuWithCommandID will * return a non-zero value indicating failure, which we ignore. */ @@ -5238,7 +5238,7 @@ void applicationWillFinishLaunching (long /*int*/ id, long /*int*/ sel, long /*i } /* - * Get the default locale's language, and then the display name of the language. Some Mac OS X localizations use the + * Get the default locale's language, and then the display name of the language. Some Mac OS X localizations use the * display name of the language, but many use the ISO two-char abbreviation instead. */ Locale loc = Locale.getDefault(); @@ -5247,7 +5247,7 @@ void applicationWillFinishLaunching (long /*int*/ id, long /*int*/ sel, long /*i englishLocale = new NSLocale(englishLocale.initWithLocaleIdentifier(NSString.stringWith("en_US"))); NSString languageDisplayName = englishLocale.displayNameForKey(OS.NSLocaleLanguageCode, NSString.stringWith(languageISOValue)); if (englishLocale != null) englishLocale.release(); - + /* To find the nib look for each of these paths, in order, until one is found: * /System/Library/..../Resources/<display name>.lproj/DefaultApp.nib * /System/Library/..../Resources/<language>.lproj/DefaultApp.nib @@ -5272,7 +5272,7 @@ void applicationWillFinishLaunching (long /*int*/ id, long /*int*/ sel, long /*i if (!loaded) { createMainMenu(); } - + //replace %@ with application name NSMenu mainmenu = application.mainMenu(); NSMenuItem appitem = mainmenu.itemAtIndex(0); @@ -5311,7 +5311,7 @@ void applicationWillFinishLaunching (long /*int*/ id, long /*int*/ sel, long /*i } long /*int*/ quitIndex = sm.indexOfItemWithTarget(applicationDelegate, OS.sel_terminate_); - + if (quitIndex != -1) { NSMenuItem quitItem = sm.itemAtIndex(quitIndex); quitItem.setAction(OS.sel_applicationShouldTerminate_); @@ -5351,7 +5351,7 @@ static long /*int*/ applicationProc(long /*int*/ id, long /*int*/ sel, long /*in if (currAppDelegate != null) { if (currAppDelegate.respondsToSelector(sel)) OS.objc_msgSend(currAppDelegate.id, sel, arg0); } - + NSApplication application = display.application; if (sel == OS.sel_sendEvent_) { display.applicationSendEvent (id, sel, arg0); @@ -5408,7 +5408,7 @@ static long /*int*/ applicationProc(long /*int*/ id, long /*int*/ sel, long /*in // Forward to the AWT, if necessary. if (currAppDelegate != null) { if (currAppDelegate.respondsToSelector(sel)) OS.objc_msgSend(currAppDelegate.id, sel, arg0, arg1); - } + } if (sel == OS.sel_application_openFile_) { String file = new NSString(arg1).getString(); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/FileDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/FileDialog.java index 9ba93e3cc2..0b563e730c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/FileDialog.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/FileDialog.java @@ -10,7 +10,7 @@ *******************************************************************************/ package org.eclipse.swt.widgets; - + import java.util.*; import org.eclipse.swt.*; @@ -31,7 +31,7 @@ import org.eclipse.swt.internal.cocoa.*; * </p><p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> - * + * * @see <a href="http://www.eclipse.org/swt/snippets/#filedialog">FileDialog snippets</a> * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample, Dialog tab</a> * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> @@ -42,7 +42,7 @@ public class FileDialog extends Dialog { NSPopUpButton popup; String [] filterNames = new String [0]; String [] filterExtensions = new String [0]; - String [] fileNames = new String[0]; + String [] fileNames = new String[0]; String filterPath = "", fileName = ""; int filterIndex = -1; boolean overwrite = false; @@ -71,7 +71,7 @@ public FileDialog (Shell parent) { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -88,7 +88,7 @@ public FileDialog (Shell parent) { * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li> * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li> * </ul> - * + * * @see SWT#SAVE * @see SWT#OPEN * @see SWT#MULTI @@ -105,7 +105,7 @@ public FileDialog (Shell parent, int style) { * Returns the path of the first file that was * selected in the dialog relative to the filter path, or an * empty string if no such file has been selected. - * + * * @return the relative path of the file */ public String getFileName () { @@ -115,7 +115,7 @@ public String getFileName () { /** * Returns a (possibly empty) array with the paths of all files * that were selected in the dialog relative to the filter path. - * + * * @return the relative paths of the files */ public String [] getFileNames () { @@ -142,10 +142,10 @@ public String [] getFilterExtensions () { * </p> * * @return index the file extension filter index - * + * * @see #getFilterExtensions * @see #getFilterNames - * + * * @since 3.4 */ public int getFilterIndex () { @@ -168,7 +168,7 @@ public String [] getFilterNames () { * in the dialog, filtered according to the filter extensions. * * @return the directory path string - * + * * @see #setFilterExtensions */ public String getFilterPath () { @@ -181,7 +181,7 @@ public String getFilterPath () { * overwrite if the selected file already exists. * * @return true if the dialog will prompt for file overwrite, false otherwise - * + * * @since 3.4 */ public boolean getOverwrite () { @@ -221,11 +221,11 @@ public String open () { openPanel.setAllowsMultipleSelection((style & SWT.MULTI) != 0); panel = openPanel; } - + Display display = parent != null ? parent.getDisplay() : Display.getCurrent(); panel.setCanCreateDirectories(true); - /* - * This line is intentionally commented. Don't show hidden files forcefully, + /* + * This line is intentionally commented. Don't show hidden files forcefully, * instead allow File dialog to use the system preference. */ // OS.objc_msgSend(panel.id, OS.sel_setShowsHiddenFiles_, true); @@ -257,7 +257,7 @@ public String open () { widget.sizeToFit(); panel.setAccessoryView(widget); popup = widget; - + setAllowedFileType(filterExtensions[0]); panel.setAllowsOtherFileTypes(true); panel.setTreatsFilePackagesAsDirectories(shouldTreatAppAsDirectory(filterExtensions[0])); @@ -298,19 +298,19 @@ public String open () { NSArray filenames = ((NSOpenPanel)panel).filenames(); int count = (int)/*64*/filenames.count(); fileNames = new String[count]; - + for (int i = 0; i < count; i++) { filename = new NSString(filenames.objectAtIndex(i)); NSString filenameOnly = filename.lastPathComponent(); NSString pathOnly = filename.stringByDeletingLastPathComponent(); - + if (i == 0) { /* Filter path */ filterPath = pathOnly.getString(); /* File name */ fileName = fileNames [0] = filenameOnly.getString(); - } else { + } else { if (pathOnly.getString().equals (filterPath)) { fileNames [i] = filenameOnly.getString(); } else { @@ -331,7 +331,7 @@ public String open () { } if (jniRef != 0) OS.DeleteGlobalRef(jniRef); panel = null; - return fullPath; + return fullPath; } long /*int*/ _overwriteExistingFileCheck (long /*int*/ id, long /*int*/ sel, long /*int*/ str) { @@ -383,13 +383,13 @@ void sendSelection (long /*int*/ id, long /*int*/ sel, long /*int*/ arg) { void setAllowedFileType (String fileTypes) { if (fileTypes == null) return; - + StringTokenizer fileTypesToken = new StringTokenizer(fileTypes, String.valueOf(EXTENSION_SEPARATOR)); NSMutableArray allowedFileTypes = NSMutableArray.arrayWithCapacity(1); while(fileTypesToken.hasMoreTokens()) { String fileType = fileTypesToken.nextToken(); - + if (fileType.equals("*") || fileType.equals("*.*")) { panel.setAllowedFileTypes(null); return; @@ -401,7 +401,7 @@ void setAllowedFileType (String fileTypes) { } allowedFileTypes.addObject(NSString.stringWith(fileType)); } - + panel.setAllowedFileTypes(allowedFileTypes); } @@ -411,7 +411,7 @@ void setAllowedFileType (String fileTypes) { * select by default when opened to the argument, * which may be null. The name will be prefixed with * the filter path when one is supplied. - * + * * @param string the file name */ public void setFileName (String string) { @@ -431,15 +431,15 @@ public void setFileName (String string) { * </p> * <p> * Note: On Mac, setting the file extension filter affects how - * app bundles are treated by the dialog. When a filter extension - * having the app extension (.app) is selected, bundles are treated - * as files. For all other extension filters, bundles are treated - * as directories. When no filter extension is set, bundles are + * app bundles are treated by the dialog. When a filter extension + * having the app extension (.app) is selected, bundles are treated + * as files. For all other extension filters, bundles are treated + * as directories. When no filter extension is set, bundles are * treated as files. * </p> * * @param extensions the file extension filter - * + * * @see #setFilterNames to specify the user-friendly * names corresponding to the extensions */ @@ -457,10 +457,10 @@ public void setFilterExtensions (String [] extensions) { * </p> * * @param index the file extension filter index - * + * * @see #setFilterExtensions * @see #setFilterNames - * + * * @since 3.4 */ public void setFilterIndex (int index) { @@ -478,7 +478,7 @@ public void setFilterIndex (int index) { * </p> * * @param names the list of filter names, or null for no filter names - * + * * @see #setFilterExtensions */ public void setFilterNames (String [] names) { @@ -499,7 +499,7 @@ public void setFilterNames (String [] names) { * </p> * * @param string the directory path - * + * * @see #setFilterExtensions */ public void setFilterPath (String string) { @@ -512,7 +512,7 @@ public void setFilterPath (String string) { * overwrite if the selected file already exists. * * @param overwrite true if the dialog will prompt for file overwrite, false otherwise - * + * * @since 3.4 */ public void setOverwrite (boolean overwrite) { @@ -520,7 +520,7 @@ public void setOverwrite (boolean overwrite) { } /** - * Determines if the treatAppAsBundle property has to be enabled for the NSOpenPanel + * Determines if the treatAppAsBundle property has to be enabled for the NSOpenPanel * for the filterExtensions passed as a parameter. */ boolean shouldTreatAppAsDirectory (String extensions) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/FontDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/FontDialog.java index 995c3f8738..a1db67892a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/FontDialog.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/FontDialog.java @@ -10,7 +10,7 @@ *******************************************************************************/ package org.eclipse.swt.widgets; - + import org.eclipse.swt.*; import org.eclipse.swt.graphics.*; import org.eclipse.swt.internal.cocoa.*; @@ -27,7 +27,7 @@ import org.eclipse.swt.internal.cocoa.*; * <p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> - * + * * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample, Dialog tab</a> * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * @noextend This class is not intended to be subclassed by clients. @@ -62,7 +62,7 @@ public FontDialog (Shell parent) { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -95,11 +95,11 @@ void changeFont(long /*int*/ id, long /*int*/ sel, long /*int*/ arg0) { * <p> * If the platform's font dialog does not have any effects selection controls, * then this method always returns false. - * </p> + * </p> * * @return <code>true</code> if the dialog's effects selection controls * are visible and <code>false</code> otherwise - * + * * @since 3.8 */ public boolean getEffectsVisible () { @@ -109,7 +109,7 @@ public boolean getEffectsVisible () { /** * Returns a FontData object describing the font that was * selected in the dialog, or null if none is available. - * + * * @return the FontData for the selected font, or null * @deprecated use #getFontList () */ @@ -121,7 +121,7 @@ public FontData getFontData () { /** * Returns a FontData set describing the font that was * selected in the dialog, or null if none is available. - * + * * @return the FontData for the selected font, or null * @since 2.1.1 */ @@ -139,7 +139,7 @@ public FontData [] getFontList () { * @return the RGB value for the selected color, or null * * @see PaletteData#getRGBs - * + * * @since 2.1 */ public RGB getRGB () { @@ -159,7 +159,7 @@ public RGB getRGB () { * </ul> */ public FontData open () { - Display display = parent != null ? parent.display : Display.getCurrent (); + Display display = parent != null ? parent.display : Display.getCurrent (); NSFontPanel panel = NSFontPanel.sharedFontPanel(); panel.setTitle(NSString.stringWith(title != null ? title : "")); boolean create = fontData != null; @@ -211,7 +211,7 @@ void setColor_forAttribute(long /*int*/ id, long /*int*/ sel, long /*int*/ color * </p> * * @param visible whether or not the dialog will show the effects selection controls - * + * * @since 3.8 */ public void setEffectsVisible(boolean visible) { @@ -222,7 +222,7 @@ public void setEffectsVisible(boolean visible) { * Sets a FontData object describing the font to be * selected by default in the dialog, or null to let * the platform choose one. - * + * * @param fontData the FontData to use initially, or null * @deprecated use #setFontList (FontData []) */ @@ -235,12 +235,12 @@ public void setFontData (FontData fontData) { * Sets the set of FontData objects describing the font to * be selected by default in the dialog, or null to let * the platform choose one. - * + * * @param fontData the set of FontData objects to use initially, or null * to let the platform select a default when open() is called * * @see Font#getFontData - * + * * @since 2.1.1 */ public void setFontList (FontData [] fontData) { @@ -259,7 +259,7 @@ public void setFontList (FontData [] fontData) { * the platform select a default when open() is called * * @see PaletteData#getRGBs - * + * * @since 2.1 */ public void setRGB (RGB rgb) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Group.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Group.java index a8a0ea6c81..4bbadc0dfc 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Group.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Group.java @@ -34,7 +34,7 @@ import org.eclipse.swt.internal.cocoa.*; * </p><p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> - * + * * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a> * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> * @noextend This class is not intended to be subclassed by clients. @@ -44,14 +44,14 @@ public class Group extends Composite { String text = ""; boolean ignoreResize; int hMargin, vMargin; - + /** * Constructs a new instance of this class given its parent * and a style value describing its behavior and appearance. * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -135,7 +135,7 @@ void createHandle () { hMargin = (int) margins.width; vMargin = (int) margins.height; widget.setContentViewMargins(new NSSize()); - + NSView contentWidget = (NSView)new SWTView().alloc(); contentWidget.init(); // contentWidget.setDrawsBackground(false); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/IME.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/IME.java index 6e2408b60f..5113a3e39a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/IME.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/IME.java @@ -19,7 +19,7 @@ import org.eclipse.swt.internal.cocoa.*; * These are typically in-line pre-edit text areas that allow * the user to compose characters from Far Eastern languages * such as Japanese, Chinese or Korean. - * + * * <dl> * <dt><b>Styles:</b></dt> * <dd>(none)</dd> @@ -29,9 +29,9 @@ import org.eclipse.swt.internal.cocoa.*; * <p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> - * + * * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> - * + * * @since 3.4 * @noextend This class is not intended to be subclassed by clients. */ @@ -43,9 +43,9 @@ public class IME extends Widget { String text; int [] ranges; TextStyle [] styles; - + static final int UNDERLINE_THICK = 1 << 16; - + /** * Prevents uninitialized instances from being created outside the package. */ @@ -58,7 +58,7 @@ IME () { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -171,14 +171,14 @@ public int getCaretOffset () { * number of characters that have been composed. When the * commit count is equal to the length of the composition * text, then the in-line edit operation is complete. - * + * * @return the commit count * * @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> - * + * * @see IME#getText */ public int getCommitCount () { @@ -219,7 +219,7 @@ public int getCompositionOffset () { * <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> - * + * * @see IME#getStyles */ public int [] getRanges () { @@ -227,7 +227,7 @@ public int [] getRanges () { if (ranges == null) return new int [0]; int [] result = new int [ranges.length]; for (int i = 0; i < result.length; i++) { - result [i] = ranges [i] + startOffset; + result [i] = ranges [i] + startOffset; } return result; } @@ -240,14 +240,14 @@ public int [] getRanges () { * that starts at ranges[n] and ends at ranges[n+1] uses the style * at styles[n/2]. * </p> - * + * * @return the ranges for the styles * * @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> - * + * * @see IME#getRanges */ public TextStyle [] getStyles () { @@ -291,7 +291,7 @@ TextStyle getStyle (NSDictionary attribs) { NSFont font = new NSFont (attribs.objectForKey (key)); font.retain(); style.font = Font.cocoa_new (display, font); - } + } } return style; } @@ -322,7 +322,7 @@ public String getText () { * <code>false</code> otherwise. In some languages, for example * Korean, the caret is typically widened to the width of the * current character in the in-line edit session. - * + * * @return the wide caret state * * @exception SWTException <ul> @@ -331,7 +331,7 @@ public String getText () { * </ul> */ public boolean getWideCaret() { - return false; + return false; } @Override diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Label.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Label.java index 688f48d30a..41928e427f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Label.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Label.java @@ -60,7 +60,7 @@ public class Label extends Control { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -97,27 +97,27 @@ public Label (Composite parent, int style) { @Override long /*int*/ accessibleHandle() { - return eventView().id; + return eventView().id; } @Override boolean accessibilityIsIgnored(long /*int*/ id, long /*int*/ sel) { if (id == view.id) return true; - return super.accessibilityIsIgnored(id, sel); + return super.accessibilityIsIgnored(id, sel); } @Override void addRelation (Control control) { if (!control.isDescribedByLabel ()) return; - + if (textView != null) { NSObject accessibleElement = control.focusView(); - + if (accessibleElement instanceof NSControl) { NSControl viewAsControl = (NSControl)accessibleElement; if (viewAsControl.cell() != null) accessibleElement = viewAsControl.cell(); } - + accessibleElement.accessibilitySetOverrideValue(textView.cell(), OS.NSAccessibilityTitleUIElementAttribute); NSArray controlArray = NSArray.arrayWithObject(accessibleElement); textView.cell().accessibilitySetOverrideValue(controlArray, OS.NSAccessibilityServesAsTitleForUIElementsAttribute); @@ -129,7 +129,7 @@ static int checkStyle (int style) { if ((style & SWT.SEPARATOR) != 0) { style = checkBits (style, SWT.VERTICAL, SWT.HORIZONTAL, 0, 0, 0, 0); return checkBits (style, SWT.SHADOW_OUT, SWT.SHADOW_IN, SWT.SHADOW_NONE, 0, 0, 0); - } + } return checkBits (style, SWT.LEFT, SWT.CENTER, SWT.RIGHT, 0, 0, 0); } @@ -186,7 +186,7 @@ void createHandle () { /* * Feature in Cocoa: Separator control decides how to orient itself * based on the width and height. If height > width it orients - * vertically, else it orients horizontally. + * vertically, else it orients horizontally. * Fix is to have two native controls to implement the separator label. * The top control (Custom NSBox) honors the bounds set by the * user and the inner one (Separator NSBox) creates the separator @@ -195,7 +195,7 @@ void createHandle () { NSRect rect = new NSRect(); rect.width = DEFAULT_WIDTH; rect.height = DEFAULT_HEIGHT; - + widget.initWithFrame(rect); widget.setTitle(NSString.string()); widget.setBorderType(OS.NSNoBorder); @@ -210,7 +210,7 @@ void createHandle () { rect.width = (int)Math.ceil (lineWidth * 2); rect.x = (DEFAULT_WIDTH / 2) - (rect.width / 2); } - + NSBox separator = (NSBox) new SWTBox().alloc(); separator.initWithFrame(rect); separator.setBoxType(OS.NSBoxSeparator); @@ -219,14 +219,14 @@ void createHandle () { } else { separator.setAutoresizingMask(OS.NSViewHeightSizable| OS.NSViewMinXMargin | OS.NSViewMaxXMargin); } - + NSView child = (NSView) new NSView().alloc().init(); separator.setContentView(child); child.release(); - + widget.addSubview(separator); this.separator = separator; - } else { + } else { widget.init(); widget.setTitle(NSString.string()); widget.setBorderType(OS.NSNoBorder); @@ -238,7 +238,7 @@ void createHandle () { NSImageView imageWidget = (NSImageView) new SWTImageView ().alloc (); imageWidget.init(); imageWidget.setImageScaling (OS.NSScaleNone); - + NSTextField textWidget = (NSTextField)new SWTTextField().alloc(); textWidget.init(); textWidget.setBordered(false); @@ -246,11 +246,11 @@ void createHandle () { textWidget.setDrawsBackground(false); NSTextFieldCell cell = new NSTextFieldCell(textWidget.cell()); cell.setWraps ((style & SWT.WRAP) != 0); - + widget.addSubview(imageWidget); widget.addSubview(textWidget); widget.setContentView(textWidget); - + imageView = imageWidget; textView = textWidget; _setAlignment(); @@ -314,10 +314,10 @@ NSView eventView () { * Returns a value which describes the position of the * text or image in the receiver. The value will be one of * <code>LEFT</code>, <code>RIGHT</code> or <code>CENTER</code> - * unless the receiver is a <code>SEPARATOR</code> label, in + * unless the receiver is a <code>SEPARATOR</code> label, in * which case, <code>NONE</code> is returned. * - * @return the alignment + * @return the alignment * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> @@ -417,7 +417,7 @@ void removeRelation () { * or <code>CENTER</code>. If the receiver is a <code>SEPARATOR</code> * label, the argument is ignored and the alignment is not changed. * - * @param alignment the new alignment + * @param alignment the new alignment * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> @@ -473,7 +473,7 @@ boolean setTabItemFocus () { * @param image the image to display on the receiver (may be null) * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> @@ -527,7 +527,7 @@ public void setImage (Image image) { * Note: If control characters like '\n', '\t' etc. are used * in the string, then the behavior is platform dependent. * </p> - * + * * @param string the new text * * @exception IllegalArgumentException <ul> diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Link.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Link.java index 6d7642a8f4..40295d494d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Link.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Link.java @@ -17,7 +17,7 @@ import org.eclipse.swt.internal.cocoa.*; /** * Instances of this class represent a selectable - * user interface object that displays a text with + * user interface object that displays a text with * links. * <p> * <dl> @@ -33,7 +33,7 @@ import org.eclipse.swt.internal.cocoa.*; * @see <a href="http://www.eclipse.org/swt/snippets/#link">Link snippets</a> * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a> * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> - * + * * @since 3.1 * @noextend This class is not intended to be subclassed by clients. */ @@ -46,14 +46,14 @@ public class Link extends Control { NSColor linkColor; int focusIndex; boolean ignoreNextMouseUp; - + /** * Constructs a new instance of this class given its parent * and a style value describing its behavior and appearance. * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -217,7 +217,7 @@ void createHandle () { dict.removeObjectForKey(OS.NSBackgroundColorAttributeName); dict.setObject(NSCursor.arrowCursor(), OS.NSCursorAttributeName); widget.setSelectedTextAttributes(dict); - + scrollView = scrollWidget; view = widget; } @@ -230,7 +230,7 @@ void createWidget () { linkColor = new NSColor(dict.valueForKey(OS.NSForegroundColorAttributeName)); offsets = new Point [0]; ids = new String [0]; - mnemonics = new int [0]; + mnemonics = new int [0]; focusIndex = -1; } @@ -284,7 +284,7 @@ Cursor findCursor () { @Override void enableWidget (boolean enabled) { super.enableWidget (enabled); - NSColor nsColor = null; + NSColor nsColor = null; if (enabled) { if (foreground == null) { nsColor = NSColor.textColor (); @@ -311,7 +311,7 @@ NSRect[] getRectangles(int linkIndex) { * rectangles is > 1 when the link has multiple lines. */ if (linkIndex == -1) return null; - + NSTextView widget = ((NSTextView)view); NSLayoutManager layoutManager = widget.layoutManager(); NSRange range = new NSRange(); @@ -321,7 +321,7 @@ NSRect[] getRectangles(int linkIndex) { long /*int*/ rangePtr = OS.malloc(NSRange.sizeof); NSRange lineRange = new NSRange(); - + /* compute number of lines in the link */ int numberOfLines = 0; long /*int*/ index = glyphRange.location; @@ -332,7 +332,7 @@ NSRect[] getRectangles(int linkIndex) { OS.memmove(lineRange, rangePtr, NSRange.sizeof); index = lineRange.location + lineRange.length; } - + /* compute the enclosing rectangle(s) for the link*/ NSRect [] result = new NSRect[numberOfLines]; index = glyphRange.location; @@ -340,7 +340,7 @@ NSRect[] getRectangles(int linkIndex) { NSRect usedRect = layoutManager.lineFragmentUsedRectForGlyphAtIndex(index, rangePtr, true); OS.memmove(lineRange, rangePtr, NSRange.sizeof); index = lineRange.location + lineRange.length; - + if (lineRange.location < glyphRange.location) { lineRange.length = index - glyphRange.location; lineRange.location = glyphRange.location; @@ -440,7 +440,7 @@ public void removeSelectionListener (SelectionListener listener) { if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; eventTable.unhook (SWT.Selection, listener); - eventTable.unhook (SWT.DefaultSelection, listener); + eventTable.unhook (SWT.DefaultSelection, listener); } String parse (String string) { @@ -456,7 +456,7 @@ String parse (String string) { while (index < length) { char c = Character.toLowerCase (buffer [index]); switch (state) { - case 0: + case 0: if (c == '<') { tagStart = index; state++; @@ -569,7 +569,7 @@ String parse (String string) { ids = newIDs; int [] newMnemonics = new int [linkIndex + 1]; System.arraycopy (mnemonics, 0, newMnemonics, 0, linkIndex + 1); - mnemonics = newMnemonics; + mnemonics = newMnemonics; } return result.toString (); } @@ -610,7 +610,7 @@ boolean sendKeyEvent(int type, Event event) { if (!result) return result; if (focusIndex == -1) return result; if (type != SWT.KeyDown) return result; - + int keyCode = event.keyCode; switch (keyCode) { case SWT.CR: @@ -634,7 +634,7 @@ boolean sendKeyEvent(int type, Event event) { focusIndex--; redraw (); return false; - } + } } break; } @@ -700,7 +700,7 @@ void setOrientation () { * </p> * <p> * Mnemonics are indicated by an '&' that causes the next - * character to be the mnemonic. The receiver can have a + * character to be the mnemonic. The receiver can have a * mnemonic in the text preceding each link. When the user presses a * key sequence that matches the mnemonic, focus is assigned * to the link that follows the text. Mnemonics in links and in @@ -709,8 +709,8 @@ void setOrientation () { * platform specific manner. The mnemonic indicator character * '&' can be escaped by doubling it in the string, causing * a single '&' to be displayed. - * </p> - * + * </p> + * * @param string the new text * * @exception IllegalArgumentException <ul> @@ -773,7 +773,7 @@ int traversalCode (int key, NSEvent theEvent) { void updateCursorRects (boolean enabled) { super.updateCursorRects (enabled); if (scrollView == null) return; - updateCursorRects (enabled, scrollView); + updateCursorRects (enabled, scrollView); NSClipView contentView = scrollView.contentView (); updateCursorRects (enabled, contentView); contentView.setDocumentCursor (enabled ? NSCursor.arrowCursor () : null); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java index e97e6358ac..1f43f9b11e 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java @@ -16,7 +16,7 @@ import org.eclipse.swt.events.*; import org.eclipse.swt.graphics.*; import org.eclipse.swt.internal.cocoa.*; -/** +/** * Instances of this class represent a selectable user interface * object that displays a list of strings and issues notification * when a string is selected. A list may be single or multi select. @@ -54,7 +54,7 @@ public class List extends Scrollable { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -93,7 +93,7 @@ long /*int*/ accessibilityAttributeValue (long /*int*/ id, long /*int*/ sel, lon // */ // return 0; // } - + return super.accessibilityAttributeValue(id, sel, arg0); } @@ -251,7 +251,7 @@ void createHandle () { if ((style & SWT.V_SCROLL) != 0) scrollWidget.setHasVerticalScroller(true); scrollWidget.setAutohidesScrollers(true); scrollWidget.setBorderType((style & SWT.BORDER) != 0 ? OS.NSBezelBorder : OS.NSNoBorder); - + NSTableView widget = (NSTableView)new SWTTableView().alloc(); widget.init(); widget.setAllowsMultipleSelection((style & SWT.MULTI) != 0); @@ -266,12 +266,12 @@ void createHandle () { widget.setIntercellSpacing(spacing); widget.setDoubleAction(OS.sel_sendDoubleSelection); if (!hasBorder()) widget.setFocusRingType(OS.NSFocusRingTypeNone); - + column = (NSTableColumn)new NSTableColumn().alloc(); column = column.initWithIdentifier(NSString.stringWith(String.valueOf(++NEXT_ID))); column.setWidth(0); widget.addTableColumn (column); - + scrollView = scrollWidget; view = widget; } @@ -321,7 +321,7 @@ public void deselect (int index) { /** * Deselects the items at the given zero-relative indices in the receiver. - * If the item at the given zero-relative index in the receiver + * If the item at the given zero-relative index in the receiver * is selected, it is deselected. If the item at the index * was not selected, it remains deselected. The range of the * indices is inclusive. Indices that are out of range are ignored. @@ -354,7 +354,7 @@ public void deselect (int start, int end) { /** * Deselects the items at the given zero-relative indices in the receiver. - * If the item at the given zero-relative index in the receiver + * If the item at the given zero-relative index in the receiver * is selected, it is deselected. If the item at the index * was not selected, it remains deselected. Indices that are out * of range and duplicate indices are ignored. @@ -515,11 +515,11 @@ public int getItemHeight () { /** * Returns a (possibly empty) array of <code>String</code>s which - * are the items in the receiver. + * are the items in the receiver. * <p> * Note: This is not the actual structure used by the receiver * to maintain its list of items, so modifying the array will - * not affect the receiver. + * not affect the receiver. * </p> * * @return the items in the receiver's list @@ -543,7 +543,7 @@ public String [] getItems () { * <p> * Note: This is not the actual structure used by the receiver * to maintain its selection, so modifying the array will - * not affect the receiver. + * not affect the receiver. * </p> * @return an array representing the selection * @@ -615,7 +615,7 @@ public int getSelectionIndex () { * <p> * Note: This is not the actual structure used by the receiver * to maintain its selection, so modifying the array will - * not affect the receiver. + * not affect the receiver. * </p> * @return the array of indices of the selected items * @@ -694,7 +694,7 @@ public int indexOf (String string) { } /** - * Searches the receiver's list starting at the given, + * Searches the receiver's list starting at the given, * zero-relative index until an item is found that is equal * to the argument, and returns the index of that item. If * no item is found or the starting index is out of range, @@ -742,21 +742,21 @@ public boolean isSelected (int index) { /* * Feature in Cocoa: Table views do not change the selection when the user - * right-clicks or control-clicks on an NSTableView or its subclasses. Fix is to select the + * right-clicks or control-clicks on an NSTableView or its subclasses. Fix is to select the * clicked-on row ourselves. */ @Override long /*int*/ menuForEvent(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) { NSEvent event = new NSEvent(theEvent); NSTableView table = (NSTableView)view; - - // get the current selections for the outline view. + + // get the current selections for the outline view. NSIndexSet selectedRowIndexes = table.selectedRowIndexes(); - + // select the row that was clicked before showing the menu for the event NSPoint mousePoint = view.convertPoint_fromView_(event.locationInWindow(), null); long /*int*/ row = table.rowAtPoint(mousePoint); - + // figure out if the row that was just clicked on is currently selected if (selectedRowIndexes.containsIndex(row) == false) { NSIndexSet set = (NSIndexSet)new NSIndexSet().alloc(); @@ -765,7 +765,7 @@ long /*int*/ menuForEvent(long /*int*/ id, long /*int*/ sel, long /*int*/ theEve set.release(); } // else that row is currently selected, so don't change anything. - + return super.menuForEvent(id, sel, theEvent); } @@ -806,7 +806,7 @@ void releaseHandle () { } @Override -void releaseWidget () { +void releaseWidget () { super.releaseWidget (); items = null; } @@ -841,7 +841,7 @@ void remove (int index, boolean fixScroll) { /** * Removes the items from the receiver which are - * between the given zero-relative start and end + * between the given zero-relative start and end * indices (inclusive). * * @param start the start of the range @@ -868,7 +868,7 @@ public void remove (int start, int end) { /** * Searches the receiver's list starting at the first item - * until an item is found that is equal to the argument, + * until an item is found that is equal to the argument, * and removes that item from the list. * * @param string the item to remove @@ -970,7 +970,7 @@ public void removeSelectionListener(SelectionListener listener) { } /** - * Selects the item at the given zero-relative index in the receiver's + * Selects the item at the given zero-relative index in the receiver's * list. If the item at the index was already selected, it remains * selected. Indices that are out of range are ignored. * @@ -1013,7 +1013,7 @@ public void select (int index) { * <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> - * + * * @see List#setSelection(int,int) */ public void select (int start, int end) { @@ -1057,7 +1057,7 @@ public void select (int start, int end) { * <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> - * + * * @see List#setSelection(int[]) */ public void select (int [] indices) { @@ -1147,7 +1147,7 @@ boolean sendMouseEvent (NSEvent nsEvent, int type, boolean send) { mouseIsDown = true; } else if (type == SWT.MouseUp || type == SWT.DragDetect) { mouseIsDown = false; - + if (rowsChanged) { rowsChanged = false; ((NSTableView)view).noteNumberOfRowsChanged(); @@ -1263,7 +1263,7 @@ boolean setScrollWidth () { } /** - * Selects the item at the given zero-relative index in the receiver. + * Selects the item at the given zero-relative index in the receiver. * If the item at the index was already selected, it remains selected. * The current selection is first cleared, then the new item is selected, * and if necessary the receiver is scrolled to make the new selection visible. @@ -1502,13 +1502,13 @@ long /*int*/ tableView_objectValueForTableColumn_row(long /*int*/ id, long /*int long /*int*/ tableView_selectionIndexesForProposedSelection (long /*int*/ id, long /*int*/ sel, long /*int*/ aTableView, long /*int*/ indexSet) { if ((style & SWT.SINGLE) != 0) { /* - * Feature in Cocoa. Calling setAllowsEmptySelection will automatically select the first row of the list. + * Feature in Cocoa. Calling setAllowsEmptySelection will automatically select the first row of the list. * And, single-selection NSTable/OutlineViews allow the user to de-select the selected item via command-click. * This is normal platform behavior, but for compatibility with other platforms, if the SINGLE style is in use, - * force a selection by seeing if the proposed selection set is empty, and if so, put back the currently selected row. + * force a selection by seeing if the proposed selection set is empty, and if so, put back the currently selected row. */ NSIndexSet indexes = new NSIndexSet(indexSet); - NSTableView table = new NSTableView(aTableView); + NSTableView table = new NSTableView(aTableView); if (indexes.count() != 1 && table.selectedRow() != -1) { NSIndexSet newSelection = (NSIndexSet)new NSIndexSet().alloc(); newSelection = newSelection.initWithIndex(table.selectedRow()); @@ -1516,13 +1516,13 @@ long /*int*/ tableView_selectionIndexesForProposedSelection (long /*int*/ id, lo return newSelection.id; } } - + return indexSet; } -void updateRowCount() { +void updateRowCount() { /* - * Feature in Cocoa. Changing the row count while the mouse is tracking will confuse the code that calculates the + * Feature in Cocoa. Changing the row count while the mouse is tracking will confuse the code that calculates the * current selection. Fix is to not call noteNumberOfRowsChanged if the mouse is down. */ if (mouseIsDown) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Menu.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Menu.java index 0fd8fd477a..5e76548049 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Menu.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Menu.java @@ -83,7 +83,7 @@ public Menu (Control parent) { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -258,7 +258,7 @@ void _setVisible (boolean visible) { location = window.mouseLocationOutsideOfEventStream(); } hasLocation = false; - + // Hold on to window in case it is disposed while the popup is open. window.retain(); // NSMenu processes events on its own while the popup is open. @@ -332,8 +332,8 @@ void createHandle () { NSMenu widget = (NSMenu)new SWTMenu().alloc(); widget = widget.initWithTitle(NSString.string()); widget.setAutoenablesItems(false); - widget.setDelegate(widget); - nsMenu = widget; + widget.setDelegate(widget); + nsMenu = widget; } else { nsMenu.retain(); long /*int*/ cls = OS.object_getClass(nsMenu.id); @@ -341,7 +341,7 @@ void createHandle () { if (cls != dynNSMenu_class) { OS.object_setClass(nsMenu.id, dynNSMenu_class); } - nsMenu.setDelegate(nsMenu); + nsMenu.setDelegate(nsMenu); } } @@ -378,10 +378,10 @@ void createItem (MenuItem item, int index) { if (nsItem.isSeparatorItem()) type = SWT.SEPARATOR; if (nsItem.submenu() != null) type = SWT.CASCADE; item.style |= type; - + // Sync native item text to Item's text. item.text = nsItem.title().getString(); - + // Sync native key equivalent to MenuItem's accelerator. // The system menu on OS X only uses command and option, so it's // safe to just check for those two key masks. @@ -494,7 +494,7 @@ public MenuItem getDefaultItem () { * <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> - * + * * @see #isEnabled */ public boolean getEnabled () { @@ -540,11 +540,11 @@ public int getItemCount () { /** * Returns a (possibly empty) array of <code>MenuItem</code>s which - * are the items in the receiver. + * are the items in the receiver. * <p> * Note: This is not the actual structure used by the receiver * to maintain its list of items, so modifying the array will - * not affect the receiver. + * not affect the receiver. * </p> * * @return the items in the receiver @@ -593,12 +593,12 @@ String getNameText () { * constants <code>SWT.LEFT_TO_RIGHT</code> or <code>SWT.RIGHT_TO_LEFT</code>. * * @return the orientation style - * + * * @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 getOrientation () { @@ -660,7 +660,7 @@ public Menu getParentMenu () { * Returns the receiver's shell. For all controls other than * shells, this simply returns the control's nearest ancestor * shell. Shells return themselves, even if they are children - * of other shells. Returns null if receiver or its ancestor + * of other shells. Returns null if receiver or its ancestor * is the application menubar. * * @return the receiver's shell or null @@ -699,7 +699,7 @@ public Shell getShell () { public boolean getVisible () { checkWidget (); if ((style & SWT.BAR) != 0) { - if (this == display.appMenuBar) + if (this == display.appMenuBar) return display.application.isActive(); else return this == parent.menuShell ().menuBar; @@ -716,7 +716,7 @@ public boolean getVisible () { /** * Searches the receiver's list starting at the first item - * (index 0) until an item is found that is equal to the + * (index 0) until an item is found that is equal to the * argument, and returns the index of that item. If no item * is found, returns -1. * @@ -752,7 +752,7 @@ public int indexOf (MenuItem item) { * <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> - * + * * @see #getEnabled */ public boolean isEnabled () { @@ -836,7 +836,7 @@ void menuWillOpen(long /*int*/ id, long /*int*/ sel, long /*int*/ menu) { tab -= (nsImage.size().width + GAP); } NSMutableAttributedString str = new NSMutableAttributedString(strs[i].mutableCopy()); - + /* Append accelerator text */ NSString label = (NSString) new NSString().alloc(); label = label.initWithString(accelText); @@ -847,7 +847,7 @@ void menuWillOpen(long /*int*/ id, long /*int*/ sel, long /*int*/ menu) { label.release(); str.appendAttributedString(attribStr); attribStr.release(); - + /* Align accelerator text */ NSRange range = new NSRange(); range.length = str.length(); @@ -859,7 +859,7 @@ void menuWillOpen(long /*int*/ id, long /*int*/ sel, long /*int*/ menu) { stop.release(); str.addAttribute(OS.NSParagraphStyleAttributeName, paragraphStyle, range); paragraphStyle.release (); - + nsItem.setAttributedTitle(str); str.release(); } @@ -986,11 +986,11 @@ void reskinChildren (int flags) { /** * Sets the default menu item to the argument or removes * the default emphasis when the argument is <code>null</code>. - * + * * @param item the default menu item or null * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the menu item has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the menu item has been disposed</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> @@ -1031,7 +1031,7 @@ public void setEnabled (boolean enabled) { * Feature in the Macintosh. When a cascade menu * item is disabled, rather than disabling the item, * the submenu is disabled. - * + * * There is no fix for this at this time. */ item.nsItem.setEnabled (enabled && item.getEnabled ()); @@ -1087,7 +1087,7 @@ public void setLocation (int x, int y) { * <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 2.1 */ public void setLocation (Point location) { @@ -1102,13 +1102,13 @@ public void setLocation (Point location) { * <p> * * @param orientation new orientation style - * + * * @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 + * + * @since 3.7 */ public void setOrientation (int orientation) { checkWidget (); @@ -1116,7 +1116,7 @@ public void setOrientation (int orientation) { /** * Marks the receiver as visible if the argument is <code>true</code>, - * and marks it invisible otherwise. + * and marks it invisible otherwise. * <p> * If one of the receiver's ancestors is not visible or some * other condition makes the receiver not visible, marking @@ -1140,5 +1140,5 @@ public void setVisible (boolean visible) { _setVisible(false); } } - + } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/MenuItem.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/MenuItem.java index 5077dd41bc..66ee2b2d43 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/MenuItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/MenuItem.java @@ -18,7 +18,7 @@ import org.eclipse.swt.events.*; /** * Instances of this class represent a selectable user interface object - * that issues notification when pressed and released. + * that issues notification when pressed and released. * <dl> * <dt><b>Styles:</b></dt> * <dd>CHECK, CASCADE, PUSH, RADIO, SEPARATOR</dd> @@ -51,7 +51,7 @@ public class MenuItem extends Item { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -91,7 +91,7 @@ public MenuItem (Menu parent, int style) { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -128,7 +128,7 @@ public MenuItem (Menu parent, int style, int index) { MenuItem (Menu parent, NSMenuItem nsMenuItem) { super(parent, 0); this.parent = parent; - this.nsItem = nsMenuItem; + this.nsItem = nsMenuItem; parent.createItem(this, parent.getItemCount ()); } @@ -195,11 +195,11 @@ public void addHelpListener (HelpListener listener) { * </p> * <p> * When the <code>SWT.RADIO</code> style bit is set, the <code>widgetSelected</code> method is - * also called when the receiver loses selection because another item in the same radio group + * also called when the receiver loses selection because another item in the same radio group * was selected by the user. During <code>widgetSelected</code> the application can use * <code>getSelection()</code> to determine the current selected state of the receiver. * </p> - * + * * @param listener the listener which should be notified when the menu item is selected by the user * * @exception IllegalArgumentException <ul> @@ -282,7 +282,7 @@ public int getAccelerator () { * <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> - * + * * @see #isEnabled */ public boolean getEnabled () { @@ -299,7 +299,7 @@ public boolean getEnabled () { * <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 () { @@ -310,7 +310,7 @@ public int getID () { /** * 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 + * a pull down menu. The sequence of key strokes, button presses * and/or button releases that are used to request a pull down * menu is platform specific. * @@ -396,7 +396,7 @@ public String getToolTipText () { * <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> - * + * * @see #getEnabled */ public boolean isEnabled () { @@ -413,7 +413,7 @@ int keyChar (int key) { case SWT.LF: return OS.NSNewlineCharacter; case SWT.TAB: return OS.NSTabCharacter; // case ' ': return OS.kMenuBlankGlyph; -// case ' ': return OS.kMenuSpaceGlyph; +// case ' ': return OS.kMenuSpaceGlyph; case SWT.ALT: return 0x2325; case SWT.SHIFT: return 0x21E7; case SWT.CONTROL: return 0xF2303; @@ -553,7 +553,7 @@ public void removeSelectionListener (SelectionListener listener) { if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; eventTable.unhook (SWT.Selection, listener); - eventTable.unhook (SWT.DefaultSelection,listener); + eventTable.unhook (SWT.DefaultSelection,listener); } @Override @@ -672,7 +672,7 @@ public void setEnabled (boolean enabled) { * <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) { @@ -746,13 +746,13 @@ public void setMenu (Menu menu) { if (parent.parent != null && menu.parent != parent.parent) { error (SWT.ERROR_INVALID_PARENT); } - } + } /* Assign the new menu */ Menu oldMenu = this.menu; if (oldMenu == menu) return; if (oldMenu != null) oldMenu.cascade = null; this.menu = menu; - + /* Update the menu in the OS */ if (menu == null) { NSMenu emptyMenu = createEmptyMenu (); @@ -764,7 +764,7 @@ public void setMenu (Menu menu) { menu.cascade = this; nsItem.setSubmenu (menu.nsMenu); } - + if (menu != null) { nsItem.setTarget(null); nsItem.setAction(0); @@ -829,7 +829,7 @@ public void setSelection (boolean selected) { * accelerator key sequence. The accelerator key sequence * is installed using #setAccelerator. * </p> - * + * * @param string the new text * * @exception IllegalArgumentException <ul> @@ -839,7 +839,7 @@ public void setSelection (boolean selected) { * <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> - * + * * @see #setAccelerator */ @Override @@ -861,7 +861,7 @@ public void setText (String string) { * causing no tool tip text to be shown. * <p> * The mnemonic indicator (character '&') is not displayed in a tool tip. - * To display a single '&' in the tool tip, the character '&' can be + * To display a single '&' in the tool tip, the character '&' can be * escaped by doubling it in the string. * </p> * <p> @@ -893,7 +893,7 @@ public void setToolTipText (String toolTip) { int length = fixMnemonic (chars); nsItem.setToolTip (NSString.stringWithCharacters (chars, length)); } - + void updateText () { if (isDisposed() || parent.isDisposed()) return; char [] buffer = new char [text.length ()]; @@ -929,7 +929,7 @@ void updateText () { * Feature in Cocoa. Setting the attributed title on an NSMenuItem * also sets the title, but clearing the attributed title does not * clear the title. The fix is to explicitly set the title to an - * empty string in this case. + * empty string in this case. */ if (text.length() == 0) nsItem.setTitle(NSString.string()); attribStr.release(); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/MessageBox.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/MessageBox.java index 1950dcd17d..87bd5f646f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/MessageBox.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/MessageBox.java @@ -64,7 +64,7 @@ public MessageBox (Shell parent) { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -80,7 +80,7 @@ public MessageBox (Shell parent) { * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li> * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li> * </ul> - * + * * @see SWT#ICON_ERROR * @see SWT#ICON_INFORMATION * @see SWT#ICON_QUESTION @@ -144,7 +144,7 @@ public int open () { if ((style & SWT.ICON_WARNING) != 0) alertType = OS.NSWarningAlertStyle; if ((style & SWT.ICON_WORKING) != 0) alertType = OS.NSInformationalAlertStyle; alert.setAlertStyle(alertType); - + int mask = (SWT.YES | SWT.NO | SWT.OK | SWT.CANCEL | SWT.ABORT | SWT.RETRY | SWT.IGNORE); int bits = style & mask; NSString title; @@ -178,7 +178,7 @@ public int open () { alert.addButtonWithTitle(title); // no.setKeyEquivalent(NSString.stringWith("\033")); break; - case SWT.YES | SWT.NO | SWT.CANCEL: + case SWT.YES | SWT.NO | SWT.CANCEL: title = NSString.stringWith(SWT.getMessage("SWT_Yes")); alert.addButtonWithTitle(title); title = NSString.stringWith(SWT.getMessage("SWT_Cancel")); @@ -276,7 +276,7 @@ public int open () { return SWT.NO; } break; - case SWT.YES | SWT.NO | SWT.CANCEL: + case SWT.YES | SWT.NO | SWT.CANCEL: switch (response) { case OS.NSAlertFirstButtonReturn: return SWT.YES; @@ -320,7 +320,7 @@ void panelDidEnd_returnCode_contextInfo(long /*int*/ id, long /*int*/ sel, long * visible on the dialog while it is open. * * @param string the message - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the string is null</li> * </ul> diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ProgressBar.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ProgressBar.java index 1fa2eade66..85096fc263 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ProgressBar.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ProgressBar.java @@ -38,7 +38,7 @@ import org.eclipse.swt.*; * @noextend This class is not intended to be subclassed by clients. */ public class ProgressBar extends Control { - + NSBezierPath visiblePath; /** @@ -47,7 +47,7 @@ public class ProgressBar extends Control { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -124,13 +124,13 @@ void _drawThemeProgressArea (long /*int*/ id, long /*int*/ sel, long /*int*/ arg */ NSRect frame = view.frame(); if (frame.width == 0 || frame.height == 0) return; - + /* * Bug in Cocoa. When the progress bar is animating it calls * _drawThemeProgressArea() directly without taking into account * obscured areas. The fix is to clip the drawing to the visible * region of the progress bar before calling super. - */ + */ if (visiblePath == null) { long /*int*/ visibleRegion = getVisibleRegion(); visiblePath = getPath(visibleRegion); @@ -140,7 +140,7 @@ void _drawThemeProgressArea (long /*int*/ id, long /*int*/ sel, long /*int*/ arg context.saveGraphicsState(); visiblePath.setClip(); super._drawThemeProgressArea (id, sel, arg0); - context.restoreGraphicsState(); + context.restoreGraphicsState(); } /** @@ -196,13 +196,13 @@ public int getSelection () { * <li>{@link SWT#PAUSED}</li> * </ul> * - * @return the state + * @return the state * * @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.4 */ public int getState () { @@ -296,14 +296,14 @@ public void setSelection (int value) { * Note: This operation is a hint and is not supported on * platforms that do not have this concept. * </p> - * + * * @param state the new state * * @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.4 */ public void setState (int state) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Sash.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Sash.java index 145a62110b..e17010551a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Sash.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Sash.java @@ -44,14 +44,14 @@ public class Sash extends Control { private final static int INCREMENT = 1; private final static int PAGE_INCREMENT = 9; NSArray accessibilityAttributes = null; - + /** * Constructs a new instance of this class given its parent * and a style value describing its behavior and appearance. * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -121,7 +121,7 @@ long /*int*/ accessibilityAttributeNames(long /*int*/ id, long /*int*/ sel) { accessibilityAttributes = ourAttributes; accessibilityAttributes.retain(); } - + return accessibilityAttributes.id; } @@ -129,10 +129,10 @@ long /*int*/ accessibilityAttributeNames(long /*int*/ id, long /*int*/ sel) { long /*int*/ accessibilityAttributeValue(long /*int*/ id, long /*int*/ sel, long /*int*/ arg0) { long /*int*/ returnValue = 0; NSString attributeName = new NSString(arg0); - + if (accessible != null) { id returnObject = accessible.internal_accessibilityAttributeValue(attributeName, ACC.CHILDID_SELF); - + if (returnObject != null) returnValue = returnObject.id; } @@ -174,8 +174,8 @@ long /*int*/ accessibilityAttributeValue(long /*int*/ id, long /*int*/ sel, long } } } - - if (nextView != null) + + if (nextView != null) return NSArray.arrayWithObject(nextView.view).id; else return NSArray.array().id; @@ -190,8 +190,8 @@ long /*int*/ accessibilityAttributeValue(long /*int*/ id, long /*int*/ sel, long } } } - - if (nextView != null) + + if (nextView != null) return NSArray.arrayWithObject(nextView.view).id; else return NSArray.array().id; @@ -202,7 +202,7 @@ long /*int*/ accessibilityAttributeValue(long /*int*/ id, long /*int*/ sel, long @Override boolean accessibilityIsIgnored(long /*int*/ id, long /*int*/ sel) { - return false; + return false; } /** @@ -314,7 +314,7 @@ boolean sendKeyEvent(NSEvent nsEvent, int type) { if (keyCode == 123 || keyCode == 124) break; yChange = keyCode == 126 ? -stepSize : stepSize; } - + Rectangle bounds = getBounds (); int width = bounds.width, height = bounds.height; Rectangle parentBounds = parent.getBounds (); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scale.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scale.java index 76deb57061..8d522fe04c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scale.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scale.java @@ -49,7 +49,7 @@ public class Scale extends Control { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -117,7 +117,7 @@ public Point computeSize (int wHint, int hHint, boolean changed) { NSSlider widget = (NSSlider)view; double /*float*/ thickness = widget.knobThickness(); int width = DEFAULT_WIDTH, height = DEFAULT_HEIGHT; - if ((style & SWT.HORIZONTAL) != 0) { + if ((style & SWT.HORIZONTAL) != 0) { height = (int)Math.ceil(thickness); width = height * 10; } else { @@ -265,7 +265,7 @@ public void removeSelectionListener(SelectionListener listener) { @Override void sendSelection () { NSEvent currEvent = NSApplication.sharedApplication().currentEvent(); - + if (currEvent.type() != OS.NSLeftMouseUp) sendSelectionEvent (SWT.Selection); } @@ -273,7 +273,7 @@ void sendSelection () { /** * Sets the amount that the receiver's value will be * modified by when the up/down (or right/left) arrows - * are pressed to the argument, which must be at least + * are pressed to the argument, which must be at least * one. * * @param increment the new increment (must be greater than zero) diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ScrollBar.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ScrollBar.java index 9f1407a36c..3527fcaaec 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ScrollBar.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ScrollBar.java @@ -10,7 +10,7 @@ *******************************************************************************/ package org.eclipse.swt.widgets; - + import org.eclipse.swt.*; import org.eclipse.swt.events.*; import org.eclipse.swt.graphics.*; @@ -18,9 +18,9 @@ import org.eclipse.swt.internal.cocoa.*; /** * Instances of this class are selectable user interface - * objects that represent a range of positive, numeric values. + * objects that represent a range of positive, numeric values. * <p> - * At any given moment, a given scroll bar will have a + * At any given moment, a given scroll bar will have a * single 'selection' that is considered to be its * value, which is constrained to be within the range of * values the scroll bar represents (that is, between its @@ -60,7 +60,7 @@ import org.eclipse.swt.internal.cocoa.*; * have no operating system resources and are not children of the control. * For this reason, scroll bars are treated specially. To create a control * that looks like a scroll bar but has operating system resources, use - * <code>Slider</code>. + * <code>Slider</code>. * </p> * <dl> * <dt><b>Styles:</b></dt> @@ -162,7 +162,7 @@ boolean getDrawing () { * <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> - * + * * @see #isEnabled */ public boolean getEnabled () { @@ -305,14 +305,14 @@ public int getThumb () { /** * Returns a rectangle describing the size and location of the * receiver's thumb relative to its parent. - * + * * @return the thumb bounds, relative to the {@link #getParent() parent} * * @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.6 */ public Rectangle getThumbBounds () { @@ -326,14 +326,14 @@ public Rectangle getThumbBounds () { * Returns a rectangle describing the size and location of the * receiver's thumb track relative to its parent. This rectangle * comprises the areas 2, 3, and 4 as described in {@link ScrollBar}. - * + * * @return the thumb track bounds, relative to the {@link #getParent() parent} * * @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.6 */ public Rectangle getThumbTrackBounds () { @@ -377,7 +377,7 @@ public boolean getVisible () { * <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> - * + * * @see #getEnabled */ public boolean isEnabled () { @@ -512,7 +512,7 @@ void sendSelection () { /** * Sets the amount that the receiver's value will be * modified by when the up/down (or right/left) arrows - * are pressed to the argument, which must be at least + * are pressed to the argument, which must be at least * one. * * @param value the new increment (must be greater than zero) @@ -651,11 +651,11 @@ public void setSelection (int selection) { } /** - * Sets the thumb value. The thumb value should be used to represent + * Sets the thumb value. The thumb value should be used to represent * the size of the visual portion of the current range. This value is * usually the same as the page increment value. * <p> - * This new value will be ignored if it is less than one, and will be + * This new value will be ignored if it is less than one, and will be * clamped if it exceeds the receiver's current range. * </p> * @@ -680,7 +680,7 @@ public void setThumb (int value) { * value, thumb, increment and page increment all at once. * <p> * Note: This is similar to setting the values individually - * using the appropriate methods, but may be implemented in a + * using the appropriate methods, but may be implemented in a * more efficient fashion on some platforms. * </p> * @@ -713,7 +713,7 @@ public void setValues (int selection, int minimum, int maximum, int thumb, int i /** * Marks the receiver as visible if the argument is <code>true</code>, - * and marks it invisible otherwise. + * and marks it invisible otherwise. * <p> * If one of the receiver's ancestors is not visible or some * other condition makes the receiver not visible, marking diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scrollable.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scrollable.java index ca17afbc94..e85917ff44 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scrollable.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scrollable.java @@ -35,7 +35,7 @@ import org.eclipse.swt.internal.cocoa.*; public abstract class Scrollable extends Control { NSScrollView scrollView; ScrollBar horizontalBar, verticalBar; - + Scrollable () { /* Do nothing */ } @@ -46,7 +46,7 @@ Scrollable () { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -86,7 +86,7 @@ public Scrollable (Composite parent, int style) { * rectangle described by the arguments (relative to the * receiver's parent). * </p> - * + * * @param x the desired x coordinate of the client area * @param y the desired y coordinate of the client area * @param width the desired width of the client area @@ -182,7 +182,7 @@ void deregister () { * Returns a rectangle which describes the area of the * receiver which is capable of displaying data (that is, * not covered by the "trimmings"). - * + * * @return the client area * * @exception SWTException <ul> @@ -228,18 +228,18 @@ public ScrollBar getHorizontalBar () { * <li><code>SWT.SCROLLBAR_OVERLAY</code> - if receiver * uses overlay scrollbars</li> * <li><code>SWT.NONE</code> - otherwise</li> - * + * * @return the mode of scrollbars - * + * * @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> - * + * * @see SWT#SCROLLBAR_OVERLAY - * + * * @since 3.8 */ public int getScrollbarsMode () { @@ -407,7 +407,7 @@ NSView topView () { void updateCursorRects (boolean enabled) { super.updateCursorRects (enabled); if (scrollView == null) return; - updateCursorRects (enabled, scrollView); + updateCursorRects (enabled, scrollView); NSClipView contentView = scrollView.contentView (); updateCursorRects (enabled, contentView); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java index 0d3134888f..cd30676117 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java @@ -21,20 +21,20 @@ import org.eclipse.swt.internal.cocoa.*; * Instances of this class represent the "windows" * which the desktop or "window manager" is managing. * Instances that do not have a parent (that is, they - * are built using the constructor, which takes a + * are built using the constructor, which takes a * <code>Display</code> as the argument) are described * as <em>top level</em> shells. Instances that do have * a parent are described as <em>secondary</em> or * <em>dialog</em> shells. * <p> - * Instances are always displayed in one of the maximized, + * Instances are always displayed in one of the maximized, * minimized or normal states: * <ul> * <li> * When an instance is marked as <em>maximized</em>, the * window manager will typically resize it to fill the * entire visible area of the display, and the instance - * is usually put in a state where it can not be resized + * is usually put in a state where it can not be resized * (even if it has style <code>RESIZE</code>) until it is * no longer maximized. * </li><li> @@ -92,19 +92,19 @@ import org.eclipse.swt.internal.cocoa.*; * <dt><code>SHELL_TRIM</code></dt> * <dd> * the result of combining the constants which are required - * to produce a typical application top level shell: (that + * to produce a typical application top level shell: (that * is, <code>CLOSE | TITLE | MIN | MAX | RESIZE</code>) * </dd> * <dt><code>DIALOG_TRIM</code></dt> * <dd> * the result of combining the constants which are required - * to produce a typical application dialog shell: (that + * to produce a typical application dialog shell: (that * is, <code>TITLE | CLOSE | BORDER</code>) * </dd> * </dl> * </p> * <p> - * Note: Only one of the styles APPLICATION_MODAL, MODELESS, + * Note: Only one of the styles APPLICATION_MODAL, MODELESS, * PRIMARY_MODAL and SYSTEM_MODAL may be specified. * </p><p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. @@ -134,7 +134,7 @@ public class Shell extends Decorations { ToolBar toolBar; Map windowEmbedCounts; MenuItem escMenuItem; - + static int DEFAULT_CLIENT_WIDTH = -1; static int DEFAULT_CLIENT_HEIGHT = -1; @@ -158,7 +158,7 @@ public Shell () { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -171,7 +171,7 @@ public Shell () { * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li> * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li> * </ul> - * + * * @see SWT#BORDER * @see SWT#CLOSE * @see SWT#MIN @@ -199,7 +199,7 @@ public Shell (int style) { * <p> * Note: Currently, null can be passed in for the display argument. * This has the effect of creating the shell on the currently active - * display if there is one. If there is no current display, the + * display if there is one. If there is no current display, the * shell is created on a "default" display. <b>Passing in null as * the display argument is not considered to be good coding style, * and may not be supported in a future release of SWT.</b> @@ -223,7 +223,7 @@ public Shell (Display display) { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -231,7 +231,7 @@ public Shell (Display display) { * </p><p> * Note: Currently, null can be passed in for the display argument. * This has the effect of creating the shell on the currently active - * display if there is one. If there is no current display, the + * display if there is one. If there is no current display, the * shell is created on a "default" display. <b>Passing in null as * the display argument is not considered to be good coding style, * and may not be supported in a future release of SWT.</b> @@ -244,7 +244,7 @@ public Shell (Display display) { * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li> * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li> * </ul> - * + * * @see SWT#BORDER * @see SWT#CLOSE * @see SWT#MIN @@ -275,7 +275,7 @@ Shell (Display display, Shell parent, int style, long /*int*/handle, boolean emb error (SWT.ERROR_THREAD_INVALID_ACCESS); } if (parent != null && parent.isDisposed ()) { - error (SWT.ERROR_INVALID_ARGUMENT); + error (SWT.ERROR_INVALID_ARGUMENT); } if (!Display.getSheetEnabled ()) { this.center = parent != null && (style & SWT.SHEET) != 0; @@ -301,7 +301,7 @@ Shell (Display display, Shell parent, int style, long /*int*/handle, boolean emb * <p> * Note: Currently, null can be passed in for the parent. * This has the effect of creating the shell on the currently active - * display if there is one. If there is no current display, the + * display if there is one. If there is no current display, the * shell is created on a "default" display. <b>Passing in null as * the parent is not considered to be good coding style, * and may not be supported in a future release of SWT.</b> @@ -310,7 +310,7 @@ Shell (Display display, Shell parent, int style, long /*int*/handle, boolean emb * @param parent a shell which will be the parent of the new instance * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the parent is disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the parent is disposed</li> * </ul> * @exception SWTException <ul> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li> @@ -327,7 +327,7 @@ public Shell (Shell parent) { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -335,7 +335,7 @@ public Shell (Shell parent) { * </p><p> * Note: Currently, null can be passed in for the parent. * This has the effect of creating the shell on the currently active - * display if there is one. If there is no current display, the + * display if there is one. If there is no current display, the * shell is created on a "default" display. <b>Passing in null as * the parent is not considered to be good coding style, * and may not be supported in a future release of SWT.</b> @@ -345,13 +345,13 @@ public Shell (Shell parent) { * @param style the style of control to construct * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the parent is disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the parent is disposed</li> * </ul> * @exception SWTException <ul> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li> * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li> * </ul> - * + * * @see SWT#BORDER * @see SWT#CLOSE * @see SWT#MIN @@ -373,7 +373,7 @@ public Shell (Shell parent, int style) { this (parent != null ? parent.display : null, parent, style, 0, false); } -/** +/** * Invokes platform specific functionality to allocate a new shell * that is not embedded. * <p> @@ -387,16 +387,16 @@ public Shell (Shell parent, int style) { * @param display the display for the shell * @param handle the handle for the shell * @return a new shell object containing the specified display and handle - * + * * @noreference This method is not intended to be referenced by clients. - * + * * @since 3.3 */ public static Shell internal_new (Display display, long /*int*/ handle) { return new Shell (display, null, SWT.NO_TRIM, handle, false); } -/** +/** * Invokes platform specific functionality to allocate a new shell * that is 'embedded'. In this case, the handle represents an NSView * that acts as an embedded SWT Shell in an AWT Canvas. @@ -411,9 +411,9 @@ public static Shell internal_new (Display display, long /*int*/ handle) { * @param display the display for the shell * @param handle the handle for the shell * @return a new shell object containing the specified display and handle - * + * * @noreference This method is not intended to be referenced by clients. - * + * * @since 3.5 */ public static Shell cocoa_new (Display display, long /*int*/ handle) { @@ -494,7 +494,7 @@ void attachObserversToWindow(NSWindow newWindow) { OS.object_setClass(hostWindow.id, embeddedSubclass); display.addWidget (hostWindow, this); hostWindowClass = newHostWindowClass; - + if (windowEmbedCounts == null) windowEmbedCounts = new HashMap(); Integer embedCount = (Integer) windowEmbedCounts.get(hostWindow); if (embedCount == null) { @@ -502,7 +502,7 @@ void attachObserversToWindow(NSWindow newWindow) { } embedCount = new Integer(embedCount.intValue() + 1); windowEmbedCounts.put(hostWindow, embedCount); - + // Register for notifications. An embedded shell has no control over the host window, // so it isn't correct to install a delegate. NSNotificationCenter defaultCenter = NSNotificationCenter.defaultCenter(); @@ -687,7 +687,7 @@ void createHandle () { // Feature in Cocoa: NSPanels that use NSUtilityWindowMask are always promoted to the floating window layer. // Fix is to call setFloatingPanel:NO, which turns off this behavior. ((NSPanel)window).setFloatingPanel(false); - // By default, panels hide on deactivation. + // By default, panels hide on deactivation. ((NSPanel)window).setHidesOnDeactivate(false); // Normally a panel doesn't become key unless something inside it needs to be first responder. // TOOL shells always become key, so disable that behavior. @@ -720,14 +720,14 @@ void createHandle () { topView ().setHidden (true); } else { state &= ~HIDDEN; - + if (window != null) { // In the FOREIGN_HANDLE case, 'window' is an NSWindow created on our behalf. // It may already have a content view, so if it does, grab and retain, since we release() // the view at disposal time. Otherwise, create a new 'view' that will be used as the window's // content view in setZOrder. view = window.contentView(); - + if (view == null) { super.createHandle(); } else { @@ -737,14 +737,14 @@ void createHandle () { // In the embedded case, 'view' is already set to the NSView we should add the window's content view to as a subview. // In that case we will hold on to the foreign view, create our own SWTCanvasView (which overwrites 'view') and then // add it to the foreign view. - NSView parentView = view; + NSView parentView = view; super.createHandle(); parentView.addSubview(topView()); } style |= SWT.NO_BACKGROUND; } - + windowDelegate = (SWTWindowDelegate)new SWTWindowDelegate().alloc().init(); if (window == null) { @@ -772,7 +772,7 @@ void createHandle () { // FindWindow() (see Display.findControl()) if (window != null) window.windowRef(); } - + NSWindow fieldEditorWindow = window; if (fieldEditorWindow == null) fieldEditorWindow = view.window(); id id = fieldEditorWindow.fieldEditor (true, null); @@ -802,7 +802,7 @@ void destroyWidget () { Display display = this.display; NSView view = topView(); if (view != null) view.retain(); - + boolean sheet = (style & (SWT.SHEET)) != 0; releaseHandle (); if (window != null) { @@ -815,7 +815,7 @@ void destroyWidget () { view.removeFromSuperview(); } if (view != null) view.release(); - + // If another shell is not going to become active, clear the menu bar. // Don't modify the menu bar if we are an embedded Shell, though. if (window != null) { @@ -859,7 +859,7 @@ boolean fixResize () { * Feature in Cocoa. It is not possible to have a resizable window * without the title bar. The fix is to resize the content view on * top of the title bar. - * + * * Never do this when the shell is embedded, because the window belongs to the AWT. */ if (window == null) return false; @@ -877,10 +877,10 @@ void fixShell (Shell newShell, Control control) { } /** - * If the receiver is visible, moves it to the top of the - * drawing order for the display on which it was created - * (so that all other shells on that display, which are not - * the receiver's children will be drawn behind it) and forces + * If the receiver is visible, moves it to the top of the + * drawing order for the display on which it was created + * (so that all other shells on that display, which are not + * the receiver's children will be drawn behind it) and forces * the window manager to make the shell active. * * @exception SWTException <ul> @@ -916,7 +916,7 @@ public void forceActive () { * <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.4 */ public int getAlpha () { @@ -974,7 +974,7 @@ public Rectangle getClientArea () { /** * Returns <code>true</code> if the receiver is currently - * in fullscreen state, and false otherwise. + * in fullscreen state, and false otherwise. * <p> * * @return the fullscreen state @@ -1003,7 +1003,7 @@ boolean _getFullScreen () { * will be the result of bitwise OR'ing together one or * more of the following constants defined in class * <code>SWT</code>: - * <code>NONE</code>, <code>ROMAN</code>, <code>DBCS</code>, + * <code>NONE</code>, <code>ROMAN</code>, <code>DBCS</code>, * <code>PHONETIC</code>, <code>NATIVE</code>, <code>ALPHA</code>. * * @return the IME mode @@ -1023,7 +1023,7 @@ public int getImeInputMode () { @Override public Point getLocation () { checkWidget(); - + if (window != null) { NSRect frame = window.frame(); double /*float*/ y = display.getPrimaryFrame().height - (int)(frame.y + frame.height); @@ -1081,12 +1081,12 @@ Shell getModalShell () { * Gets the receiver's modified state. * * @return <code>true</code> if the receiver is marked as modified, or <code>false</code> otherwise - * + * * @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.5 */ public boolean getModified () { @@ -1114,7 +1114,7 @@ public boolean getMinimized () { * <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.1 */ public Point getMinimumSize () { @@ -1124,12 +1124,12 @@ public Point getMinimumSize () { return new Point((int)size.width, (int)size.height); } -/** +/** * Returns the region that defines the shape of the shell, * or <code>null</code> if the shell has the default shape. * * @return the region that defines the shape of the shell, or <code>null</code> - * + * * @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> @@ -1152,7 +1152,7 @@ public Shell getShell () { } /** - * Returns an array containing all shells which are + * Returns an array containing all shells which are * descendants of the receiver. * <p> * @return the dialog shells @@ -1202,17 +1202,17 @@ float getThemeAlpha () { /** * Returns a ToolBar object representing the tool bar that can be shown in the receiver's * trim. This will return <code>null</code> if the platform does not support tool bars that - * are not part of the content area of the shell, or if the Shell's style does not support - * having a tool bar. + * are not part of the content area of the shell, or if the Shell's style does not support + * having a tool bar. * <p> - * + * * @return a ToolBar object representing the Shell's tool bar, or <ocde>null</code>. * * @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 ToolBar getToolBar() { @@ -1300,7 +1300,7 @@ void makeKeyAndOrderFront() { * case the parent window does become active when its child is closed * and the user is forced to restore the window from the dock. * The fix is to be sure that the parent window is deminiaturized before - * making the child a key window. + * making the child a key window. */ if (parent != null) { NSWindow parentWindow = parentWindow (); @@ -1317,11 +1317,11 @@ void mouseMoved(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) { * Bug in AWT. WebViews need to have a mouseMove: handled by the window so it can generate * DOMMouseMove events and also provide proper feedback to the window. However, the top-level * view in an AWT window does not have the NSWindow as a next responder. - * + * * Fix is to forward the message to the window if this is an embedded shell (that is, window == null) */ if (id == view.id && window == null) { - view.window().mouseMoved(new NSEvent(theEvent)); + view.window().mouseMoved(new NSEvent(theEvent)); } } @@ -1331,7 +1331,7 @@ void noResponderFor(long /*int*/ id, long /*int*/ sel, long /*int*/ selector) { * Feature in Cocoa. If the selector is keyDown and nothing has handled the event * a system beep is generated. There's no need to beep, as many keystrokes in the SWT * are listened for and acted upon but not explicitly handled in a keyDown handler. Fix is to - * not call the default implementation when a keyDown: is being handled. + * not call the default implementation when a keyDown: is being handled. */ if (selector != OS.sel_keyDown_) super.noResponderFor(id, sel, selector); } @@ -1394,8 +1394,8 @@ public boolean print (GC gc) { void register () { /* * Note that if there are multiple SWT_AWT shells only the last one created - * will be associated with the NSWindow. This is okay, and intentional because - * all of the NSWindow overrides operate on the entire window. + * will be associated with the NSWindow. This is okay, and intentional because + * all of the NSWindow overrides operate on the entire window. */ super.register (); if (window != null) display.addWidget (window, this); @@ -1448,7 +1448,7 @@ void releaseWidget () { } void removeObserversFromWindow () { - NSNotificationCenter.defaultCenter().removeObserver(windowDelegate); + NSNotificationCenter.defaultCenter().removeObserver(windowDelegate); if (hostWindow != null) { Integer embedCount = (Integer) windowEmbedCounts.get(hostWindow); @@ -1541,11 +1541,11 @@ void sendToolTipEvent (boolean enter) { } /** - * If the receiver is visible, moves it to the top of the - * drawing order for the display on which it was created - * (so that all other shells on that display, which are not - * the receiver's children will be drawn behind it) and asks - * the window manager to make the shell active + * If the receiver is visible, moves it to the top of the + * drawing order for the display on which it was created + * (so that all other shells on that display, which are not + * the receiver's children will be drawn behind it) and asks + * the window manager to make the shell active * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> @@ -1562,7 +1562,7 @@ void sendToolTipEvent (boolean enter) { * @see Shell#setActive */ public void setActive () { - if (window == null) return; + if (window == null) return; checkWidget (); if (!isVisible()) return; makeKeyAndOrderFront (); @@ -1576,7 +1576,7 @@ void setActiveControl (Control control, int type) { if (control != null && control.isDisposed ()) control = null; if (lastActive != null && lastActive.isDisposed ()) lastActive = null; if (lastActive == control) return; - + /* * Compute the list of controls to be activated and * deactivated by finding the first common parent @@ -1590,7 +1590,7 @@ void setActiveControl (Control control, int type) { if (activate [index] != deactivate [index]) break; index++; } - + /* * It is possible (but unlikely), that application * code could have destroyed some of the widgets. If @@ -1625,11 +1625,11 @@ void setActiveControl (Control control, int type) { * <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.4 */ public void setAlpha (int alpha) { - if (window == null) return; + if (window == null) return; checkWidget (); alpha &= 0xFF; window.setAlphaValue (alpha / 255f); @@ -1715,12 +1715,12 @@ public void setEnabled (boolean enabled) { * into full screen state, causes the receiver to switch back * to either the maximized or normal states. * <p> - * Note: The result of intermixing calls to <code>setFullScreen(true)</code>, - * <code>setMaximized(true)</code> and <code>setMinimized(true)</code> will - * vary by platform. Typically, the behavior will match the platform user's + * Note: The result of intermixing calls to <code>setFullScreen(true)</code>, + * <code>setMaximized(true)</code> and <code>setMinimized(true)</code> will + * vary by platform. Typically, the behavior will match the platform user's * expectations, but not always. This should be avoided if possible. * </p> - * + * * @param fullScreen the new fullscreen state * * @exception SWTException <ul> @@ -1734,7 +1734,7 @@ public void setFullScreen (boolean fullScreen) { checkWidget (); if (window == null) return; if (_getFullScreen () == fullScreen) return; - + if ((window.collectionBehavior() & OS.NSWindowCollectionBehaviorFullScreenPrimary) != 0) { OS.objc_msgSend(window.id, OS.sel_toggleFullScreen_, 0); return; @@ -1747,14 +1747,14 @@ public void setFullScreen (boolean fullScreen) { if (window.respondsToSelector(OS.sel_setMovable_)) { OS.objc_msgSend(window.id, OS.sel_setMovable_, 0); } - + fullScreenFrame = NSScreen.mainScreen().frame(); if (getMonitor().equals(display.getPrimaryMonitor ())) { if (menuBar != null) { double /*float*/ menuBarHt = NSStatusBar.systemStatusBar().thickness(); fullScreenFrame.height -= menuBarHt; OS.SetSystemUIMode(OS.kUIModeContentHidden, 0); - } + } else { OS.SetSystemUIMode(OS.kUIModeAllHidden, 0); } @@ -1784,10 +1784,10 @@ public void setMenuBar (Menu menu) { } /** - * Sets the input method editor mode to the argument which + * Sets the input method editor mode to the argument which * should be the result of bitwise OR'ing together one or more * of the following constants defined in class <code>SWT</code>: - * <code>NONE</code>, <code>ROMAN</code>, <code>DBCS</code>, + * <code>NONE</code>, <code>ROMAN</code>, <code>DBCS</code>, * <code>PHONETIC</code>, <code>NATIVE</code>, <code>ALPHA</code>. * * @param mode the new IME mode @@ -1837,7 +1837,7 @@ public void setMinimized (boolean minimized) { * <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.1 */ public void setMinimumSize (int width, int height) { @@ -1869,7 +1869,7 @@ public void setMinimumSize (int width, int height) { * <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.1 */ public void setMinimumSize (Point size) { @@ -1888,7 +1888,7 @@ public void setMinimumSize (Point size) { * <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.5 */ public void setModified (boolean modified) { @@ -1912,7 +1912,7 @@ public void setModified (boolean modified) { * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the region has been disposed</li> - * </ul> + * </ul> * @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> @@ -1993,7 +1993,7 @@ void setWindowVisible (boolean visible, boolean key) { if (visible) { display.clearPool (); if (center && !moved) { - if (isDisposed ()) return; + if (isDisposed ()) return; center (); } sendEvent (SWT.Show); @@ -2051,7 +2051,7 @@ void setWindowVisible (boolean visible, boolean key) { if ((style & (SWT.SHEET)) != 0) { NSApplication application = NSApplication.sharedApplication(); application.endSheet(window, 0); - } + } window.orderOut (null); } if (isDisposed()) return; @@ -2059,7 +2059,7 @@ void setWindowVisible (boolean visible, boolean key) { invalidateVisibleRegion(); sendEvent (SWT.Hide); } - + if (isDisposed()) return; display.updateQuitMenu(); @@ -2129,7 +2129,7 @@ void updateParent (boolean visible) { if (parent != null && parent.getVisible ()) { NSWindow parentWindow = display.modalPanel != null ? display.modalPanel : parentWindow (); parentWindow.addChildWindow (window, OS.NSWindowAbove); - + /** * Feature in Cocoa: When a window is added as a child window, * its window level resets to its parent's window level. So, we @@ -2301,9 +2301,9 @@ void windowSendEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ event) { if (trimControl != null && (trimControl.state & WEBKIT_EVENTS_FIX) != 0) trimControl = null; if (trimControl != null) trimControl.sendMouseEvent (nsEvent, type, false); } - + // Tooltip updating: Find the widget under the cursor. If it changed, clear the tooltip from - // the last tracked item and send a tooltip event to make it visible on the new widget. + // the last tracked item and send a tooltip event to make it visible on the new widget. Widget target = null; if (control != null) { NSPoint eventPoint = nsEvent.locationInWindow(); @@ -2316,10 +2316,10 @@ void windowSendEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ event) { eventPoint = eventWindow.convertBaseToScreen(eventPoint); eventPoint = hitView[0].window().convertScreenToBase(eventPoint); } - } + } target = control.findTooltip (eventPoint); } - + if (display.tooltipControl != control || display.tooltipTarget != target) { Control oldControl = display.tooltipControl; Shell oldShell = oldControl != null && !oldControl.isDisposed() ? oldControl.getShell() : null; @@ -2330,11 +2330,11 @@ void windowSendEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ event) { display.tooltipControl = control; display.tooltipTarget = target; break; - + case OS.NSKeyDown: /* * Feature in Cocoa. For some reason, Cocoa does not perform accelerators - * with ESC key code. The fix is to perform the accelerators ourselves. + * with ESC key code. The fix is to perform the accelerators ourselves. */ if (display.escAsAcceleratorPresent && nsEvent.keyCode() == 53 /* ESC */) { if (escMenuItem == null || escMenuItem.getAccelerator() != SWT.ESC) { @@ -2357,7 +2357,7 @@ void windowSendEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ event) { */ if ((nsEvent.modifierFlags() & OS.NSControlKeyMask) != 0) { NSString chars = nsEvent.characters(); - + if (chars != null && chars.length() == 1) { int firstChar = (int)/*64*/chars.characterAtIndex(0); @@ -2374,7 +2374,7 @@ void windowSendEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ event) { } break; } - + // Window may have been disposed at this point. if (isDisposed()) return; super.windowSendEvent (id, sel, event); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Slider.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Slider.java index a2addd1778..ddca6ea935 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Slider.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Slider.java @@ -10,7 +10,7 @@ *******************************************************************************/ package org.eclipse.swt.widgets; - + import org.eclipse.swt.internal.cocoa.*; import org.eclipse.swt.*; @@ -19,9 +19,9 @@ import org.eclipse.swt.graphics.*; /** * Instances of this class are selectable user interface - * objects that represent a range of positive, numeric values. + * objects that represent a range of positive, numeric values. * <p> - * At any given moment, a given slider will have a + * At any given moment, a given slider will have a * single 'selection' that is considered to be its * value, which is constrained to be within the range of * values the slider represents (that is, between its @@ -81,7 +81,7 @@ public class Slider extends Control { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -235,7 +235,7 @@ public int getIncrement () { */ public int getMaximum () { checkWidget(); - return maximum; + return maximum; } /** @@ -362,7 +362,7 @@ void sendSelection () { /** * Sets the amount that the receiver's value will be * modified by when the up/down (or right/left) arrows - * are pressed to the argument, which must be at least + * are pressed to the argument, which must be at least * one. * * @param value the new increment (must be greater than zero) @@ -478,15 +478,15 @@ void updateBar (int selection, int minimum, int maximum, int thumb) { float knob = range <= 0 ? 1 : (float)thumb / (maximum - minimum); widget.setDoubleValue(fraction); widget.setKnobProportion(knob); - widget.setEnabled (range > 0); + widget.setEnabled (range > 0); } /** - * Sets the thumb value. The thumb value should be used to represent + * Sets the thumb value. The thumb value should be used to represent * the size of the visual portion of the current range. This value is * usually the same as the page increment value. * <p> - * This new value will be ignored if it is less than one, and will be + * This new value will be ignored if it is less than one, and will be * clamped if it exceeds the receiver's current range. * </p> * @@ -511,7 +511,7 @@ public void setThumb (int value) { * value, thumb, increment and page increment all at once. * <p> * Note: This is similar to setting the values individually - * using the appropriate methods, but may be implemented in a + * using the appropriate methods, but may be implemented in a * more efficient fashion on some platforms. * </p> * diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Spinner.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Spinner.java index 5df4874e57..181b3739ad 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Spinner.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Spinner.java @@ -36,7 +36,7 @@ import org.eclipse.swt.internal.cocoa.*; * @see <a href="http://www.eclipse.org/swt/snippets/#spinner">Spinner snippets</a> * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a> * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> - * + * * @since 3.1 * @noextend This class is not intended to be subclassed by clients. */ @@ -48,15 +48,15 @@ public class Spinner extends Composite { int digits = 0; int textLimit = LIMIT; static int GAP = 0; - + /** * the operating system limit for the number of characters * that the text field in an instance of this class can hold - * + * * @since 3.4 */ public static final int LIMIT; - + /* * These values can be different on different platforms. * Therefore they are not initialized in the declaration @@ -72,7 +72,7 @@ public class Spinner extends Composite { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -108,7 +108,7 @@ boolean acceptsFirstResponder(long /*int*/ id, long /*int*/ sel) { @Override boolean accessibilityIsIgnored(long /*int*/ id, long /*int*/ sel) { if (id == view.id) return true; - return super.accessibilityIsIgnored(id, sel); + return super.accessibilityIsIgnored(id, sel); } /** @@ -337,7 +337,7 @@ void deregister () { display.removeWidget (textView); display.removeWidget (textView.cell()); } - + if (buttonView != null) { display.removeWidget (buttonView); display.removeWidget (buttonView.cell()); @@ -457,7 +457,7 @@ public int getPageIncrement () { /** * Returns the <em>selection</em>, which is the receiver's position. * - * @return the selection + * @return the selection * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> @@ -520,7 +520,7 @@ int getSelectionText (boolean[] parseFail) { * <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.4 */ public String getText () { @@ -534,16 +534,16 @@ public String getText () { * text field is capable of holding. If this has not been changed * by <code>setTextLimit()</code>, it will be the constant * <code>Spinner.LIMIT</code>. - * + * * @return the text limit - * + * * @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> * * @see #LIMIT - * + * * @since 3.4 */ public int getTextLimit () { @@ -593,7 +593,7 @@ void register () { display.addWidget (textView, this); display.addWidget (textView.cell(), this); } - + if (buttonView != null) { display.addWidget (buttonView, this); display.addWidget (buttonView.cell(), this); @@ -612,7 +612,7 @@ void releaseHandle () { } @Override -void releaseWidget () { +void releaseWidget () { super.releaseWidget (); if (textView != null) textView.abortEditing(); } @@ -638,7 +638,7 @@ public void removeModifyListener (ModifyListener listener) { checkWidget (); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; - eventTable.unhook (SWT.Modify, listener); + eventTable.unhook (SWT.Modify, listener); } /** @@ -663,7 +663,7 @@ public void removeSelectionListener(SelectionListener listener) { if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; eventTable.unhook (SWT.Selection, listener); - eventTable.unhook (SWT.DefaultSelection,listener); + eventTable.unhook (SWT.DefaultSelection,listener); } /** @@ -687,7 +687,7 @@ void removeVerifyListener (VerifyListener listener) { checkWidget (); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; - eventTable.unhook (SWT.Verify, listener); + eventTable.unhook (SWT.Verify, listener); } @Override @@ -758,7 +758,7 @@ boolean sendKeyEvent (NSEvent nsEvent, int type) { } @Override -void sendSelection () { +void sendSelection () { setSelection (getSelection(), false, true, true); } @@ -778,17 +778,17 @@ void setBackgroundImage(NSImage image) { * Sets the number of decimal places used by the receiver. * <p> * The digit setting is used to allow for floating point values in the receiver. - * For example, to set the selection to a floating point value of 1.37 call setDigits() with + * For example, to set the selection to a floating point value of 1.37 call setDigits() with * a value of 2 and setSelection() with a value of 137. Similarly, if getDigits() has a value * of 2 and getSelection() returns 137 this should be interpreted as 1.37. This applies to all - * numeric APIs. + * numeric APIs. * </p> - * + * * @param value the new digits (must be greater than or equal to zero) - * + * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the value is less than zero</li> - * </ul> + * </ul> * @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> @@ -799,7 +799,7 @@ public void setDigits (int value) { if (value < 0) error (SWT.ERROR_INVALID_ARGUMENT); if (value == digits) return; digits = value; - int pos = (int)buttonView.doubleValue(); + int pos = (int)buttonView.doubleValue(); setSelection (pos, false, true, false); } @@ -856,7 +856,7 @@ public void setMaximum (int value) { if (value < min) return; int pos = getSelection(); buttonView.setMaxValue(value); - if (pos > value) setSelection (value, true, true, false); + if (pos > value) setSelection (value, true, true, false); } /** @@ -988,9 +988,9 @@ void setSmallSize () { * <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> - * + * * @see #LIMIT - * + * * @since 3.4 */ public void setTextLimit (int limit) { @@ -1004,7 +1004,7 @@ public void setTextLimit (int limit) { * value, digits, increment and page increment all at once. * <p> * Note: This is similar to setting the values individually - * using the appropriate methods, but may be implemented in a + * using the appropriate methods, but may be implemented in a * more efficient fashion on some platforms. * </p> * @@ -1019,7 +1019,7 @@ public void setTextLimit (int limit) { * <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.2 */ public void setValues (int selection, int minimum, int maximum, int digits, int increment, int pageIncrement) { @@ -1131,7 +1131,7 @@ String verifyText (String string, int start, int end, NSEvent keyEvent) { if (!Character.isDigit (string.charAt (index))) break; index++; } - event.doit = index == string.length (); + event.doit = index == string.length (); /* * It is possible (but unlikely), that application * code could have disposed the widget in the verify diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TabFolder.java index 99bafb6838..adfa21b2c7 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TabFolder.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TabFolder.java @@ -10,7 +10,7 @@ *******************************************************************************/ package org.eclipse.swt.widgets; - + import org.eclipse.swt.internal.cocoa.*; import org.eclipse.swt.*; @@ -51,14 +51,14 @@ public class TabFolder extends Composite { TabItem [] items; int itemCount; boolean ignoreSelect; - + /** * Constructs a new instance of this class given its parent * and a style value describing its behavior and appearance. * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -284,7 +284,7 @@ public TabItem getItem (int index) { * <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.4 */ public TabItem getItem (Point point) { @@ -321,11 +321,11 @@ public int getItemCount () { /** * Returns an array of <code>TabItem</code>s which are the items - * in the receiver. + * in the receiver. * <p> * Note: This is not the actual structure used by the receiver * to maintain its list of items, so modifying the array will - * not affect the receiver. + * not affect the receiver. * </p> * * @return the items in the receiver @@ -350,7 +350,7 @@ public TabItem [] getItems () { * <p> * Note: This is not the actual structure used by the receiver * to maintain its selection, so modifying the array will - * not affect the receiver. + * not affect the receiver. * </p> * @return an array representing the selection * @@ -394,7 +394,7 @@ float getThemeAlpha () { /** * Searches the receiver's list starting at the first item - * (index 0) until an item is found that is equal to the + * (index 0) until an item is found that is equal to the * argument, and returns the index of that item. If no item * is found, returns -1. * @@ -495,7 +495,7 @@ public void removeSelectionListener (SelectionListener listener) { if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; eventTable.unhook (SWT.Selection, listener); - eventTable.unhook (SWT.DefaultSelection,listener); + eventTable.unhook (SWT.DefaultSelection,listener); } @Override @@ -541,7 +541,7 @@ void setForeground (double /*float*/ [] color) { * <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.2 */ public void setSelection (TabItem item) { @@ -579,7 +579,7 @@ public void setSelection (TabItem [] items) { } /** - * Selects the item at the given zero-relative index in the receiver. + * Selects the item at the given zero-relative index in the receiver. * If the item at the index was already selected, it remains selected. * The current selection is first cleared, then the new items are * selected. Indices that are out of range are ignored. diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TabItem.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TabItem.java index 559012223e..351456cccf 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TabItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TabItem.java @@ -48,7 +48,7 @@ public class TabItem extends Item { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -84,7 +84,7 @@ public TabItem (TabFolder parent, int style) { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -116,7 +116,7 @@ public TabItem (TabFolder parent, int style, int index) { @Override long /*int*/ accessibilityAttributeValue (long /*int*/ id, long /*int*/ sel, long /*int*/ arg0) { - + if (id == nsItem.id) { NSString nsAttributeName = new NSString(arg0); @@ -130,7 +130,7 @@ long /*int*/ accessibilityAttributeValue (long /*int*/ id, long /*int*/ sel, lon } } } - + return super.accessibilityAttributeValue(id, sel, arg0); } @@ -168,7 +168,7 @@ void drawLabelInRect(long /*int*/ id, long /*int*/ sel, boolean shouldTruncateLa image.handle.drawInRect(destRect, new NSRect(), OS.NSCompositeSourceOver, 1); NSGraphicsContext.static_restoreGraphicsState(); rect.x += imageSize.width + IMAGE_GAP; - rect.width -= imageSize.width + IMAGE_GAP; + rect.width -= imageSize.width + IMAGE_GAP; } if (attriStr != null) { attriStr.drawInRect(rect); @@ -186,7 +186,7 @@ void drawLabelInRect(long /*int*/ id, long /*int*/ sel, boolean shouldTruncateLa * <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.4 */ public Rectangle getBounds() { @@ -194,7 +194,7 @@ public Rectangle getBounds() { Rectangle result = new Rectangle (0, 0, 0, 0); if (nsItem.respondsToSelector (OS.sel_accessibilityAttributeValue_)) { long /*int*/ posValue = OS.objc_msgSend (nsItem.id, OS.sel_accessibilityAttributeValue_, OS.NSAccessibilityPositionAttribute ()); - long /*int*/ sizeValue = OS.objc_msgSend (nsItem.id, OS.sel_accessibilityAttributeValue_, OS.NSAccessibilitySizeAttribute ()); + long /*int*/ sizeValue = OS.objc_msgSend (nsItem.id, OS.sel_accessibilityAttributeValue_, OS.NSAccessibilitySizeAttribute ()); NSValue val = new NSValue (posValue); NSPoint pt = val.pointValue (); NSWindow window = parent.view.window (); @@ -298,7 +298,7 @@ void releaseWidget () { * @param control the new control (or null) * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the control has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the control has been disposed</li> * <li>ERROR_INVALID_PARENT - if the control is not in the same widget tree</li> * </ul> * @exception SWTException <ul> @@ -324,7 +324,7 @@ public void setControl (Control control) { if (selectionIndex != -1) { Control selectedControl = parent.getItem(selectionIndex).getControl(); if (selectedControl == newControl) hideControl=false; - } + } if (hideControl) newControl.setVisible(false); } } else { @@ -380,7 +380,7 @@ public void setImage (Image image) { * escaped by doubling it in the string, causing a single * '&' to be displayed. * </p> - * + * * @param string the new text * * @exception IllegalArgumentException <ul> @@ -390,7 +390,7 @@ public void setImage (Image image) { * <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> - * + * */ @Override public void setText (String string) { @@ -404,17 +404,17 @@ public void setText (String string) { /** * Sets the receiver's tool tip text to the argument, which - * may be null indicating that the default tool tip for the + * may be null indicating that the default tool tip for the * control will be shown. For a control that has a default * tool tip, such as the Tree control on Windows, setting * the tool tip text to an empty string replaces the default, * causing no tool tip text to be shown. * <p> * The mnemonic indicator (character '&') is not displayed in a tool tip. - * To display a single '&' in the tool tip, the character '&' can be + * To display a single '&' in the tool tip, the character '&' can be * escaped by doubling it in the string. * </p> - * + * * @param string the new tool tip text (or null) * * @exception SWTException <ul> diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java index e225e463a1..615e899141 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java @@ -15,7 +15,7 @@ import org.eclipse.swt.events.*; import org.eclipse.swt.graphics.*; import org.eclipse.swt.internal.cocoa.*; -/** +/** * Instances of this class implement a selectable user interface * object that displays a list of images and strings and issues * notification when selected. @@ -40,7 +40,7 @@ import org.eclipse.swt.internal.cocoa.*; * item.setText ("Item " + index); * System.out.println (item.getText ()); * } - * }); + * }); * </pre></code> * </p><p> * Note that although this class is a subclass of <code>Composite</code>, @@ -77,7 +77,7 @@ public class Table extends Composite { int columnCount, itemCount, lastIndexOf, sortDirection, selectedRowIndex = -1; boolean ignoreSelect, fixScrollWidth, drawExpansion, didSelect, preventSelect, dragDetected; Rectangle imageBounds; - + /* Used to control drop feedback when FEEDBACK_SCROLL is set/not set */ boolean shouldScroll = true; @@ -94,7 +94,7 @@ public class Table extends Composite { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -135,7 +135,7 @@ boolean acceptsFirstResponder (long /*int*/ id, long /*int*/ sel) { long /*int*/ accessibilityAttributeValue(long /*int*/ id, long /*int*/ sel, long /*int*/ arg0) { long /*int*/ returnValue = 0; NSString attributeName = new NSString(arg0); - + // If the check column is visible, don't report it back as a column for accessibility purposes. // The check column is meant to appear as a part of the first column. if (attributeName.isEqualToString (OS.NSAccessibilityColumnsAttribute) || attributeName.isEqualToString(OS.NSAccessibilityVisibleColumnsAttribute)) { @@ -150,7 +150,7 @@ long /*int*/ accessibilityAttributeValue(long /*int*/ id, long /*int*/ sel, long } } } - + if (returnValue != 0) { return returnValue; } else { @@ -244,12 +244,12 @@ NSSize cellSize (long /*int*/ id, long /*int*/ sel) { @Override boolean canDragRowsWithIndexes_atPoint(long /*int*/ id, long /*int*/ sel, long /*int*/ rowIndexes, NSPoint mouseDownPoint) { if (!super.canDragRowsWithIndexes_atPoint(id, sel, rowIndexes, mouseDownPoint)) return false; - + // If the current row is not selected and the user is not attempting to modify the selection, select the row first. NSTableView widget = (NSTableView)view; long /*int*/ row = widget.rowAtPoint(mouseDownPoint); long /*int*/ modifiers = NSApplication.sharedApplication().currentEvent().modifierFlags(); - + boolean drag = (state & DRAG_DETECT) != 0 && hooks (SWT.DragDetect); if (drag) { if (!widget.isRowSelected(row) && (modifiers & (OS.NSCommandKeyMask | OS.NSShiftKeyMask | OS.NSAlternateKeyMask)) == 0) { @@ -259,7 +259,7 @@ boolean canDragRowsWithIndexes_atPoint(long /*int*/ id, long /*int*/ sel, long / set.release(); } } - + // The clicked row must be selected to initiate a drag. return (widget.isRowSelected(row) && drag) || !hasFocus(); } @@ -291,7 +291,7 @@ static int checkStyle (int style) { * WS_VSCROLL is not specified, Windows creates * trees and tables with scroll bars. The fix * is to set H_SCROLL and V_SCROLL. - * + * * NOTE: This code appears on all platforms so that * applications have consistent scroll bar behavior. */ @@ -323,10 +323,10 @@ protected void checkSubclass () { * <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> - * + * * @see SWT#VIRTUAL * @see SWT#SetData - * + * * @since 3.0 */ public void clear (int index) { @@ -356,10 +356,10 @@ public void clear (int index) { * <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> - * + * * @see SWT#VIRTUAL * @see SWT#SetData - * + * * @since 3.0 */ public void clear (int start, int end) { @@ -393,10 +393,10 @@ public void clear (int start, int end) { * <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> - * + * * @see SWT#VIRTUAL * @see SWT#SetData - * + * * @since 3.0 */ public void clear (int [] indices) { @@ -423,10 +423,10 @@ public void clear (int [] indices) { * <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> - * + * * @see SWT#VIRTUAL * @see SWT#SetData - * + * * @since 3.0 */ public void clearAll () { @@ -444,7 +444,7 @@ public void clearAll () { void clearCachedWidth (TableItem[] items) { if (items == null) return; for (int i = 0; i < items.length; i++) { - if (items [i] != null) items [i].width = -1; + if (items [i] != null) items [i].width = -1; } } @@ -453,7 +453,7 @@ long /*int*/ columnAtPoint(long /*int*/ id, long /*int*/ sel, NSPoint point) { if ((style & SWT.CHECK) != 0) { if (point.x <= getCheckColumnWidth() && point.y < headerView.frame().height) return 1; } - + return super.columnAtPoint(id, sel, point); } @@ -536,7 +536,7 @@ void createHandle () { scrollWidget.setHasVerticalScroller ((style & SWT.V_SCROLL) != 0); scrollWidget.setAutohidesScrollers(true); scrollWidget.setBorderType(hasBorder() ? OS.NSBezelBorder : OS.NSNoBorder); - + NSTableView widget = (NSTableView)new SWTTableView().alloc(); widget.init(); widget.setAllowsMultipleSelection((style & SWT.MULTI) != 0); @@ -731,7 +731,7 @@ public void deselect (int index) { /** * Deselects the items at the given zero-relative indices in the receiver. - * If the item at the given zero-relative index in the receiver + * If the item at the given zero-relative index in the receiver * is selected, it is deselected. If the item at the index * was not selected, it remains deselected. The range of the * indices is inclusive. Indices that are out of range are ignored. @@ -764,7 +764,7 @@ public void deselect (int start, int end) { /** * Deselects the items at the given zero-relative indices in the receiver. - * If the item at the given zero-relative index in the receiver + * If the item at the given zero-relative index in the receiver * is selected, it is deselected. If the item at the index * was not selected, it remains deselected. Indices that are out * of range and duplicate indices are ignored. @@ -910,7 +910,7 @@ void destroyItem (TableItem item) { if (items [index] == item) break; index++; } - if (index != itemCount - 1) fixSelection (index, false); + if (index != itemCount - 1) fixSelection (index, false); System.arraycopy (items, index + 1, items, index, --itemCount - index); items [itemCount] = null; updateRowCount(); @@ -967,14 +967,14 @@ void drawInteriorWithFrame_inView (long /*int*/ id, long /*int*/ sel, NSRect rec selectionForeground = Color.cocoa_new(display, hasFocus ? display.alternateSelectedControlTextColor : display.selectedControlTextColor); selectionBackground = Color.cocoa_new(display, hasFocus ? display.alternateSelectedControlColor : display.secondarySelectedControlColor); } - + NSSize contentSize = super.cellSize(id, OS.sel_cellSize); NSImage image = cell.image(); if (image != null) contentSize.width += imageBounds.width + IMAGE_GAP; int contentWidth = (int)Math.ceil (contentSize.width); NSSize spacing = widget.intercellSpacing(); int itemHeight = (int)Math.ceil (widget.rowHeight() + spacing.height); - + NSRect cellRect = widget.rectOfColumn (nsColumnIndex); cellRect.y = rect.y; cellRect.height = rect.height + spacing.height; @@ -998,7 +998,7 @@ void drawInteriorWithFrame_inView (long /*int*/ id, long /*int*/ sel, NSRect rec if (hooksMeasure) { sendMeasureItem(item, columnIndex, contentSize, isSelected); } - + Color userForeground = null; if (hooksErase) { context.saveGraphicsState(); @@ -1035,11 +1035,11 @@ void drawInteriorWithFrame_inView (long /*int*/ id, long /*int*/ sel, NSRect rec event.height = (int)cellRect.height; sendEvent (SWT.EraseItem, event); if (!event.doit) { - drawForeground = drawBackground = drawSelection = false; + drawForeground = drawBackground = drawSelection = false; } else { drawBackground = drawBackground && (event.detail & SWT.BACKGROUND) != 0; drawForeground = (event.detail & SWT.FOREGROUND) != 0; - drawSelection = drawSelection && (event.detail & SWT.SELECTED) != 0; + drawSelection = drawSelection && (event.detail & SWT.SELECTED) != 0; } if (!drawSelection && isSelected) { userForeground = Color.cocoa_new(display, gc.getForeground().handle); @@ -1127,7 +1127,7 @@ void drawInteriorWithFrame_inView (long /*int*/ id, long /*int*/ sel, NSRect rec NSColor nsColor = NSColor.colorWithDeviceRed(color[0], color[1], color[2], color[3]); cell.setTextColor(nsColor); callSuper = true; - } + } } else { callSuper = true; } @@ -1305,7 +1305,7 @@ public Rectangle getClientArea () { TableColumn getColumn (id id) { for (int i = 0; i < columnCount; i++) { if (columns[i].nsColumn.id == id.id) { - return columns[i]; + return columns[i]; } } return null; @@ -1331,7 +1331,7 @@ TableColumn getColumn (id id) { * <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> - * + * * @see Table#getColumnOrder() * @see Table#setColumnOrder(int[]) * @see TableColumn#getMoveable() @@ -1374,7 +1374,7 @@ public int getColumnCount () { * </p><p> * Note: This is not the actual structure used by the receiver * to maintain its list of items, so modifying the array will - * not affect the receiver. + * not affect the receiver. * </p> * * @return the current visual order of the receiver's items @@ -1383,12 +1383,12 @@ public int getColumnCount () { * <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> - * + * * @see Table#setColumnOrder(int[]) * @see TableColumn#getMoveable() * @see TableColumn#setMoveable(boolean) * @see SWT#Move - * + * * @since 3.1 */ public int [] getColumnOrder () { @@ -1414,7 +1414,7 @@ public int [] getColumnOrder () { * <p> * Note: This is not the actual structure used by the receiver * to maintain its list of items, so modifying the array will - * not affect the receiver. + * not affect the receiver. * </p> * * @return the items in the receiver @@ -1423,7 +1423,7 @@ public int [] getColumnOrder () { * <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> - * + * * @see Table#getColumnOrder() * @see Table#setColumnOrder(int[]) * @see TableColumn#getMoveable() @@ -1441,7 +1441,7 @@ public TableColumn [] getColumns () { * Returns the width in pixels of a grid line. * * @return the width of a grid line in pixels - * + * * @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> @@ -1453,7 +1453,7 @@ public int getGridLineWidth () { } /** - * Returns the height of the receiver's header + * Returns the height of the receiver's header * * @return the height of the header or zero if the header is not visible * @@ -1461,8 +1461,8 @@ public int getGridLineWidth () { * <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 2.0 + * + * @since 2.0 */ public int getHeaderHeight () { checkWidget (); @@ -1520,8 +1520,8 @@ public TableItem getItem (int index) { * coordinate system of the receiver. * <p> * The item that is returned represents an item that could be selected by the user. - * For example, if selection only occurs in items in the first column, then null is - * returned if the point is outside of the item. + * For example, if selection only occurs in items in the first column, then null is + * returned if the point is outside of the item. * Note that the SWT.FULL_SELECTION style hint, which specifies the selection policy, * determines the extent of the selection. * </p> @@ -1581,11 +1581,11 @@ public int getItemHeight () { /** * Returns a (possibly empty) array of <code>TableItem</code>s which - * are the items in the receiver. + * are the items in the receiver. * <p> * Note: This is not the actual structure used by the receiver * to maintain its list of items, so modifying the array will - * not affect the receiver. + * not affect the receiver. * </p> * * @return the items in the receiver @@ -1610,7 +1610,7 @@ public TableItem [] getItems () { /** * Returns <code>true</code> if the receiver's lines are visible, - * and <code>false</code> otherwise. Note that some platforms draw + * and <code>false</code> otherwise. Note that some platforms draw * grid lines while others may draw alternating row colors. * <p> * If one of the receiver's ancestors is not visible or some @@ -1638,7 +1638,7 @@ public boolean getLinesVisible () { * <p> * Note: This is not the actual structure used by the receiver * to maintain its selection, so modifying the array will - * not affect the receiver. + * not affect the receiver. * </p> * @return an array representing the selection * @@ -1710,7 +1710,7 @@ public int getSelectionIndex () { * <p> * Note: This is not the actual structure used by the receiver * to maintain its selection, so modifying the array will - * not affect the receiver. + * not affect the receiver. * </p> * @return the array of indices of the selected items * @@ -1741,15 +1741,15 @@ public int [] getSelectionIndices () { * the receiver. The value may be null if no column shows * the sort indicator. * - * @return the sort indicator + * @return the sort indicator * * @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> - * + * * @see #setSortColumn(TableColumn) - * + * * @since 3.2 */ public TableColumn getSortColumn () { @@ -1758,8 +1758,8 @@ public TableColumn getSortColumn () { } /** - * Returns the direction of the sort indicator for the receiver. - * The value will be one of <code>UP</code>, <code>DOWN</code> + * Returns the direction of the sort indicator for the receiver. + * The value will be one of <code>UP</code>, <code>DOWN</code> * or <code>NONE</code>. * * @return the sort direction @@ -1768,9 +1768,9 @@ public TableColumn getSortColumn () { * <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> - * + * * @see #setSortDirection(int) - * + * * @since 3.2 */ public int getSortDirection () { @@ -1797,16 +1797,16 @@ public int getTopIndex () { NSPoint point = new NSPoint(); point.x = rect.x; point.y = rect.y; - + int /*64*/ rowAtPoint = (int)/*64*/((NSTableView)view).rowAtPoint(point); - if (rowAtPoint == -1) return 0; /* Empty table */ - return rowAtPoint; + if (rowAtPoint == -1) return 0; /* Empty table */ + return rowAtPoint; } @Override NSRect headerRectOfColumn (long /*int*/ id, long /*int*/ sel, long /*int*/ column) { if ((style & SWT.CHECK) == 0) return callSuperRect(id, sel, column); - + if (column == 0) { NSRect returnValue = callSuperRect(id, sel, column); returnValue.width = 0; @@ -1836,7 +1836,7 @@ long /*int*/ hitTestForEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ ev /* * For some reason, the cell class needs to implement hitTestForEvent:inRect:ofView:, * otherwise the double action selector is not called properly. - */ + */ return callSuper(id, sel, event, rect, controlView); } @@ -1864,7 +1864,7 @@ int indexOf (NSTableColumn column) { /** * Searches the receiver's list starting at the first column - * (index 0) until a column is found that is equal to the + * (index 0) until a column is found that is equal to the * argument, and returns the index of that column. If no column * is found, returns -1. * @@ -1890,7 +1890,7 @@ public int indexOf (TableColumn column) { /** * Searches the receiver's list starting at the first item - * (index 0) until an item is found that is equal to the + * (index 0) until an item is found that is equal to the * argument, and returns the index of that item. If no item * is found, returns -1. * @@ -1966,19 +1966,19 @@ long /*int*/ menuForEvent(long /*int*/ id, long /*int*/ sel, long /*int*/ theEve if (id != headerView.id) { /* * Feature in Cocoa: Table views do not change the selection when the user - * right-clicks or control-clicks on an NSTableView or its subclasses. Fix is to select the + * right-clicks or control-clicks on an NSTableView or its subclasses. Fix is to select the * clicked-on row ourselves. */ NSEvent event = new NSEvent(theEvent); NSTableView table = (NSTableView)view; - - // get the current selections for the table view. + + // get the current selections for the table view. NSIndexSet selectedRowIndexes = table.selectedRowIndexes(); - + // select the row that was clicked before showing the menu for the event NSPoint mousePoint = view.convertPoint_fromView_(event.locationInWindow(), null); long /*int*/ row = table.rowAtPoint(mousePoint); - + // figure out if the row that was just clicked on is currently selected if (selectedRowIndexes.containsIndex(row) == false) { NSIndexSet set = (NSIndexSet)new NSIndexSet().alloc(); @@ -1996,7 +1996,7 @@ void mouseDown (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) { if (id == view.id) { // Bug/feature in Cocoa: If the table has a context menu we just set it visible instead of returning // it from menuForEvent:. This has the side effect, however, of sending control-click to the NSTableView, - // which is interpreted as a single click that clears the selection. Fix is to ignore control-click if the + // which is interpreted as a single click that clears the selection. Fix is to ignore control-click if the // view has a context menu. NSEvent event = new NSEvent(theEvent); if ((event.modifierFlags() & OS.NSControlKeyMask) != 0) return; @@ -2042,7 +2042,7 @@ boolean needsPanelToBecomeKey (long /*int*/ id, long /*int*/ sel) { /* * Feature in Cocoa. If a checkbox is in multi-state mode, nextState cycles * from off to mixed to on and back to off again. This will cause the on state - * to momentarily appear while clicking on the checkbox. To avoid this, + * to momentarily appear while clicking on the checkbox. To avoid this, * override [NSCell nextState] to go directly to the desired state. */ @Override @@ -2109,7 +2109,7 @@ void releaseHandle () { } @Override -void releaseWidget () { +void releaseWidget () { super.releaseWidget (); currentItem = null; sortColumn = null; @@ -2145,7 +2145,7 @@ public void remove (int index) { /** * Removes the items from the receiver which are - * between the given zero-relative start and end + * between the given zero-relative start and end * indices (inclusive). * * @param start the start of the range @@ -2251,7 +2251,7 @@ public void remove (int [] indices) { /** * Removes all of the items from 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> @@ -2289,7 +2289,7 @@ public void removeSelectionListener(SelectionListener listener) { if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; eventTable.unhook (SWT.Selection, listener); - eventTable.unhook (SWT.DefaultSelection,listener); + eventTable.unhook (SWT.DefaultSelection,listener); } @Override @@ -2315,7 +2315,7 @@ void scrollClipViewToPoint(long /*int*/ id, long /*int*/ sel, long /*int*/ clipV super.scrollClipViewToPoint(id, sel, clipView, point); if ((style & SWT.CHECK) != 0 && columnCount > 0 && ((NSTableView)view).headerView() != null) { if (point.x <= getCheckColumnWidth()) { - /* + /* * Header of first column is extended as header of the checkbox column. * So, redraw header of first column when check column is scrolled to be visible. */ @@ -2326,7 +2326,7 @@ void scrollClipViewToPoint(long /*int*/ id, long /*int*/ sel, long /*int*/ clipV } /** - * Selects the item at the given zero-relative index in the receiver. + * Selects the item at the given zero-relative index in the receiver. * If the item at the index was already selected, it remains * selected. Indices that are out of range are ignored. * @@ -2370,7 +2370,7 @@ public void select (int index) { * <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> - * + * * @see Table#setSelection(int,int) */ public void select (int start, int end) { @@ -2415,7 +2415,7 @@ public void select (int start, int end) { * <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> - * + * * @see Table#setSelection(int[]) */ public void select (int [] indices) { @@ -2477,7 +2477,7 @@ void setBackgroundColor(NSColor nsColor) { } /** - * Sets the order that the items in the receiver should + * Sets the order that the items in the receiver should * be displayed in to the given argument which is described * in terms of the zero-relative ordering of when the items * were added. @@ -2492,12 +2492,12 @@ void setBackgroundColor(NSColor nsColor) { * <li>ERROR_NULL_ARGUMENT - if the item order is null</li> * <li>ERROR_INVALID_ARGUMENT - if the item order is not the same length as the number of items</li> * </ul> - * + * * @see Table#getColumnOrder() * @see TableColumn#getMoveable() * @see TableColumn#setMoveable(boolean) * @see SWT#Move - * + * * @since 3.1 */ public void setColumnOrder (int [] order) { @@ -2559,7 +2559,7 @@ void setFont (NSFont font) { /** * Marks the receiver's header as visible if the argument is <code>true</code>, - * and marks it invisible otherwise. + * and marks it invisible otherwise. * <p> * If one of the receiver's ancestors is not visible or some * other condition makes the receiver not visible, marking @@ -2613,7 +2613,7 @@ public void setItemCount (int count) { new TableItem (this, SWT.NONE, i, true); } return; - } + } } int length = Math.max (4, (count + 3) / 4 * 4); TableItem [] newItems = new TableItem [length]; @@ -2741,7 +2741,7 @@ boolean setScrollWidth (TableItem [] items, boolean set) { } /** - * Selects the item at the given zero-relative index in the receiver. + * Selects the item at the given zero-relative index in the receiver. * The current selection is first cleared, then the new item is selected, * and if necessary the receiver is scrolled to make the new selection visible. * @@ -2776,7 +2776,7 @@ public void setSelection (int index) { * If the receiver is single-select and there is more than one item in the * given range, then all indices are ignored. * </p> - * + * * @param start the start index of the items to select * @param end the end index of the items to select * @@ -2852,7 +2852,7 @@ public void setSelection (int [] indices) { * <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.2 */ public void setSelection (TableItem item) { @@ -2914,19 +2914,19 @@ void setShouldScrollClipView(long /*int*/ id, long /*int*/ sel, boolean shouldSc /** * Sets the column used by the sort indicator for the receiver. A null - * value will clear the sort indicator. The current sort column is cleared + * value will clear the sort indicator. The current sort column is cleared * before the new column is set. * * @param column the column used by the sort indicator or <code>null</code> - * + * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the column is disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the column is disposed</li> * </ul> * @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.2 */ public void setSortColumn (TableColumn column) { @@ -2937,16 +2937,16 @@ public void setSortColumn (TableColumn column) { } /** - * Sets the direction of the sort indicator for the receiver. The value + * Sets the direction of the sort indicator for the receiver. The value * can be one of <code>UP</code>, <code>DOWN</code> or <code>NONE</code>. * - * @param direction the direction of the sort indicator + * @param direction the direction of the sort indicator * * @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.2 */ public void setSortDirection (int direction) { @@ -3097,8 +3097,8 @@ void selectRowIndexes_byExtendingSelection (long /*int*/ id, long /*int*/ sel, l @Override void sendDoubleSelection() { NSTableView tableView = (NSTableView)view; - int rowIndex = (int)/*64*/tableView.clickedRow (); - if (rowIndex == -1) rowIndex = (int)/*64*/tableView.selectedRow(); + int rowIndex = (int)/*64*/tableView.clickedRow (); + if (rowIndex == -1) rowIndex = (int)/*64*/tableView.selectedRow(); if (rowIndex != -1) { if ((style & SWT.CHECK) != 0) { NSArray columns = tableView.tableColumns (); @@ -3171,7 +3171,7 @@ void tableViewColumnDidMove (long /*int*/ id, long /*int*/ sel, long /*int*/ aNo NSDictionary userInfo = notification.userInfo (); NSString nsstring = (NSString) new NSString().alloc(); nsstring = nsstring.initWithString("NSOldColumn"); //$NON-NLS-1$ - id nsOldIndex = userInfo.valueForKey (nsstring); + id nsOldIndex = userInfo.valueForKey (nsstring); nsstring.release(); nsstring = (NSString) new NSString().alloc(); nsstring = nsstring.initWithString("NSNewColumn"); //$NON-NLS-1$ @@ -3288,7 +3288,7 @@ boolean tableView_shouldReorderColumn_toColumn(long /*int*/ id, long /*int*/ sel if (currentColIndex == 0) return false; if (newColIndex == 0) return false; } - + NSTableView widget = new NSTableView(aTableView); id nsColumn = widget.tableColumns().objectAtIndex(currentColIndex); for (int i = 0; i < columnCount; i++) { @@ -3296,7 +3296,7 @@ boolean tableView_shouldReorderColumn_toColumn(long /*int*/ id, long /*int*/ sel return columns[i].movable; } } - + return true; } @@ -3399,7 +3399,7 @@ boolean sendMouseEvent(NSEvent nsEvent, int type, boolean send) { if (type == SWT.DragDetect) { dragDetected = true; } else if (type == SWT.MouseUp) { - /* + /* * This code path handles the case of an unmodified click on an already-selected row. * To keep the order of events correct, deselect the other selected items and send the * selection event before MouseUp is sent. Ignore the next selection event. @@ -3416,7 +3416,7 @@ boolean sendMouseEvent(NSEvent nsEvent, int type, boolean send) { widget.deselectRow (indexBuffer[i]); ignoreSelect = false; } - + Event event = new Event (); event.item = _getItem ((int)/*64*/selectedRowIndex); selectedRowIndex = -1; @@ -3425,7 +3425,7 @@ boolean sendMouseEvent(NSEvent nsEvent, int type, boolean send) { } dragDetected = false; } - + return super.sendMouseEvent (nsEvent, type, send); } @@ -3447,7 +3447,7 @@ void updateCursorRects (boolean enabled) { updateCursorRects (enabled, headerView); } -void updateRowCount() { +void updateRowCount() { NSTableView widget = (NSTableView)view; setRedraw(false); ignoreSelect = true; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableColumn.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableColumn.java index 05a19f48f9..3d1c050f1e 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableColumn.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableColumn.java @@ -51,7 +51,7 @@ public class TableColumn extends Item { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -89,7 +89,7 @@ public TableColumn (Table parent, int style) { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -259,7 +259,7 @@ void drawInteriorWithFrame_inView (long /*int*/ id, long /*int*/ sel, NSRect cel destRect.y = Math.max(cellRect.y, cellRect.y + (cellRect.height - imageSize.height)/2); destRect.width = Math.min (imageSize.width, cellRect.width - 2 * MARGIN); destRect.height = Math.min (imageSize.height, cellRect.height); - boolean isFlipped = new NSView (view).isFlipped(); + boolean isFlipped = new NSView (view).isFlipped(); if (isFlipped) { context.saveGraphicsState (); NSAffineTransform transform = NSAffineTransform.transform (); @@ -294,7 +294,7 @@ void drawInteriorWithFrame_inView (long /*int*/ id, long /*int*/ sel, NSRect cel * text or image in the receiver. The value will be one of * <code>LEFT</code>, <code>RIGHT</code> or <code>CENTER</code>. * - * @return the alignment + * @return the alignment * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> @@ -331,8 +331,8 @@ public Table getParent () { /** * Gets the moveable attribute. A column that is - * not moveable cannot be reordered by the user - * by dragging the header but may be reordered + * not moveable cannot be reordered by the user + * by dragging the header but may be reordered * by the programmer. * * @return the moveable attribute @@ -341,12 +341,12 @@ public Table getParent () { * <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> - * + * * @see Table#getColumnOrder() * @see Table#setColumnOrder(int[]) * @see TableColumn#setMoveable(boolean) * @see SWT#Move - * + * * @since 3.1 */ public boolean getMoveable () { @@ -381,7 +381,7 @@ public boolean getResizable () { * <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.2 */ public String getToolTipText () { @@ -510,7 +510,7 @@ public void removeSelectionListener(SelectionListener listener) { if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; eventTable.unhook (SWT.Selection, listener); - eventTable.unhook (SWT.DefaultSelection,listener); + eventTable.unhook (SWT.DefaultSelection,listener); } /** @@ -521,7 +521,7 @@ public void removeSelectionListener(SelectionListener listener) { * Note that due to a restriction on some platforms, the first column * is always left aligned. * </p> - * @param alignment the new alignment + * @param alignment the new alignment * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> @@ -562,8 +562,8 @@ public void setImage (Image image) { /** * Sets the moveable attribute. A column that is * moveable can be reordered by the user by dragging - * the header. A column that is not moveable cannot be - * dragged by the user but may be reordered + * the header. A column that is not moveable cannot be + * dragged by the user but may be reordered * by the programmer. * * @param moveable the moveable attribute @@ -572,12 +572,12 @@ public void setImage (Image image) { * <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> - * + * * @see Table#setColumnOrder(int[]) * @see Table#getColumnOrder() * @see TableColumn#getMoveable() * @see SWT#Move - * + * * @since 3.1 */ public void setMoveable (boolean moveable) { @@ -588,8 +588,8 @@ public void setMoveable (boolean moveable) { /** * Sets the resizable attribute. A column that is * resizable can be resized by the user dragging the - * edge of the header. A column that is not resizable - * cannot be dragged by the user but may be resized + * edge of the header. A column that is not resizable + * cannot be dragged by the user but may be resized * by the programmer. * * @param resizable the resize attribute @@ -624,24 +624,24 @@ public void setText (String string) { /** * Sets the receiver's tool tip text to the argument, which - * may be null indicating that the default tool tip for the + * may be null indicating that the default tool tip for the * control will be shown. For a control that has a default * tool tip, such as the Tree control on Windows, setting * the tool tip text to an empty string replaces the default, * causing no tool tip text to be shown. * <p> * The mnemonic indicator (character '&') is not displayed in a tool tip. - * To display a single '&' in the tool tip, the character '&' can be + * To display a single '&' in the tool tip, the character '&' can be * escaped by doubling it in the string. * </p> - * + * * @param string the new tool tip text (or null) * * @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.2 */ public void setToolTipText (String string) { @@ -664,7 +664,7 @@ public void setWidth (int width) { checkWidget (); if (width < 0) return; // TODO how to differentiate 0 and 1 cases? - width = Math.max (0, width - Table.CELL_GAP); + width = Math.max (0, width - Table.CELL_GAP); nsColumn.setWidth (width); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableItem.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableItem.java index 1aa580e2e0..655666d06d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableItem.java @@ -42,7 +42,7 @@ public class TableItem extends Item { Font font; Font[] cellFont; int width = -1; - + /** * Constructs a new instance of this class given its parent * (which must be a <code>Table</code>) and a style value @@ -51,7 +51,7 @@ public class TableItem extends Item { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -85,7 +85,7 @@ public TableItem (Table parent, int style) { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -221,7 +221,7 @@ void destroyWidget () { * <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 2.0 */ public Color getBackground () { @@ -240,7 +240,7 @@ public Color getBackground () { * <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.0 */ public Color getBackground (int index) { @@ -262,7 +262,7 @@ public Color getBackground (int index) { * <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.2 */ public Rectangle getBounds () { @@ -405,7 +405,7 @@ public Font getFont (int index) { * <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 2.0 */ public Color getForeground () { @@ -415,7 +415,7 @@ public Color getForeground () { } /** - * + * * Returns the foreground color at the given column index in the receiver. * * @param index the column index @@ -425,7 +425,7 @@ public Color getForeground () { * <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.0 */ public Color getForeground (int index) { @@ -606,7 +606,7 @@ public String getText (int index) { * <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.3 */ public Rectangle getTextBounds (int index) { @@ -658,7 +658,7 @@ void redraw (int columnIndex) { } rect = tableView.frameOfCellAtColumn (index, parent.indexOf (this)); } - tableView.setNeedsDisplayInRect (rect); + tableView.setNeedsDisplayInRect (rect); } @Override @@ -692,13 +692,13 @@ void releaseWidget () { * @param color the new color (or null) * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> * </ul> * @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 2.0 */ public void setBackground (Color color) { @@ -715,7 +715,7 @@ public void setBackground (Color color) { } /** - * Sets the background color at the given column index in the receiver + * Sets the background color at the given column index in the receiver * to the color specified by the argument, or to the default system color for the item * if the argument is null. * @@ -723,13 +723,13 @@ public void setBackground (Color color) { * @param color the new color (or null) * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> * </ul> * @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.0 */ public void setBackground (int index, Color color) { @@ -748,11 +748,11 @@ public void setBackground (int index, Color color) { cellBackground [index] = color; if (oldColor != null && oldColor.equals (color)) return; cached = true; - redraw (index); + redraw (index); } /** - * Sets the checked state of the checkbox for this item. This state change + * Sets the checked state of the checkbox for this item. This state change * only applies if the Table was created with the SWT.CHECK style. * * @param checked the new checked state of the checkbox @@ -779,13 +779,13 @@ public void setChecked (boolean checked) { * @param font the new font (or null) * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> * </ul> * @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.0 */ public void setFont (Font font) { @@ -804,21 +804,21 @@ public void setFont (Font font) { /** * Sets the font that the receiver will use to paint textual information - * for the specified cell in this item to the font specified by the - * argument, or to the default font for that kind of control if the + * for the specified cell in this item to the font specified by the + * argument, or to the default font for that kind of control if the * argument is null. * * @param index the column index * @param font the new font (or null) * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> * </ul> * @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.0 */ public void setFont (int index, Font font) { @@ -849,13 +849,13 @@ public void setFont (int index, Font font) { * @param color the new color (or null) * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> * </ul> * @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 2.0 */ public void setForeground (Color color) { @@ -872,7 +872,7 @@ public void setForeground (Color color) { } /** - * Sets the foreground color at the given column index in the receiver + * Sets the foreground color at the given column index in the receiver * to the color specified by the argument, or to the default system color for the item * if the argument is null. * @@ -880,13 +880,13 @@ public void setForeground (Color color) { * @param color the new color (or null) * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> * </ul> * @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.0 */ public void setForeground (int index, Color color) { @@ -909,10 +909,10 @@ public void setForeground (int index, Color color) { } /** - * Sets the grayed state of the checkbox for this item. This state change + * Sets the grayed state of the checkbox for this item. This state change * only applies if the Table was created with the SWT.CHECK style. * - * @param grayed the new grayed state of the checkbox; + * @param grayed the new grayed state of the checkbox; * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> @@ -929,8 +929,8 @@ public void setGrayed (boolean grayed) { } /** - * Sets the image for multiple columns in the table. - * + * Sets the image for multiple columns in the table. + * * @param images the array of new images * * @exception IllegalArgumentException <ul> @@ -987,10 +987,10 @@ public void setImage (int index, Image image) { if (image != null && image.type == SWT.ICON) { if (image.equals (images [index])) return; } - images [index] = image; + images [index] = image; } cached = true; - if (index == 0) parent.setScrollWidth (this); + if (index == 0) parent.setScrollWidth (this); redraw (index); } @@ -1010,7 +1010,7 @@ public void setImage (Image image) { * <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> - * + * * @deprecated this functionality is not supported on most platforms */ @Deprecated @@ -1022,7 +1022,7 @@ public void setImageIndent (int indent) { } /** - * Sets the text for multiple columns in the table. + * Sets the text for multiple columns in the table. * <p> * Note: If control characters like '\n', '\t' etc. are used * in the string, then the behavior is platform dependent. diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TaskBar.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TaskBar.java index 823bb33c1e..8bade8da5b 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TaskBar.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TaskBar.java @@ -15,19 +15,19 @@ import org.eclipse.swt.*; /** * Instances of this class represent the system task bar. - * + * * <dl> * <dt><b>Styles:</b></dt> * <dd>(none)</dd> * <dt><b>Events:</b></dt> * <dd>(none)</dd> * </dl> - * + * * @see Display#getSystemTaskBar * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> - * + * * @since 3.6 - * + * * @noextend This class is not intended to be subclassed by clients. */ public class TaskBar extends Widget { @@ -110,10 +110,10 @@ public int getItemCount () { } /** - * Returns the <code>TaskItem</code> for the given <code>Shell</code> or the <code>TaskItem</code> + * Returns the <code>TaskItem</code> for the given <code>Shell</code> or the <code>TaskItem</code> * for the application if the <code>Shell</code> parameter is <code>null</code>. * If the requested item is not supported by the platform it returns <code>null</code>. - * + * * @param shell the shell for which the task item is requested, or null to request the application item * @return the task item for the given shell or the application * @@ -142,11 +142,11 @@ public TaskItem getItem (Shell shell) { /** * Returns an array of <code>TaskItem</code>s which are the items - * in the receiver. + * in the receiver. * <p> * Note: This is not the actual structure used by the receiver * to maintain its list of items, so modifying the array will - * not affect the receiver. + * not affect the receiver. * </p> * * @return the items in the receiver @@ -185,7 +185,7 @@ void releaseParent () { } @Override -void reskinChildren (int flags) { +void reskinChildren (int flags) { if (items != null) { for (int i=0; i<items.length; i++) { TaskItem item = items [i]; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TaskItem.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TaskItem.java index d381ac6952..a85bf937c9 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TaskItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TaskItem.java @@ -17,7 +17,7 @@ import org.eclipse.swt.internal.cocoa.*; /** * Instances of this class represent a task item. - * + * * <dl> * <dt><b>Styles:</b></dt> * <dd>(none)</dd> @@ -26,9 +26,9 @@ import org.eclipse.swt.internal.cocoa.*; * </dl> * * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> - * + * * @since 3.6 - * + * * @noextend This class is not intended to be subclassed by clients. */ public class TaskItem extends Item { @@ -39,11 +39,11 @@ public class TaskItem extends Item { Image overlayImage; String overlayText = ""; Menu menu; - + static final int PROGRESS_MAX = 100; static final int PROGRESS_TIMER = 350; static final int PROGRESS_BARS = 7; - + /** * Constructs a new instance of this class given its parent * (which must be a <code>Tray</code>) and a style value @@ -52,7 +52,7 @@ public class TaskItem extends Item { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -113,7 +113,7 @@ void destroyWidget () { public Menu getMenu () { checkWidget (); return menu; -} +} /** * Returns the receiver's overlay image if it has one, or null @@ -156,7 +156,7 @@ public String getOverlayText () { * <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> - * + * */ public TaskBar getParent () { checkWidget (); @@ -212,7 +212,7 @@ void releaseWidget () { /** * Sets the receiver's pop up menu to the argument. The way the menu is * shown is platform specific. - * + * * <p> * This feature might not be available for the receiver on all * platforms. The application code can check if it is supported @@ -227,13 +227,13 @@ void releaseWidget () { * <p> * The menu should be fully created before this method is called. * Dynamic changes to the menu after the method is called will not be reflected - * in the native menu.</p> + * in the native menu.</p> * * @param menu the new pop up menu * * @exception IllegalArgumentException <ul> * <li>ERROR_MENU_NOT_POP_UP - the menu is not a pop up menu</li> - * <li>ERROR_INVALID_ARGUMENT - if the menu has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the menu has been disposed</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> @@ -254,7 +254,7 @@ public void setMenu (Menu menu) { /** * Sets the receiver's overlay image, which may be null * indicating that no image should be displayed. The bounds - * for the overlay image is determined by the platform and in + * for the overlay image is determined by the platform and in * general it should be a small image. * * <p> @@ -265,13 +265,13 @@ public void setMenu (Menu menu) { * * <p> * For better cross platform support, the application code should - * first try to set this feature on the <code>TaskItem</code> for the + * first try to set this feature on the <code>TaskItem</code> for the * main shell then on the <code>TaskItem</code> for the application.</p> * * @param overlayImage the new overlay image (may be null) * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the overlayImage has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the overlayImage has been disposed</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> @@ -299,7 +299,7 @@ public void setOverlayImage (Image overlayImage) { * * <p> * For better cross platform support, the application code should - * first try to set this feature on the <code>TaskItem</code> for the + * first try to set this feature on the <code>TaskItem</code> for the * main shell then on the <code>TaskItem</code> for the application.</p> * * @param overlayText the new overlay text @@ -333,7 +333,7 @@ public void setOverlayText (String overlayText) { * * <p> * For better cross platform support, the application code should - * first try to set this feature on the <code>TaskItem</code> for the + * first try to set this feature on the <code>TaskItem</code> for the * main shell then on the <code>TaskItem</code> for the application.</p> * * @param progress the new progress @@ -342,7 +342,7 @@ public void setOverlayText (String overlayText) { * <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> - * + * * #see {@link #setProgressState(int)} */ public void setProgress (int progress) { @@ -363,8 +363,8 @@ public void setProgress (int progress) { * <li>{@link SWT#ERROR}</li> * <li>{@link SWT#INDETERMINATE}</li> * </ul></p> - * - * The percentage of progress shown by the states <code>SWT#NORMAL</code>, <code>SWT#PAUSED</code>, + * + * The percentage of progress shown by the states <code>SWT#NORMAL</code>, <code>SWT#PAUSED</code>, * <code>SWT#ERROR</code> is set with <code>setProgress()</code>. <br> * The state <code>SWT#DEFAULT</code> indicates that no progress should be shown. * @@ -376,16 +376,16 @@ public void setProgress (int progress) { * * <p> * For better cross platform support, the application code should - * first try to set this feature on the <code>TaskItem</code> for the + * first try to set this feature on the <code>TaskItem</code> for the * main shell then on the <code>TaskItem</code> for the application.</p> * - * @param progressState the new progress state + * @param progressState the new progress state * * @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> - * + * * #see {@link #setProgress(int)} */ public void setProgressState (int progressState) { @@ -415,7 +415,7 @@ void updateImage () { app.setApplicationIconImage (defaultImage); return; } - + NSSize size = defaultImage.size (); NSImage newImage = (NSImage)new NSImage().alloc (); newImage = newImage.initWithSize (size); @@ -423,7 +423,7 @@ void updateImage () { rep = rep.initWithBitmapDataPlanes (0, (int)size.width, (int)size.height, 8, 4, true, false, OS.NSDeviceRGBColorSpace, OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, (int)size.width * 4, 32); newImage.addRepresentation (rep); rep.release (); - + NSRect rect = new NSRect (); rect.height = size.height; rect.width = size.width; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Text.java index 226bdbd37c..8e3b54ea82 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Text.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Text.java @@ -62,7 +62,7 @@ public class Text extends Scrollable { NSRange selectionRange; id targetSearch, targetCancel; long /*int*/ actionSearch, actionCancel; - + /** * The maximum number of characters that can be entered * into a text widget. @@ -72,7 +72,7 @@ public class Text extends Scrollable { * </p> */ public static final int LIMIT; - + /** * The delimiter used by multi-line text widgets. When text * is queried and from the widget, it will be delimited using @@ -97,7 +97,7 @@ public class Text extends Scrollable { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -194,11 +194,11 @@ public void addModifyListener (ModifyListener listener) { * Adds a segment listener. * <p> * A <code>SegmentEvent</code> is sent whenever text content is being modified or - * a segment listener is added or removed. You can + * a segment listener is added or removed. You can * customize the appearance of text by indicating certain characters to be inserted * at certain text offsets. This may be used for bidi purposes, e.g. when * adjacent segments of right-to-left text should not be reordered relative to - * each other. + * each other. * E.g., multiple Java string literals in a right-to-left language * should generally remain in logical order to each other, that is, the * way they are stored. @@ -221,7 +221,7 @@ public void addModifyListener (ModifyListener listener) { * @see SegmentEvent * @see SegmentListener * @see #removeSegmentListener - * + * * @since 3.8 */ public void addSegmentListener (SegmentListener listener) { @@ -240,7 +240,7 @@ public void addSegmentListener (SegmentListener listener) { * <code>widgetDefaultSelected</code> is typically called when ENTER is pressed in a single-line text, * or when ENTER is pressed in a search text. If the receiver has the <code>SWT.SEARCH | SWT.ICON_CANCEL</code> style * and the user cancels the search, the event object detail field contains the value <code>SWT.ICON_CANCEL</code>. - * Likewise, if the receiver has the <code>SWT.ICON_SEARCH</code> style and the icon search is selected, the + * Likewise, if the receiver has the <code>SWT.ICON_SEARCH</code> style and the icon search is selected, the * event object detail field contains the value <code>SWT.ICON_SEARCH</code>. * </p> * @@ -351,10 +351,10 @@ static int checkStyle (int style) { if ((style & SWT.SEARCH) != 0) { style |= SWT.SINGLE | SWT.BORDER; style &= ~SWT.PASSWORD; - /* + /* * NOTE: ICON_CANCEL has the same value as H_SCROLL and * ICON_SEARCH has the same value as V_SCROLL so they are - * cleared because SWT.SINGLE is set. + * cleared because SWT.SINGLE is set. */ } if ((style & SWT.SINGLE) != 0 && (style & SWT.MULTI) != 0) { @@ -383,7 +383,7 @@ static int checkStyle (int style) { public void clearSelection () { checkWidget (); Point selection = getSelection (); - setSelection (selection.x); + setSelection (selection.x); } @Override @@ -524,10 +524,10 @@ void createHandle () { widget.setFocusRingType (OS.NSFocusRingTypeNone); widget.setBordered (false); } - /* + /* * Bug in Cocoa: On OSX 10.10, setting the alignment on the search field * to NSLeftTextAlignment causes the text to disappear on Focus Out. - * Fix is to use NSJustifiedTextAlignment instead, since for + * Fix is to use NSJustifiedTextAlignment instead, since for * a single line of text, justified has the same effect as left aligned. */ int align = ((style & SWT.SEARCH) != 0) ? OS.NSJustifiedTextAlignment : OS.NSLeftTextAlignment; @@ -547,12 +547,12 @@ void createHandle () { scrollWidget.setHasHorizontalScroller ((style & SWT.HORIZONTAL) != 0); scrollWidget.setAutoresizesSubviews (true); if ((style & SWT.BORDER) != 0) scrollWidget.setBorderType (OS.NSBezelBorder); - + NSTextView widget = (NSTextView) new SWTTextView ().alloc (); widget.init (); widget.setEditable ((style & SWT.READ_ONLY) == 0); widget.setAllowsUndo(true); - + NSSize size = new NSSize (); size.width = size.height = Float.MAX_VALUE; widget.setMaxSize (size); @@ -668,7 +668,7 @@ Color defaultForeground () { @Override void deregister() { super.deregister(); - + if ((style & SWT.SINGLE) != 0) { display.removeWidget(((NSControl)view).cell()); } @@ -718,7 +718,7 @@ boolean dragDetect (int x, int y, boolean filter, boolean [] consume) { @Override void enableWidget(boolean enabled) { super.enableWidget(enabled); - + if ((style & SWT.MULTI) != 0) { setForeground(this.foreground); } @@ -836,7 +836,7 @@ public int getCharCount () { * default action of the text widget when the user * double clicks. * </p> - * + * * @return whether or not double click is enabled * * @exception SWTException <ul> @@ -856,14 +856,14 @@ public boolean getDoubleClickEnabled () { * displayed when the user enters text or the * text is changed by the programmer. * </p> - * + * * @return the echo character * * @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> - * + * * @see #setEchoChar */ public char getEchoChar () { @@ -875,7 +875,7 @@ public char getEchoChar () { * Returns the editable state. * * @return whether or not the receiver is editable - * + * * @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> @@ -978,7 +978,7 @@ public int getLineCount () { * <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> - * + * * @see #DELIMITER */ public String getLineDelimiter () { @@ -1017,12 +1017,12 @@ public int getLineHeight () { * constants <code>SWT.LEFT_TO_RIGHT</code> or <code>SWT.RIGHT_TO_LEFT</code>. * * @return the orientation style - * + * * @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 2.1.2 */ @Override @@ -1037,14 +1037,14 @@ public int getOrientation () { * <p> * Typically this is used in conjunction with <code>SWT.SEARCH</code>. * </p> - * + * * @return the widget message * * @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.3 */ public String getMessage () { @@ -1061,7 +1061,7 @@ long /*int*/ getPosition (long /*int*/ x, long /*int*/ y) { viewLocation.y = y; return widget.characterIndexForInsertionAtPoint(viewLocation); } else { - //TODO + //TODO return 0; } } @@ -1124,7 +1124,7 @@ public int getSelectionCount () { * Gets the selected text, or an empty string if there is no current selection. * * @return the selected text - * + * * @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> @@ -1240,7 +1240,7 @@ public String getText (int start, int end) { * However, the text can't be protected if an {@link SWT#Segments} or * {@link SWT#Verify} listener has been added to the widget. * </p> - * + * * @return a character array that contains the widget's text * * @exception SWTException <ul> @@ -1268,19 +1268,19 @@ public char[] getTextChars () { } /** - * Returns the maximum number of characters that the receiver is capable of holding. + * Returns the maximum number of characters that the receiver is capable of holding. * <p> * If this has not been changed by <code>setTextLimit()</code>, * it will be the constant <code>Text.LIMIT</code>. * </p> - * + * * @return the text limit - * + * * @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> - * + * * @see #LIMIT */ public int getTextLimit () { @@ -1491,7 +1491,7 @@ public void paste () { @Override void register() { super.register(); - + if ((style & SWT.SINGLE) != 0) { display.addWidget(((NSControl)view).cell(), this); } @@ -1547,7 +1547,7 @@ public void removeModifyListener (ModifyListener listener) { * @see SegmentEvent * @see SegmentListener * @see #addSegmentListener - * + * * @since 3.8 */ public void removeSegmentListener (SegmentListener listener) { @@ -1664,7 +1664,7 @@ boolean sendKeyEvent (int type, Event event) { if (type != SWT.KeyDown) return result; if ((event.stateMask & SWT.COMMAND) != 0) { switch (event.keyCode) { - case 'z': + case 'z': NSUndoManager undoManager = view.undoManager(); if (undoManager == null && (style & SWT.SINGLE) != 0) { NSText fieldEditor = ((NSTextField) view).currentEditor (); @@ -1740,7 +1740,7 @@ void setBackgroundImage(NSImage image) { * Note: This operation is a hint and is not supported on * platforms that do not have this concept. * </p> - * + * * @param doubleClick the new double click flag * * @exception SWTException <ul> @@ -1898,12 +1898,12 @@ void setForeground (double /*float*/ [] color) { * </p> * * @param orientation new orientation style - * + * * @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 2.1.2 */ @Override @@ -1929,7 +1929,7 @@ void setOrientation () { * <p> * Typically this is used in conjunction with <code>SWT.SEARCH</code>. * </p> - * + * * @param message the new message * * @exception IllegalArgumentException <ul> @@ -1939,7 +1939,7 @@ void setOrientation () { * <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.3 */ public void setMessage (String message) { @@ -2222,7 +2222,7 @@ public void setTextChars (char[] text) { * <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> - * + * * @see #LIMIT */ public void setTextLimit (int limit) { @@ -2306,7 +2306,7 @@ boolean shouldChangeTextInRange_replacementString(long /*int*/ id, long /*int*/ * in the receiver, this method simply returns. Otherwise, * lines are scrolled until the selection is visible. * </p> - * + * * @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> diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolBar.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolBar.java index a1c2bccd53..3079eb4456 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolBar.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolBar.java @@ -10,7 +10,7 @@ *******************************************************************************/ package org.eclipse.swt.widgets; - + import org.eclipse.swt.*; import org.eclipse.swt.accessibility.*; import org.eclipse.swt.graphics.*; @@ -58,7 +58,7 @@ public class ToolBar extends Composite { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -91,7 +91,7 @@ public ToolBar (Composite parent, int style) { ToolBar(Composite parent, int style, boolean internal) { super (parent, checkStyle (parent, style, internal)); - + /* * Ensure that either of HORIZONTAL or VERTICAL is set. * NOTE: HORIZONTAL and VERTICAL have the same values @@ -115,7 +115,7 @@ long /*int*/ accessibilityAttributeValue (long /*int*/ id, long /*int*/ sel, lon id returnObject = accessible.internal_accessibilityAttributeValue(nsAttributeName, ACC.CHILDID_SELF); if (returnObject != null) return returnObject.id; } - + if (nsAttributeName.isEqualToString (OS.NSAccessibilityRoleAttribute) || nsAttributeName.isEqualToString (OS.NSAccessibilityRoleDescriptionAttribute)) { NSString role = OS.NSAccessibilityToolbarRole; @@ -127,7 +127,7 @@ long /*int*/ accessibilityAttributeValue (long /*int*/ id, long /*int*/ sel, lon } } else if (nsAttributeName.isEqualToString(OS.NSAccessibilityChildrenAttribute)) { NSMutableArray returnValue = NSMutableArray.arrayWithCapacity(itemCount); - + for (int i = 0; i < itemCount; i++) { returnValue.addObject(new id(getItem(i).accessibleHandle())); } @@ -138,7 +138,7 @@ long /*int*/ accessibilityAttributeValue (long /*int*/ id, long /*int*/ sel, lon boolean focused = (view.id == view.window().firstResponder().id); return NSNumber.numberWithBool(focused).id; } - + return super.accessibilityAttributeValue(id, sel, arg0); } @@ -146,7 +146,7 @@ long /*int*/ accessibilityAttributeValue (long /*int*/ id, long /*int*/ sel, lon boolean accessibilityIsIgnored(long /*int*/ id, long /*int*/ sel) { // Toolbars aren't ignored. if (id == view.id) return false; - return super.accessibilityIsIgnored(id, sel); + return super.accessibilityIsIgnored(id, sel); } static int checkStyle (Composite parent, int style, boolean internal) { @@ -158,14 +158,14 @@ static int checkStyle (Composite parent, int style, boolean internal) { * the SWT style. */ int newStyle = style & ~(SWT.H_SCROLL | SWT.V_SCROLL); - + /* * Only internal clients can create an NSToolbar-based ToolBar. */ if (!internal && (newStyle & SWT.SMOOTH) != 0) { newStyle &= ~SWT.SMOOTH; } - + /* * A unified toolbar can only be parented to a Shell, and * there can only be one unified toolbar per shell. If neither of these @@ -179,15 +179,15 @@ static int checkStyle (Composite parent, int style, boolean internal) { newStyle &= ~SWT.SMOOTH; } } - + /* * Unified toolbar only supports a horizontal layout, and doesn't wrap. */ if ((newStyle & SWT.SMOOTH) != 0) { - newStyle &= ~(SWT.VERTICAL | SWT.WRAP); + newStyle &= ~(SWT.VERTICAL | SWT.WRAP); newStyle |= SWT.HORIZONTAL; } - + return newStyle; } @@ -279,7 +279,7 @@ void createItem (ToolItem item, int index) { System.arraycopy (items, index, items, index + 1, itemCount++ - index); items [index] = item; if (nsToolbar != null) { - nsToolbar.insertItemWithItemIdentifier(item.getItemID(), index); + nsToolbar.insertItemWithItemIdentifier(item.getItemID(), index); } else { view.addSubview(item.view); } @@ -368,7 +368,7 @@ public Rectangle getBounds () { rect = view.convertRect_toView_(rect, null); return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height); } - + return super.getBounds(); } @@ -451,11 +451,11 @@ public int getItemCount () { /** * Returns an array of <code>ToolItem</code>s which are the items - * in the receiver. + * in the receiver. * <p> * Note: This is not the actual structure used by the receiver * to maintain its list of items, so modifying the array will - * not affect the receiver. + * not affect the receiver. * </p> * * @return the items in the receiver @@ -498,7 +498,7 @@ boolean hasKeyboardFocus(long /*int*/ inId) { /** * Searches the receiver's list starting at the first item - * (index 0) until an item is found that is equal to the + * (index 0) until an item is found that is equal to the * argument, and returns the index of that item. If no item * is found, returns -1. * @@ -556,7 +556,7 @@ int [] layoutHorizontal (int width, int height, boolean resize) { x += xSpacing + size.x; maxX = Math.max (maxX, x); } - + return new int [] {rows, maxX, y + itemHeight}; } @@ -587,7 +587,7 @@ int [] layoutUnified (int width, int height, boolean resize) { x += containerRects[i].width; maxX = Math.max (maxX, x); } - + return new int [] {1, maxX, itemHeight}; } @@ -623,7 +623,7 @@ int [] layoutVertical (int width, int height, boolean resize) { y += ySpacing + size.y; maxY = Math.max (maxY, y); } - + return new int [] {cols, x + itemWidth, maxY}; } @@ -717,13 +717,13 @@ boolean sendMouseEvent (NSEvent nsEvent, int type, boolean send) { for (int i = 0; i < itemCount; i++) { ToolItem item = items [i]; int currState = item.state; - NSPoint viewPoint = item.view.convertPoint_fromView_(windowPoint, null); + NSPoint viewPoint = item.view.convertPoint_fromView_(windowPoint, null); if (item.view.mouse(viewPoint, item.view.bounds())) { item.state |= Widget.HOT; } else { - item.state &= ~Widget.HOT; + item.state &= ~Widget.HOT; } - + if (currState != item.state) item.updateImage(true); } break; @@ -731,12 +731,12 @@ boolean sendMouseEvent (NSEvent nsEvent, int type, boolean send) { for (int i = 0; i < itemCount; i++) { ToolItem item = items [i]; int currState = item.state; - item.state &= ~Widget.HOT; + item.state &= ~Widget.HOT; if (currState != item.state) item.updateImage(true); } break; } - + return super.sendMouseEvent(nsEvent, type, send); } @@ -747,7 +747,7 @@ void setBounds (int x, int y, int width, int height, boolean move, boolean resiz if (nsToolbar != null) return; super.setBounds(x, y, width, height, move, resize); } - + @Override void setFont(NSFont font) { for (int i = 0; i < itemCount; i++) { @@ -804,7 +804,7 @@ long /*int*/ toolbarDefaultItemIdentifiers(long /*int*/ id, long /*int*/ sel, lo /* * toolbarSelectableItemIdentifiers returns an array of all items that can be the selected item, as determined - * by setSelectedItemIdentifier. + * by setSelectedItemIdentifier. */ @Override long /*int*/ toolbarSelectableItemIdentifiers(long /*int*/ id, long /*int*/ sel, long /*int*/ toolbar) { @@ -834,15 +834,15 @@ boolean translateTraversal (int key, NSEvent theEvent, boolean[] consume) { next = true; checkPopup = true; break; - + default: return false; } consume [0] = true; - + if (checkPopup && lastFocus != null) { if (lastFocus.handleKeyDown()) return false; } - + ToolItem[] items = getItems(); ToolItem item = lastFocus; int length = items.length; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java index 0301cd3ee8..86932176fb 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java @@ -26,7 +26,7 @@ import org.eclipse.swt.internal.cocoa.*; * <dd>Selection</dd> * </dl> * <p> - * Note: Only one of the styles CHECK, PUSH, RADIO, SEPARATOR and DROP_DOWN + * Note: Only one of the styles CHECK, PUSH, RADIO, SEPARATOR and DROP_DOWN * may be specified. * </p><p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. @@ -63,7 +63,7 @@ public class ToolItem extends Item { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -103,7 +103,7 @@ public ToolItem (ToolBar parent, int style) { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -148,7 +148,7 @@ long /*int*/ accessibleHandle() { long /*int*/ accessibilityActionNames(long /*int*/ id, long /*int*/ sel) { long /*int*/ returnValue = super.accessibilityActionNames(id, sel); - + if (id == accessibleHandle()) { if ((style & SWT.DROP_DOWN) != 0) { NSArray baseArray = new NSArray(returnValue); @@ -167,7 +167,7 @@ long /*int*/ accessibilityActionNames(long /*int*/ id, long /*int*/ sel) { long /*int*/ accessibilityAttributeNames(long /*int*/ id, long /*int*/ sel) { long /*int*/ returnValue = super.accessibilityAttributeNames(id, sel); - + if (id == accessibleHandle()) { if ((style & (SWT.CHECK|SWT.RADIO)) !=0) { NSArray baseArray = new NSArray(returnValue); @@ -227,7 +227,7 @@ long /*int*/ accessibilityAttributeValue(long /*int*/ id, long /*int*/ sel, long NSNumber value = NSNumber.numberWithBool(getEnabled()); return value.id; } else if (nsAttributeName.isEqualToString(OS.NSAccessibilityChildrenAttribute)) { - // + // NSArray value = NSArray.array(); return value.id; } else if (nsAttributeName.isEqualToString(OS.NSAccessibilityParentAttribute)) { @@ -257,7 +257,7 @@ boolean accessibilityIsIgnored(long /*int*/ id, long /*int*/ sel) { * </p> * <p> * When the <code>SWT.RADIO</code> style bit is set, the <code>widgetSelected</code> method is - * also called when the receiver loses selection because another item in the same radio group + * also called when the receiver loses selection because another item in the same radio group * was selected by the user. During <code>widgetSelected</code> the application can use * <code>getSelection()</code> to determine the current selected state of the receiver. * </p> @@ -336,7 +336,7 @@ Point computeSize () { if ((style & SWT.DROP_DOWN) != 0) { width += ARROW_WIDTH + INSET; } - + if (parent.nsToolbar == null || image != null) { width += INSET * 2; height += INSET * 2; @@ -356,7 +356,7 @@ void createHandle () { nsItem.setAction(OS.sel_sendSelection); nsMenuRep = ((NSMenuItem)new SWTMenuItem().alloc()).initWithTitle(NSString.string(), OS.sel_sendSelection, NSString.string()); nsItem.setMenuFormRepresentation(nsMenuRep); - } + } if ((style & SWT.SEPARATOR) != 0) { if (parent.nsToolbar != null) { @@ -377,7 +377,7 @@ void createHandle () { /* * Feature in Cocoa. NSButtons without borders do not leave any margin * between their edge and their image. The workaround is to provide a - * custom cell that displays the image in a better position. + * custom cell that displays the image in a better position. */ NSButtonCell cell = (NSButtonCell)new SWTButtonCell ().alloc ().init (); button.setCell (cell); @@ -408,7 +408,7 @@ NSAttributedString createString() { void deregister () { super.deregister (); display.removeWidget(view); - + if (button != null) { display.removeWidget (button); display.removeWidget (button.cell()); @@ -427,7 +427,7 @@ void drawImageWithFrameInView (long /*int*/ id, long /*int*/ sel, long /*int*/ i if ((parent.style & SWT.RIGHT) != 0) { rect.x += 3; } else { - rect.y += 3; + rect.y += 3; } } long /*int*/ cgContext = NSGraphicsContext.currentContext().graphicsPort(); @@ -457,7 +457,7 @@ void drawImageWithFrameInView (long /*int*/ id, long /*int*/ sel, long /*int*/ i @Override NSRect drawTitleWithFrameInView (long /*int*/ id, long /*int*/ sel, long /*int*/ title, NSRect titleRect, long /*int*/ view) { boolean hiliteShadow = new NSButtonCell(id).isHighlighted() && text.length() > 0 && image == null; - + // An unbordered cell doesn't draw any highlighting when pushed or selected, so we have to do it here. if (hiliteShadow) { NSColor transWhiteColor = NSColor.colorWithDeviceRed(1.0f, 1.0f, 1.0f, .8f); @@ -476,7 +476,7 @@ NSRect drawTitleWithFrameInView (long /*int*/ id, long /*int*/ sel, long /*int*/ @Override void drawWidget (long /*int*/ id, NSGraphicsContext context, NSRect rect) { if (id == view.id) { - boolean drawSelected = getSelection() && (parent.nsToolbar == null); + boolean drawSelected = getSelection() && (parent.nsToolbar == null); if (drawSelected) { NSRect bounds = view.bounds(); context.saveGraphicsState(); @@ -516,7 +516,7 @@ void drawWidget (long /*int*/ id, NSGraphicsContext context, NSRect rect) { void enableWidget(boolean enabled) { if (parent.nsToolbar != null) { nsItem.setEnabled(enabled); - } + } if ((style & SWT.SEPARATOR) == 0) { ((NSButton)button).setEnabled(enabled); @@ -544,7 +544,7 @@ public Rectangle getBounds () { // parent, the toolbar, relative coordinates. rect = parent.view.convertRect_fromView_(rect, view); return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height); - } + } NSRect rect = view.frame(); return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height); @@ -607,7 +607,7 @@ boolean getDrawing () { * <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> - * + * * @see #isEnabled */ public boolean getEnabled () { @@ -636,10 +636,10 @@ public Image getHotImage () { NSString getItemID() { NSString itemID = id; - + // For separators, return a Cocoa constant for the tool item ID. if ((style & SWT.SEPARATOR) != 0) { - // If we are using a non-default width or control use that instead. + // If we are using a non-default width or control use that instead. if (control == null) { if (width == DEFAULT_SEPARATOR_WIDTH || width == 0) { if (OS.VERSION < 0x1070) itemID = OS.NSToolbarSeparatorItemIdentifier; @@ -650,7 +650,7 @@ NSString getItemID() { } } } - + return itemID; } @@ -734,7 +734,7 @@ public int getWidth () { * <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> - * + * * @see #getEnabled */ public boolean isEnabled () { @@ -827,7 +827,7 @@ void otherMouseDragged(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) void register () { super.register (); display.addWidget (view, this); - + if (button != null) { display.addWidget (button, this); display.addWidget (button.cell(), this); @@ -856,7 +856,7 @@ public void removeSelectionListener(SelectionListener listener) { if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; eventTable.unhook(SWT.Selection, listener); - eventTable.unhook(SWT.DefaultSelection,listener); + eventTable.unhook(SWT.DefaultSelection,listener); } @Override @@ -891,7 +891,7 @@ void releaseWidget () { super.releaseWidget (); control = null; toolTipText = null; - image = disabledImage = hotImage = null; + image = disabledImage = hotImage = null; } void selectRadio () { @@ -957,7 +957,7 @@ void setBounds (int x, int y, int width, int height) { * @param control the new control * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the control has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the control has been disposed</li> * <li>ERROR_INVALID_PARENT - if the control is not in the same widget tree</li> * </ul> * @exception SWTException <ul> @@ -1012,7 +1012,7 @@ public void setEnabled (boolean enabled) { checkWidget(); if ((state & DISABLED) == 0 && enabled) return; if (enabled) { - state &= ~DISABLED; + state &= ~DISABLED; } else { state |= DISABLED; } @@ -1029,7 +1029,7 @@ public void setEnabled (boolean enabled) { * @param image the disabled image to display on the receiver (may be null) * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> @@ -1048,7 +1048,7 @@ boolean setFocus () { if (button == null) return false; if (!isEnabled ()) return false; NSWindow window = view.window (); - if(window == null) { + if(window == null) { return false; } return window.makeFirstResponder (button); @@ -1064,7 +1064,7 @@ boolean setFocus () { * @param image the hot image to display on the receiver (may be null) * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> @@ -1116,13 +1116,13 @@ public void setSelection (boolean selected) { checkWidget(); if ((style & (SWT.CHECK | SWT.RADIO)) == 0) return; this.selection = selected; - + if (parent.nsToolbar != null) { if ((style & SWT.RADIO) != 0 && selection) { parent.nsToolbar.setSelectedItemIdentifier(nsItem.itemIdentifier()); } } - + view.setNeedsDisplay(true); } @@ -1143,7 +1143,7 @@ public void setSelection (boolean selected) { * Note: If control characters like '\n', '\t' etc. are used * in the string, then the behavior is platform dependent. * </p> - * + * * @param string the new text * * @exception IllegalArgumentException <ul> @@ -1174,7 +1174,7 @@ public void setText (String string) { if ((parent.style & SWT.RIGHT) != 0) { widget.setImagePosition(OS.NSImageLeft); } else { - widget.setImagePosition(OS.NSImageAbove); + widget.setImagePosition(OS.NSImageAbove); } } else { widget.setImagePosition(text.length() != 0 ? OS.NSNoImage : OS.NSImageOnly); @@ -1184,17 +1184,17 @@ public void setText (String string) { /** * Sets the receiver's tool tip text to the argument, which - * may be null indicating that the default tool tip for the + * may be null indicating that the default tool tip for the * control will be shown. For a control that has a default * tool tip, such as the Tree control on Windows, setting * the tool tip text to an empty string replaces the default, * causing no tool tip text to be shown. * <p> * The mnemonic indicator (character '&') is not displayed in a tool tip. - * To display a single '&' in the tool tip, the character '&' can be + * To display a single '&' in the tool tip, the character '&' can be * escaped by doubling it in the string. * </p> - * + * * @param string the new tool tip text (or null) * * @exception SWTException <ul> @@ -1234,11 +1234,11 @@ void setVisible (boolean visible) { * @param width the new width. If the new value is <code>SWT.DEFAULT</code>, * the width is a fixed-width area whose amount is determined by the platform. * If the new value is 0 a vertical or horizontal line will be drawn, depending - * on the setting of the corresponding style bit (<code>SWT.VERTICAL</code> or + * on the setting of the corresponding style bit (<code>SWT.VERTICAL</code> or * <code>SWT.HORIZONTAL</code>). If the new value is <code>SWT.SEPARATOR_FILL</code> * a variable-width space is inserted that acts as a spring between the two adjoining * items which will push them out to the extent of the containing ToolBar. - * + * * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> @@ -1292,10 +1292,10 @@ void updateImage (boolean layout) { if ((parent.style & SWT.RIGHT) != 0) { widget.setImagePosition(OS.NSImageLeft); } else { - widget.setImagePosition(OS.NSImageAbove); + widget.setImagePosition(OS.NSImageAbove); } - } else { - widget.setImagePosition(text.length() != 0 ? OS.NSNoImage : OS.NSImageOnly); + } else { + widget.setImagePosition(text.length() != 0 ? OS.NSNoImage : OS.NSImageOnly); } parent.relayout(); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tracker.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tracker.java index 9bc7f005a9..5e8f3aa15c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tracker.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tracker.java @@ -10,7 +10,7 @@ *******************************************************************************/ package org.eclipse.swt.widgets; - + import org.eclipse.swt.*; import org.eclipse.swt.events.*; import org.eclipse.swt.graphics.*; @@ -22,7 +22,7 @@ import org.eclipse.swt.internal.cocoa.*; * These rectangles can be specified to respond to mouse and key events * by either moving or resizing themselves accordingly. Trackers are * typically used to represent window geometries in a lightweight manner. - * + * * <dl> * <dt><b>Styles:</b></dt> * <dd>LEFT, RIGHT, UP, DOWN, RESIZE</dd> @@ -49,7 +49,7 @@ public class Tracker extends Widget { boolean inEvent = false; NSWindow window; int oldX, oldY; - + /* * The following values mirror step sizes on Windows */ @@ -62,7 +62,7 @@ public class Tracker extends Widget { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -100,7 +100,7 @@ public Tracker (Composite parent, int style) { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -108,7 +108,7 @@ public Tracker (Composite parent, int style) { * </p><p> * Note: Currently, null can be passed in for the display argument. * This has the effect of creating the tracker on the currently active - * display if there is one. If there is no current display, the + * display if there is one. If there is no current display, the * tracker is created on a "default" display. <b>Passing in null as * the display argument is not considered to be good coding style, * and may not be supported in a future release of SWT.</b> @@ -121,7 +121,7 @@ public Tracker (Composite parent, int style) { * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li> * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li> * </ul> - * + * * @see SWT#LEFT * @see SWT#RIGHT * @see SWT#UP @@ -235,7 +235,7 @@ Point adjustResizeCursor (boolean movePointer) { if (parent != null) { Point pt = parent.toDisplay (newX, newY); newX = pt.x; - newY = pt.y; + newY = pt.y; } if (movePointer) { display.setCursorLocation(newX, newY); @@ -284,7 +284,7 @@ Point adjustResizeCursor (boolean movePointer) { } resizeCursor = newCursor; } - + return new Point (newX, newY); } @@ -314,16 +314,16 @@ Rectangle computeBounds () { int yMin = rectangles [0].y; int xMax = rectangles [0].x + rectangles [0].width; int yMax = rectangles [0].y + rectangles [0].height; - + for (int i = 1; i < rectangles.length; i++) { if (rectangles [i].x < xMin) xMin = rectangles [i].x; if (rectangles [i].y < yMin) yMin = rectangles [i].y; int rectRight = rectangles [i].x + rectangles [i].width; - if (rectRight > xMax) xMax = rectRight; + if (rectRight > xMax) xMax = rectRight; int rectBottom = rectangles [i].y + rectangles [i].height; if (rectBottom > yMax) yMax = rectBottom; } - + return new Rectangle (xMin, yMin, xMax - xMin, yMax - yMin); } @@ -345,7 +345,7 @@ Rectangle [] computeProportions (Rectangle [] rects) { } else { height = 100; } - result [i] = new Rectangle (x, y, width, height); + result [i] = new Rectangle (x, y, width, height); } } return result; @@ -360,7 +360,7 @@ void drawRectangles (NSWindow window, Rectangle [] rects, boolean erase) { if (parent != null) { parentOrigin = display.map (parent, null, 0, 0); } else { - parentOrigin = new Point (0, 0); + parentOrigin = new Point (0, 0); } context.setCompositingOperation(erase ? OS.NSCompositeClear : OS.NSCompositeSourceOver); NSRect rectFrame = new NSRect(); @@ -377,7 +377,7 @@ void drawRectangles (NSWindow window, Rectangle [] rects, boolean erase) { globalPoint = window.convertScreenToBase(globalPoint); rectFrame.x = globalPoint.x; rectFrame.y = globalPoint.y; - + if (erase) { rectFrame.width++; rectFrame.height++; @@ -399,7 +399,7 @@ void drawRectangles (NSWindow window, Rectangle [] rects, boolean erase) { * coordinates. * * @return the bounds of the Rectangles being drawn - * + * * @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> @@ -740,9 +740,9 @@ void moveRectangles (int xChange, int yChange) { * Displays the Tracker rectangles for manipulation by the user. Returns when * the user has either finished manipulating the rectangles or has cancelled the * Tracker. - * + * * @return <code>true</code> if the user did not cancel the Tracker, <code>false</code> otherwise - * + * * @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> @@ -756,7 +756,7 @@ public boolean open () { window = (NSWindow)new NSWindow().alloc(); NSArray screens = NSScreen.screens(); double /*float*/ minX = Float.MAX_VALUE, maxX = Float.MIN_VALUE; - double /*float*/ minY = Float.MAX_VALUE, maxY = Float.MIN_VALUE; + double /*float*/ minY = Float.MAX_VALUE, maxY = Float.MIN_VALUE; int count = (int)/*64*/screens.count(); for (int i = 0; i < count; i++) { NSScreen screen = new NSScreen(screens.objectAtIndex(i)); @@ -771,7 +771,7 @@ public boolean open () { if (y2 < minY) minY = y2; if (y1 > maxY) maxY = y1; if (y2 > maxY) maxY = y2; - } + } NSRect frame = new NSRect(); frame.x = minX; frame.y = minY; @@ -792,7 +792,7 @@ public boolean open () { window.orderFrontRegardless(); drawRectangles (window, rectangles, false); - + /* * If exactly one of UP/DOWN is specified as a style then set the cursor * orientation accordingly (the same is done for LEFT/RIGHT styles below). @@ -805,7 +805,7 @@ public boolean open () { if (hStyle == SWT.LEFT || hStyle == SWT.RIGHT) { cursorOrientation |= hStyle; } - + Point cursorPos; boolean down = false; NSApplication application = NSApplication.sharedApplication(); @@ -893,14 +893,14 @@ public boolean open () { display.removePool(); } } - + /* * Cleanup: If this tracker was resizing then the last cursor that it created * needs to be destroyed. */ if (resizeCursor != null) resizeCursor.dispose(); resizeCursor = null; - + if (oldTrackingControl != null && !oldTrackingControl.isDisposed()) { display.trackingControl = oldTrackingControl; } @@ -994,25 +994,25 @@ boolean resizeRectangles (int xChange, int yChange) { cursorOrientation |= SWT.RIGHT; orientationInit = true; } - } + } if (yChange < 0 && ((style & SWT.UP) != 0) && ((cursorOrientation & SWT.DOWN) == 0)) { if ((cursorOrientation & SWT.UP) == 0) { cursorOrientation |= SWT.UP; orientationInit = true; } - } + } if (yChange > 0 && ((style & SWT.DOWN) != 0) && ((cursorOrientation & SWT.UP) == 0)) { if ((cursorOrientation & SWT.DOWN) == 0) { cursorOrientation |= SWT.DOWN; orientationInit = true; } } - + /* * If the bounds will flip about the x or y axis then apply the adjustment * up to the axis (ie.- where bounds width/height becomes 0), change the * cursor's orientation accordingly, and flip each Rectangle's origin (only - * necessary for > 1 Rectangles) + * necessary for > 1 Rectangles) */ if ((cursorOrientation & SWT.LEFT) != 0) { if (xChange > bounds.width) { @@ -1074,7 +1074,7 @@ boolean resizeRectangles (int xChange, int yChange) { } } } - + // apply the bounds adjustment if ((cursorOrientation & SWT.LEFT) != 0) { bounds.x += xChange; @@ -1088,7 +1088,7 @@ boolean resizeRectangles (int xChange, int yChange) { } else if ((cursorOrientation & SWT.DOWN) != 0) { bounds.height += yChange; } - + Rectangle [] newRects = new Rectangle [rectangles.length]; for (int i = 0; i < rectangles.length; i++) { Rectangle proportion = proportions[i]; @@ -1107,7 +1107,7 @@ boolean resizeRectangles (int xChange, int yChange) { * then the cursor reverts to the default. * * @param newCursor the new <code>Cursor</code> to display - * + * * @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> diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TrayItem.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TrayItem.java index 09a275b644..0c4e4123dc 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TrayItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TrayItem.java @@ -32,7 +32,7 @@ import org.eclipse.swt.internal.cocoa.*; * * @see <a href="http://www.eclipse.org/swt/snippets/#tray">Tray, TrayItem snippets</a> * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> - * + * * @since 3.0 * @noextend This class is not intended to be subclassed by clients. */ @@ -44,7 +44,7 @@ public class TrayItem extends Item { NSStatusItem item; NSImageView view; Image highlightImage; - + /** * Constructs a new instance of this class given its parent * (which must be a <code>Tray</code>) and a style value @@ -53,7 +53,7 @@ public class TrayItem extends Item { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -153,7 +153,7 @@ void createHandle () { item = statusBar.statusItemWithLength(0); if (item == null) error (SWT.ERROR_NO_HANDLES); item.retain(); - item.setHighlightMode(true); + item.setHighlightMode(true); view = (NSImageView)new SWTImageView().alloc(); if (view == null) error (SWT.ERROR_NO_HANDLES); view.init (); @@ -183,7 +183,7 @@ void destroyWidget () { * <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.8 */ public Image getHighlightImage () { @@ -210,7 +210,7 @@ Point getLocation () { * <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.2 */ public Tray getParent () { @@ -228,7 +228,7 @@ public Tray getParent () { * <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.2 */ public ToolTip getToolTip () { @@ -253,7 +253,7 @@ public String getToolTipText () { } /** - * Returns <code>true</code> if the receiver is visible and + * Returns <code>true</code> if the receiver is visible and * <code>false</code> otherwise. * * @return the receiver's visibility @@ -345,7 +345,7 @@ public void removeSelectionListener (SelectionListener listener) { if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; eventTable.unhook (SWT.Selection, listener); - eventTable.unhook (SWT.DefaultSelection,listener); + eventTable.unhook (SWT.DefaultSelection,listener); } /** @@ -381,7 +381,7 @@ public void setImage (Image image) { * <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.8 */ public void setHighlightImage (Image image) { @@ -401,7 +401,7 @@ public void setHighlightImage (Image image) { * <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.2 */ public void setToolTip (ToolTip toolTip) { @@ -414,17 +414,17 @@ public void setToolTip (ToolTip toolTip) { /** * Sets the receiver's tool tip text to the argument, which - * may be null indicating that the default tool tip for the + * may be null indicating that the default tool tip for the * control will be shown. For a control that has a default * tool tip, such as the Tree control on Windows, setting * the tool tip text to an empty string replaces the default, * causing no tool tip text to be shown. * <p> * The mnemonic indicator (character '&') is not displayed in a tool tip. - * To display a single '&' in the tool tip, the character '&' can be + * To display a single '&' in the tool tip, the character '&' can be * escaped by doubling it in the string. * </p> - * + * * @param string the new tool tip text (or null) * * @exception SWTException <ul> @@ -452,7 +452,7 @@ void _setToolTipText (String string) { /** * Makes the receiver visible if the argument is <code>true</code>, - * and makes it invisible otherwise. + * and makes it invisible otherwise. * * @param visible the new visibility state * diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java index d88f3ddf5a..2a17111d33 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java @@ -88,7 +88,7 @@ public class Tree extends Composite { Rectangle imageBounds; TreeItem insertItem; boolean insertBefore; - + /* Used to control drop feedback when DND.FEEDBACK_EXPAND and DND.FEEDBACK_SCROLL is set/not set */ boolean shouldExpand = true, shouldScroll = true; @@ -105,7 +105,7 @@ public class Tree extends Composite { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -153,7 +153,7 @@ TreeItem _getItem (TreeItem parentItem, int index, boolean create) { items = this.items; } if (index < 0 || index >= count) return null; - TreeItem item = items [index]; + TreeItem item = items [index]; if (item != null || (style & SWT.VIRTUAL) == 0 || !create) return item; item = new TreeItem (this, parentItem, SWT.NONE, index, false); items [index] = item; @@ -169,7 +169,7 @@ boolean acceptsFirstResponder (long /*int*/ id, long /*int*/ sel) { long /*int*/ accessibilityAttributeValue(long /*int*/ id, long /*int*/ sel, long /*int*/ arg0) { long /*int*/ returnValue = 0; NSString attributeName = new NSString(arg0); - + // If the check column is visible, don't report it back as a column for accessibility purposes. // The check column is meant to appear as a part of the first column. if (attributeName.isEqualToString (OS.NSAccessibilityColumnsAttribute) || attributeName.isEqualToString(OS.NSAccessibilityVisibleColumnsAttribute)) { @@ -184,7 +184,7 @@ long /*int*/ accessibilityAttributeValue(long /*int*/ id, long /*int*/ sel, long } } } - + if (returnValue != 0) { return returnValue; } else { @@ -297,12 +297,12 @@ NSSize cellSize (long /*int*/ id, long /*int*/ sel) { @Override boolean canDragRowsWithIndexes_atPoint(long /*int*/ id, long /*int*/ sel, long /*int*/ rowIndexes, NSPoint mouseDownPoint) { if (!super.canDragRowsWithIndexes_atPoint(id, sel, rowIndexes, mouseDownPoint)) return false; - + // If the current row is not selected and the user is not attempting to modify the selection, select the row first. NSTableView widget = (NSTableView)view; long /*int*/ row = widget.rowAtPoint(mouseDownPoint); long /*int*/ modifiers = NSApplication.sharedApplication().currentEvent().modifierFlags(); - + boolean drag = (state & DRAG_DETECT) != 0 && hooks (SWT.DragDetect); if (drag) { if (!widget.isRowSelected(row) && (modifiers & (OS.NSCommandKeyMask | OS.NSShiftKeyMask | OS.NSAlternateKeyMask | OS.NSControlKeyMask)) == 0) { @@ -312,7 +312,7 @@ boolean canDragRowsWithIndexes_atPoint(long /*int*/ id, long /*int*/ sel, long / set.release(); } } - + // The clicked row must be selected to initiate a drag. return (widget.isRowSelected(row) && drag) || !hasFocus(); } @@ -341,7 +341,7 @@ static int checkStyle (int style) { * WS_VSCROLL is not specified, Windows creates * trees and tables with scroll bars. The fix * is to set H_SCROLL and V_SCROLL. - * + * * NOTE: This code appears on all platforms so that * applications have consistent scroll bar behavior. */ @@ -385,7 +385,7 @@ void clear (TreeItem parentItem, int index, boolean all) { void clearAll (TreeItem parentItem, boolean all) { int count = getItemCount (parentItem); if (count == 0) return; - TreeItem [] children = parentItem == null ? items : parentItem.items; + TreeItem [] children = parentItem == null ? items : parentItem.items; for (int i=0; i<count; i++) { TreeItem item = children [i]; if (item != null) { @@ -413,10 +413,10 @@ void clearAll (TreeItem parentItem, boolean all) { * <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> - * + * * @see SWT#VIRTUAL * @see SWT#SetData - * + * * @since 3.2 */ public void clear (int index, boolean all) { @@ -431,7 +431,7 @@ public void clear (int index, boolean all) { * attributes of the items are set to their default values. If the * tree was created with the <code>SWT.VIRTUAL</code> style, these * attributes are requested again as needed. - * + * * @param all <code>true</code> if all child items should be cleared * recursively, and <code>false</code> otherwise * @@ -439,10 +439,10 @@ public void clear (int index, boolean all) { * <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> - * + * * @see SWT#VIRTUAL * @see SWT#SetData - * + * * @since 3.2 */ public void clearAll (boolean all) { @@ -477,7 +477,7 @@ long /*int*/ columnAtPoint(long /*int*/ id, long /*int*/ sel, NSPoint point) { if ((style & SWT.CHECK) != 0) { if (point.x <= getCheckColumnWidth() && point.y < headerView.frame().height) return 1; } - + return super.columnAtPoint(id, sel, point); } @@ -564,12 +564,12 @@ void createHandle () { scrollWidget.setHasVerticalScroller ((style & SWT.V_SCROLL) != 0); scrollWidget.setAutohidesScrollers (true); scrollWidget.setBorderType(hasBorder () ? OS.NSBezelBorder : OS.NSNoBorder); - + NSOutlineView widget = (NSOutlineView) new SWTOutlineView ().alloc (); /* * Bug in Cocoa. Calling init, instead of initWithFrame on an NSOutlineView - * cause the NSOutlineView to leak some memory. The work around is to call - * initWithFrame and pass an empty NSRect instead of calling init. + * cause the NSOutlineView to leak some memory. The work around is to call + * initWithFrame and pass an empty NSRect instead of calling init. */ widget.initWithFrame(new NSRect()); widget.setAllowsMultipleSelection ((style & SWT.MULTI) != 0); @@ -583,10 +583,10 @@ void createHandle () { widget.setIntercellSpacing(spacing); widget.setDoubleAction (OS.sel_sendDoubleSelection); if (!hasBorder ()) widget.setFocusRingType (OS.NSFocusRingTypeNone); - + headerView = (NSTableHeaderView)new SWTTableHeaderView ().alloc ().init (); widget.setHeaderView (null); - + NSString str = NSString.string(); if ((style & SWT.CHECK) != 0) { checkColumn = (NSTableColumn) new NSTableColumn ().alloc (); @@ -609,7 +609,7 @@ void createHandle () { buttonCell.setAllowsMixedState (true); checkColumn.setWidth (getCheckColumnWidth ()); } - + firstColumn = (NSTableColumn) new NSTableColumn ().alloc (); NSString nsstring = (NSString) new NSString().alloc(); nsstring = nsstring.initWithString(String.valueOf(++NEXT_ID)); @@ -631,7 +631,7 @@ void createHandle () { dataCell = (NSTextFieldCell)new SWTImageTextCell ().alloc ().init (); dataCell.setLineBreakMode(OS.NSLineBreakByTruncatingTail); firstColumn.setDataCell (dataCell); - + scrollView = scrollWidget; view = widget; } @@ -1030,14 +1030,14 @@ void drawInteriorWithFrame_inView (long /*int*/ id, long /*int*/ sel, NSRect rec selectionForeground = Color.cocoa_new(display, hasFocus ? display.alternateSelectedControlTextColor : display.selectedControlTextColor); selectionBackground = Color.cocoa_new(display, hasFocus ? display.alternateSelectedControlColor : display.secondarySelectedControlColor); } - + NSSize contentSize = super.cellSize(id, OS.sel_cellSize); NSImage image = cell.image(); if (image != null) contentSize.width += imageBounds.width + IMAGE_GAP; int contentWidth = (int)Math.ceil (contentSize.width); NSSize spacing = widget.intercellSpacing(); int itemHeight = (int)Math.ceil (widget.rowHeight() + spacing.height); - + NSRect cellRect = widget.rectOfColumn (nsColumnIndex); cellRect.y = rect.y; cellRect.height = rect.height + spacing.height; @@ -1057,7 +1057,7 @@ void drawInteriorWithFrame_inView (long /*int*/ id, long /*int*/ sel, NSRect rec } int itemX = (int)(rect.x - offsetX), itemY = (int)(rect.y - offsetY); NSGraphicsContext context = NSGraphicsContext.currentContext (); - + if (hooksMeasure) { sendMeasureItem(item, cell.isHighlighted(), columnIndex, contentSize); } @@ -1098,17 +1098,17 @@ void drawInteriorWithFrame_inView (long /*int*/ id, long /*int*/ sel, NSRect rec event.height = (int)cellRect.height; sendEvent (SWT.EraseItem, event); if (!event.doit) { - drawForeground = drawBackground = drawSelection = false; + drawForeground = drawBackground = drawSelection = false; } else { drawBackground = drawBackground && (event.detail & SWT.BACKGROUND) != 0; drawForeground = (event.detail & SWT.FOREGROUND) != 0; - drawSelection = drawSelection && (event.detail & SWT.SELECTED) != 0; + drawSelection = drawSelection && (event.detail & SWT.SELECTED) != 0; } if (!drawSelection && isSelected) { userForeground = Color.cocoa_new(display, gc.getForeground().handle); } gc.dispose (); - + context.restoreGraphicsState(); if (isDisposed ()) return; @@ -1133,7 +1133,7 @@ void drawInteriorWithFrame_inView (long /*int*/ id, long /*int*/ sel, NSRect rec NSBezierPath.fillRect (cellRect); context.restoreGraphicsState (); } - + if (item == insertItem && insertItem != null && !insertItem.isDisposed()) { context.saveGraphicsState (); NSRect contentRect = cell.titleRectForBounds (rect); @@ -1211,7 +1211,7 @@ void drawInteriorWithFrame_inView (long /*int*/ id, long /*int*/ sel, NSRect rec NSColor nsColor = NSColor.colorWithDeviceRed(color[0], color[1], color[2], color[3]); cell.setTextColor(nsColor); callSuper = true; - } + } } else { callSuper = true; } @@ -1378,7 +1378,7 @@ public Rectangle getClientArea () { TreeColumn getColumn (id id) { for (int i = 0; i < columnCount; i++) { if (columns[i].nsColumn.id == id.id) { - return columns[i]; + return columns[i]; } } return null; @@ -1404,13 +1404,13 @@ TreeColumn getColumn (id id) { * <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> - * + * * @see Tree#getColumnOrder() * @see Tree#setColumnOrder(int[]) * @see TreeColumn#getMoveable() * @see TreeColumn#setMoveable(boolean) * @see SWT#Move - * + * * @since 3.1 */ public TreeColumn getColumn (int index) { @@ -1432,7 +1432,7 @@ public TreeColumn getColumn (int index) { * <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.1 */ public int getColumnCount () { @@ -1451,7 +1451,7 @@ public int getColumnCount () { * </p><p> * Note: This is not the actual structure used by the receiver * to maintain its list of items, so modifying the array will - * not affect the receiver. + * not affect the receiver. * </p> * * @return the current visual order of the receiver's items @@ -1460,12 +1460,12 @@ public int getColumnCount () { * <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> - * + * * @see Tree#setColumnOrder(int[]) * @see TreeColumn#getMoveable() * @see TreeColumn#setMoveable(boolean) * @see SWT#Move - * + * * @since 3.2 */ public int [] getColumnOrder () { @@ -1491,7 +1491,7 @@ public int [] getColumnOrder () { * <p> * Note: This is not the actual structure used by the receiver * to maintain its list of items, so modifying the array will - * not affect the receiver. + * not affect the receiver. * </p> * * @return the items in the receiver @@ -1500,13 +1500,13 @@ public int [] getColumnOrder () { * <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> - * + * * @see Tree#getColumnOrder() * @see Tree#setColumnOrder(int[]) * @see TreeColumn#getMoveable() * @see TreeColumn#setMoveable(boolean) * @see SWT#Move - * + * * @since 3.1 */ public TreeColumn [] getColumns () { @@ -1520,12 +1520,12 @@ public TreeColumn [] getColumns () { * Returns the width in pixels of a grid line. * * @return the width of a grid line in pixels - * + * * @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.1 */ public int getGridLineWidth () { @@ -1534,7 +1534,7 @@ public int getGridLineWidth () { } /** - * Returns the height of the receiver's header + * Returns the height of the receiver's header * * @return the height of the header or zero if the header is not visible * @@ -1542,8 +1542,8 @@ public int getGridLineWidth () { * <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.1 + * + * @since 3.1 */ public int getHeaderHeight () { checkWidget (); @@ -1568,7 +1568,7 @@ public int getHeaderHeight () { * <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.1 */ public boolean getHeaderVisible () { @@ -1590,7 +1590,7 @@ public boolean getHeaderVisible () { * <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.1 */ public TreeItem getItem (int index) { @@ -1606,8 +1606,8 @@ public TreeItem getItem (int index) { * coordinate system of the receiver. * <p> * The item that is returned represents an item that could be selected by the user. - * For example, if selection only occurs in items in the first column, then null is - * returned if the point is outside of the item. + * For example, if selection only occurs in items in the first column, then null is + * returned if the point is outside of the item. * Note that the SWT.FULL_SELECTION style hint, which specifies the selection policy, * determines the extent of the selection. * </p> @@ -1688,7 +1688,7 @@ public int getItemHeight () { * <p> * Note: This is not the actual structure used by the receiver * to maintain its list of items, so modifying the array will - * not affect the receiver. + * not affect the receiver. * </p> * * @return the items @@ -1709,7 +1709,7 @@ public TreeItem [] getItems () { /** * Returns <code>true</code> if the receiver's lines are visible, - * and <code>false</code> otherwise. Note that some platforms draw + * and <code>false</code> otherwise. Note that some platforms draw * grid lines while others may draw alternating row colors. * <p> * If one of the receiver's ancestors is not visible or some @@ -1724,7 +1724,7 @@ public TreeItem [] getItems () { * <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.1 */ public boolean getLinesVisible () { @@ -1752,11 +1752,11 @@ public TreeItem getParentItem () { /** * Returns an array of <code>TreeItem</code>s that are currently * selected in the receiver. The order of the items is unspecified. - * An empty array indicates that no items are selected. + * An empty array indicates that no items are selected. * <p> * Note: This is not the actual structure used by the receiver * to maintain its selection, so modifying the array will - * not affect the receiver. + * not affect the receiver. * </p> * @return an array representing the selection * @@ -1806,15 +1806,15 @@ public int getSelectionCount () { * the receiver. The value may be null if no column shows * the sort indicator. * - * @return the sort indicator + * @return the sort indicator * * @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> - * + * * @see #setSortColumn(TreeColumn) - * + * * @since 3.2 */ public TreeColumn getSortColumn () { @@ -1823,8 +1823,8 @@ public TreeColumn getSortColumn () { } /** - * Returns the direction of the sort indicator for the receiver. - * The value will be one of <code>UP</code>, <code>DOWN</code> + * Returns the direction of the sort indicator for the receiver. + * The value will be one of <code>UP</code>, <code>DOWN</code> * or <code>NONE</code>. * * @return the sort direction @@ -1833,9 +1833,9 @@ public TreeColumn getSortColumn () { * <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> - * + * * @see #setSortDirection(int) - * + * * @since 3.2 */ public int getSortDirection () { @@ -1848,13 +1848,13 @@ public int getSortDirection () { * This item can change when items are expanded, collapsed, scrolled * or new items are added or removed. * - * @return the item at the top of the receiver - * + * @return the item at the top of 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 2.1 */ public TreeItem getTopItem () { @@ -1874,7 +1874,7 @@ public TreeItem getTopItem () { @Override NSRect headerRectOfColumn (long /*int*/ id, long /*int*/ sel, long /*int*/ column) { if ((style & SWT.CHECK) == 0) return callSuperRect(id, sel, column); - + if (column == 0) { NSRect returnValue = callSuperRect(id, sel, column); returnValue.width = 0; @@ -1932,7 +1932,7 @@ int indexOf (NSTableColumn column) { /** * Searches the receiver's list starting at the first column - * (index 0) until a column is found that is equal to the + * (index 0) until a column is found that is equal to the * argument, and returns the index of that column. If no column * is found, returns -1. * @@ -1946,7 +1946,7 @@ int indexOf (NSTableColumn column) { * <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.1 */ public int indexOf (TreeColumn column) { @@ -1961,7 +1961,7 @@ public int indexOf (TreeColumn column) { /** * Searches the receiver's list starting at the first item - * (index 0) until an item is found that is equal to the + * (index 0) until an item is found that is equal to the * argument, and returns the index of that item. If no item * is found, returns -1. * @@ -1976,7 +1976,7 @@ public int indexOf (TreeColumn column) { * <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.1 */ public int indexOf (TreeItem item) { @@ -2012,19 +2012,19 @@ long /*int*/ menuForEvent(long /*int*/ id, long /*int*/ sel, long /*int*/ theEve if (id != headerView.id) { /* * Feature in Cocoa: Table views do not change the selection when the user - * right-clicks or control-clicks on an NSTableView or its subclasses. Fix is to select the + * right-clicks or control-clicks on an NSTableView or its subclasses. Fix is to select the * clicked-on row ourselves. */ NSEvent event = new NSEvent(theEvent); NSOutlineView tree = (NSOutlineView)view; - - // get the current selections for the outline view. + + // get the current selections for the outline view. NSIndexSet selectedRowIndexes = tree.selectedRowIndexes(); - + // select the row that was clicked before showing the menu for the event NSPoint mousePoint = view.convertPoint_fromView_(event.locationInWindow(), null); long /*int*/ row = tree.rowAtPoint(mousePoint); - + // figure out if the row that was just clicked on is currently selected if (selectedRowIndexes.containsIndex(row) == false) { NSIndexSet set = (NSIndexSet)new NSIndexSet().alloc(); @@ -2034,7 +2034,7 @@ long /*int*/ menuForEvent(long /*int*/ id, long /*int*/ sel, long /*int*/ theEve } // else that row is currently selected, so don't change anything. } - + return super.menuForEvent(id, sel, theEvent); } @@ -2093,7 +2093,7 @@ boolean needsPanelToBecomeKey (long /*int*/ id, long /*int*/ sel) { /* * Feature in Cocoa. If a checkbox is in multi-state mode, nextState cycles * from off to mixed to on and back to off again. This will cause the on state - * to momentarily appear while clicking on the checkbox. To avoid this, + * to momentarily appear while clicking on the checkbox. To avoid this, * override [NSCell nextState] to go directly to the desired state. */ @Override @@ -2167,7 +2167,7 @@ boolean outlineView_shouldReorderColumn_toColumn(long /*int*/ id, long /*int*/ s if (currentColIndex == 0) return false; if (newColIndex == 0) return false; } - + NSOutlineView widget = new NSOutlineView(aTableView); id nsColumn = widget.tableColumns().objectAtIndex(currentColIndex); for (int i = 0; i < columnCount; i++) { @@ -2175,7 +2175,7 @@ boolean outlineView_shouldReorderColumn_toColumn(long /*int*/ id, long /*int*/ s return columns[i].movable; } } - + return true; } @@ -2185,7 +2185,7 @@ boolean outlineView_shouldTrackCell_forTableColumn_item(long /*int*/ id, long /* if (new NSCell(cell).isKindOfClass(OS.class_NSButtonCell)) return true; } NSOutlineView widget = (NSOutlineView)view; - long /*int*/ rowIndex = widget.rowForItem(new id(item)); + long /*int*/ rowIndex = widget.rowForItem(new id(item)); return widget.isRowSelected(rowIndex); } @@ -2261,7 +2261,7 @@ void outlineViewColumnDidMove (long /*int*/ id, long /*int*/ sel, long /*int*/ a NSDictionary userInfo = notification.userInfo (); NSString nsstring = (NSString) new NSString().alloc(); nsstring = nsstring.initWithString("NSOldColumn"); //$NON-NLS-1$ - id nsOldIndex = userInfo.valueForKey (nsstring); + id nsOldIndex = userInfo.valueForKey (nsstring); nsstring.release(); nsstring = (NSString) new NSString().alloc(); nsstring = nsstring.initWithString("NSNewColumn"); //$NON-NLS-1$ @@ -2320,7 +2320,7 @@ void scrollClipViewToPoint (long /*int*/ id, long /*int*/ sel, long /*int*/ clip super.scrollClipViewToPoint(id, sel, clipView, point); if ((style & SWT.CHECK) != 0 && columnCount > 0 && ((NSOutlineView) view).headerView () != null) { if (point.x <= getCheckColumnWidth()) { - /* + /* * Header of first column is extended as header of the checkbox column. * So, redraw header of first column when check column is scrolled to be visible. */ @@ -2429,7 +2429,7 @@ void releaseWidget () { /** * Removes all of the items from 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> @@ -2472,7 +2472,7 @@ public void removeSelectionListener (SelectionListener listener) { checkWidget (); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); eventTable.unhook (SWT.Selection, listener); - eventTable.unhook (SWT.DefaultSelection, listener); + eventTable.unhook (SWT.DefaultSelection, listener); } /** @@ -2524,11 +2524,11 @@ void setImage (long /*int*/ id, long /*int*/ sel, long /*int*/ arg0) { /** * Display a mark indicating the point at which an item will be inserted. - * The drop insert item has a visual hint to show where a dragged item + * The drop insert item has a visual hint to show where a dragged item * will be inserted when dropped on the tree. - * + * * @param item the insert item. Null will clear the insertion mark. - * @param before true places the insert mark above 'item'. false places + * @param before true places the insert mark above 'item'. false places * the insert mark below 'item'. * * @exception IllegalArgumentException <ul> @@ -2616,7 +2616,7 @@ void selectRowIndexes_byExtendingSelection (long /*int*/ id, long /*int*/ sel, l @Override void sendDoubleSelection() { NSOutlineView outlineView = (NSOutlineView)view; - int rowIndex = (int)/*64*/outlineView.clickedRow (); + int rowIndex = (int)/*64*/outlineView.clickedRow (); if (rowIndex == -1) rowIndex = (int)/*64*/outlineView.selectedRow (); if (rowIndex != -1) { if ((style & SWT.CHECK) != 0) { @@ -2691,7 +2691,7 @@ boolean sendMouseEvent(NSEvent nsEvent, int type, boolean send) { if (type == SWT.DragDetect) { dragDetected = true; } else if (type == SWT.MouseUp) { - /* + /* * This code path handles the case of an unmodified click on an already-selected row. * To keep the order of events correct, deselect the other selected items and send the * selection event before MouseUp is sent. Ignore the next selection event. @@ -2708,7 +2708,7 @@ boolean sendMouseEvent(NSEvent nsEvent, int type, boolean send) { widget.deselectRow (indexBuffer[i]); ignoreSelect = false; } - + Event event = new Event (); id itemID = widget.itemAtRow (selectedRowIndex); if (itemID != null) { @@ -2723,7 +2723,7 @@ boolean sendMouseEvent(NSEvent nsEvent, int type, boolean send) { } dragDetected = false; } - + return super.sendMouseEvent (nsEvent, type, send); } @@ -2765,7 +2765,7 @@ void setBackgroundColor(NSColor nsColor) { } /** - * Sets the order that the items in the receiver should + * Sets the order that the items in the receiver should * be displayed in to the given argument which is described * in terms of the zero-relative ordering of when the items * were added. @@ -2780,12 +2780,12 @@ void setBackgroundColor(NSColor nsColor) { * <li>ERROR_NULL_ARGUMENT - if the item order is null</li> * <li>ERROR_INVALID_ARGUMENT - if the item order is not the same length as the number of items</li> * </ul> - * + * * @see Tree#getColumnOrder() * @see TreeColumn#getMoveable() * @see TreeColumn#setMoveable(boolean) * @see SWT#Move - * + * * @since 3.2 */ public void setColumnOrder (int [] order) { @@ -2848,7 +2848,7 @@ void setFont (NSFont font) { /** * Marks the receiver's header as visible if the argument is <code>true</code>, - * and marks it invisible otherwise. + * and marks it invisible otherwise. * <p> * If one of the receiver's ancestors is not visible or some * other condition makes the receiver not visible, marking @@ -2861,7 +2861,7 @@ void setFont (NSFont font) { * <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.1 */ public void setHeaderVisible (boolean show) { @@ -2982,7 +2982,7 @@ void setItemHeight (Image image, NSFont font, boolean set) { /** * Marks the receiver's lines as visible if the argument is <code>true</code>, - * and marks it invisible otherwise. Note that some platforms draw + * and marks it invisible otherwise. Note that some platforms draw * grid lines while others may draw alternating row colors. * <p> * If one of the receiver's ancestors is not visible or some @@ -2996,7 +2996,7 @@ void setItemHeight (Image image, NSFont font, boolean set) { * <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.1 */ public void setLinesVisible (boolean show) { @@ -3080,7 +3080,7 @@ void setShouldScrollClipView (long /*int*/ id, long /*int*/ sel, boolean shouldS * <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.2 */ public void setSelection (TreeItem item) { @@ -3124,7 +3124,7 @@ public void setSelection (TreeItem [] items) { for (int i = 0; i < items.length; i++) { TreeItem item = items[i]; if (item != null) { - showItem(item, true); + showItem(item, true); break; } } @@ -3133,19 +3133,19 @@ public void setSelection (TreeItem [] items) { /** * Sets the column used by the sort indicator for the receiver. A null - * value will clear the sort indicator. The current sort column is cleared + * value will clear the sort indicator. The current sort column is cleared * before the new column is set. * * @param column the column used by the sort indicator or <code>null</code> - * + * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the column is disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the column is disposed</li> * </ul> * @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.2 */ public void setSortColumn (TreeColumn column) { @@ -3156,16 +3156,16 @@ public void setSortColumn (TreeColumn column) { } /** - * Sets the direction of the sort indicator for the receiver. The value + * Sets the direction of the sort indicator for the receiver. The value * can be one of <code>UP</code>, <code>DOWN</code> or <code>NONE</code>. * - * @param direction the direction of the sort indicator + * @param direction the direction of the sort indicator * * @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.2 */ public void setSortDirection (int direction) { @@ -3210,7 +3210,7 @@ void setSort (TreeColumn column, int direction) { * </ul> * * @see Tree#getTopItem() - * + * * @since 2.1 */ public void setTopItem (TreeItem item) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeColumn.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeColumn.java index f56d4bd52b..beb2bb0a38 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeColumn.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeColumn.java @@ -33,7 +33,7 @@ import org.eclipse.swt.events.*; * * @see <a href="http://www.eclipse.org/swt/snippets/#tree">Tree, TreeItem, TreeColumn snippets</a> * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> - * + * * @since 3.1 * @noextend This class is not intended to be subclassed by clients. */ @@ -53,7 +53,7 @@ public class TreeColumn extends Item { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -91,7 +91,7 @@ public TreeColumn (Tree parent, int style) { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -261,7 +261,7 @@ void drawInteriorWithFrame_inView (long /*int*/ id, long /*int*/ sel, NSRect cel destRect.y = cellRect.y; destRect.width = Math.min (imageSize.width, cellRect.width - 2 * MARGIN); destRect.height = Math.min (imageSize.height, cellRect.height); - boolean isFlipped = new NSView (view).isFlipped(); + boolean isFlipped = new NSView (view).isFlipped(); if (isFlipped) { context.saveGraphicsState (); NSAffineTransform transform = NSAffineTransform.transform (); @@ -296,7 +296,7 @@ void drawInteriorWithFrame_inView (long /*int*/ id, long /*int*/ sel, NSRect cel * text or image in the receiver. The value will be one of * <code>LEFT</code>, <code>RIGHT</code> or <code>CENTER</code>. * - * @return the alignment + * @return the alignment * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> @@ -333,8 +333,8 @@ public Tree getParent () { /** * Gets the moveable attribute. A column that is - * not moveable cannot be reordered by the user - * by dragging the header but may be reordered + * not moveable cannot be reordered by the user + * by dragging the header but may be reordered * by the programmer. * * @return the moveable attribute @@ -343,12 +343,12 @@ public Tree getParent () { * <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> - * + * * @see Tree#getColumnOrder() * @see Tree#setColumnOrder(int[]) * @see TreeColumn#setMoveable(boolean) * @see SWT#Move - * + * * @since 3.2 */ public boolean getMoveable () { @@ -383,7 +383,7 @@ public boolean getResizable () { * <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.2 */ public String getToolTipText () { @@ -511,7 +511,7 @@ public void removeSelectionListener(SelectionListener listener) { if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; eventTable.unhook (SWT.Selection, listener); - eventTable.unhook (SWT.DefaultSelection,listener); + eventTable.unhook (SWT.DefaultSelection,listener); } /** @@ -522,7 +522,7 @@ public void removeSelectionListener(SelectionListener listener) { * Note that due to a restriction on some platforms, the first column * is always left aligned. * </p> - * @param alignment the new alignment + * @param alignment the new alignment * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> @@ -563,8 +563,8 @@ public void setImage (Image image) { /** * Sets the moveable attribute. A column that is * moveable can be reordered by the user by dragging - * the header. A column that is not moveable cannot be - * dragged by the user but may be reordered + * the header. A column that is not moveable cannot be + * dragged by the user but may be reordered * by the programmer. * * @param moveable the moveable attribute @@ -573,12 +573,12 @@ public void setImage (Image image) { * <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> - * + * * @see Tree#setColumnOrder(int[]) * @see Tree#getColumnOrder() * @see TreeColumn#getMoveable() * @see SWT#Move - * + * * @since 3.2 */ public void setMoveable (boolean moveable) { @@ -623,24 +623,24 @@ public void setText (String string) { /** * Sets the receiver's tool tip text to the argument, which - * may be null indicating that the default tool tip for the + * may be null indicating that the default tool tip for the * control will be shown. For a control that has a default * tool tip, such as the Tree control on Windows, setting * the tool tip text to an empty string replaces the default, * causing no tool tip text to be shown. * <p> * The mnemonic indicator (character '&') is not displayed in a tool tip. - * To display a single '&' in the tool tip, the character '&' can be + * To display a single '&' in the tool tip, the character '&' can be * escaped by doubling it in the string. * </p> - * + * * @param string the new tool tip text (or null) * * @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.2 */ public void setToolTipText (String string) { @@ -663,7 +663,7 @@ public void setWidth (int width) { checkWidget (); if (width < 0) return; // TODO how to differentiate 0 and 1 cases? - width = Math.max (0, width - Tree.CELL_GAP); + width = Math.max (0, width - Tree.CELL_GAP); nsColumn.setWidth (width); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeItem.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeItem.java index 2fb28aa664..59c1506843 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeItem.java @@ -18,7 +18,7 @@ import org.eclipse.swt.internal.cocoa.*; /** * Instances of this class represent a selectable user interface object * that represents a hierarchy of tree items in a tree widget. - * + * * <dl> * <dt><b>Styles:</b></dt> * <dd>(none)</dd> @@ -47,7 +47,7 @@ public class TreeItem extends Item { Font [] cellFont; int width = -1; /** - * the handle to the OS resource + * the handle to the OS resource * (Warning: This field is platform dependent) * <p> * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT @@ -55,7 +55,7 @@ public class TreeItem extends Item { * within the packages provided by SWT. It is not available on all * platforms and should never be accessed from application code. * </p> - * + * * @noreference This field is not intended to be referenced by clients. */ public SWTTreeItem handle; @@ -68,7 +68,7 @@ public class TreeItem extends Item { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -102,7 +102,7 @@ public TreeItem (Tree parent, int style) { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -138,7 +138,7 @@ public TreeItem (Tree parent, int style, int index) { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -172,7 +172,7 @@ public TreeItem (TreeItem parentItem, int style) { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -328,16 +328,16 @@ void clear () { * <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> - * + * * @see SWT#VIRTUAL * @see SWT#SetData - * + * * @since 3.2 */ public void clear (int index, boolean all) { checkWidget (); int count = getItemCount (); - if (index < 0 || index >= count) + if (index < 0 || index >= count) error (SWT.ERROR_INVALID_RANGE); parent.clear (this, index, all); } @@ -348,7 +348,7 @@ public void clear (int index, boolean all) { * attributes of the items are set to their default values. If the * tree was created with the <code>SWT.VIRTUAL</code> style, these * attributes are requested again as needed. - * + * * @param all <code>true</code> if all child items should be cleared * recursively, and <code>false</code> otherwise * @@ -356,10 +356,10 @@ public void clear (int index, boolean all) { * <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> - * + * * @see SWT#VIRTUAL * @see SWT#SetData - * + * * @since 3.2 */ public void clearAll (boolean all) { @@ -401,14 +401,14 @@ void destroyWidget () { * Returns the receiver's background color. * * @return the background color - * + * * @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 2.0 - * + * */ public Color getBackground () { checkWidget (); @@ -426,7 +426,7 @@ public Color getBackground () { * <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.1 */ public Color getBackground (int index) { @@ -506,7 +506,7 @@ public Rectangle getBounds () { * <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.1 */ public Rectangle getBounds (int index) { @@ -613,9 +613,9 @@ public Font getFont (int index) { * <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 2.0 - * + * */ public Color getForeground () { checkWidget (); @@ -624,7 +624,7 @@ public Color getForeground () { } /** - * + * * Returns the foreground color at the given column index in the receiver. * * @param index the column index @@ -634,7 +634,7 @@ public Color getForeground () { * <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.1 */ public Color getForeground (int index) { @@ -684,7 +684,7 @@ public Image getImage () { * <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.1 */ public Image getImage (int index) { @@ -709,7 +709,7 @@ public Image getImage (int index) { * <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.1 */ public Rectangle getImageBounds (int index) { @@ -750,7 +750,7 @@ public Rectangle getImageBounds (int index) { * <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.1 */ public TreeItem getItem (int index) { @@ -784,7 +784,7 @@ public int getItemCount () { * <p> * Note: This is not the actual structure used by the receiver * to maintain its list of items, so modifying the array will - * not affect the receiver. + * not affect the receiver. * </p> * * @return the receiver's items @@ -862,7 +862,7 @@ public String getText () { * <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.1 */ public String getText (int index) { @@ -890,7 +890,7 @@ public String getText (int index) { * <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.3 */ public Rectangle getTextBounds (int index) { @@ -920,7 +920,7 @@ public Rectangle getTextBounds (int index) { /** * Searches the receiver's list starting at the first item - * (index 0) until an item is found that is equal to the + * (index 0) until an item is found that is equal to the * argument, and returns the index of that item. If no item * is found, returns -1. * @@ -935,7 +935,7 @@ public Rectangle getTextBounds (int index) { * <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.1 */ public int indexOf (TreeItem item) { @@ -1064,17 +1064,17 @@ void sendExpand (boolean expand, boolean recurse) { * if the argument is null. * * @param color the new color (or null) - * + * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> * </ul> * @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 2.0 - * + * */ public void setBackground (Color color) { checkWidget (); @@ -1090,7 +1090,7 @@ public void setBackground (Color color) { } /** - * Sets the background color at the given column index in the receiver + * Sets the background color at the given column index in the receiver * to the color specified by the argument, or to the default system color for the item * if the argument is null. * @@ -1098,15 +1098,15 @@ public void setBackground (Color color) { * @param color the new color (or null) * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> * </ul> * @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.1 - * + * */ public void setBackground (int index, Color color) { checkWidget (); @@ -1123,7 +1123,7 @@ public void setBackground (int index, Color color) { if (oldColor == color) return; cellBackground [index] = color; if (oldColor != null && oldColor.equals (color)) return; - cached = true; + cached = true; redraw (index); } @@ -1187,13 +1187,13 @@ public void setExpanded (boolean expanded) { * @param font the new font (or null) * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> * </ul> * @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.0 */ public void setFont (Font font) { @@ -1212,21 +1212,21 @@ public void setFont (Font font) { /** * Sets the font that the receiver will use to paint textual information - * for the specified cell in this item to the font specified by the - * argument, or to the default font for that kind of control if the + * for the specified cell in this item to the font specified by the + * argument, or to the default font for that kind of control if the * argument is null. * * @param index the column index * @param font the new font (or null) * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> * </ul> * @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.1 */ public void setFont (int index, Font font) { @@ -1257,15 +1257,15 @@ public void setFont (int index, Font font) { * @param color the new color (or null) * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> * </ul> * @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 2.0 - * + * */ public void setForeground (Color color) { checkWidget (); @@ -1281,7 +1281,7 @@ public void setForeground (Color color) { } /** - * Sets the foreground color at the given column index in the receiver + * Sets the foreground color at the given column index in the receiver * to the color specified by the argument, or to the default system color for the item * if the argument is null. * @@ -1289,15 +1289,15 @@ public void setForeground (Color color) { * @param color the new color (or null) * * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> + * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> * </ul> * @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.1 - * + * */ public void setForeground (int index, Color color){ checkWidget (); @@ -1319,7 +1319,7 @@ public void setForeground (int index, Color color){ } /** - * Sets the grayed state of the checkbox for this item. This state change + * Sets the grayed state of the checkbox for this item. This state change * only applies if the Tree was created with the SWT.CHECK style. * * @param grayed the new grayed state of the checkbox @@ -1339,8 +1339,8 @@ public void setGrayed (boolean grayed) { } /** - * Sets the image for multiple columns in the tree. - * + * Sets the image for multiple columns in the tree. + * * @param images the array of new images * * @exception IllegalArgumentException <ul> @@ -1351,7 +1351,7 @@ public void setGrayed (boolean grayed) { * <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.1 */ public void setImage (Image [] images) { @@ -1375,7 +1375,7 @@ public void setImage (Image [] images) { * <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.1 */ public void setImage (int index, Image image) { @@ -1399,7 +1399,7 @@ public void setImage (int index, Image image) { if (image != null && image.type == SWT.ICON) { if (image.equals (images [index])) return; } - images [index] = image; + images [index] = image; } cached = true; if (index == 0) parent.setScrollWidth (this); @@ -1431,7 +1431,7 @@ public void setItemCount (int count) { } /** - * Sets the text for multiple columns in the tree. + * Sets the text for multiple columns in the tree. * <p> * Note: If control characters like '\n', '\t' etc. are used * in the string, then the behavior is platform dependent. @@ -1445,7 +1445,7 @@ public void setItemCount (int count) { * <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.1 */ public void setText (String [] strings) { @@ -1473,7 +1473,7 @@ public void setText (String [] strings) { * <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.1 */ public void setText (int index, String string) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java index 66696e5fea..4b780d0d01 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java @@ -16,7 +16,7 @@ import org.eclipse.swt.internal.*; import org.eclipse.swt.internal.cocoa.*; /** - * This class is the abstract superclass of all user interface objects. + * This class is the abstract superclass of all user interface objects. * Widgets are created, disposed and issue notification to listeners * when events occur which affect them. * <dl> @@ -63,19 +63,19 @@ public abstract class Widget { static final int IGNORE_WHEEL = 1 << 9; static final int PARENT_BACKGROUND = 1 << 10; static final int THEME_BACKGROUND = 1 << 11; - + /* A layout was requested on this widget */ static final int LAYOUT_NEEDED = 1<<12; - + /* The preferred size of a child has changed */ static final int LAYOUT_CHANGED = 1<<13; - + /* A layout was requested in this widget hierachy */ static final int LAYOUT_CHILD = 1<<14; /* More global state flags */ static final int RELEASED = 1<<15; - static final int DISPOSE_SENT = 1<<16; + static final int DISPOSE_SENT = 1<<16; static final int FOREIGN_HANDLE = 1<<17; static final int DRAG_DETECT = 1<<18; static final int RESIZING = 1<<19; @@ -84,15 +84,15 @@ public abstract class Widget { static final int WEBKIT_EVENTS_FIX = 1<<20; static final String WEBKIT_EVENTS_FIX_KEY = "org.eclipse.swt.internal.webKitEventsFix"; //$NON-NLS-1$ static final String GLCONTEXT_KEY = "org.eclipse.swt.internal.cocoa.glcontext"; //$NON-NLS-1$ - + static final String IS_ACTIVE = "org.eclipse.swt.internal.isActive"; //$NON-NLS-1$ /* Notify of the opportunity to skin this widget */ static final int SKIN_NEEDED = 1<<21; - + /* Bidi "auto" text direction */ static final int HAS_AUTO_DIRECTION = 0; - + /* Bidi flag and for auto text direction */ static final int AUTO_TEXT_DIRECTION = SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT; @@ -110,7 +110,7 @@ Widget () { * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this - * class, or must be built by <em>bitwise OR</em>'ing together + * class, or must be built by <em>bitwise OR</em>'ing together * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. @@ -382,14 +382,14 @@ void becomeKeyWindow (long /*int*/ id, long /*int*/ sel) { } /** - * Marks the widget to be skinned. + * Marks the widget to be skinned. * <p> * The skin event is sent to the receiver's display when appropriate (usually before the next event * is handled). Widgets are automatically marked for skinning upon creation as well as when its skin - * id or class changes. The skin id and/or class can be changed by calling <code>Display.setData(String, Object)</code> - * with the keys SWT.SKIN_ID and/or SWT.SKIN_CLASS. Once the skin event is sent to a widget, it - * will not be sent again unless <code>reskin(int)</code> is called on the widget or on an ancestor - * while specifying the <code>SWT.ALL</code> flag. + * id or class changes. The skin id and/or class can be changed by calling <code>Display.setData(String, Object)</code> + * with the keys SWT.SKIN_ID and/or SWT.SKIN_CLASS. Once the skin event is sent to a widget, it + * will not be sent again unless <code>reskin(int)</code> is called on the widget or on an ancestor + * while specifying the <code>SWT.ALL</code> flag. * </p> * <p> * The parameter <code>flags</code> may be either: @@ -401,8 +401,8 @@ void becomeKeyWindow (long /*int*/ id, long /*int*/ sel) { * </dl> * </p> * @param flags the flags specifying how to reskin - * - * @exception SWTException + * + * @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> @@ -415,7 +415,7 @@ public void reskin (int flags) { if ((flags & SWT.ALL) != 0) reskinChildren (flags); } -void reskinChildren (int flags) { +void reskinChildren (int flags) { } void reskinWidget() { @@ -531,14 +531,14 @@ void checkParent (Widget parent) { /** * Checks that this class can be subclassed. * <p> - * The SWT class library is intended to be subclassed - * only at specific, controlled points (most notably, + * The SWT class library is intended to be subclassed + * only at specific, controlled points (most notably, * <code>Composite</code> and <code>Canvas</code> when * implementing new widgets). This method enforces this * rule unless it is overridden. * </p><p> * <em>IMPORTANT:</em> By providing an implementation of this - * method that allows a subclass of a class which does not + * method that allows a subclass of a class which does not * normally allow subclassing to be created, the implementer * agrees to be fully responsible for the fact that any such * subclass will likely fail between SWT releases and will be @@ -569,7 +569,7 @@ protected void checkSubclass () { * widget implementors to enforce the standard SWT invariants. * <p> * Currently, it is an error to invoke any method (other than - * <code>isDisposed()</code>) on a widget that has had its + * <code>isDisposed()</code>) on a widget that has had its * <code>dispose()</code> method called. It is also an error * to call widget methods from any thread that is different * from the thread that created the widget. @@ -626,7 +626,7 @@ void createWidget () { setOrientation(); register (); } - + void comboBoxSelectionDidChange(long /*int*/ id, long /*int*/ sel, long /*int*/ notification) { } @@ -757,7 +757,7 @@ void drawRect (long /*int*/ id, long /*int*/ sel, NSRect rect) { super_struct.super_class = OS.objc_msgSend(id, OS.sel_superclass); OS.objc_msgSendSuper(super_struct, sel, rect); if (!isDisposed()) { - /* + /* * Feature in Cocoa. There are widgets that draw outside of the UI thread, * such as the progress bar and default button. The fix is to draw the * widget but not send paint events. @@ -843,7 +843,7 @@ NSRect focusRingMaskBoundsForFrame(long /*int*/ id, long /*int*/ sel, NSRect cel * Returns the application defined widget data associated * with the receiver, or null if it has not been set. The * <em>widget data</em> is a single, unnamed field that is - * stored with every widget. + * stored with every widget. * <p> * Applications may put arbitrary objects in this field. If * the object stored in the widget data needs to be notified @@ -929,8 +929,8 @@ boolean getDrawing () { } /** - * Returns an array of listeners who will be notified when an event - * of the given type occurs. The event type is one of the event constants + * Returns an array of listeners who will be notified when an event + * of the given type occurs. The event type is one of the event constants * defined in class <code>SWT</code>. * * @param eventType the type of event to listen for @@ -946,7 +946,7 @@ boolean getDrawing () { * @see #addListener(int, Listener) * @see #removeListener(int, Listener) * @see #notifyListeners - * + * * @since 3.4 */ public Listener[] getListeners (int eventType) { @@ -1002,7 +1002,7 @@ NSRect headerRectOfColumn (long /*int*/ id, long /*int*/ sel, long /*int*/ colum void helpRequested(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) { } -void highlightSelectionInClipRect(long /*int*/ id, long /*int*/ sel, long /*int*/ rect) { +void highlightSelectionInClipRect(long /*int*/ id, long /*int*/ sel, long /*int*/ rect) { } long /*int*/ hitTest (long /*int*/ id, long /*int*/ sel, NSPoint point) { @@ -1043,9 +1043,9 @@ boolean isActive () { * and <code>false</code> otherwise. * * @return <code>true</code> when the widget has auto direction and <code>false</code> otherwise - * + * * @see #HAS_AUTO_DIRECTION - * + * * @since 3.105 */ public boolean isAutoDirection () { @@ -1301,7 +1301,7 @@ boolean outlineView_writeItems_toPasteboard(long /*int*/ id, long /*int*/ sel, l * <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> - * + * * @see SWT * @see #addListener * @see #getListeners(int) @@ -1429,7 +1429,7 @@ public void removeListener (int eventType, Listener listener) { * * @see Listener * @see #addListener - * + * * @noreference This method is not intended to be referenced by clients. * @nooverride This method is not intended to be re-implemented or extended by clients. */ @@ -1537,7 +1537,7 @@ boolean sendKeyEvent (NSEvent nsEvent, int type) { boolean sendKeyEvent (int type, Event event) { sendEvent (type, event); // widget could be disposed at this point - + /* * It is possible (but unlikely), that application * code could have disposed the widget in the key @@ -1581,7 +1581,7 @@ void sendVerticalSelection () { * Sets the application defined widget data associated * with the receiver to be the argument. The <em>widget * data</em> is a single, unnamed field that is stored - * with every widget. + * with every widget. * <p> * Applications may put arbitrary objects in this field. If * the object stored in the widget data needs to be notified @@ -1596,7 +1596,7 @@ void sendVerticalSelection () { * <li>ERROR_WIDGET_DISPOSED - when the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - when called from the wrong thread</li> * </ul> - * + * * @see #getData() */ public void setData (Object data) { @@ -1719,7 +1719,7 @@ boolean setInputState (Event event, NSEvent nsEvent, int type) { if ((modifierFlags & OS.NSShiftKeyMask) != 0) event.stateMask |= SWT.SHIFT; if ((modifierFlags & OS.NSControlKeyMask) != 0) event.stateMask |= SWT.CONTROL; if ((modifierFlags & OS.NSCommandKeyMask) != 0) event.stateMask |= SWT.COMMAND; - + int state = OS.GetCurrentEventButtonState (); if ((state & 0x1) != 0) event.stateMask |= SWT.BUTTON1; if ((state & 0x2) != 0) event.stateMask |= SWT.BUTTON3; @@ -1756,7 +1756,7 @@ boolean setInputState (Event event, NSEvent nsEvent, int type) { if (event.keyCode == SWT.CONTROL) event.stateMask |= SWT.CONTROL; if (event.keyCode == SWT.COMMAND) event.stateMask |= SWT.COMMAND; break; - } + } return true; } @@ -1790,14 +1790,14 @@ boolean setKeyState (Event event, int type, NSEvent nsEvent) { long /*int*/ uchrPtr = 0; long /*int*/ currentKbd = OS.TISCopyCurrentKeyboardInputSource(); long /*int*/ uchrCFData = OS.TISGetInputSourceProperty(currentKbd, OS.kTISPropertyUnicodeKeyLayoutData()); - + if (uchrCFData != 0) { uchrPtr = OS.CFDataGetBytePtr(uchrCFData); - + if (uchrPtr != 0 && OS.CFDataGetLength(uchrCFData) > 0) { long /*int*/ cgEvent = nsEvent.CGEvent(); long keyboardType = OS.CGEventGetIntegerValueField(cgEvent, OS.kCGKeyboardEventKeyboardType); - + int maxStringLength = 256; char [] output = new char [maxStringLength]; int [] actualStringLength = new int [1]; @@ -1816,7 +1816,7 @@ boolean setKeyState (Event event, int type, NSEvent nsEvent) { NSString unmodifiedChars = nsEvent.charactersIgnoringModifiers ().lowercaseString(); if (unmodifiedChars.length() > 0) event.keyCode = (char)unmodifiedChars.characterAtIndex(0); } - + if (currentKbd != 0) OS.CFRelease(currentKbd); } } @@ -1969,7 +1969,7 @@ boolean tableView_shouldSelectRow(long /*int*/ id, long /*int*/ sel, long /*int* return true; } -void tableView_setObjectValue_forTableColumn_row(long /*int*/ id, long /*int*/ sel, long /*int*/ aTableView, long /*int*/ anObject, long /*int*/ aTableColumn, long /*int*/ rowIndex) { +void tableView_setObjectValue_forTableColumn_row(long /*int*/ id, long /*int*/ sel, long /*int*/ aTableView, long /*int*/ anObject, long /*int*/ aTableColumn, long /*int*/ rowIndex) { } boolean tableView_shouldReorderColumn_toColumn(long /*int*/ id, long /*int*/ sel, long /*int*/ aTableView, long /*int*/ columnIndex, long /*int*/ newColumnIndex) { @@ -2047,39 +2047,39 @@ public String toString () { } void touchesBeganWithEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ event) { - callSuper(id, sel, event); + callSuper(id, sel, event); } void touchesCancelledWithEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ event) { - callSuper(id, sel, event); + callSuper(id, sel, event); } void touchesEndedWithEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ event) { - callSuper(id, sel, event); + callSuper(id, sel, event); } void touchesMovedWithEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ event) { - callSuper(id, sel, event); + callSuper(id, sel, event); } void beginGestureWithEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ event) { - callSuper(id, sel, event); + callSuper(id, sel, event); } void endGestureWithEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ event) { - callSuper(id, sel, event); + callSuper(id, sel, event); } void magnifyWithEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ event) { - callSuper(id, sel, event); + callSuper(id, sel, event); } void rotateWithEvent(long /*int*/ id, long /*int*/ sel, long /*int*/ event) { - callSuper(id, sel, event); + callSuper(id, sel, event); } void swipeWithEvent(long /*int*/ id, long /*int*/ sel, long /*int*/ event) { - callSuper(id, sel, event); + callSuper(id, sel, event); } void resetCursorRects (long /*int*/ id, long /*int*/ sel) { @@ -2112,10 +2112,10 @@ long /*int*/ view_stringForToolTip_point_userData (long /*int*/ id, long /*int*/ return 0; } -void viewDidMoveToWindow(long /*int*/ id, long /*int*/ sel) { +void viewDidMoveToWindow(long /*int*/ id, long /*int*/ sel) { } -void viewWillMoveToWindow(long /*int*/ id, long /*int*/ sel, long /*int*/ arg0) { +void viewWillMoveToWindow(long /*int*/ id, long /*int*/ sel, long /*int*/ arg0) { } void windowDidMove(long /*int*/ id, long /*int*/ sel, long /*int*/ notification) { |