From 5ac9a285370904f70d1bfedebeb9324141831c8d Mon Sep 17 00:00:00 2001
From: Andrey Loskutov
Date: Thu, 7 Jan 2016 22:13:38 +0100
Subject: Bug 485367 - cleaned trailing spaces in swt (cocoa)
Change-Id: I47e7c08d8fdd9beea2ace6603c5de79755925f48
Signed-off-by: Andrey Loskutov
@@ -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
* IMPORTANT: This field is not 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.
*
* IMPORTANT: This field is not 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.
*
* IMPORTANT: This field is not 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.
*
* IMPORTANT: This field is not 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.
*
* IMPORTANT: This field is not 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.
*
* IMPORTANT: This field is not 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.
*
* IMPORTANT: This field is not 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.
*
*
- *
+ *
* @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.
* ACC
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.
*
Accessible
* that were retrieved with Control.getAccessible()
.
*
- *
+ *
* @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.
*
- *
+ *
* @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 ACC
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 ACC
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 * IMPORTANT: This method is not 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. *
- * + * * @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 usinggetData(String)
. 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 setData(String, Object)
.
*/
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 /*