Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Keller2015-11-02 18:07:26 +0000
committerMarkus Keller2015-11-02 18:07:26 +0000
commit7082dd9c9ab28760ad0148f50b8dd66bdb6622f7 (patch)
treec4eed60ca49fe8cf50949d5ad7db6f5da98e8499 /bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt
parent7b95e78e991bc71e9e2b321efd5d25434257ad44 (diff)
downloadeclipse.platform.swt-7082dd9c9ab28760ad0148f50b8dd66bdb6622f7.tar.gz
eclipse.platform.swt-7082dd9c9ab28760ad0148f50b8dd66bdb6622f7.tar.xz
eclipse.platform.swt-7082dd9c9ab28760ad0148f50b8dd66bdb6622f7.zip
Bug 462633: Enable save actions for annotations
Added missing @Override/@Deprecated in cocoa
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Color.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Cursor.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Font.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/FontData.java3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/FontMetrics.java3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Path.java3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Pattern.java3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Region.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/TextLayout.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Transform.java3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Canvas.java27
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Caret.java3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Composite.java35
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java61
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Decorations.java13
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/FontDialog.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Group.java18
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/IME.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Label.java20
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Link.java27
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java25
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/MenuItem.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ProgressBar.java7
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Sash.java18
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scale.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ScrollBar.java9
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scrollable.java16
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Slider.java7
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Spinner.java32
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TabFolder.java21
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TabItem.java13
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java67
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableColumn.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableItem.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TaskBar.java3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TaskItem.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolBar.java32
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java35
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tracker.java1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java72
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeColumn.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeItem.java16
43 files changed, 691 insertions, 0 deletions
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 387bcb9e27..f20e2675ce 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
@@ -203,6 +203,7 @@ public Color(Device device, RGB rgb, int alpha) {
init();
}
+@Override
void destroy() {
handle = null;
}
@@ -217,6 +218,7 @@ void destroy() {
*
* @see #hashCode
*/
+@Override
public boolean equals(Object object) {
if (object == this) return true;
if (!(object instanceof Color)) return false;
@@ -298,6 +300,7 @@ public int getRed() {
*
* @see #equals
*/
+@Override
public int hashCode() {
if (isDisposed()) return 0;
return (int)(handle[0] * 255) ^ (int)(handle[1] * 255) ^ (int)(handle[2] * 255) ^ (int)(handle[3] * 255);
@@ -419,6 +422,7 @@ void init(int red, int green, int blue, int alpha) {
*
* @return <code>true</code> when the color is disposed and <code>false</code> otherwise
*/
+@Override
public boolean isDisposed() {
return handle == null;
}
@@ -429,6 +433,7 @@ public boolean isDisposed() {
*
* @return a string representation of the receiver
*/
+@Override
public String toString () {
if (isDisposed()) return "Color {*DISPOSED*}";
return "Color {" + getRed() + ", " + getGreen() + ", " + getBlue() + ", " + getAlpha() + "}";
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 c3cfc20de7..1dba750be7 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
@@ -415,6 +415,7 @@ public Cursor(Device device, ImageData source, int hotspotX, int hotspotY) {
}
}
+@Override
void destroy() {
handle.release();
handle = null;
@@ -430,6 +431,7 @@ void destroy() {
*
* @see #hashCode
*/
+@Override
public boolean equals (Object object) {
if (object == this) return true;
if (!(object instanceof Cursor)) return false;
@@ -447,6 +449,7 @@ public boolean equals (Object object) {
*
* @see #equals
*/
+@Override
public int hashCode () {
return handle != null ? (int)/*64*/handle.id : 0;
}
@@ -461,6 +464,7 @@ public int hashCode () {
*
* @return <code>true</code> when the cursor is disposed and <code>false</code> otherwise
*/
+@Override
public boolean isDisposed() {
return handle == null;
}
@@ -471,6 +475,7 @@ public boolean isDisposed() {
*
* @return a string representation of the receiver
*/
+@Override
public String toString () {
if (isDisposed()) return "Cursor {*DISPOSED*}";
return "Cursor {" + handle + "}";
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 20c7dd2333..29a5d1bb7c 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
@@ -209,6 +209,7 @@ void addTraits(NSMutableDictionary dict) {
}
}
+@Override
void destroy() {
handle.release();
handle = null;
@@ -225,6 +226,7 @@ void destroy() {
*
* @see #hashCode
*/
+@Override
public boolean equals(Object object) {
if (object == this) return true;
if (!(object instanceof Font)) return false;
@@ -300,6 +302,7 @@ public static Font cocoa_new(Device device, NSFont handle) {
*
* @see #equals
*/
+@Override
public int hashCode() {
return handle != null ? (int)/*64*/handle.id : 0;
}
@@ -367,6 +370,7 @@ void init(String name, float height, int style, String nsName) {
*
* @return <code>true</code> when the font is disposed and <code>false</code> otherwise
*/
+@Override
public boolean isDisposed() {
return handle == null;
}
@@ -377,6 +381,7 @@ public boolean isDisposed() {
*
* @return a string representation of the receiver
*/
+@Override
public String toString () {
if (isDisposed()) return "Font {*DISPOSED*}";
return "Font {" + handle + "}";
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 f17a174449..6f3500e9dc 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
@@ -219,6 +219,7 @@ public FontData(String name, int height, int style) {
*
* @see #hashCode
*/
+@Override
public boolean equals (Object object) {
if (object == this) return true;
if (!(object instanceof FontData)) return false;
@@ -319,6 +320,7 @@ public int getStyle() {
*
* @see #equals
*/
+@Override
public int hashCode () {
return name.hashCode() ^ getHeight() << 8 ^ style;
}
@@ -438,6 +440,7 @@ public void setStyle(int style) {
*
* @see FontData
*/
+@Override
public String toString() {
StringBuffer buffer = new StringBuffer(128);
buffer.append("1|");
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 b18b8f726f..ce992d490f 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
@@ -47,6 +47,7 @@ public static FontMetrics cocoa_new(int ascent, int descent, int averageCharWidt
*
* @see #hashCode
*/
+@Override
public boolean equals (Object object) {
if (object == this) return true;
if (!(object instanceof FontMetrics)) return false;
@@ -126,6 +127,7 @@ public int getLeading() {
*
* @see #equals
*/
+@Override
public int hashCode() {
return ascent ^ descent ^ averageCharWidth ^ leading ^ height;
}
@@ -137,6 +139,7 @@ String getName () {
return string.substring (index + 1, string.length ());
}
+@Override
public String toString() {
return getName() +
"{"
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 3f39395a0c..b5d05cce78 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
@@ -746,6 +746,7 @@ void createAlpha () {
}
}
+@Override
void destroy() {
if (memGC != null) memGC.dispose();
handle.release();
@@ -763,6 +764,7 @@ void destroy() {
*
* @see #hashCode
*/
+@Override
public boolean equals (Object object) {
if (object == this) return true;
if (!(object instanceof Image)) return false;
@@ -979,6 +981,7 @@ NSBitmapImageRep getRepresentation () {
*
* @see #equals
*/
+@Override
public int hashCode () {
if (imageDataProvider != null) {
return imageDataProvider.hashCode();
@@ -1367,6 +1370,7 @@ public void internal_dispose_GC (long /*int*/ hDC, GCData data) {
*
* @return <code>true</code> when the image is disposed and <code>false</code> otherwise
*/
+@Override
public boolean isDisposed() {
return handle == null;
}
@@ -1458,6 +1462,7 @@ public void setBackground(Color color) {
*
* @return a string representation of the receiver
*/
+@Override
public String toString () {
if (isDisposed()) return "Image {*DISPOSED*}";
return "Image {" + handle + "}";
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 43586e90a3..62ce07f30d 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
@@ -553,6 +553,7 @@ public void cubicTo(float cx1, float cy1, float cx2, float cy2, float x, float y
}
}
+@Override
void destroy() {
handle.release();
handle = null;
@@ -726,6 +727,7 @@ void init(PathData data) {
*
* @return <code>true</code> when the Path is disposed, and <code>false</code> otherwise
*/
+@Override
public boolean isDisposed() {
return handle == null;
}
@@ -823,6 +825,7 @@ public void quadTo(float cx, float cy, float x, float y) {
*
* @return a string representation of the receiver
*/
+@Override
public String toString () {
if (isDisposed()) return "Path {*DISPOSED*}";
return "Path {" + handle + "}";
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 04bb99b68a..3e61c32d3d 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
@@ -189,6 +189,7 @@ public Pattern(Device device, float x1, float y1, float x2, float y2, Color colo
}
}
+@Override
void destroy() {
if (color != null) color.release();
color = null;
@@ -208,6 +209,7 @@ void destroy() {
*
* @return <code>true</code> when the Pattern is disposed, and <code>false</code> otherwise
*/
+@Override
public boolean isDisposed() {
return device == null;
}
@@ -218,6 +220,7 @@ public boolean isDisposed() {
*
* @return a string representation of the receiver
*/
+@Override
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 dbe3ff2bc4..a071af29b9 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
@@ -412,6 +412,7 @@ long /*int*/ convertRgn(long /*int*/ message, long /*int*/ rgn, long /*int*/ r,
return 0;
}
+@Override
void destroy() {
OS.DisposeRgn(handle);
handle = 0;
@@ -427,6 +428,7 @@ void destroy() {
*
* @see #hashCode
*/
+@Override
public boolean equals(Object object) {
if (this == object) return true;
if (!(object instanceof Region)) return false;
@@ -503,6 +505,7 @@ long /*int*/ regionToRects(long /*int*/ message, long /*int*/ rgn, long /*int*/
*
* @see #equals
*/
+@Override
public int hashCode() {
return (int)/*64*/handle;
}
@@ -656,6 +659,7 @@ public boolean intersects(Rectangle rect) {
*
* @return <code>true</code> when the region is disposed, and <code>false</code> otherwise
*/
+@Override
public boolean isDisposed() {
return handle == 0;
}
@@ -856,6 +860,7 @@ public void translate (Point pt) {
*
* @return a string representation of the receiver
*/
+@Override
public String toString () {
if (isDisposed()) return "Region {*DISPOSED*}";
return "Region {" + handle + "}";
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 6e568f065e..186246dc7b 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
@@ -69,6 +69,7 @@ public final class TextLayout extends Resource {
int start;
long /*int*/ jniRef;
NSCell cell;
+ @Override
public String toString () {
return "StyleItem {" + start + ", " + style + "}";
}
@@ -344,6 +345,7 @@ void computeRuns() {
this.lineBounds = bounds;
}
+@Override
void destroy() {
freeRuns();
if (textStorage != null) textStorage.release();
@@ -1598,6 +1600,7 @@ void initClasses () {
*
* @return <code>true</code> when the text layout is disposed and <code>false</code> otherwise
*/
+@Override
public boolean isDisposed () {
return device == null;
}
@@ -2189,6 +2192,7 @@ public void setWidth (int width) {
*
* @return a string representation of the receiver
*/
+@Override
public String toString () {
if (isDisposed()) return "TextLayout {*DISPOSED*}";
return "TextLayout {" + text + "}";
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 30e7dd3e29..8866875ec1 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
@@ -160,6 +160,7 @@ static float[] checkTransform(float[] elements) {
return elements;
}
+@Override
void destroy() {
handle.release();
handle = null;
@@ -256,6 +257,7 @@ public void invert() {
*
* @return <code>true</code> when the Transform is disposed, and <code>false</code> otherwise
*/
+@Override
public boolean isDisposed() {
return handle == null;
}
@@ -478,6 +480,7 @@ public void translate(float offsetX, float offsetY) {
*
* @return a string representation of the receiver
*/
+@Override
public String toString() {
if (isDisposed()) return "Transform {*DISPOSED*}";
float[] elements = new float[6];
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 004dc6c342..f28e2af66c 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
@@ -58,11 +58,13 @@ Canvas () {
/* Do nothing */
}
+@Override
long /*int*/ attributedSubstringFromRange (long /*int*/ id, long /*int*/ sel, long /*int*/ range) {
if (ime != null) return ime.attributedSubstringFromRange (id, sel, range);
return super.attributedSubstringFromRange(id, sel, range);
}
+@Override
void sendFocusEvent(int type) {
if (caret != null) {
if (type == SWT.FocusIn) {
@@ -105,6 +107,7 @@ public Canvas (Composite parent, int style) {
super (parent, style);
}
+@Override
long /*int*/ characterIndexForPoint (long /*int*/ id, long /*int*/ sel, long /*int*/ point) {
if (ime != null) return ime.characterIndexForPoint (id, sel, point);
return super.characterIndexForPoint (id, sel, point);
@@ -135,6 +138,7 @@ public void drawBackground (GC gc, int x, int y, int width, int height) {
drawBackground(gc, x, y, width, height, 0, 0);
}
+@Override
void drawBackground (long /*int*/ id, NSGraphicsContext context, NSRect rect) {
super.drawBackground(id, context, rect);
if (glcontext != null) {
@@ -156,11 +160,13 @@ void drawBackground (long /*int*/ id, NSGraphicsContext context, NSRect rect) {
}
}
+@Override
void drawRect (long /*int*/ id, long /*int*/ sel, NSRect rect) {
if (glcontext != null && glcontext.view() == null) glcontext.setView(view);
super.drawRect(id, sel, rect);
}
+@Override
void drawWidget (long /*int*/ id, NSGraphicsContext context, NSRect rect) {
if (id != view.id) return;
super.drawWidget (id, context, rect);
@@ -216,6 +222,7 @@ void drawWidget (long /*int*/ id, NSGraphicsContext context, NSRect rect) {
}
}
+@Override
NSRect firstRectForCharacterRange (long /*int*/ id, long /*int*/ sel, long /*int*/ range) {
if (ime != null) return ime.firstRectForCharacterRange (id, sel, range);
return super.firstRectForCharacterRange (id, sel, range);
@@ -261,15 +268,18 @@ public IME getIME () {
return ime;
}
+@Override
boolean hasMarkedText (long /*int*/ id, long /*int*/ sel) {
if (ime != null) return ime.hasMarkedText (id, sel);
return super.hasMarkedText (id, sel);
}
+@Override
boolean imeInComposition () {
return ime != null && ime.isInlineEnabled () && ime.startOffset != -1;
}
+@Override
boolean insertText (long /*int*/ id, long /*int*/ sel, long /*int*/ string) {
if (ime != null) {
if (!ime.insertText (id, sel, string)) return false;
@@ -277,16 +287,19 @@ boolean insertText (long /*int*/ id, long /*int*/ sel, long /*int*/ string) {
return super.insertText (id, sel, string);
}
+@Override
boolean isOpaque (long /*int*/ id, long /*int*/ sel) {
if (glcontext != null) return true;
return super.isOpaque(id, sel);
}
+@Override
NSRange markedRange (long /*int*/ id, long /*int*/ sel) {
if (ime != null) return ime.markedRange (id, sel);
return super.markedRange (id, sel);
}
+@Override
boolean readSelectionFromPasteboard(long /*int*/ id, long /*int*/ sel, long /*int*/ pasteboard) {
boolean result = false;
NSPasteboard pboard = new NSPasteboard(pasteboard);
@@ -322,6 +335,7 @@ boolean readSelectionFromPasteboard(NSPasteboard pboard, NSString type) {
return result;
}
+@Override
void releaseChildren (boolean destroy) {
if (caret != null) {
caret.release (false);
@@ -334,18 +348,21 @@ void releaseChildren (boolean destroy) {
super.releaseChildren (destroy);
}
+@Override
void reskinChildren (int flags) {
if (caret != null) caret.reskin (flags);
if (ime != null) ime.reskin (flags);
super.reskinChildren (flags);
}
+@Override
void releaseWidget () {
super.releaseWidget();
if (visiblePath != null) visiblePath.release();
visiblePath = null;
}
+@Override
void resetVisibleRegion () {
super.resetVisibleRegion ();
if (visiblePath != null) visiblePath.release();
@@ -486,11 +503,13 @@ public void scroll (int destX, int destY, int x, int y, int width, int height, b
if (isFocus) caret.setFocus ();
}
+@Override
NSRange selectedRange (long /*int*/ id, long /*int*/ sel) {
if (ime != null) return ime.selectedRange (id, sel);
return super.selectedRange (id, sel);
}
+@Override
boolean sendKeyEvent (NSEvent nsEvent, int type) {
if (caret != null) NSCursor.setHiddenUntilMouseMoves (true);
return super.sendKeyEvent (nsEvent, type);
@@ -530,12 +549,14 @@ public void setCaret (Caret caret) {
}
}
+@Override
public void setFont (Font font) {
checkWidget ();
if (caret != null) caret.setFont (font);
super.setFont (font);
}
+@Override
void setOpenGLContext(Object value) {
glcontext = (NSOpenGLContext)value;
Shell shell = getShell ();
@@ -568,6 +589,7 @@ public void setIME (IME ime) {
this.ime = ime;
}
+@Override
boolean setMarkedText_selectedRange (long /*int*/ id, long /*int*/ sel, long /*int*/ string, long /*int*/ range) {
if (ime != null) {
if (!ime.setMarkedText_selectedRange (id, sel, string, range)) return false;
@@ -575,11 +597,13 @@ boolean setMarkedText_selectedRange (long /*int*/ id, long /*int*/ sel, long /*i
return super.setMarkedText_selectedRange (id, sel, string, range);
}
+@Override
long /*int*/ validAttributesForMarkedText (long /*int*/ id, long /*int*/ sel) {
if (ime != null) return ime.validAttributesForMarkedText (id, sel);
return super.validAttributesForMarkedText(id, sel);
}
+@Override
long /*int*/ validRequestorForSendType(long /*int*/ id, long /*int*/ sel, long /*int*/ sendType, long /*int*/ returnType) {
if (id == view.id) {
Accessible acc = getAccessible();
@@ -606,10 +630,12 @@ long /*int*/ validRequestorForSendType(long /*int*/ id, long /*int*/ sel, long /
return super.validRequestorForSendType(id, sel, sendType, returnType);
}
+@Override
void updateOpenGLContext(long /*int*/ id, long /*int*/ sel, long /*int*/ notification) {
if (glcontext != null) ((NSOpenGLContext)glcontext).update();
}
+@Override
void viewWillMoveToWindow(long /*int*/ id, long /*int*/ sel, long /*int*/ arg0) {
super.viewWillMoveToWindow(id, sel, arg0);
if (glcontext != null && id == view.id && arg0 != 0) {
@@ -624,6 +650,7 @@ void viewWillMoveToWindow(long /*int*/ id, long /*int*/ sel, long /*int*/ arg0)
}
}
+@Override
boolean writeSelectionToPasteboard(long /*int*/ id, long /*int*/ sel, long /*int*/ pasteboardObj, long /*int*/ typesObj) {
boolean result = false;
NSPasteboard pboard = new NSPasteboard(pasteboardObj);
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 01a25cc0fd..a9ffeeb00e 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
@@ -85,6 +85,7 @@ boolean blinkCaret () {
return hideCaret ();
}
+@Override
void createWidget () {
super.createWidget ();
blinkRate = display.getCaretBlinkTime ();
@@ -279,11 +280,13 @@ void killFocus () {
if (isVisible) hideCaret ();
}
+@Override
void releaseParent () {
super.releaseParent ();
if (this == parent.getCaret ()) parent.setCaret (null);
}
+@Override
void releaseWidget () {
super.releaseWidget ();
if (display.currentCaret == this) {
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 7e6147fe5d..0b2a7fc882 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
@@ -127,6 +127,7 @@ Control [] _getTabList () {
return tabList;
}
+@Override
boolean acceptsFirstMouse (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
if ((state & CANVAS) != 0) {
return true;
@@ -134,6 +135,7 @@ boolean acceptsFirstMouse (long /*int*/ id, long /*int*/ sel, long /*int*/ theEv
return super.acceptsFirstMouse (id, sel, theEvent);
}
+@Override
boolean acceptsFirstResponder (long /*int*/ id, long /*int*/ sel) {
if ((state & CANVAS) != 0) {
if ((style & SWT.NO_FOCUS) == 0 && hooksKeys ()) {
@@ -144,6 +146,7 @@ boolean acceptsFirstResponder (long /*int*/ id, long /*int*/ sel) {
return super.acceptsFirstResponder (id, sel);
}
+@Override
long /*int*/ accessibilityAttributeValue (long /*int*/ id, long /*int*/ sel, long /*int*/ arg0) {
NSString nsAttributeName = new NSString(arg0);
long /*int*/ superValue = super.accessibilityAttributeValue(id, sel, arg0);
@@ -177,6 +180,7 @@ long /*int*/ accessibilityAttributeValue (long /*int*/ id, long /*int*/ sel, lon
}
+@Override
boolean accessibilityIsIgnored(long /*int*/ id, long /*int*/ sel) {
if (id == accessibleHandle()) {
// If a Composite or subclass has an Accessible it should not be ignored.
@@ -233,6 +237,7 @@ public void changed (Control[] changed) {
}
}
+@Override
public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget();
display.runSkin ();
@@ -256,10 +261,12 @@ public Point computeSize (int wHint, int hHint, boolean changed) {
return new Point (trim.width, trim.height);
}
+@Override
protected void checkSubclass () {
/* Do nothing - Subclassing is allowed */
}
+@Override
Widget [] computeTabList () {
Widget result [] = super.computeTabList ();
if (result.length == 0) return result;
@@ -277,6 +284,7 @@ Widget [] computeTabList () {
return result;
}
+@Override
void createHandle () {
state |= CANVAS;
boolean scrolled = (style & (SWT.V_SCROLL | SWT.H_SCROLL)) != 0;
@@ -357,6 +365,7 @@ public void drawBackground(GC gc, int x, int y, int width, int height, int offse
}
}
+@Override
void drawBackground (long /*int*/ id, NSGraphicsContext context, NSRect rect) {
if (id != view.id) return;
if ((state & CANVAS) != 0) {
@@ -370,6 +379,7 @@ Composite findDeferredControl () {
return layoutCount > 0 ? this : parent.findDeferredControl ();
}
+@Override
Menu [] findMenus (Control control) {
if (control == this) return new Menu [0];
Menu result [] = super.findMenus (control);
@@ -387,6 +397,7 @@ Menu [] findMenus (Control control) {
return result;
}
+@Override
void fixChildren (Shell newShell, Shell oldShell, Decorations newDecorations, Decorations oldDecorations, Menu [] menus) {
super.fixChildren (newShell, oldShell, newDecorations, oldDecorations, menus);
Control [] children = _getChildren ();
@@ -534,10 +545,12 @@ public Control [] getTabList () {
return tabList;
}
+@Override
boolean hooksKeys () {
return hooks (SWT.KeyDown) || hooks (SWT.KeyUp);
}
+@Override
void invalidateChildrenVisibleRegion () {
Control [] children = _getChildren ();
for (int i=0; i<children.length; i++) {
@@ -570,6 +583,7 @@ public boolean isLayoutDeferred () {
return findDeferredControl () != null;
}
+@Override
boolean isOpaque (long /*int*/ id, long /*int*/ sel) {
if ((state & CANVAS) != 0) {
if (id == view.id) {
@@ -579,11 +593,13 @@ boolean isOpaque (long /*int*/ id, long /*int*/ sel) {
return super.isOpaque (id, sel);
}
+@Override
boolean isTabGroup () {
if ((state & CANVAS) != 0) return true;
return super.isTabGroup ();
}
+@Override
void keyDown (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
if (hasFocus()) {
if ((state & CANVAS) != 0) {
@@ -857,6 +873,7 @@ public void layout (Control [] changed, int flags) {
}
}
+@Override
void markLayout (boolean changed, boolean all) {
if (layout != null) {
state |= LAYOUT_NEEDED;
@@ -882,26 +899,31 @@ Point minimumSize (int wHint, int Hint, boolean changed) {
return new Point (width, height);
}
+@Override
boolean mouseEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent, int type) {
boolean result = super.mouseEvent (id, sel, theEvent, type);
return (state & CANVAS) == 0 ? result : new NSEvent (theEvent).type () != OS.NSLeftMouseDown;
}
+@Override
void pageDown(long /*int*/ id, long /*int*/ sel, long /*int*/ sender) {
if ((state & CANVAS) != 0) return;
super.pageDown(id, sel, sender);
}
+@Override
void pageUp(long /*int*/ id, long /*int*/ sel, long /*int*/ sender) {
if ((state & CANVAS) != 0) return;
super.pageUp(id, sel, sender);
}
+@Override
void reflectScrolledClipView (long /*int*/ id, long /*int*/ sel, long /*int*/ aClipView) {
if ((state & CANVAS) != 0) return;
super.reflectScrolledClipView (id, sel, aClipView);
}
+@Override
void releaseChildren (boolean destroy) {
Control [] children = _getChildren ();
for (int i=0; i<children.length; i++) {
@@ -913,6 +935,7 @@ void releaseChildren (boolean destroy) {
super.releaseChildren (destroy);
}
+@Override
void releaseWidget () {
super.releaseWidget ();
layout = null;
@@ -924,6 +947,7 @@ void removeControl (Control control) {
fixTabList (control);
}
+@Override
void reskinChildren (int flags) {
super.reskinChildren (flags);
Control [] children = _getChildren ();
@@ -933,6 +957,7 @@ void reskinChildren (int flags) {
}
}
+@Override
void resized () {
super.resized ();
if (layout != null) {
@@ -941,6 +966,7 @@ void resized () {
}
}
+@Override
void scrollWheel (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
if ((state & CANVAS) != 0) {
NSView view = scrollView != null ? scrollView : this.view;
@@ -1030,6 +1056,7 @@ public void setBackgroundMode (int mode) {
}
}
+@Override
public boolean setFocus () {
checkWidget ();
Control [] children = _getChildren ();
@@ -1090,6 +1117,7 @@ public void setLayoutDeferred (boolean defer) {
}
}
+@Override
boolean setScrollBarVisible (ScrollBar bar, boolean visible) {
boolean changed = super.setScrollBarVisible (bar, visible);
if (changed && layout != null) {
@@ -1099,6 +1127,7 @@ boolean setScrollBarVisible (ScrollBar bar, boolean visible) {
return changed;
}
+@Override
boolean setTabGroupFocus () {
if (isTabItem ()) return setTabItemFocus ();
boolean takeFocus = (style & SWT.NO_FOCUS) == 0;
@@ -1143,6 +1172,7 @@ public void setTabList (Control [] tabList) {
this.tabList = tabList;
}
+@Override
int traversalCode (int key, NSEvent theEvent) {
if ((state & CANVAS) != 0) {
if ((style & SWT.NO_FOCUS) != 0) return 0;
@@ -1151,6 +1181,7 @@ int traversalCode (int key, NSEvent theEvent) {
return super.traversalCode (key, theEvent);
}
+@Override
void updateBackgroundColor () {
super.updateBackgroundColor ();
Control [] children = _getChildren ();
@@ -1161,6 +1192,7 @@ void updateBackgroundColor () {
}
}
+@Override
void updateBackgroundImage () {
super.updateBackgroundImage ();
Control [] children = _getChildren ();
@@ -1171,6 +1203,7 @@ void updateBackgroundImage () {
}
}
+@Override
void updateBackgroundMode () {
super.updateBackgroundMode ();
Control [] children = _getChildren ();
@@ -1179,6 +1212,7 @@ void updateBackgroundMode () {
}
}
+@Override
void updateCursorRects (boolean enabled) {
super.updateCursorRects (enabled);
Control [] children = _getChildren ();
@@ -1188,6 +1222,7 @@ void updateCursorRects (boolean enabled) {
}
}
+@Override
void updateLayout (boolean all) {
Composite parent = findDeferredControl ();
if (parent != null) {
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 366da3de13..d0c84812d7 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
@@ -118,12 +118,14 @@ public Control (Composite parent, int style) {
createWidget ();
}
+@Override
boolean acceptsFirstMouse (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
Shell shell = getShell ();
if ((shell.style & SWT.ON_TOP) != 0) return true;
return super.acceptsFirstMouse (id, sel, theEvent);
}
+@Override
long /*int*/ accessibleHandle() {
long /*int*/ returnValue = view.id;
@@ -136,6 +138,7 @@ long /*int*/ accessibleHandle() {
return returnValue;
}
+@Override
long /*int*/ accessibilityActionDescription(long /*int*/ id, long /*int*/ sel, long /*int*/ arg0) {
if (id == accessibleHandle() && accessible != null) {
NSString actionName = new NSString(arg0);
@@ -145,6 +148,7 @@ long /*int*/ accessibilityActionDescription(long /*int*/ id, long /*int*/ sel, l
return super.accessibilityActionDescription(id, sel, arg0);
}
+@Override
long /*int*/ accessibilityActionNames(long /*int*/ id, long /*int*/ sel) {
long /*int*/ returnValue = super.accessibilityActionNames(id, sel);
if (handleIsAccessible(id)) {
@@ -163,6 +167,7 @@ long /*int*/ accessibilityActionNames(long /*int*/ id, long /*int*/ sel) {
return returnValue;
}
+@Override
long /*int*/ accessibilityAttributeNames(long /*int*/ id, long /*int*/ sel) {
long /*int*/ returnValue = 0;
@@ -195,6 +200,7 @@ boolean handleIsAccessible(long /*int*/ id) {
return id == accessibleHandle();
}
+@Override
long /*int*/ accessibilityParameterizedAttributeNames(long /*int*/ id, long /*int*/ sel) {
if (handleIsAccessible(id) && accessible != null) {
@@ -205,6 +211,7 @@ long /*int*/ accessibilityParameterizedAttributeNames(long /*int*/ id, long /*in
return super.accessibilityParameterizedAttributeNames(id, sel);
}
+@Override
void accessibilityPerformAction(long /*int*/ id, long /*int*/ sel, long /*int*/ arg0) {
if (handleIsAccessible(id) && accessible != null) {
NSString action = new NSString(arg0);
@@ -213,6 +220,7 @@ void accessibilityPerformAction(long /*int*/ id, long /*int*/ sel, long /*int*/
super.accessibilityPerformAction(id, sel, arg0);
}
+@Override
long /*int*/ accessibilityFocusedUIElement(long /*int*/ id, long /*int*/ sel) {
id returnValue = null;
@@ -228,6 +236,7 @@ long /*int*/ accessibilityFocusedUIElement(long /*int*/ id, long /*int*/ sel) {
return returnValue.id;
}
+@Override
long /*int*/ accessibilityHitTest(long /*int*/ id, long /*int*/ sel, NSPoint point) {
id returnValue = null;
@@ -243,6 +252,7 @@ long /*int*/ accessibilityHitTest(long /*int*/ id, long /*int*/ sel, NSPoint poi
return returnValue.id;
}
+@Override
long /*int*/ accessibilityAttributeValue(long /*int*/ id, long /*int*/ sel, long /*int*/ arg0) {
NSString attribute = new NSString(arg0);
long /*int*/ returnValue = 0;
@@ -272,6 +282,7 @@ long /*int*/ accessibilityAttributeValue(long /*int*/ id, long /*int*/ sel, long
return returnValue;
}
+@Override
long /*int*/ accessibilityAttributeValue_forParameter(long /*int*/ id, long /*int*/ sel, long /*int*/ arg0, long /*int*/ arg1) {
NSString attribute = new NSString(arg0);
@@ -290,6 +301,7 @@ long /*int*/ accessibilityAttributeValue_forParameter(long /*int*/ id, long /*in
return returnValue.id;
}
+@Override
boolean accessibilityIsAttributeSettable(long /*int*/ id, long /*int*/ sel, long /*int*/ arg0) {
boolean returnValue = false;
if (handleIsAccessible(id) && accessible != null) {
@@ -302,6 +314,7 @@ boolean accessibilityIsAttributeSettable(long /*int*/ id, long /*int*/ sel, long
return returnValue;
}
+@Override
void accessibilitySetValue_forAttribute(long /*int*/ id, long /*int*/ sel, long /*int*/ arg0, long /*int*/ arg1) {
if (handleIsAccessible(id) && accessible != null) {
id value = new id(arg0);
@@ -732,16 +745,19 @@ public void addTraverseListener (TraverseListener listener) {
addListener (SWT.Traverse,typedListener);
}
+@Override
boolean becomeFirstResponder (long /*int*/ id, long /*int*/ sel) {
if ((state & DISABLED) != 0) return false;
return super.becomeFirstResponder (id, sel);
}
+@Override
void beginGestureWithEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ event) {
if (!gestureEvent(id, event, SWT.GESTURE_BEGIN)) return;
super.beginGestureWithEvent(id, sel, event);
}
+@Override
void endGestureWithEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ event) {
if (!gestureEvent(id, event, SWT.GESTURE_END)) return;
super.endGestureWithEvent(id, sel, event);
@@ -792,6 +808,7 @@ void calculateVisibleRegion (NSView view, long /*int*/ visibleRgn, boolean clipC
OS.DisposeRgn (tempRgn);
}
+@Override
void cancelOperation(long /*int*/ id, long /*int*/ sel, long /*int*/ sender) {
// Cmd-. and escape arrive here. Forward the current event as a key event.
if (hasKeyboardFocus(id)) {
@@ -994,6 +1011,7 @@ NSAttributedString createString (String string, Font font, double /*float*/ [] f
return attribStr;
}
+@Override
void createWidget () {
state |= DRAG_DETECT;
checkOrientation (parent);
@@ -1026,17 +1044,20 @@ NSFont defaultNSFont () {
return display.getSystemFont().handle;
}
+@Override
void deregister () {
super.deregister ();
display.removeWidget (view);
}
+@Override
void destroyWidget () {
NSView view = topView ();
view.removeFromSuperview ();
releaseHandle ();
}
+@Override
void doCommandBySelector (long /*int*/ id, long /*int*/ sel, long /*int*/ selector) {
if (hasKeyboardFocus(id)) {
if (imeInComposition ()) return;
@@ -1227,6 +1248,7 @@ boolean drawsBackground() {
return true;
}
+@Override
void drawWidget (long /*int*/ id, NSGraphicsContext context, NSRect rect) {
if (id != paintView().id) return;
if (!hooks (SWT.Paint) && !filters (SWT.Paint)) return;
@@ -1358,6 +1380,7 @@ void fixFocus (Control focusControl) {
}
}
+@Override
void flagsChanged (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
if (hasKeyboardFocus(id)) {
if ((state & WEBKIT_EVENTS_FIX) == 0) {
@@ -1632,6 +1655,7 @@ public boolean getDragDetect () {
return (state & DRAG_DETECT) != 0;
}
+@Override
boolean getDrawing () {
return drawCount <= 0;
}
@@ -2046,6 +2070,7 @@ boolean hasRegion () {
return region != null || parent.hasRegion ();
}
+@Override
long /*int*/ hitTest (long /*int*/ id, long /*int*/ sel, NSPoint point) {
if ((state & DISABLED) != 0) return 0;
if (!isActive ()) return 0;
@@ -2062,6 +2087,7 @@ boolean imeInComposition () {
return false;
}
+@Override
boolean insertText (long /*int*/ id, long /*int*/ sel, long /*int*/ string) {
// sendKeyEvent may do something to run the event loop. That would cause
// 'string' to be released before any superclass could use it, so save it
@@ -2213,6 +2239,7 @@ void invalidateVisibleRegion () {
parent.resetVisibleRegion ();
}
+@Override
boolean isActive () {
if (getShell().getModalShell () != null) return false;
Dialog dialog = display.getModalDialog();
@@ -2231,6 +2258,7 @@ boolean isDescribedByLabel () {
return true;
}
+@Override
boolean isDrawing () {
return getDrawing() && parent.isDrawing();
}
@@ -2388,6 +2416,7 @@ public boolean isVisible () {
return getVisible () && parent.isVisible ();
}
+@Override
void keyDown (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
if (hasKeyboardFocus(id)) {
Shell s = this.getShell();
@@ -2426,6 +2455,7 @@ boolean hasKeyboardFocus(long /*int*/ inId) {
return view.window().firstResponder().id == inId;
}
+@Override
void keyUp (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
if (hasKeyboardFocus(id)) {
NSEvent nsEvent = new NSEvent (theEvent);
@@ -2434,6 +2464,7 @@ void keyUp (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
super.keyUp (id, sel, theEvent);
}
+@Override
void magnifyWithEvent(long /*int*/ id, long /*int*/ sel, long /*int*/ event) {
if (!gestureEvent(id, event, SWT.GESTURE_MAGNIFY)) return;
super.magnifyWithEvent(id, sel, event);
@@ -2443,6 +2474,7 @@ void markLayout (boolean changed, boolean all) {
/* Do nothing */
}
+@Override
long /*int*/ menuForEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
if (!isEnabled ()) return 0;
@@ -2474,6 +2506,7 @@ Decorations menuShell () {
return parent.menuShell ();
}
+@Override
void scrollWheel (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
boolean handled = false;
if (id == view.id) {
@@ -2561,6 +2594,7 @@ boolean mouseEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent, in
return true;
}
+@Override
void mouseDown(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
if (!mouseEvent(id, sel, theEvent, SWT.MouseDown)) return;
boolean tracking = isEventView (id);
@@ -2570,41 +2604,49 @@ void mouseDown(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
if (tracking) display.trackingControl = null;
}
+@Override
void mouseUp(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
if (!mouseEvent(id, sel, theEvent, SWT.MouseUp)) return;
super.mouseUp(id, sel, theEvent);
}
+@Override
void mouseDragged(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
if (!mouseEvent(id, sel, theEvent, SWT.MouseMove)) return;
super.mouseDragged(id, sel, theEvent);
}
+@Override
void rightMouseDown(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
if (!mouseEvent(id, sel, theEvent, SWT.MouseDown)) return;
super.rightMouseDown(id, sel, theEvent);
}
+@Override
void rightMouseUp(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
if (!mouseEvent(id, sel, theEvent, SWT.MouseUp)) return;
super.rightMouseUp(id, sel, theEvent);
}
+@Override
void rightMouseDragged(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
if (!mouseEvent(id, sel, theEvent, SWT.MouseMove)) return;
super.rightMouseDragged(id, sel, theEvent);
}
+@Override
void otherMouseDown(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
if (!mouseEvent(id, sel, theEvent, SWT.MouseDown)) return;
super.otherMouseDown(id, sel, theEvent);
}
+@Override
void otherMouseUp(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
if (!mouseEvent(id, sel, theEvent, SWT.MouseUp)) return;
super.otherMouseUp(id, sel, theEvent);
}
+@Override
void otherMouseDragged(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
if (!mouseEvent(id, sel, theEvent, SWT.MouseMove)) return;
super.otherMouseDragged(id, sel, theEvent);
@@ -2845,11 +2887,13 @@ long /*int*/ regionToRects(long /*int*/ message, long /*int*/ rgn, long /*int*/
return 0;
}
+@Override
void register () {
super.register ();
display.addWidget (view, this);
}
+@Override
void release (boolean destroy) {
Control next = null, previous = null;
if (destroy && parent != null) {
@@ -2870,6 +2914,7 @@ void release (boolean destroy) {
}
}
+@Override
void releaseHandle () {
super.releaseHandle ();
if (view != null) view.release();
@@ -2877,11 +2922,13 @@ void releaseHandle () {
parent = null;
}
+@Override
void releaseParent () {
invalidateVisibleRegion ();
parent.removeControl (this);
}
+@Override
void releaseWidget () {
super.releaseWidget ();
if (display.currentControl == this) {
@@ -3302,6 +3349,7 @@ void resized () {
sendEvent (SWT.Resize);
}
+@Override
void rotateWithEvent(long /*int*/ id, long /*int*/ sel, long /*int*/ event) {
if (!gestureEvent(id, event, SWT.GESTURE_ROTATE)) return;
super.rotateWithEvent(id, sel, event);
@@ -3637,6 +3685,7 @@ public void setCapture (boolean capture) {
checkWidget();
}
+@Override
void setClipRegion (NSView view) {
if (regionPath != null) {
NSView rgnView = topView ();
@@ -3825,6 +3874,7 @@ public void setForeground (Color color) {
void setForeground (double /*float*/ [] color) {
}
+@Override
void setFrameOrigin (long /*int*/ id, long /*int*/ sel, NSPoint point) {
NSView topView = topView ();
if (topView.id != id) {
@@ -3839,6 +3889,7 @@ void setFrameOrigin (long /*int*/ id, long /*int*/ sel, NSPoint point) {
}
}
+@Override
void setFrameSize (long /*int*/ id, long /*int*/ sel, NSSize size) {
NSView topView = topView ();
if (topView.id != id) {
@@ -4144,6 +4195,7 @@ void setSmallSize () {
}
}
+@Override
boolean setTabItemFocus () {
if (!isShowing ()) return false;
return forceFocus ();
@@ -4301,6 +4353,7 @@ void setZOrder () {
parent.contentView().addSubview(topView, OS.NSWindowBelow, null);
}
+@Override
boolean shouldDelayWindowOrderingForEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
Shell shell = getShell ();
if ((shell.style & SWT.ON_TOP) != 0) return false;
@@ -4394,6 +4447,7 @@ void sort (int [] items) {
}
}
+@Override
void swipeWithEvent(long /*int*/ id, long /*int*/ sel, long /*int*/ event) {
if (!gestureEvent(id, event, SWT.GESTURE_SWIPE)) return;
super.swipeWithEvent(id, sel, event);
@@ -4406,6 +4460,7 @@ NSSize textExtent (String string) {
return size;
}
+@Override
String tooltipText () {
return toolTipText;
}
@@ -4592,21 +4647,25 @@ boolean touchEvent(long /*int*/ id, long /*int*/ sel, long /*int*/ eventPtr) {
return true;
}
+@Override
void touchesBeganWithEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ event) {
if (!touchEvent(id, sel, event)) return;
super.touchesBeganWithEvent(id, sel, event);
}
+@Override
void touchesCancelledWithEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ event) {
if (!touchEvent(id, sel, event)) return;
super.touchesCancelledWithEvent(id, sel, event);
}
+@Override
void touchesEndedWithEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ event) {
if (!touchEvent(id, sel, event)) return;
super.touchesEndedWithEvent(id, sel, event);
}
+@Override
void touchesMovedWithEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ event) {
if (!touchEvent(id, sel, event)) return;
super.touchesMovedWithEvent(id, sel, event);
@@ -5035,10 +5094,12 @@ void updateBackgroundMode () {
}
}
+@Override
void resetCursorRects (long /*int*/ id, long /*int*/ sel) {
if (isEnabled ()) callSuper (id, sel);
}
+@Override
void updateTrackingAreas (long /*int*/ id, long /*int*/ sel) {
if (isEnabled ()) callSuper (id, sel);
}
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 7be554d06f..b0246b5818 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
@@ -166,6 +166,7 @@ void bringToTop (boolean force) {
moveAbove (null);
}
+@Override
protected void checkSubclass () {
if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
}
@@ -185,10 +186,12 @@ int compare (ImageData data1, ImageData data2) {
return data1.width > data2.width || data1.height > data2.height ? -1 : 1;
}
+@Override
Widget computeTabGroup () {
return this;
}
+@Override
Control computeTabRoot () {
return this;
}
@@ -346,6 +349,7 @@ public boolean getMinimized () {
return minimized;
}
+@Override
String getNameText () {
return getText ();
}
@@ -368,23 +372,28 @@ public String getText () {
return text;
}
+@Override
public boolean isReparentable () {
checkWidget();
return false;
}
+@Override
boolean isTabGroup () {
return true;
}
+@Override
boolean isTabItem () {
return false;
}
+@Override
Decorations menuShell () {
return this;
}
+@Override
void releaseChildren (boolean destroy) {
if (menuBar != null) {
menuBar.dispose ();
@@ -403,6 +412,7 @@ void releaseChildren (boolean destroy) {
menus = null;
}
}
+@Override
void releaseWidget () {
super.releaseWidget ();
image = null;
@@ -411,6 +421,7 @@ void releaseWidget () {
defaultButton = null;
}
+@Override
void reskinChildren (int flags) {
if (menuBar != null) menuBar.reskin (flags);
Menu [] menus = display.getMenus (this);
@@ -687,10 +698,12 @@ void sort (Image [] images) {
}
}
+@Override
boolean traverseItem (boolean next) {
return false;
}
+@Override
boolean traverseReturn () {
if (defaultButton == null || defaultButton.isDisposed ()) return false;
if (!defaultButton.isVisible () || !defaultButton.isEnabled ()) return false;
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 427c3f3149..995c3f8738 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
@@ -113,6 +113,7 @@ public boolean getEffectsVisible () {
* @return the FontData for the selected font, or null
* @deprecated use #getFontList ()
*/
+@Deprecated
public FontData getFontData () {
return fontData;
}
@@ -225,6 +226,7 @@ public void setEffectsVisible(boolean visible) {
* @param fontData the FontData to use initially, or null
* @deprecated use #setFontList (FontData [])
*/
+@Deprecated
public void setFontData (FontData fontData) {
this.fontData = fontData;
}
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 4e5fe880cc..a8a0ea6c81 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
@@ -93,10 +93,12 @@ static int checkStyle (int style) {
return style & ~(SWT.H_SCROLL | SWT.V_SCROLL);
}
+@Override
protected void checkSubclass () {
if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
}
+@Override
public Rectangle computeTrim (int x, int y, int width, int height) {
checkWidget ();
NSBox widget = (NSBox)view;
@@ -118,10 +120,12 @@ public Rectangle computeTrim (int x, int y, int width, int height) {
return super.computeTrim(x, y, width, height);
}
+@Override
NSView contentView () {
return contentView;
}
+@Override
void createHandle () {
state |= THEME_BACKGROUND;
NSBox widget = (NSBox)new SWTBox().alloc();
@@ -140,10 +144,12 @@ void createHandle () {
view = widget;
}
+@Override
NSFont defaultNSFont () {
return display.boxFont;
}
+@Override
void deregister () {
super.deregister ();
display.removeWidget (contentView);
@@ -151,15 +157,18 @@ void deregister () {
display.removeWidget (box.titleCell());
}
+@Override
void drawBackground (long /*int*/ id, NSGraphicsContext context, NSRect rect) {
if (id != view.id) return;
fillBackground (view, context, rect, -1);
}
+@Override
NSView eventView () {
return contentView;
}
+@Override
public Rectangle getClientArea () {
checkWidget();
NSRect rect = contentView.bounds();
@@ -168,6 +177,7 @@ public Rectangle getClientArea () {
return new Rectangle((int)(rect.x) + hMargin, (int)(rect.y) + vMargin, width, height);
}
+@Override
String getNameText () {
return getText ();
}
@@ -188,14 +198,17 @@ public String getText () {
checkWidget ();
return text;
}
+@Override
boolean isTransparent() {
return true;
}
+@Override
float getThemeAlpha () {
return (background != null ? 1 : 0.25f) * parent.getThemeAlpha ();
}
+@Override
void register () {
super.register ();
display.addWidget (contentView, this);
@@ -203,20 +216,24 @@ void register () {
display.addWidget (box.titleCell(), this);
}
+@Override
void releaseHandle () {
super.releaseHandle ();
if (contentView != null) contentView.release();
contentView = null;
}
+@Override
void resized() {
if (!ignoreResize) super.resized();
}
+@Override
void setFont(NSFont font) {
((NSBox) view).setTitleFont(font);
}
+@Override
void setForeground (double /*float*/ [] color) {
NSColor nsColor;
if (color == null) {
@@ -228,6 +245,7 @@ void setForeground (double /*float*/ [] color) {
cell.setTextColor (nsColor);
}
+@Override
void setOrientation () {
int direction = (style & SWT.RIGHT_TO_LEFT) != 0 ? OS.NSWritingDirectionRightToLeft : OS.NSWritingDirectionLeftToRight;
NSTextFieldCell cell = new NSTextFieldCell (((NSBox)view).titleCell ().id);
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 6e04f8b9d0..6e2408b60f 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
@@ -85,6 +85,7 @@ public IME (Canvas parent, int style) {
createWidget ();
}
+@Override
long /*int*/ attributedSubstringFromRange (long /*int*/ id, long /*int*/ sel, long /*int*/ rangePtr) {
Event event = new Event ();
event.detail = SWT.COMPOSITION_SELECTION;
@@ -104,6 +105,7 @@ long /*int*/ attributedSubstringFromRange (long /*int*/ id, long /*int*/ sel, lo
return 0;
}
+@Override
long /*int*/ characterIndexForPoint (long /*int*/ id, long /*int*/ sel, long /*int*/ point) {
if (!isInlineEnabled ()) return OS.NSNotFound;
NSPoint pt = new NSPoint ();
@@ -120,6 +122,7 @@ long /*int*/ characterIndexForPoint (long /*int*/ id, long /*int*/ sel, long /*i
return offset != -1 ? offset : OS.NSNotFound;
}
+@Override
void createWidget () {
text = "";
startOffset = -1;
@@ -128,6 +131,7 @@ void createWidget () {
}
}
+@Override
NSRect firstRectForCharacterRange(long /*int*/ id, long /*int*/ sel, long /*int*/ range) {
NSRect rect = new NSRect ();
Caret caret = parent.caret;
@@ -330,10 +334,12 @@ public boolean getWideCaret() {
return false;
}
+@Override
boolean hasMarkedText (long /*int*/ id, long /*int*/ sel) {
return text.length () != 0;
}
+@Override
boolean insertText (long /*int*/ id, long /*int*/ sel, long /*int*/ string) {
if (startOffset == -1) return true;
NSString str = new NSString (string);
@@ -360,6 +366,7 @@ boolean isInlineEnabled () {
return hooks (SWT.ImeComposition);
}
+@Override
NSRange markedRange (long /*int*/ id, long /*int*/ sel) {
NSRange range = new NSRange ();
if (startOffset != -1) {
@@ -383,11 +390,13 @@ void resetStyles () {
ranges = null;
}
+@Override
void releaseParent () {
super.releaseParent ();
if (this == parent.getIME ()) parent.setIME (null);
}
+@Override
void releaseWidget () {
super.releaseWidget ();
parent = null;
@@ -395,6 +404,7 @@ void releaseWidget () {
resetStyles ();
}
+@Override
NSRange selectedRange (long /*int*/ id, long /*int*/ sel) {
Event event = new Event ();
event.detail = SWT.COMPOSITION_SELECTION;
@@ -429,6 +439,7 @@ public void setCompositionOffset (int offset) {
}
}
+@Override
boolean setMarkedText_selectedRange (long /*int*/ id, long /*int*/ sel, long /*int*/ string, long /*int*/ selRange) {
if (!isInlineEnabled ()) return true;
resetStyles ();
@@ -494,6 +505,7 @@ boolean setMarkedText_selectedRange (long /*int*/ id, long /*int*/ sel, long /*i
return true;
}
+@Override
long /*int*/ validAttributesForMarkedText (long /*int*/ id, long /*int*/ sel) {
NSMutableArray attribs = NSMutableArray.arrayWithCapacity (6);
attribs.addObject (new NSString (OS.NSForegroundColorAttributeName ()));
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 a48d22aae6..688f48d30a 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
@@ -95,15 +95,18 @@ public Label (Composite parent, int style) {
super (parent, checkStyle (style));
}
+@Override
long /*int*/ accessibleHandle() {
return eventView().id;
}
+@Override
boolean accessibilityIsIgnored(long /*int*/ id, long /*int*/ sel) {
if (id == view.id) return true;
return super.accessibilityIsIgnored(id, sel);
}
+@Override
void addRelation (Control control) {
if (!control.isDescribedByLabel ()) return;
@@ -130,6 +133,7 @@ static int checkStyle (int style) {
return checkBits (style, SWT.LEFT, SWT.CENTER, SWT.RIGHT, 0, 0, 0);
}
+@Override
public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget();
int width = DEFAULT_WIDTH;
@@ -174,6 +178,7 @@ public Point computeSize (int wHint, int hHint, boolean changed) {
return new Point (width, height);
}
+@Override
void createHandle () {
state |= THEME_BACKGROUND;
NSBox widget = (NSBox)new SWTBox().alloc();
@@ -253,6 +258,7 @@ void createHandle () {
view = widget;
}
+@Override
void createWidget() {
text = "";
super.createWidget ();
@@ -264,10 +270,12 @@ NSAttributedString createString() {
return attribStr;
}
+@Override
NSFont defaultNSFont () {
return display.textFieldFont;
}
+@Override
void deregister () {
super.deregister ();
if (textView != null) {
@@ -281,19 +289,23 @@ void deregister () {
if (separator != null) display.removeWidget(separator);
}
+@Override
void drawBackground (long /*int*/ id, NSGraphicsContext context, NSRect rect) {
if (id != view.id) return;
fillBackground(view, context, rect, -1);
}
+@Override
long /*int*/ imageView() {
return imageView.id;
};
+@Override
boolean drawsBackground() {
return background != null || backgroundImage != null;
}
+@Override
NSView eventView () {
return ((NSBox)view).contentView();
}
@@ -336,6 +348,7 @@ public Image getImage () {
return image;
}
+@Override
String getNameText () {
return getText ();
}
@@ -358,10 +371,12 @@ public String getText () {
return text;
}
+@Override
boolean isDescribedByLabel () {
return false;
}
+@Override
void register () {
super.register ();
if (textView != null) {
@@ -375,6 +390,7 @@ void register () {
if (separator != null) display.addWidget(separator, this);
}
+@Override
void releaseHandle () {
super.releaseHandle ();
if (textView != null) textView.release();
@@ -388,6 +404,7 @@ void releaseHandle () {
/*
* Remove "Labeled by" relations from the receiver.
*/
+@Override
void removeRelation () {
if (textView != null) {
textView.cell().accessibilitySetOverrideValue(null, OS.NSAccessibilityServesAsTitleForUIElementsAttribute);
@@ -428,6 +445,7 @@ void _setAlignment() {
}
}
+@Override
void setFont(NSFont font) {
if (textView != null) {
NSCell cell = new NSCell(textView.cell());
@@ -436,12 +454,14 @@ void setFont(NSFont font) {
}
}
+@Override
void setForeground (double /*float*/ [] color) {
if ((style & SWT.SEPARATOR) != 0) return;
NSCell cell = new NSCell(textView.cell());
cell.setAttributedStringValue(createString());
}
+@Override
boolean setTabItemFocus () {
return false;
}
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 937417e556..d8be139bca 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
@@ -110,6 +110,7 @@ public void addSelectionListener (SelectionListener listener) {
addListener (SWT.DefaultSelection, typedListener);
}
+@Override
boolean textView_clickOnLink_atIndex(long /*int*/ id, long /*int*/ sel, long /*int*/ textView, long /*int*/ link, long /*int*/ charIndex) {
NSString str = new NSString (link);
Event event = new Event ();
@@ -128,6 +129,7 @@ boolean textView_clickOnLink_atIndex(long /*int*/ id, long /*int*/ sel, long /*i
return true;
}
+@Override
boolean sendMouseEvent (NSEvent nsEvent, int type, boolean send) {
if (type == SWT.MouseMove) {
if (view.window().firstResponder().id != view.id) {
@@ -137,6 +139,7 @@ boolean sendMouseEvent (NSEvent nsEvent, int type, boolean send) {
return super.sendMouseEvent(nsEvent, type, send);
}
+@Override
public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget ();
if (wHint != SWT.DEFAULT && wHint < 0) wHint = 0;
@@ -185,6 +188,7 @@ public Point computeSize (int wHint, int hHint, boolean changed) {
return new Point (width, height);
}
+@Override
void createHandle () {
state |= THEME_BACKGROUND;
NSScrollView scrollWidget = (NSScrollView)new SWTScrollView().alloc();
@@ -218,6 +222,7 @@ void createHandle () {
view = widget;
}
+@Override
void createWidget () {
super.createWidget ();
text = "";
@@ -229,15 +234,18 @@ void createWidget () {
focusIndex = -1;
}
+@Override
NSFont defaultNSFont () {
return display.textFieldFont;
}
+@Override
void deregister () {
super.deregister ();
if (scrollView != null) display.removeWidget (scrollView);
}
+@Override
void drawBackground (long /*int*/ id, NSGraphicsContext context, NSRect rectangle) {
fillBackground (view, context, rectangle, -1);
if (!hasFocus() || focusIndex == -1) return;
@@ -260,6 +268,7 @@ void drawBackground (long /*int*/ id, NSGraphicsContext context, NSRect rectangl
}
}
+@Override
Cursor findCursor () {
Cursor cursor = super.findCursor();
if (cursor != null) return cursor;
@@ -272,6 +281,7 @@ Cursor findCursor () {
return null;
}
+@Override
void enableWidget (boolean enabled) {
super.enableWidget (enabled);
NSColor nsColor = null;
@@ -344,6 +354,7 @@ NSRect[] getRectangles(int linkIndex) {
return result;
}
+@Override
String getNameText () {
return getText ();
}
@@ -365,6 +376,7 @@ public String getText () {
return text;
}
+@Override
void mouseUp(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
/*
* Feature in Cocoa: Link click notices are sent on mouseDown, but for some reason, Cocoa
@@ -378,21 +390,25 @@ void mouseUp(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
super.mouseUp(id, sel, theEvent);
}
+@Override
boolean shouldDrawInsertionPoint(long /*int*/ id, long /*int*/ sel) {
return false;
}
+@Override
void register () {
super.register ();
display.addWidget(scrollView, this);
}
+@Override
void releaseHandle () {
super.releaseHandle ();
if (scrollView != null) scrollView.release();
scrollView = null;
}
+@Override
void releaseWidget () {
super.releaseWidget ();
offsets = null;
@@ -582,11 +598,13 @@ void scrollWheel(long id, long sel, long theEvent) {
parent.scrollWheel(parent.view.id, sel, theEvent);
}
+@Override
void sendFocusEvent(int type) {
if (focusIndex != -1) redrawWidget(view, false);
super.sendFocusEvent(type);
}
+@Override
boolean sendKeyEvent(int type, Event event) {
boolean result = super.sendKeyEvent (type, event);
if (!result) return result;
@@ -623,10 +641,12 @@ boolean sendKeyEvent(int type, Event event) {
return result;
}
+@Override
void setBackgroundColor(NSColor nsColor) {
setBackground(nsColor);
}
+@Override
void setBackgroundImage(NSImage image) {
((NSTextView) view).setDrawsBackground(image == null);
}
@@ -641,10 +661,12 @@ void setBackground(NSColor nsColor) {
}
}
+@Override
void setFont(NSFont font) {
((NSTextView) view).setFont(font);
}
+@Override
void setForeground (double /*float*/ [] color) {
if (!getEnabled ()) return;
NSColor nsColor;
@@ -656,6 +678,7 @@ void setForeground (double /*float*/ [] color) {
((NSTextView) view).setTextColor (nsColor);
}
+@Override
void setOrientation () {
NSTextView widget = (NSTextView)view;
int direction = (style & SWT.RIGHT_TO_LEFT) != 0 ? OS.NSWritingDirectionRightToLeft : OS.NSWritingDirectionLeftToRight;
@@ -718,15 +741,18 @@ public void setText (String string) {
}
}
+@Override
void setZOrder () {
super.setZOrder ();
if (scrollView != null) scrollView.setDocumentView (view);
}
+@Override
NSView topView () {
return scrollView;
}
+@Override
int traversalCode (int key, NSEvent theEvent) {
if (offsets.length == 0) return 0;
int bits = super.traversalCode (key, theEvent);
@@ -743,6 +769,7 @@ int traversalCode (int key, NSEvent theEvent) {
return bits;
}
+@Override
void updateCursorRects (boolean enabled) {
super.updateCursorRects (enabled);
if (scrollView == null) return;
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 e94fde4d69..e97e6358ac 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
@@ -81,6 +81,7 @@ public List (Composite parent, int style) {
super (parent, checkStyle (style));
}
+@Override
long /*int*/ accessibilityAttributeValue (long /*int*/ id, long /*int*/ sel, long /*int*/ arg0) {
// if (attributeName.isEqualToString(OS.NSAccessibilityHeaderAttribute)) {
// /*
@@ -96,6 +97,7 @@ long /*int*/ accessibilityAttributeValue (long /*int*/ id, long /*int*/ sel, lon
return super.accessibilityAttributeValue(id, sel, arg0);
}
+@Override
boolean acceptsFirstResponder (long /*int*/ id, long /*int*/ sel) {
return true;
}
@@ -209,6 +211,7 @@ static int checkStyle (int style) {
return checkBits (style, SWT.SINGLE, SWT.MULTI, 0, 0, 0, 0);
}
+@Override
public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget();
int width = 0;
@@ -240,6 +243,7 @@ public Point computeSize (int wHint, int hHint, boolean changed) {
return new Point (rect.width, rect.height);
}
+@Override
void createHandle () {
NSScrollView scrollWidget = (NSScrollView)new SWTScrollView().alloc();
scrollWidget.init();
@@ -272,19 +276,23 @@ void createHandle () {
view = widget;
}
+@Override
void createWidget () {
super.createWidget ();
items = new String [4];
}
+@Override
Color defaultBackground () {
return display.getWidgetColor (SWT.COLOR_LIST_BACKGROUND);
}
+@Override
NSFont defaultNSFont () {
return display.tableViewFont;
}
+@Override
Color defaultForeground () {
return display.getWidgetColor (SWT.COLOR_LIST_FOREGROUND);
}
@@ -388,6 +396,7 @@ public void deselectAll () {
ignoreSelect = false;
}
+@Override
boolean dragDetect(int x, int y, boolean filter, boolean[] consume) {
NSTableView widget = (NSTableView)view;
NSPoint pt = new NSPoint();
@@ -409,6 +418,7 @@ boolean dragDetect(int x, int y, boolean filter, boolean[] consume) {
return dragging;
}
+@Override
void drawBackgroundInClipRect(long /*int*/ id, long /*int*/ sel, NSRect rect) {
super.drawViewBackgroundInRect(id, sel, rect);
if (id != view.id) return;
@@ -735,6 +745,7 @@ public boolean isSelected (int index) {
* 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;
@@ -758,6 +769,7 @@ long /*int*/ menuForEvent(long /*int*/ id, long /*int*/ sel, long /*int*/ theEve
return super.menuForEvent(id, sel, theEvent);
}
+@Override
void mouseDownSuper(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
ignoreSelect = false;
NSTableView widget = (NSTableView)view;
@@ -776,20 +788,24 @@ void mouseDownSuper(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
didSelect = false;
}
+@Override
boolean needsPanelToBecomeKey (long /*int*/ id, long /*int*/ sel) {
return false;
}
+@Override
long /*int*/ numberOfRowsInTableView(long /*int*/ id, long /*int*/ sel, long /*int*/ aTableView) {
return itemCount;
}
+@Override
void releaseHandle () {
super.releaseHandle ();
if (column != null) column.release();
column = null;
}
+@Override
void releaseWidget () {
super.releaseWidget ();
items = null;
@@ -1096,12 +1112,14 @@ public void selectAll () {
ignoreSelect = false;
}
+@Override
void sendDoubleSelection() {
if (((NSTableView)view).clickedRow () != -1) {
sendSelectionEvent (SWT.DefaultSelection);
}
}
+@Override
boolean sendKeyEvent (NSEvent nsEvent, int type) {
boolean result = super.sendKeyEvent (nsEvent, type);
if (!result) return result;
@@ -1117,6 +1135,7 @@ boolean sendKeyEvent (NSEvent nsEvent, int type) {
return result;
}
+@Override
boolean sendMouseEvent (NSEvent nsEvent, int type, boolean send) {
boolean handleMouseDown = true;
if (nsEvent != null) {
@@ -1138,15 +1157,18 @@ boolean sendMouseEvent (NSEvent nsEvent, int type, boolean send) {
return super.sendMouseEvent(nsEvent, type, send);
}
+@Override
void sendSelection () {
if (ignoreSelect) return;
sendSelectionEvent(SWT.Selection);
}
+@Override
void setBackgroundColor(NSColor nsColor) {
((NSTableView) view).setBackgroundColor (nsColor);
}
+@Override
void setFont (NSFont font) {
super.setFont (font);
double /*float*/ ascent = font.ascender ();
@@ -1457,16 +1479,19 @@ public void showSelection () {
if (index >= 0) showIndex (index);
}
+@Override
void tableViewSelectionDidChange (long /*int*/ id, long /*int*/ sel, long /*int*/ aNotification) {
if (didSelect) return;
sendSelection();
}
+@Override
void tableViewSelectionIsChanging (long /*int*/ id, long /*int*/ sel, long /*int*/ aNotification) {
didSelect = true;
sendSelection();
}
+@Override
long /*int*/ tableView_objectValueForTableColumn_row(long /*int*/ id, long /*int*/ sel, long /*int*/ aTableView, long /*int*/ aTableColumn, long /*int*/ rowIndex) {
double /*float*/ [] fg = ((NSTableView)view).isRowSelected(rowIndex) ? null : foreground;
NSAttributedString attribStr = createString(items[(int)/*64*/rowIndex], null, fg, SWT.LEFT, false, getEnabled(), 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 31890f0efe..5077dd41bc 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
@@ -222,6 +222,7 @@ public void addSelectionListener (SelectionListener listener) {
addListener (SWT.DefaultSelection,typedListener);
}
+@Override
protected void checkSubclass () {
if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
}
@@ -237,11 +238,13 @@ NSMenu createEmptyMenu () {
return null;
}
+@Override
void deregister () {
super.deregister ();
display.removeWidget (nsItem);
}
+@Override
void destroyWidget () {
parent.destroyItem (this);
releaseHandle ();
@@ -323,6 +326,7 @@ public Menu getMenu () {
return menu;
}
+@Override
String getNameText () {
if ((style & SWT.SEPARATOR) != 0) return "|";
return super.getNameText ();
@@ -449,11 +453,13 @@ int keyChar (int key) {
}
+@Override
void register () {
super.register ();
display.addWidget (nsItem, this);
}
+@Override
void releaseHandle () {
super.releaseHandle ();
if (nsItem != null) nsItem.release();
@@ -461,6 +467,7 @@ void releaseHandle () {
parent = null;
}
+@Override
void releaseChildren (boolean destroy) {
if (menu != null) {
menu.release (false);
@@ -469,6 +476,7 @@ void releaseChildren (boolean destroy) {
super.releaseChildren (destroy);
}
+@Override
void releaseWidget () {
super.releaseWidget ();
accelerator = 0;
@@ -548,6 +556,7 @@ public void removeSelectionListener (SelectionListener listener) {
eventTable.unhook (SWT.DefaultSelection,listener);
}
+@Override
void reskinChildren (int flags) {
if (menu != null) {
menu.reskin (flags);
@@ -566,6 +575,7 @@ void selectRadio () {
setSelection (true);
}
+@Override
void sendSelection () {
if ((style & SWT.CHECK) != 0) {
setSelection (!getSelection ());
@@ -688,6 +698,7 @@ public void setID (int id) {
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
+@Override
public void setImage (Image image) {
checkWidget ();
if ((style & SWT.SEPARATOR) != 0) return;
@@ -831,6 +842,7 @@ public void setSelection (boolean selected) {
*
* @see #setAccelerator
*/
+@Override
public void setText (String string) {
checkWidget ();
if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
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 6ba143ae67..1fa2eade66 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
@@ -81,6 +81,7 @@ static int checkStyle (int style) {
return checkBits (style, SWT.HORIZONTAL, SWT.VERTICAL, 0, 0, 0, 0);
}
+@Override
public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget();
int size = OS.NSProgressIndicatorPreferredThickness;
@@ -97,6 +98,7 @@ public Point computeSize (int wHint, int hHint, boolean changed) {
return new Point (width, height);
}
+@Override
void createHandle () {
NSProgressIndicator widget = (NSProgressIndicator)new SWTProgressIndicator().alloc();
widget.init();
@@ -106,10 +108,12 @@ void createHandle () {
view = widget;
}
+@Override
NSFont defaultNSFont () {
return display.progressIndicatorFont;
}
+@Override
void _drawThemeProgressArea (long /*int*/ id, long /*int*/ sel, long /*int*/ arg0) {
/*
* Bug in Cocoa. When the threaded animation is turned off by calling
@@ -307,18 +311,21 @@ public void setState (int state) {
//NOT IMPLEMENTED
}
+@Override
void releaseWidget () {
super.releaseWidget();
if (visiblePath != null) visiblePath.release();
visiblePath = null;
}
+@Override
void resetVisibleRegion () {
super.resetVisibleRegion ();
if (visiblePath != null) visiblePath.release();
visiblePath = null;
}
+@Override
void viewDidMoveToWindow(long /*int*/ id, long /*int*/ sel) {
/*
* Bug in Cocoa. An indeterminate progress indicator doesn't start animating until it is in
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 f3f887de34..145a62110b 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
@@ -81,6 +81,7 @@ public Sash (Composite parent, int style) {
sizeCursor = new Cursor (display, cursorStyle);
}
+@Override
long /*int*/ accessibilityAttributeNames(long /*int*/ id, long /*int*/ sel) {
if (accessibilityAttributes == null) {
NSMutableArray ourAttributes = NSMutableArray.arrayWithCapacity(10);
@@ -124,6 +125,7 @@ long /*int*/ accessibilityAttributeNames(long /*int*/ id, long /*int*/ sel) {
return accessibilityAttributes.id;
}
+@Override
long /*int*/ accessibilityAttributeValue(long /*int*/ id, long /*int*/ sel, long /*int*/ arg0) {
long /*int*/ returnValue = 0;
NSString attributeName = new NSString(arg0);
@@ -198,6 +200,7 @@ long /*int*/ accessibilityAttributeValue(long /*int*/ id, long /*int*/ sel, long
return super.accessibilityAttributeValue(id, sel, arg0);
}
+@Override
boolean accessibilityIsIgnored(long /*int*/ id, long /*int*/ sel) {
return false;
}
@@ -243,6 +246,7 @@ static int checkStyle (int style) {
return checkBits (style, SWT.HORIZONTAL, SWT.VERTICAL, 0, 0, 0, 0);
}
+@Override
boolean becomeFirstResponder (long /*int*/ id, long /*int*/ sel) {
boolean result = super.becomeFirstResponder(id, sel);
NSRect frame = view.frame();
@@ -251,6 +255,7 @@ boolean becomeFirstResponder (long /*int*/ id, long /*int*/ sel) {
return result;
}
+@Override
public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget();
int width = 0, height = 0;
@@ -264,6 +269,7 @@ public Point computeSize (int wHint, int hHint, boolean changed) {
return new Point (width, height);
}
+@Override
void createHandle () {
state |= THEME_BACKGROUND;
NSView widget = (NSView)new SWTView().alloc();
@@ -271,11 +277,13 @@ void createHandle () {
view = widget;
}
+@Override
void drawBackground (long /*int*/ id, NSGraphicsContext context, NSRect rect) {
if (id != view.id) return;
fillBackground (view, context, rect, -1);
}
+@Override
Cursor findCursor () {
Cursor cursor = super.findCursor ();
if (cursor == null) {
@@ -285,6 +293,7 @@ Cursor findCursor () {
return cursor;
}
+@Override
boolean sendKeyEvent(NSEvent nsEvent, int type) {
super.sendKeyEvent (nsEvent, type);
if (type == SWT.KeyDown) {
@@ -346,6 +355,7 @@ boolean sendKeyEvent(NSEvent nsEvent, int type) {
return true;
}
+@Override
void mouseDown(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
//TODO use sendMouseEvent
super.mouseDown(id, sel, theEvent);
@@ -372,11 +382,13 @@ void mouseDown(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
}
}
+@Override
boolean mouseEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent, int type) {
super.mouseEvent (id, sel, theEvent, type);
return new NSEvent (theEvent).type () != OS.NSLeftMouseDown;
}
+@Override
void mouseDragged(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
//TODO use sendMouseEvent
super.mouseDragged(id, sel, theEvent);
@@ -408,6 +420,7 @@ void mouseDragged(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
}
}
+@Override
void mouseUp(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
//TODO use sendMouseEvent
super.mouseUp(id, sel, theEvent);
@@ -427,12 +440,14 @@ void mouseUp(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
}
}
+@Override
void releaseHandle () {
super.releaseHandle ();
if (accessibilityAttributes != null) accessibilityAttributes.release();
accessibilityAttributes = null;
}
+@Override
void releaseWidget () {
super.releaseWidget ();
if (sizeCursor != null) sizeCursor.dispose ();
@@ -464,12 +479,15 @@ public void removeSelectionListener(SelectionListener listener) {
eventTable.unhook(SWT.DefaultSelection,listener);
}
+@Override
void superKeyDown (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
}
+@Override
void superKeyUp (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
}
+@Override
int traversalCode (int key, NSEvent theEvent) {
return 0;
}
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 830d3c23ec..76deb57061 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
@@ -111,6 +111,7 @@ static int checkStyle (int style) {
return checkBits (style, SWT.HORIZONTAL, SWT.VERTICAL, 0, 0, 0, 0);
}
+@Override
public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget();
NSSlider widget = (NSSlider)view;
@@ -128,6 +129,7 @@ public Point computeSize (int wHint, int hHint, boolean changed) {
return new Point (width, height);
}
+@Override
void createHandle () {
state |= THEME_BACKGROUND;
NSSlider widget = (NSSlider)new SWTSlider().alloc();
@@ -138,10 +140,12 @@ void createHandle () {
view = widget;
}
+@Override
NSFont defaultNSFont () {
return display.sliderFont;
}
+@Override
void deregister() {
super.deregister();
display.removeWidget(((NSControl)view).cell());
@@ -227,6 +231,7 @@ public int getSelection () {
return (int)((NSSlider)view).doubleValue();
}
+@Override
void register() {
super.register();
display.addWidget(((NSControl)view).cell(), this);
@@ -257,6 +262,7 @@ public void removeSelectionListener(SelectionListener listener) {
eventTable.unhook(SWT.DefaultSelection,listener);
}
+@Override
void sendSelection () {
NSEvent currEvent = NSApplication.sharedApplication().currentEvent();
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 97b812f494..9f1407a36c 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
@@ -139,11 +139,13 @@ static int checkStyle (int style) {
return checkBits (style, SWT.HORIZONTAL, SWT.VERTICAL, 0, 0, 0, 0);
}
+@Override
void deregister () {
super.deregister ();
display.removeWidget (view);
}
+@Override
boolean getDrawing () {
return parent.getDrawing ();
}
@@ -383,6 +385,7 @@ public boolean isEnabled () {
return getEnabled () && parent.isEnabled ();
}
+@Override
boolean isDrawing () {
return getDrawing() && parent.isDrawing ();
}
@@ -431,28 +434,33 @@ public void removeSelectionListener(SelectionListener listener) {
eventTable.unhook(SWT.DefaultSelection,listener);
}
+@Override
void register () {
super.register ();
display.addWidget (view, this);
}
+@Override
void releaseHandle () {
super.releaseHandle ();
if (view != null) view.release();
view = null;
}
+@Override
void releaseParent () {
super.releaseParent ();
if (parent.horizontalBar == this) parent.horizontalBar = null;
if (parent.verticalBar == this) parent.verticalBar = null;
}
+@Override
void releaseWidget () {
super.releaseWidget ();
parent = null;
}
+@Override
void sendSelection () {
NSWindow window = view.window ();
if (target == null) parent.getShell().deferFlushing();
@@ -520,6 +528,7 @@ public void setIncrement (int value) {
increment = value;
}
+@Override
void setClipRegion (NSView view) {
parent.setClipRegion(view);
}
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 1cb1bf8334..ca17afbc94 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
@@ -165,12 +165,14 @@ ScrollBar createScrollBar (int style) {
return bar;
}
+@Override
void createWidget () {
super.createWidget ();
if ((style & SWT.H_SCROLL) != 0) horizontalBar = createScrollBar (SWT.H_SCROLL);
if ((style & SWT.V_SCROLL) != 0) verticalBar = createScrollBar (SWT.V_SCROLL);
}
+@Override
void deregister () {
super.deregister ();
if (scrollView != null) display.removeWidget (scrollView);
@@ -271,6 +273,7 @@ boolean hooksKeys () {
return hooks (SWT.KeyDown) || hooks (SWT.KeyUp) || hooks (SWT.Traverse);
}
+@Override
boolean isEventView (long /*int*/ id) {
return id == eventView ().id;
}
@@ -279,6 +282,7 @@ boolean isNeeded(ScrollBar scrollbar) {
return true;
}
+@Override
boolean isTrim (NSView view) {
if (scrollView != null) {
if (scrollView.id == view.id) return true;
@@ -297,22 +301,26 @@ void redrawBackgroundImage () {
}
}
+@Override
void reflectScrolledClipView(long /*int*/ id, long /*int*/ sel, long /*int*/ aClipView) {
super.reflectScrolledClipView(id, sel, aClipView);
redrawBackgroundImage();
}
+@Override
void register () {
super.register ();
if (scrollView != null) display.addWidget (scrollView, this);
}
+@Override
void releaseHandle () {
super.releaseHandle ();
if (scrollView != null) scrollView.release();
scrollView = null;
}
+@Override
void releaseChildren (boolean destroy) {
if (horizontalBar != null) {
horizontalBar.release (false);
@@ -325,12 +333,14 @@ void releaseChildren (boolean destroy) {
super.releaseChildren (destroy);
}
+@Override
void reskinChildren (int flags) {
if (horizontalBar != null) horizontalBar.reskin (flags);
if (verticalBar != null) verticalBar.reskin (flags);
super.reskinChildren (flags);
}
+@Override
void scrollClipViewToPoint (long /*int*/ id, long /*int*/ sel, long /*int*/ clipView, NSPoint point) {
if ((state & CANVAS) == 0 && scrollView != null) {
NSClipView clip = new NSClipView (clipView);
@@ -342,16 +352,19 @@ void scrollClipViewToPoint (long /*int*/ id, long /*int*/ sel, long /*int*/ clip
super.scrollClipViewToPoint (id, sel, clipView, point);
}
+@Override
void sendHorizontalSelection () {
if (horizontalBar.view.isHiddenOrHasHiddenAncestor()) return;
horizontalBar.sendSelection ();
}
+@Override
void sendVerticalSelection () {
if (verticalBar.view.isHiddenOrHasHiddenAncestor()) return;
verticalBar.sendSelection ();
}
+@Override
void enableWidget (boolean enabled) {
super.enableWidget (enabled);
if (horizontalBar != null) horizontalBar.enableWidget (enabled && isNeeded(horizontalBar));
@@ -378,16 +391,19 @@ boolean setScrollBarVisible (ScrollBar bar, boolean visible) {
return true;
}
+@Override
void setZOrder () {
super.setZOrder ();
if (scrollView != null) scrollView.setDocumentView (view);
}
+@Override
NSView topView () {
if (scrollView != null) return scrollView;
return super.topView ();
}
+@Override
void updateCursorRects (boolean enabled) {
super.updateCursorRects (enabled);
if (scrollView == null) return;
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 332691ace9..a2addd1778 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
@@ -152,6 +152,7 @@ static int checkStyle (int style) {
return checkBits (style, SWT.HORIZONTAL, SWT.VERTICAL, 0, 0, 0, 0);
}
+@Override
public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget();
int width = 0, height = 0;
@@ -167,6 +168,7 @@ public Point computeSize (int wHint, int hHint, boolean changed) {
return new Point (width, height);
}
+@Override
void createHandle () {
NSScroller widget = (NSScroller)new SWTScroller().alloc();
NSRect rect = new NSRect();
@@ -183,16 +185,19 @@ void createHandle () {
updateBar(0, minimum, maximum, thumb);
}
+@Override
void createWidget () {
maximum = 100;
thumb = 10;
super.createWidget();
}
+@Override
NSFont defaultNSFont () {
return display.scrollerFont;
}
+@Override
void enableWidget(boolean enabled) {
super.enableWidget(enabled);
if (enabled) {
@@ -322,6 +327,7 @@ public void removeSelectionListener(SelectionListener listener) {
eventTable.unhook(SWT.DefaultSelection,listener);
}
+@Override
void sendSelection () {
Event event = new Event();
int hitPart = (int)/*64*/((NSScroller)view).hitPart();
@@ -458,6 +464,7 @@ public void setSelection (int value) {
updateBar(value, minimum, maximum, thumb);
}
+@Override
void setSmallSize () {
/* This code is intentionally comment */
// ((NSScroller)view).setControlSize (OS.NSSmallControlSize);
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 7050b2c8f4..5df4874e57 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
@@ -99,11 +99,13 @@ public Spinner (Composite parent, int style) {
super (parent, checkStyle (style));
}
+@Override
boolean acceptsFirstResponder(long /*int*/ id, long /*int*/ sel) {
if (id == view.id) return false;
return super.acceptsFirstResponder (id, sel);
}
+@Override
boolean accessibilityIsIgnored(long /*int*/ id, long /*int*/ sel) {
if (id == view.id) return true;
return super.accessibilityIsIgnored(id, sel);
@@ -204,10 +206,12 @@ static int checkStyle (int style) {
return style & ~(SWT.H_SCROLL | SWT.V_SCROLL);
}
+@Override
protected void checkSubclass () {
if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
}
+@Override
public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget ();
double /*float*/ width = 0, height = 0;
@@ -227,6 +231,7 @@ public Point computeSize (int wHint, int hHint, boolean changed) {
}
return new Point (trim.width, trim.height);
}
+@Override
public Rectangle computeTrim (int x, int y, int width, int height) {
checkWidget();
NSRect frameRect = textView.frame();
@@ -261,6 +266,7 @@ public void copy () {
}
}
+@Override
void createHandle () {
NSView widget = (NSView)new SWTView().alloc();
widget.init();
@@ -312,16 +318,19 @@ public void cut () {
}
}
+@Override
void enableWidget (boolean enabled) {
super.enableWidget(enabled);
buttonView.setEnabled(enabled);
textView.setEnabled(enabled);
}
+@Override
NSFont defaultNSFont () {
return display.textFieldFont;
}
+@Override
void deregister () {
super.deregister ();
if (textView != null) {
@@ -335,6 +344,7 @@ void deregister () {
}
}
+@Override
void drawBackground (long /*int*/ id, NSGraphicsContext context, NSRect rect) {
if (backgroundImage == null) return;
if (new NSView(id).isKindOfClass(OS.class_NSText)) {
@@ -344,6 +354,7 @@ void drawBackground (long /*int*/ id, NSGraphicsContext context, NSRect rect) {
fillBackground (view, context, rect, -1);
}
+@Override
void drawInteriorWithFrame_inView(long /*int*/ id, long /*int*/ sel, NSRect cellFrame, long /*int*/ viewid) {
Control control = findBackgroundControl();
if (control == null) control = this;
@@ -355,11 +366,13 @@ void drawInteriorWithFrame_inView(long /*int*/ id, long /*int*/ sel, NSRect cell
super.drawInteriorWithFrame_inView(id, sel, cellFrame, viewid);
}
+@Override
Cursor findCursor () {
Cursor cursor = super.findCursor ();
return (cursor != null || (style & SWT.READ_ONLY) != 0) ? cursor : display.getSystemCursor (SWT.CURSOR_IBEAM);
}
+@Override
NSView focusView () {
return textView;
}
@@ -538,12 +551,14 @@ public int getTextLimit () {
return textLimit;
}
+@Override
boolean handleIsAccessible(long /*int*/ id) {
// All subviews of a Spinner can have their accessible properties overridden.
// The top-level NSView is already ignored, so we don't need to test for that.
return true;
}
+@Override
boolean isEventView (long /*int*/ id) {
return true;
}
@@ -571,6 +586,7 @@ public void paste () {
}
}
+@Override
void register () {
super.register ();
if (textView != null) {
@@ -584,6 +600,7 @@ void register () {
}
}
+@Override
void releaseHandle () {
super.releaseHandle();
if (textFormatter != null) textFormatter.release();
@@ -594,6 +611,7 @@ void releaseHandle () {
textView = null;
}
+@Override
void releaseWidget () {
super.releaseWidget ();
if (textView != null) textView.abortEditing();
@@ -672,6 +690,7 @@ void removeVerifyListener (VerifyListener listener) {
eventTable.unhook (SWT.Verify, listener);
}
+@Override
void resized () {
super.resized ();
buttonView.sizeToFit();
@@ -689,6 +708,7 @@ void resized () {
buttonView.setFrame(buttonFrame);
}
+@Override
boolean sendKeyEvent (NSEvent nsEvent, int type) {
boolean result = super.sendKeyEvent (nsEvent, type);
if (!result) return result;
@@ -737,14 +757,17 @@ boolean sendKeyEvent (NSEvent nsEvent, int type) {
return result;
}
+@Override
void sendSelection () {
setSelection (getSelection(), false, true, true);
}
+@Override
void setBackgroundColor(NSColor nsColor) {
((NSTextField) textView).setBackgroundColor (nsColor);
}
+@Override
void setBackgroundImage(NSImage image) {
NSTextField widget = (NSTextField) textView;
widget.setDrawsBackground(image == null);
@@ -780,10 +803,12 @@ public void setDigits (int value) {
setSelection (pos, false, true, false);
}
+@Override
void setFont(NSFont font) {
textView.setFont(font);
}
+@Override
void setForeground (double /*float*/ [] color) {
NSColor nsColor;
if (color == null) {
@@ -874,6 +899,7 @@ public void setPageIncrement (int value) {
pageIncrement = value;
}
+@Override
void setOrientation () {
int direction = (style & SWT.RIGHT_TO_LEFT) != 0 ? OS.NSWritingDirectionRightToLeft : OS.NSWritingDirectionLeftToRight;
textView.setBaseWritingDirection(direction);
@@ -939,6 +965,7 @@ void setSelection (int value, boolean setPos, boolean setText, boolean notify) {
if (notify) sendSelectionEvent (SWT.Selection);
}
+@Override
void setSmallSize () {
textView.cell ().setControlSize (OS.NSSmallControlSize);
buttonView.cell ().setControlSize (OS.NSSmallControlSize);
@@ -1010,6 +1037,7 @@ public void setValues (int selection, int minimum, int maximum, int digits, int
setSelection (selection, true, true, false);
}
+@Override
boolean shouldChangeTextInRange_replacementString(long /*int*/ id, long /*int*/ sel, long /*int*/ affectedCharRange, long /*int*/ replacementString) {
NSRange range = new NSRange();
OS.memmove(range, affectedCharRange, NSRange.sizeof);
@@ -1044,6 +1072,7 @@ boolean shouldChangeTextInRange_replacementString(long /*int*/ id, long /*int*/
return result;
}
+@Override
void textDidChange (long /*int*/ id, long /*int*/ sel, long /*int*/ aNotification) {
super.textDidChange (id, sel, aNotification);
boolean [] parseFail = new boolean [1];
@@ -1057,6 +1086,7 @@ void textDidChange (long /*int*/ id, long /*int*/ sel, long /*int*/ aNotificatio
postEvent (SWT.Modify);
}
+@Override
NSRange textView_willChangeSelectionFromCharacterRange_toCharacterRange (long /*int*/ id, long /*int*/ sel, long /*int*/ aTextView, long /*int*/ oldSelectedCharRange, long /*int*/ newSelectedCharRange) {
/* allow the selection change to proceed */
NSRange result = new NSRange ();
@@ -1064,6 +1094,7 @@ NSRange textView_willChangeSelectionFromCharacterRange_toCharacterRange (long /*
return result;
}
+@Override
void textDidEndEditing(long /*int*/ id, long /*int*/ sel, long /*int*/ aNotification) {
boolean [] parseFail = new boolean [1];
int value = getSelectionText (parseFail);
@@ -1074,6 +1105,7 @@ void textDidEndEditing(long /*int*/ id, long /*int*/ sel, long /*int*/ aNotifica
super.textDidEndEditing(id, sel, aNotification);
}
+@Override
void updateCursorRects (boolean enabled) {
super.updateCursorRects (enabled);
updateCursorRects (enabled, textView);
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 e32466a985..99bafb6838 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
@@ -130,10 +130,12 @@ static int checkStyle (int style) {
return style & ~(SWT.H_SCROLL | SWT.V_SCROLL);
}
+@Override
protected void checkSubclass () {
if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
}
+@Override
public Point computeSize (int wHint, int hHint, boolean changed) {
Point size = super.computeSize (wHint, hHint, changed);
if (wHint == SWT.DEFAULT && items.length > 0) {
@@ -144,6 +146,7 @@ public Point computeSize (int wHint, int hHint, boolean changed) {
return size;
}
+@Override
public Rectangle computeTrim (int x, int y, int width, int height) {
checkWidget ();
NSTabView widget = (NSTabView)view;
@@ -156,6 +159,7 @@ public Rectangle computeTrim (int x, int y, int width, int height) {
return super.computeTrim (x, y, width, height);
}
+@Override
void createHandle () {
NSTabView widget = (NSTabView)new SWTTabView().alloc();
widget.init ();
@@ -184,11 +188,13 @@ void createItem (TabItem item, int index) {
((NSTabView)view).insertTabViewItem(nsItem, index);
}
+@Override
void createWidget () {
super.createWidget ();
items = new TabItem [4];
}
+@Override
NSFont defaultNSFont () {
return display.tabViewFont;
}
@@ -211,11 +217,13 @@ void destroyItem (TabItem item) {
((NSTabView)view).removeTabViewItem(item.nsItem);
}
+@Override
void drawBackground (long /*int*/ id, NSGraphicsContext context, NSRect rect) {
if (id != view.id) return;
fillBackground (view, context, rect, -1);
}
+@Override
Widget findTooltip (NSPoint pt) {
pt = view.convertPoint_fromView_ (pt, null);
NSTabViewItem nsItem = ((NSTabView)view).tabViewItemAtPoint (pt);
@@ -228,6 +236,7 @@ Widget findTooltip (NSPoint pt) {
return super.findTooltip (pt);
}
+@Override
public Rectangle getClientArea () {
checkWidget ();
NSRect rect = ((NSTabView)view).contentRect();
@@ -378,6 +387,7 @@ public int getSelectionIndex () {
return -1;
}
+@Override
float getThemeAlpha () {
return (background != null ? 1 : 0.25f) * parent.getThemeAlpha ();
}
@@ -409,10 +419,12 @@ public int indexOf (TabItem item) {
return -1;
}
+@Override
boolean isTransparent() {
return true;
}
+@Override
Point minimumSize (int wHint, int hHint, boolean flushCache) {
Control [] children = _getChildren ();
int width = 0, height = 0;
@@ -437,6 +449,7 @@ Point minimumSize (int wHint, int hHint, boolean flushCache) {
return new Point (width, height);
}
+@Override
void releaseChildren (boolean destroy) {
if (items != null) {
for (int i=0; i<items.length; i++) {
@@ -450,6 +463,7 @@ void releaseChildren (boolean destroy) {
super.releaseChildren (destroy);
}
+@Override
void removeControl (Control control) {
super.removeControl (control);
int count = itemCount;
@@ -484,6 +498,7 @@ public void removeSelectionListener (SelectionListener listener) {
eventTable.unhook (SWT.DefaultSelection,listener);
}
+@Override
void reskinChildren (int flags) {
if (items != null) {
for (int i=0; i<itemCount; i++) {
@@ -494,6 +509,7 @@ void reskinChildren (int flags) {
super.reskinChildren (flags);
}
+@Override
void setFont (NSFont font) {
((NSTabView)view).setFont(font);
int index = getSelectionIndex();
@@ -502,6 +518,7 @@ void setFont (NSFont font) {
}
}
+@Override
void setForeground (double /*float*/ [] color) {
super.setForeground(color);
int index = getSelectionIndex();
@@ -614,10 +631,12 @@ void setSelection (int index, boolean notify, boolean force) {
}
}
+@Override
void setSmallSize () {
((NSTabView)view).setControlSize (OS.NSSmallControlSize);
}
+@Override
boolean traversePage (boolean next) {
int count = getItemCount ();
if (count == 0) return false;
@@ -632,6 +651,7 @@ boolean traversePage (boolean next) {
return index == getSelectionIndex ();
}
+@Override
void tabView_willSelectTabViewItem(long /*int*/ id, long /*int*/ sel, long /*int*/ tabView, long /*int*/ tabViewItem) {
if (tabViewItem == 0) return;
for (int i = 0; i < itemCount; i++) {
@@ -658,6 +678,7 @@ void tabView_willSelectTabViewItem(long /*int*/ id, long /*int*/ sel, long /*int
}
}
+@Override
void tabView_didSelectTabViewItem(long /*int*/ id, long /*int*/ sel, long /*int*/ tabView, long /*int*/ tabViewItem) {
if (tabViewItem == 0) return;
for (int i = 0; i < itemCount; i++) {
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 0b2bb7409c..559012223e 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
@@ -114,6 +114,7 @@ public TabItem (TabFolder parent, int style, int index) {
parent.createItem (this, index);
}
+@Override
long /*int*/ accessibilityAttributeValue (long /*int*/ id, long /*int*/ sel, long /*int*/ arg0) {
if (id == nsItem.id) {
@@ -133,20 +134,24 @@ long /*int*/ accessibilityAttributeValue (long /*int*/ id, long /*int*/ sel, lon
return super.accessibilityAttributeValue(id, sel, arg0);
}
+@Override
protected void checkSubclass () {
if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
}
+@Override
void deregister () {
super.deregister ();
display.removeWidget (nsItem);
}
+@Override
void destroyWidget () {
parent.destroyItem (this);
releaseHandle ();
}
+@Override
void drawLabelInRect(long /*int*/ id, long /*int*/ sel, boolean shouldTruncateLabel, NSRect rect) {
if (image != null && !image.isDisposed()) {
NSSize imageSize = image.handle.size();
@@ -255,11 +260,13 @@ public String getToolTipText () {
return toolTipText;
}
+@Override
void register () {
super.register ();
display.addWidget (nsItem, this);
}
+@Override
void releaseHandle () {
super.releaseHandle ();
if (nsItem != null) nsItem.release();
@@ -269,6 +276,7 @@ void releaseHandle () {
parent = null;
}
+@Override
void releaseParent () {
super.releaseParent ();
int index = parent.indexOf (this);
@@ -277,6 +285,7 @@ void releaseParent () {
}
}
+@Override
void releaseWidget () {
super.releaseWidget ();
control = null;
@@ -347,6 +356,7 @@ public void setControl (Control control) {
}
}
+@Override
public void setImage (Image image) {
checkWidget ();
int index = parent.indexOf (this);
@@ -382,6 +392,7 @@ public void setImage (Image image) {
* </ul>
*
*/
+@Override
public void setText (String string) {
checkWidget ();
if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
@@ -417,6 +428,7 @@ public void setToolTipText (String string) {
parent.checkToolTip (this);
}
+@Override
NSSize sizeOfLabel(long /*int*/ id, long /*int*/ sel, boolean shouldTruncateLabel) {
NSSize size = super.sizeOfLabel(id, sel, shouldTruncateLabel);
if (image != null && !image.isDisposed()) {
@@ -430,6 +442,7 @@ NSSize sizeOfLabel(long /*int*/ id, long /*int*/ sel, boolean shouldTruncateLabe
return size;
}
+@Override
String tooltipText () {
return toolTipText;
}
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 518e5eedcd..e225e463a1 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
@@ -126,10 +126,12 @@ public Table (Composite parent, int style) {
super (parent, checkStyle (style));
}
+@Override
boolean acceptsFirstResponder (long /*int*/ id, long /*int*/ sel) {
return true;
}
+@Override
long /*int*/ accessibilityAttributeValue(long /*int*/ id, long /*int*/ sel, long /*int*/ arg0) {
long /*int*/ returnValue = 0;
NSString attributeName = new NSString(arg0);
@@ -156,6 +158,7 @@ long /*int*/ accessibilityAttributeValue(long /*int*/ id, long /*int*/ sel, long
}
}
+@Override
void _addListener (int eventType, Listener listener) {
super._addListener (eventType, listener);
clearCachedWidth(items);
@@ -213,6 +216,7 @@ int calculateWidth (TableItem[] items, int index, GC gc) {
return width;
}
+@Override
NSSize cellSize (long /*int*/ id, long /*int*/ sel) {
NSSize size = super.cellSize(id, sel);
NSCell cell = new NSCell(id);
@@ -237,6 +241,7 @@ NSSize cellSize (long /*int*/ id, long /*int*/ sel) {
return size;
}
+@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;
@@ -298,6 +303,7 @@ static int checkStyle (int style) {
return checkBits (style, SWT.SINGLE, SWT.MULTI, 0, 0, 0, 0);
}
+@Override
protected void checkSubclass () {
if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
}
@@ -442,6 +448,7 @@ void clearCachedWidth (TableItem[] items) {
}
}
+@Override
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;
@@ -450,6 +457,7 @@ long /*int*/ columnAtPoint(long /*int*/ id, long /*int*/ sel, NSPoint point) {
return super.columnAtPoint(id, sel, point);
}
+@Override
public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget ();
int width = 0;
@@ -520,6 +528,7 @@ void createColumn (TableItem item, int index) {
}
}
+@Override
void createHandle () {
NSScrollView scrollWidget = (NSScrollView)new SWTScrollView().alloc();
scrollWidget.init();
@@ -650,24 +659,29 @@ void createItem (TableItem item, int index) {
if (index != itemCount) fixSelection (index, true);
}
+@Override
void createWidget () {
super.createWidget ();
items = new TableItem [4];
columns = new TableColumn [4];
}
+@Override
Color defaultBackground () {
return display.getWidgetColor (SWT.COLOR_LIST_BACKGROUND);
}
+@Override
NSFont defaultNSFont () {
return display.tableViewFont;
}
+@Override
Color defaultForeground () {
return display.getWidgetColor (SWT.COLOR_LIST_FOREGROUND);
}
+@Override
void deregister () {
super.deregister ();
display.removeWidget (headerView);
@@ -675,6 +689,7 @@ void deregister () {
if (buttonCell != null) display.removeWidget (buttonCell);
}
+@Override
void deselectAll(long /*int*/ id, long /*int*/ sel, long /*int*/ sender) {
if (preventSelect && !ignoreSelect) return;
if ((style & SWT.SINGLE) != 0 && !ignoreSelect) {
@@ -683,6 +698,7 @@ void deselectAll(long /*int*/ id, long /*int*/ sel, long /*int*/ sender) {
super.deselectAll (id, sel, sender);
}
+@Override
void deselectRow (long /*int*/ id, long /*int*/ sel, long /*int*/ index) {
if (preventSelect && !ignoreSelect) return;
if ((style & SWT.SINGLE) != 0 && !ignoreSelect) {
@@ -901,17 +917,20 @@ void destroyItem (TableItem item) {
if (itemCount == 0) setTableEmpty ();
}
+@Override
boolean dragDetect(int x, int y, boolean filter, boolean[] consume) {
// Let Cocoa determine if a drag is starting and fire the notification when we get the callback.
return false;
}
+@Override
void drawBackgroundInClipRect(long /*int*/ id, long /*int*/ sel, NSRect rect) {
super.drawViewBackgroundInRect(id, sel, rect);
if (id != view.id) return;
fillBackground (view, NSGraphicsContext.currentContext(), rect, -1);
}
+@Override
void drawInteriorWithFrame_inView (long /*int*/ id, long /*int*/ sel, NSRect rect, long /*int*/ view) {
boolean hooksErase = hooks (SWT.EraseItem);
boolean hooksPaint = hooks (SWT.PaintItem);
@@ -1161,12 +1180,14 @@ void drawInteriorWithFrame_inView (long /*int*/ id, long /*int*/ sel, NSRect rec
}
}
+@Override
void drawWithExpansionFrame_inView (long /*int*/ id, long /*int*/ sel, NSRect cellFrame, long /*int*/ view) {
drawExpansion = true;
super.drawWithExpansionFrame_inView(id, sel, cellFrame, view);
drawExpansion = false;
}
+@Override
void drawRect(long /*int*/ id, long /*int*/ sel, NSRect rect) {
fixScrollWidth = false;
super.drawRect(id, sel, rect);
@@ -1177,6 +1198,7 @@ void drawRect(long /*int*/ id, long /*int*/ sel, NSRect rect) {
}
}
+@Override
NSRect expansionFrameWithFrame_inView(long /*int*/ id, long /*int*/ sel, NSRect cellRect, long /*int*/ view) {
if (toolTipText == null) {
NSRect rect = super.expansionFrameWithFrame_inView(id, sel, cellRect, view);
@@ -1220,6 +1242,7 @@ NSRect expansionFrameWithFrame_inView(long /*int*/ id, long /*int*/ sel, NSRect
return new NSRect();
}
+@Override
Widget findTooltip (NSPoint pt) {
NSTableView widget = (NSTableView)view;
NSTableHeaderView headerView = widget.headerView();
@@ -1264,6 +1287,7 @@ int getCheckColumnWidth () {
return (int)checkColumn.dataCell().cellSize().width;
}
+@Override
public Rectangle getClientArea () {
checkWidget ();
Rectangle rect = super.getClientArea ();
@@ -1779,6 +1803,7 @@ public int getTopIndex () {
return rowAtPoint;
}
+@Override
NSRect headerRectOfColumn (long /*int*/ id, long /*int*/ sel, long /*int*/ column) {
if ((style & SWT.CHECK) == 0) return callSuperRect(id, sel, column);
@@ -1797,6 +1822,7 @@ NSRect headerRectOfColumn (long /*int*/ id, long /*int*/ sel, long /*int*/ colum
return callSuperRect(id, sel, column);
}
+@Override
void highlightSelectionInClipRect(long /*int*/ id, long /*int*/ sel, long /*int*/ rect) {
if (hooks (SWT.EraseItem)) return;
if ((style & SWT.HIDE_SELECTION) != 0 && !hasFocus()) return;
@@ -1805,6 +1831,7 @@ void highlightSelectionInClipRect(long /*int*/ id, long /*int*/ sel, long /*int*
callSuper (id, sel, clipRect);
}
+@Override
long /*int*/ hitTestForEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ event, NSRect rect, long /*int*/ controlView) {
/*
* For some reason, the cell class needs to implement hitTestForEvent:inRect:ofView:,
@@ -1813,12 +1840,14 @@ long /*int*/ hitTestForEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ ev
return callSuper(id, sel, event, rect, controlView);
}
+@Override
long /*int*/ image (long /*int*/ id, long /*int*/ sel) {
long /*int*/ [] image = new long /*int*/ [1];
OS.object_getInstanceVariable(id, Display.SWT_IMAGE, image);
return image[0];
}
+@Override
NSRect imageRectForBounds (long /*int*/ id, long /*int*/ sel, NSRect cellFrame) {
NSImage image = new NSCell(id).image();
if (image != null) {
@@ -1915,20 +1944,24 @@ public boolean isSelected (int index) {
return ((NSTableView)view).isRowSelected(index);
}
+@Override
boolean isTransparent() {
return true;
}
+@Override
void keyDown(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
ignoreSelect = preventSelect = false;
super.keyDown(id, sel, theEvent);
}
+@Override
boolean isTrim (NSView view) {
if (super.isTrim (view)) return true;
return view.id == headerView.id;
}
+@Override
long /*int*/ menuForEvent(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
if (id != headerView.id) {
/*
@@ -1958,6 +1991,7 @@ long /*int*/ menuForEvent(long /*int*/ id, long /*int*/ sel, long /*int*/ theEve
return super.menuForEvent(id, sel, theEvent);
}
+@Override
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
@@ -1970,6 +2004,7 @@ void mouseDown (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
super.mouseDown(id, sel, theEvent);
}
+@Override
void mouseDownSuper(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
ignoreSelect = preventSelect = false;
boolean check = false;
@@ -1999,6 +2034,7 @@ void mouseDownSuper(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
didSelect = false;
}
+@Override
boolean needsPanelToBecomeKey (long /*int*/ id, long /*int*/ sel) {
return false;
}
@@ -2009,6 +2045,7 @@ boolean needsPanelToBecomeKey (long /*int*/ id, long /*int*/ sel) {
* to momentarily appear while clicking on the checkbox. To avoid this,
* override [NSCell nextState] to go directly to the desired state.
*/
+@Override
long /*int*/ nextState (long /*int*/ id, long /*int*/ sel) {
NSTableView tableView = (NSTableView)view;
int index = (int)/*64*/tableView.clickedRow();
@@ -2020,10 +2057,12 @@ long /*int*/ nextState (long /*int*/ id, long /*int*/ sel) {
return item.checked ? OS.NSOffState : OS.NSOnState;
}
+@Override
long /*int*/ numberOfRowsInTableView(long /*int*/ id, long /*int*/ sel, long /*int*/ aTableView) {
return itemCount;
}
+@Override
void register () {
super.register ();
display.addWidget (headerView, this);
@@ -2031,6 +2070,7 @@ void register () {
if (buttonCell != null) display.addWidget (buttonCell, this);
}
+@Override
void releaseChildren (boolean destroy) {
if (items != null) {
for (int i=0; i<itemCount; i++) {
@@ -2053,6 +2093,7 @@ void releaseChildren (boolean destroy) {
super.releaseChildren (destroy);
}
+@Override
void releaseHandle () {
super.releaseHandle ();
if (headerView != null) headerView.release();
@@ -2067,6 +2108,7 @@ void releaseHandle () {
buttonCell = null;
}
+@Override
void releaseWidget () {
super.releaseWidget ();
currentItem = null;
@@ -2250,6 +2292,7 @@ public void removeSelectionListener(SelectionListener listener) {
eventTable.unhook (SWT.DefaultSelection,listener);
}
+@Override
void reskinChildren (int flags) {
if (items != null) {
for (int i=0; i<itemCount; i++) {
@@ -2266,6 +2309,7 @@ void reskinChildren (int flags) {
super.reskinChildren (flags);
}
+@Override
void scrollClipViewToPoint(long /*int*/ id, long /*int*/ sel, long /*int*/ clipView, NSPoint point) {
if (shouldScroll) {
super.scrollClipViewToPoint(id, sel, clipView, point);
@@ -2427,6 +2471,7 @@ public void selectAll () {
ignoreSelect = false;
}
+@Override
void setBackgroundColor(NSColor nsColor) {
((NSTableView) view).setBackgroundColor (nsColor);
}
@@ -2503,6 +2548,7 @@ public void setColumnOrder (int [] order) {
}
}
+@Override
void setFont (NSFont font) {
super.setFont (font);
setItemHeight (null, font, !hooks (SWT.MeasureItem));
@@ -2533,6 +2579,7 @@ public void setHeaderVisible (boolean show) {
scrollView.tile();
}
+@Override
void setImage (long /*int*/ id, long /*int*/ sel, long /*int*/ arg0) {
OS.object_setInstanceVariable(id, Display.SWT_IMAGE, arg0);
}
@@ -2605,6 +2652,7 @@ void setItemHeight (Image image, NSFont font, boolean set) {
}
}
+@Override
public void setRedraw (boolean redraw) {
checkWidget ();
super.setRedraw (redraw);
@@ -2859,6 +2907,7 @@ public void setSelection (TableItem [] items) {
}
}
+@Override
void setShouldScrollClipView(long /*int*/ id, long /*int*/ sel, boolean shouldScroll) {
this.shouldScroll = shouldScroll;
}
@@ -3035,6 +3084,7 @@ public void showSelection () {
}
}
+@Override
void selectRowIndexes_byExtendingSelection (long /*int*/ id, long /*int*/ sel, long /*int*/ indexes, boolean extend) {
if (preventSelect && !ignoreSelect) return;
if ((style & SWT.SINGLE) != 0 && !ignoreSelect) {
@@ -3044,6 +3094,7 @@ void selectRowIndexes_byExtendingSelection (long /*int*/ id, long /*int*/ sel, l
super.selectRowIndexes_byExtendingSelection (id, sel, indexes, extend);
}
+@Override
void sendDoubleSelection() {
NSTableView tableView = (NSTableView)view;
int rowIndex = (int)/*64*/tableView.clickedRow ();
@@ -3063,6 +3114,7 @@ void sendDoubleSelection() {
}
}
+@Override
boolean sendKeyEvent (NSEvent nsEvent, int type) {
boolean result = super.sendKeyEvent (nsEvent, type);
if (!result) return result;
@@ -3113,6 +3165,7 @@ void sendMeasureItem (TableItem item, int columnIndex, NSSize size, boolean isSe
}
}
+@Override
void tableViewColumnDidMove (long /*int*/ id, long /*int*/ sel, long /*int*/ aNotification) {
NSNotification notification = new NSNotification (aNotification);
NSDictionary userInfo = notification.userInfo ();
@@ -3141,6 +3194,7 @@ void tableViewColumnDidMove (long /*int*/ id, long /*int*/ sel, long /*int*/ aNo
headerView.setNeedsDisplay(true);
}
+@Override
void tableViewColumnDidResize (long /*int*/ id, long /*int*/ sel, long /*int*/ aNotification) {
NSNotification notification = new NSNotification (aNotification);
NSDictionary userInfo = notification.userInfo ();
@@ -3170,6 +3224,7 @@ void tableViewColumnDidResize (long /*int*/ id, long /*int*/ sel, long /*int*/ a
}
}
+@Override
void sendSelection () {
if (ignoreSelect) return;
NSTableView widget = (NSTableView) view;
@@ -3185,22 +3240,26 @@ void sendSelection () {
}
}
+@Override
void tableViewSelectionDidChange (long /*int*/ id, long /*int*/ sel, long /*int*/ aNotification) {
if (didSelect) return;
sendSelection();
}
+@Override
void tableViewSelectionIsChanging (long /*int*/ id, long /*int*/ sel, long /*int*/ aNotification) {
didSelect = true;
sendSelection();
}
+@Override
void tableView_didClickTableColumn (long /*int*/ id, long /*int*/ sel, long /*int*/ tableView, long /*int*/ tableColumn) {
TableColumn column = getColumn (new id (tableColumn));
if (column == null) return; /* either CHECK column or firstColumn in 0-column Table */
column.sendSelectionEvent (SWT.Selection);
}
+@Override
long /*int*/ tableView_objectValueForTableColumn_row (long /*int*/ id, long /*int*/ sel, long /*int*/ aTableView, long /*int*/ aTableColumn, long /*int*/ rowIndex) {
int index = (int)/*64*/rowIndex;
TableItem item = _getItem (index);
@@ -3222,6 +3281,7 @@ long /*int*/ tableView_objectValueForTableColumn_row (long /*int*/ id, long /*in
return item.createString (0).id;
}
+@Override
boolean tableView_shouldReorderColumn_toColumn(long /*int*/ id, long /*int*/ sel, long /*int*/ aTableView, long /*int*/ currentColIndex, long /*int*/ newColIndex) {
// Check column should never move and no column can be dragged to the left of it, if present.
if ((style & SWT.CHECK) != 0) {
@@ -3240,6 +3300,7 @@ boolean tableView_shouldReorderColumn_toColumn(long /*int*/ id, long /*int*/ sel
return true;
}
+@Override
boolean tableView_shouldTrackCell_forTableColumn_row(long /*int*/ id, long /*int*/ sel, long /*int*/ table, long /*int*/ cell, /*long*/ long /*int*/ tableColumn, long /*int*/ rowIndex) {
if ((style & SWT.CHECK) != 0) {
if (new NSCell(cell).isKindOfClass(OS.class_NSButtonCell)) return true;
@@ -3248,6 +3309,7 @@ boolean tableView_shouldTrackCell_forTableColumn_row(long /*int*/ id, long /*int
return widget.isRowSelected(rowIndex);
}
+@Override
void tableView_setObjectValue_forTableColumn_row (long /*int*/ id, long /*int*/ sel, long /*int*/ aTableView, long /*int*/ anObject, long /*int*/ aTableColumn, long /*int*/ rowIndex) {
if (checkColumn != null && aTableColumn == checkColumn.id) {
TableItem item = items [(int)/*64*/rowIndex];
@@ -3261,6 +3323,7 @@ void tableView_setObjectValue_forTableColumn_row (long /*int*/ id, long /*int*/
}
}
+@Override
void tableView_willDisplayCell_forTableColumn_row (long /*int*/ id, long /*int*/ sel, long /*int*/ aTableView, long /*int*/ cell, long /*int*/ tableColumn, long /*int*/ rowIndex) {
if (checkColumn != null && tableColumn == checkColumn.id) return;
TableItem item = items [(int)/*64*/rowIndex];
@@ -3326,10 +3389,12 @@ void tableView_willDisplayCell_forTableColumn_row (long /*int*/ id, long /*int*/
}
}
+@Override
boolean tableView_writeRowsWithIndexes_toPasteboard(long /*int*/ id, long /*int*/ sel, long /*int*/ arg0, long /*int*/ arg1, long /*int*/ arg2) {
return sendMouseEvent(NSApplication.sharedApplication().currentEvent(), SWT.DragDetect, true);
}
+@Override
boolean sendMouseEvent(NSEvent nsEvent, int type, boolean send) {
if (type == SWT.DragDetect) {
dragDetected = true;
@@ -3364,6 +3429,7 @@ boolean sendMouseEvent(NSEvent nsEvent, int type, boolean send) {
return super.sendMouseEvent (nsEvent, type, send);
}
+@Override
NSRect titleRectForBounds (long /*int*/ id, long /*int*/ sel, NSRect cellFrame) {
NSImage image = new NSCell(id).image();
if (image != null) {
@@ -3374,6 +3440,7 @@ NSRect titleRectForBounds (long /*int*/ id, long /*int*/ sel, NSRect cellFrame)
return cellFrame;
}
+@Override
void updateCursorRects (boolean enabled) {
super.updateCursorRects (enabled);
if (headerView == null) return;
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 b08e42cdff..05a19f48f9 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
@@ -187,20 +187,24 @@ static int checkStyle (int style) {
return checkBits (style, SWT.LEFT, SWT.CENTER, SWT.RIGHT, 0, 0, 0);
}
+@Override
protected void checkSubclass () {
if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
}
+@Override
void deregister () {
super.deregister ();
display.removeWidget (nsColumn.headerCell());
}
+@Override
void destroyWidget () {
parent.destroyItem (this);
releaseHandle ();
}
+@Override
void drawInteriorWithFrame_inView (long /*int*/ id, long /*int*/ sel, NSRect cellRect, long /*int*/ view) {
/*
* Feature in Cocoa. When the last column in a table does not reach the
@@ -305,6 +309,7 @@ public int getAlignment () {
return SWT.LEFT;
}
+@Override
String getNameText () {
return getText ();
}
@@ -439,6 +444,7 @@ public void pack () {
setWidth (width);
}
+@Override
void releaseHandle () {
super.releaseHandle ();
if (nsColumn != null) {
@@ -449,6 +455,7 @@ void releaseHandle () {
parent = null;
}
+@Override
void releaseWidget () {
super.releaseWidget ();
if (parent.sortColumn == this) {
@@ -538,6 +545,7 @@ public void setAlignment (int alignment) {
parent.view.setNeedsDisplayInRect (rect);
}
+@Override
public void setImage (Image image) {
checkWidget();
if (image != null && image.isDisposed ()) {
@@ -596,6 +604,7 @@ public void setResizable (boolean resizable) {
nsColumn.setResizingMask (resizable ? OS.NSTableColumnUserResizingMask : OS.NSTableColumnNoResizing);
}
+@Override
public void setText (String string) {
checkWidget ();
if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
@@ -659,6 +668,7 @@ public void setWidth (int width) {
nsColumn.setWidth (width);
}
+@Override
String tooltipText () {
return toolTipText;
}
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 156f105fc2..1aa580e2e0 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
@@ -183,6 +183,7 @@ int calculateWidth (int index, GC gc, boolean rowSelected) {
return width;
}
+@Override
protected void checkSubclass () {
if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
}
@@ -205,6 +206,7 @@ NSObject createString (int index) {
return NSString.stringWith(text != null ? text : "");
}
+@Override
void destroyWidget () {
parent.destroyItem (this);
releaseHandle ();
@@ -454,6 +456,7 @@ public boolean getGrayed () {
return grayed;
}
+@Override
public Image getImage () {
checkWidget ();
if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
@@ -535,6 +538,7 @@ public int getImageIndent () {
return 0;
}
+@Override
String getNameText () {
if ((parent.style & SWT.VIRTUAL) != 0) {
if (!cached) return "*virtual*"; //$NON-NLS-1$
@@ -557,6 +561,7 @@ public Table getParent () {
return parent;
}
+@Override
public String getText () {
checkWidget ();
if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
@@ -628,6 +633,7 @@ public Rectangle getTextBounds (int index) {
return new Rectangle((int) rect.x, (int) rect.y, (int) rect.width, (int) rect.height);
}
+@Override
boolean isDrawing () {
return getDrawing() && parent.isDrawing ();
}
@@ -655,16 +661,19 @@ void redraw (int columnIndex) {
tableView.setNeedsDisplayInRect (rect);
}
+@Override
void releaseHandle () {
super.releaseHandle ();
parent = null;
}
+@Override
void releaseParent () {
super.releaseParent ();
// parent.checkItems (true);
}
+@Override
void releaseWidget () {
super.releaseWidget ();
strings = null;
@@ -985,6 +994,7 @@ public void setImage (int index, Image image) {
redraw (index);
}
+@Override
public void setImage (Image image) {
checkWidget ();
setImage (0, image);
@@ -1003,6 +1013,7 @@ public void setImage (Image image) {
*
* @deprecated this functionality is not supported on most platforms
*/
+@Deprecated
public void setImageIndent (int indent) {
checkWidget ();
if (indent < 0) return;
@@ -1071,6 +1082,7 @@ public void setText (int index, String string) {
redraw (index);
}
+@Override
public void setText (String string) {
checkWidget ();
setText (0, string);
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 9e425f5d89..823bb33c1e 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
@@ -164,6 +164,7 @@ public TaskItem [] getItems () {
return result;
}
+@Override
void releaseChildren (boolean destroy) {
if (items != null) {
for (int i=0; i<items.length; i++) {
@@ -177,11 +178,13 @@ void releaseChildren (boolean destroy) {
super.releaseChildren (destroy);
}
+@Override
void releaseParent () {
super.releaseParent ();
if (display.taskBar == this) display.taskBar = null;
}
+@Override
void reskinChildren (int flags) {
if (items != null) {
for (int i=0; i<items.length; 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 dd6dc8a06e..d381ac6952 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
@@ -81,16 +81,19 @@ TaskItem (TaskBar parent, int style) {
createWidget ();
}
+@Override
protected void checkSubclass () {
if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
}
+@Override
void createWidget () {
NSApplication app = NSApplication.sharedApplication ();
NSImage image = app.applicationIconImage ();
defaultImage = new NSImage (image.copy ());
}
+@Override
void destroyWidget () {
parent.destroyItem (this);
releaseHandle ();
@@ -190,6 +193,7 @@ public int getProgressState () {
return progressState;
}
+@Override
void releaseHandle () {
super.releaseHandle ();
parent = null;
@@ -197,6 +201,7 @@ void releaseHandle () {
defaultImage = null;
}
+@Override
void releaseWidget () {
super.releaseWidget ();
overlayImage = null;
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 1b1b8f5ae0..a1c2bccd53 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
@@ -107,6 +107,7 @@ ToolBar(Composite parent, int style, boolean internal) {
}
}
+@Override
long /*int*/ accessibilityAttributeValue (long /*int*/ id, long /*int*/ sel, long /*int*/ arg0) {
NSString nsAttributeName = new NSString(arg0);
@@ -141,6 +142,7 @@ long /*int*/ accessibilityAttributeValue (long /*int*/ id, long /*int*/ sel, lon
return super.accessibilityAttributeValue(id, sel, arg0);
}
+@Override
boolean accessibilityIsIgnored(long /*int*/ id, long /*int*/ sel) {
// Toolbars aren't ignored.
if (id == view.id) return false;
@@ -189,10 +191,12 @@ static int checkStyle (Composite parent, int style, boolean internal) {
return newStyle;
}
+@Override
protected void checkSubclass () {
if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
}
+@Override
public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget();
int width = wHint, height = hHint;
@@ -206,6 +210,7 @@ public Point computeSize (int wHint, int hHint, boolean changed) {
return new Point (trim.width, trim.height);
}
+@Override
public Rectangle computeTrim (int x, int y, int width, int height) {
checkWidget();
if (nsToolbar != null) {
@@ -226,6 +231,7 @@ public Rectangle computeTrim (int x, int y, int width, int height) {
return new Rectangle (x, y, width, height);
}
+@Override
void createHandle () {
if ((style & SWT.SMOOTH) != 0) {
nsToolbar = ((NSToolbar)new SWTToolbar().alloc()).initWithIdentifier(NSString.stringWith(String.valueOf(NEXT_ID++)));
@@ -280,16 +286,19 @@ void createItem (ToolItem item, int index) {
relayout ();
}
+@Override
void createWidget () {
super.createWidget ();
items = new ToolItem [4];
itemCount = 0;
}
+@Override
NSFont defaultNSFont() {
return NSFont.systemFontOfSize(11.0f);
}
+@Override
void deregister () {
super.deregister ();
if (nsToolbar != null) display.removeWidget (nsToolbar);
@@ -313,6 +322,7 @@ void destroyItem (ToolItem item) {
relayout ();
}
+@Override
void drawBackground (long /*int*/ id, NSGraphicsContext context, NSRect rect) {
if (id != view.id) return;
if (background != null) {
@@ -320,6 +330,7 @@ void drawBackground (long /*int*/ id, NSGraphicsContext context, NSRect rect) {
}
}
+@Override
void enableWidget(boolean enabled) {
super.enableWidget(enabled);
for (int i = 0; i < itemCount; i++) {
@@ -330,6 +341,7 @@ void enableWidget(boolean enabled) {
}
}
+@Override
Widget findTooltip (NSPoint pt) {
pt = view.convertPoint_fromView_ (pt, null);
for (int i = 0; i < itemCount; i++) {
@@ -339,11 +351,13 @@ Widget findTooltip (NSPoint pt) {
return super.findTooltip (pt);
}
+@Override
void setZOrder() {
if (nsToolbar != null) return;
super.setZOrder();
}
+@Override
public Rectangle getBounds () {
checkWidget();
@@ -358,6 +372,7 @@ public Rectangle getBounds () {
return super.getBounds();
}
+@Override
boolean forceFocus (NSView focusView) {
if (lastFocus != null && lastFocus.setFocus ()) return true;
ToolItem [] items = getItems ();
@@ -476,6 +491,7 @@ public int getRowCount () {
return layout (rect.width, rect.height, false) [0];
}
+@Override
boolean hasKeyboardFocus(long /*int*/ inId) {
return hasFocus();
}
@@ -623,6 +639,7 @@ int [] layout (int nWidth, int nHeight, boolean resize) {
}
}
+@Override
void register() {
super.register();
if (nsToolbar != null) display.addWidget (nsToolbar, this);
@@ -634,6 +651,7 @@ void relayout () {
layout (rect.width, rect.height, true);
}
+@Override
void releaseChildren (boolean destroy) {
if (items != null) {
for (int i=0; i<itemCount; i++) {
@@ -648,6 +666,7 @@ void releaseChildren (boolean destroy) {
super.releaseChildren (destroy);
}
+@Override
void releaseHandle () {
super.releaseHandle ();
@@ -660,6 +679,7 @@ void releaseHandle () {
accessibilityAttributes = null;
}
+@Override
void removeControl (Control control) {
super.removeControl (control);
for (int i=0; i<itemCount; i++) {
@@ -668,11 +688,13 @@ void removeControl (Control control) {
}
}
+@Override
void resized () {
super.resized ();
relayout ();
}
+@Override
void reskinChildren (int flags) {
if (items != null) {
for (int i=0; i<items.length; i++) {
@@ -683,6 +705,7 @@ void reskinChildren (int flags) {
super.reskinChildren (flags);
}
+@Override
boolean sendMouseEvent (NSEvent nsEvent, int type, boolean send) {
switch (type) {
case SWT.MouseEnter:
@@ -717,6 +740,7 @@ boolean sendMouseEvent (NSEvent nsEvent, int type, boolean send) {
return super.sendMouseEvent(nsEvent, type, send);
}
+@Override
void setBounds (int x, int y, int width, int height, boolean move, boolean resize) {
// In the unified toolbar case, the toolbar view size and position is completely controlled
// by the window, so don't change its bounds or location.
@@ -724,6 +748,7 @@ void setBounds (int x, int y, int width, int height, boolean move, boolean resiz
super.setBounds(x, y, width, height, move, resize);
}
+@Override
void setFont(NSFont font) {
for (int i = 0; i < itemCount; i++) {
ToolItem item = items[i];
@@ -731,17 +756,20 @@ void setFont(NSFont font) {
}
}
+@Override
public void setRedraw (boolean redraw) {
checkWidget();
super.setRedraw (redraw);
if (redraw && drawCount == 0) relayout();
}
+@Override
public void setVisible(boolean visible) {
if (nsToolbar != null) nsToolbar.setVisible(visible);
super.setVisible(visible);
}
+@Override
long /*int*/ toolbar_itemForItemIdentifier_willBeInsertedIntoToolbar(long /*int*/ id, long /*int*/ sel, long /*int*/ toolbar, long /*int*/ itemIdentifier, boolean flag) {
NSString itemID = new NSString(itemIdentifier);
for (int j = 0; j < itemCount; j++) {
@@ -757,6 +785,7 @@ long /*int*/ toolbar_itemForItemIdentifier_willBeInsertedIntoToolbar(long /*int*
* Returns an array of all toolbar item IDs allowed to be in the toolbar. Since the ToolBar created all of the ToolItems
* return all of the item IDs.
*/
+@Override
long /*int*/ toolbarAllowedItemIdentifiers(long /*int*/ id, long /*int*/ sel, long /*int*/ toolbar) {
NSMutableArray array = NSMutableArray.arrayWithCapacity(itemCount);
for (int i = 0; i < itemCount; i++) {
@@ -768,6 +797,7 @@ long /*int*/ toolbarAllowedItemIdentifiers(long /*int*/ id, long /*int*/ sel, lo
/*
* This delegate method isn't really needed because ToolBars aren't customizable, but it's required according to the documentation.
*/
+@Override
long /*int*/ toolbarDefaultItemIdentifiers(long /*int*/ id, long /*int*/ sel, long /*int*/ toolbar) {
return toolbarAllowedItemIdentifiers(id, sel, toolbar);
}
@@ -776,6 +806,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.
*/
+@Override
long /*int*/ toolbarSelectableItemIdentifiers(long /*int*/ id, long /*int*/ sel, long /*int*/ toolbar) {
NSMutableArray array = NSMutableArray.arrayWithCapacity(itemCount);
for (int i = 0; i < itemCount; i++) {
@@ -784,6 +815,7 @@ long /*int*/ toolbarSelectableItemIdentifiers(long /*int*/ id, long /*int*/ sel,
return array.id;
}
+@Override
boolean translateTraversal (int key, NSEvent theEvent, boolean[] consume) {
boolean result = super.translateTraversal (key, theEvent, consume);
if (result) return result;
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 de0a34c5c2..0301cd3ee8 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
@@ -137,12 +137,14 @@ public ToolItem (ToolBar parent, int style, int index) {
parent.createItem (this, index);
}
+@Override
long /*int*/ accessibleHandle() {
if (button != null && button.cell() != null) return button.cell().id;
if (view != null) return view.id;
return 0;
}
+@Override
long /*int*/ accessibilityActionNames(long /*int*/ id, long /*int*/ sel) {
long /*int*/ returnValue = super.accessibilityActionNames(id, sel);
@@ -161,6 +163,7 @@ long /*int*/ accessibilityActionNames(long /*int*/ id, long /*int*/ sel) {
return returnValue;
}
+@Override
long /*int*/ accessibilityAttributeNames(long /*int*/ id, long /*int*/ sel) {
long /*int*/ returnValue = super.accessibilityAttributeNames(id, sel);
@@ -185,6 +188,7 @@ long /*int*/ accessibilityAttributeNames(long /*int*/ id, long /*int*/ sel) {
return returnValue;
}
+@Override
long /*int*/ accessibilityAttributeValue(long /*int*/ id, long /*int*/ sel, long /*int*/ arg0) {
NSString nsAttributeName = new NSString(arg0);
@@ -234,6 +238,7 @@ long /*int*/ accessibilityAttributeValue(long /*int*/ id, long /*int*/ sel, long
return super.accessibilityAttributeValue(id, sel, arg0);
}
+@Override
boolean accessibilityIsIgnored(long /*int*/ id, long /*int*/ sel) {
// The interesting part of a ToolItem is its button, if it has one.
if (id == accessibleHandle()) return false;
@@ -283,6 +288,7 @@ static int checkStyle (int style) {
return checkBits (style, SWT.PUSH, SWT.CHECK, SWT.RADIO, SWT.SEPARATOR, SWT.DROP_DOWN, 0);
}
+@Override
protected void checkSubclass () {
if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
}
@@ -341,6 +347,7 @@ Point computeSize () {
return new Point (width, height);
}
+@Override
void createHandle () {
if (parent.nsToolbar != null) {
id = NSString.stringWith(String.valueOf(ToolBar.NEXT_ID++));
@@ -397,6 +404,7 @@ NSAttributedString createString() {
return attribStr;
}
+@Override
void deregister () {
super.deregister ();
display.removeWidget(view);
@@ -407,11 +415,13 @@ void deregister () {
}
}
+@Override
void destroyWidget() {
parent.destroyItem(this);
super.destroyWidget();
}
+@Override
void drawImageWithFrameInView (long /*int*/ id, long /*int*/ sel, long /*int*/ image, NSRect rect, long /*int*/ view) {
if (text.length () > 0) {
if ((parent.style & SWT.RIGHT) != 0) {
@@ -444,6 +454,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;
@@ -462,6 +473,7 @@ NSRect drawTitleWithFrameInView (long /*int*/ id, long /*int*/ sel, long /*int*/
return super.drawTitleWithFrameInView(id, sel, title, titleRect, view);
}
+@Override
void drawWidget (long /*int*/ id, NSGraphicsContext context, NSRect rect) {
if (id == view.id) {
boolean drawSelected = getSelection() && (parent.nsToolbar == null);
@@ -538,6 +550,7 @@ public Rectangle getBounds () {
return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
}
+@Override
void setClipRegion (NSView view) {
parent.setClipRegion(view);
}
@@ -577,6 +590,7 @@ public Image getDisabledImage () {
return disabledImage;
}
+@Override
boolean getDrawing () {
return parent.getDrawing ();
}
@@ -728,14 +742,17 @@ public boolean isEnabled () {
return getEnabled () && parent.isEnabled ();
}
+@Override
boolean isDrawing () {
return getDrawing() && parent.isDrawing ();
}
+@Override
long /*int*/ menuForEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
return parent.menuForEvent (id, sel, theEvent);
}
+@Override
void mouseDown(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
if (!parent.mouseEvent(parent.view.id, sel, theEvent, SWT.MouseDown)) return;
Display display = this.display;
@@ -752,51 +769,61 @@ void mouseDown(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
}
}
+@Override
boolean mouseDownCanMoveWindow(long /*int*/ id, long /*int*/ sel) {
if (id == view.id) return false;
return super.mouseDownCanMoveWindow(id, sel);
}
+@Override
void mouseUp(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
if (!parent.mouseEvent(parent.view.id, sel, theEvent, SWT.MouseUp)) return;
super.mouseUp(id, sel, theEvent);
}
+@Override
void mouseDragged(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
if (!parent.mouseEvent(parent.view.id, sel, theEvent, SWT.MouseMove)) return;
super.mouseDragged(id, sel, theEvent);
}
+@Override
void rightMouseDown(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
if (!parent.mouseEvent(parent.view.id, sel, theEvent, SWT.MouseDown)) return;
super.rightMouseDown(id, sel, theEvent);
}
+@Override
void rightMouseUp(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
if (!parent.mouseEvent(parent.view.id, sel, theEvent, SWT.MouseUp)) return;
super.rightMouseUp(id, sel, theEvent);
}
+@Override
void rightMouseDragged(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
if (!parent.mouseEvent(parent.view.id, sel, theEvent, SWT.MouseMove)) return;
super.rightMouseDragged(id, sel, theEvent);
}
+@Override
void otherMouseDown(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
if (!parent.mouseEvent(parent.view.id, sel, theEvent, SWT.MouseDown)) return;
super.otherMouseDown(id, sel, theEvent);
}
+@Override
void otherMouseUp(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
if (!parent.mouseEvent(parent.view.id, sel, theEvent, SWT.MouseUp)) return;
super.otherMouseUp(id, sel, theEvent);
}
+@Override
void otherMouseDragged(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
if (!parent.mouseEvent(parent.view.id, sel, theEvent, SWT.MouseMove)) return;
super.otherMouseDragged(id, sel, theEvent);
}
+@Override
void register () {
super.register ();
display.addWidget (view, this);
@@ -832,11 +859,13 @@ public void removeSelectionListener(SelectionListener listener) {
eventTable.unhook(SWT.DefaultSelection,listener);
}
+@Override
void releaseParent () {
super.releaseParent ();
setVisible (false);
}
+@Override
void releaseHandle () {
super.releaseHandle ();
if (view != null) view.release ();
@@ -857,6 +886,7 @@ void releaseHandle () {
parent = null;
}
+@Override
void releaseWidget () {
super.releaseWidget ();
control = null;
@@ -875,6 +905,7 @@ void selectRadio () {
setSelection (true);
}
+@Override
void sendSelection () {
if ((style & SWT.RADIO) != 0) {
if ((parent.getStyle () & SWT.NO_RADIO_GROUP) == 0) {
@@ -1048,6 +1079,7 @@ public void setHotImage (Image image) {
updateImage (true);
}
+@Override
public void setImage (Image image) {
checkWidget();
if (image != null && image.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
@@ -1122,6 +1154,7 @@ public void setSelection (boolean selected) {
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
+@Override
public void setText (String string) {
checkWidget();
if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
@@ -1226,6 +1259,7 @@ public void setWidth (int width) {
parent.relayout();
}
+@Override
String tooltipText () {
return toolTipText;
}
@@ -1266,6 +1300,7 @@ void updateImage (boolean layout) {
parent.relayout();
}
+@Override
boolean validateMenuItem(long /*int*/ id, long /*int*/ sel, long /*int*/ menuItem) {
return isEnabled();
}
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 127ce11cf0..3d50aa5cc1 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
@@ -914,6 +914,7 @@ public boolean open () {
return !cancelled;
}
+@Override
void releaseWidget () {
super.releaseWidget ();
parent = null;
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 bbfd033fc3..d88f3ddf5a 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
@@ -136,6 +136,7 @@ public Tree (Composite parent, int style) {
super (parent, checkStyle (style));
}
+@Override
void _addListener (int eventType, Listener listener) {
super._addListener (eventType, listener);
clearCachedWidth (items);
@@ -159,10 +160,12 @@ TreeItem _getItem (TreeItem parentItem, int index, boolean create) {
return item;
}
+@Override
boolean acceptsFirstResponder (long /*int*/ id, long /*int*/ sel) {
return true;
}
+@Override
long /*int*/ accessibilityAttributeValue(long /*int*/ id, long /*int*/ sel, long /*int*/ arg0) {
long /*int*/ returnValue = 0;
NSString attributeName = new NSString(arg0);
@@ -267,6 +270,7 @@ int calculateWidth (TreeItem[] items, int index, GC gc, boolean recurse) {
return width;
}
+@Override
NSSize cellSize (long /*int*/ id, long /*int*/ sel) {
NSSize size = super.cellSize(id, sel);
NSCell cell = new NSCell(id);
@@ -290,6 +294,7 @@ NSSize cellSize (long /*int*/ id, long /*int*/ sel) {
return size;
}
+@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;
@@ -348,6 +353,7 @@ static int checkStyle (int style) {
return checkBits (style, SWT.SINGLE, SWT.MULTI, 0, 0, 0, 0);
}
+@Override
protected void checkSubclass () {
if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
}
@@ -454,6 +460,7 @@ void clearCachedWidth (TreeItem[] items) {
}
}
+@Override
void collapseItem_collapseChildren (long /*int*/ id, long /*int*/ sel, long /*int*/ itemID, boolean children) {
TreeItem item = (TreeItem)display.getWidget(itemID);
if (item == null) return;
@@ -465,6 +472,7 @@ void collapseItem_collapseChildren (long /*int*/ id, long /*int*/ sel, long /*in
setScrollWidth ();
}
+@Override
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;
@@ -473,6 +481,7 @@ long /*int*/ columnAtPoint(long /*int*/ id, long /*int*/ sel, NSPoint point) {
return super.columnAtPoint(id, sel, point);
}
+@Override
public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget ();
int width = 0, height = 0;
@@ -547,6 +556,7 @@ void createColumn (TreeItem item, int index) {
}
}
+@Override
void createHandle () {
NSScrollView scrollWidget = (NSScrollView) new SWTScrollView ().alloc ();
scrollWidget.init ();
@@ -735,24 +745,29 @@ void createItem (TreeItem item, TreeItem parentItem, int index) {
ignoreExpand = false;
}
+@Override
void createWidget () {
super.createWidget ();
items = new TreeItem [4];
columns = new TreeColumn [4];
}
+@Override
Color defaultBackground () {
return display.getWidgetColor (SWT.COLOR_LIST_BACKGROUND);
}
+@Override
NSFont defaultNSFont () {
return display.outlineViewFont;
}
+@Override
Color defaultForeground () {
return display.getWidgetColor (SWT.COLOR_LIST_FOREGROUND);
}
+@Override
void deselectAll(long /*int*/ id, long /*int*/ sel, long /*int*/ sender) {
if (preventSelect && !ignoreSelect) return;
if ((style & SWT.SINGLE) != 0 && !ignoreSelect) {
@@ -761,6 +776,7 @@ void deselectAll(long /*int*/ id, long /*int*/ sel, long /*int*/ sender) {
super.deselectAll (id, sel, sender);
}
+@Override
void deselectRow (long /*int*/ id, long /*int*/ sel, long /*int*/ index) {
if (preventSelect && !ignoreSelect) return;
if ((style & SWT.SINGLE) != 0 && !ignoreSelect) {
@@ -785,6 +801,7 @@ public void deselectAll () {
ignoreSelect = false;
}
+@Override
void deregister () {
super.deregister ();
display.removeWidget (headerView);
@@ -959,17 +976,20 @@ void destroyItem (TreeItem item) {
if (insertItem == item) insertItem = null;
}
+@Override
boolean dragDetect(int x, int y, boolean filter, boolean[] consume) {
// Let Cocoa determine if a drag is starting and fire the notification when we get the callback.
return false;
}
+@Override
void drawBackgroundInClipRect(long /*int*/ id, long /*int*/ sel, NSRect rect) {
super.drawViewBackgroundInRect(id, sel, rect);
if (id != view.id) return;
fillBackground (view, NSGraphicsContext.currentContext(), rect, -1);
}
+@Override
void drawInteriorWithFrame_inView (long /*int*/ id, long /*int*/ sel, NSRect rect, long /*int*/ view) {
boolean hooksErase = hooks (SWT.EraseItem);
boolean hooksPaint = hooks (SWT.PaintItem);
@@ -1244,12 +1264,14 @@ void drawInteriorWithFrame_inView (long /*int*/ id, long /*int*/ sel, NSRect rec
}
}
+@Override
void drawWithExpansionFrame_inView (long /*int*/ id, long /*int*/ sel, NSRect cellFrame, long /*int*/ view) {
drawExpansion = true;
super.drawWithExpansionFrame_inView(id, sel, cellFrame, view);
drawExpansion = false;
}
+@Override
void expandItem_expandChildren (long /*int*/ id, long /*int*/ sel, long /*int*/ itemID, boolean children) {
TreeItem item = (TreeItem)display.getWidget(itemID);
if (item == null) return;
@@ -1269,6 +1291,7 @@ void expandItem_expandChildren (long /*int*/ id, long /*int*/ sel, long /*int*/
setScrollWidth (false, item.items, true);
}
+@Override
NSRect expansionFrameWithFrame_inView(long /*int*/ id, long /*int*/ sel, NSRect cellRect, long /*int*/ view) {
if (toolTipText == null) {
NSRect rect = super.expansionFrameWithFrame_inView(id, sel, cellRect, view);
@@ -1312,6 +1335,7 @@ NSRect expansionFrameWithFrame_inView(long /*int*/ id, long /*int*/ sel, NSRect
return new NSRect();
}
+@Override
Widget findTooltip (NSPoint pt) {
NSTableView widget = (NSTableView)view;
NSTableHeaderView headerView = widget.headerView();
@@ -1336,6 +1360,7 @@ int getCheckColumnWidth () {
return (int)checkColumn.dataCell().cellSize().width;
}
+@Override
public Rectangle getClientArea () {
checkWidget ();
Rectangle rect = super.getClientArea ();
@@ -1846,6 +1871,7 @@ public TreeItem getTopItem () {
return (TreeItem)display.getWidget (item.id);
}
+@Override
NSRect headerRectOfColumn (long /*int*/ id, long /*int*/ sel, long /*int*/ column) {
if ((style & SWT.CHECK) == 0) return callSuperRect(id, sel, column);
@@ -1864,6 +1890,7 @@ NSRect headerRectOfColumn (long /*int*/ id, long /*int*/ sel, long /*int*/ colum
return callSuperRect(id, sel, column);
}
+@Override
void highlightSelectionInClipRect(long /*int*/ id, long /*int*/ sel, long /*int*/ rect) {
if (hooks (SWT.EraseItem)) return;
if ((style & SWT.HIDE_SELECTION) != 0 && !hasFocus()) return;
@@ -1872,6 +1899,7 @@ void highlightSelectionInClipRect(long /*int*/ id, long /*int*/ sel, long /*int*
callSuper (id, sel, clipRect);
}
+@Override
long /*int*/ hitTestForEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ event, NSRect rect, long /*int*/ controlView) {
/*
* For some reason, the cell class needs to implement hitTestForEvent:inRect:ofView:,
@@ -1880,12 +1908,14 @@ long /*int*/ hitTestForEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ ev
return callSuper(id, sel, event, rect, controlView);
}
+@Override
long /*int*/ image (long /*int*/ id, long /*int*/ sel) {
long /*int*/ [] image = new long /*int*/ [1];
OS.object_getInstanceVariable(id, Display.SWT_IMAGE, image);
return image[0];
}
+@Override
NSRect imageRectForBounds (long /*int*/ id, long /*int*/ sel, NSRect cellFrame) {
NSImage image = new NSCell(id).image();
if (image != null) {
@@ -1960,20 +1990,24 @@ public int indexOf (TreeItem item) {
return -1;
}
+@Override
boolean isTransparent() {
return true;
}
+@Override
boolean isTrim (NSView view) {
if (super.isTrim (view)) return true;
return view.id == headerView.id;
}
+@Override
void keyDown(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
ignoreSelect = preventSelect = false;
super.keyDown(id, sel, theEvent);
}
+@Override
long /*int*/ menuForEvent(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
if (id != headerView.id) {
/*
@@ -2004,6 +2038,7 @@ long /*int*/ menuForEvent(long /*int*/ id, long /*int*/ sel, long /*int*/ theEve
return super.menuForEvent(id, sel, theEvent);
}
+@Override
void mouseDown (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
if (id == view.id) {
// Bug/feature in Cocoa: If the tree has a context menu we just set it visible instead of returning
@@ -2015,6 +2050,7 @@ void mouseDown (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
super.mouseDown(id, sel, theEvent);
}
+@Override
void mouseDownSuper(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
ignoreSelect = preventSelect = false;
boolean check = false;
@@ -2049,6 +2085,7 @@ void mouseDownSuper(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
didSelect = false;
}
+@Override
boolean needsPanelToBecomeKey (long /*int*/ id, long /*int*/ sel) {
return false;
}
@@ -2059,6 +2096,7 @@ boolean needsPanelToBecomeKey (long /*int*/ id, long /*int*/ sel) {
* to momentarily appear while clicking on the checkbox. To avoid this,
* override [NSCell nextState] to go directly to the desired state.
*/
+@Override
long /*int*/ nextState (long /*int*/ id, long /*int*/ sel) {
NSOutlineView outlineView = (NSOutlineView)view;
int index = (int)/*64*/outlineView.clickedRow();
@@ -2070,18 +2108,21 @@ long /*int*/ nextState (long /*int*/ id, long /*int*/ sel) {
return item.checked ? OS.NSOffState : OS.NSOnState;
}
+@Override
long /*int*/ outlineView_child_ofItem (long /*int*/ id, long /*int*/ sel, long /*int*/ outlineView, long /*int*/ index, long /*int*/ itemID) {
TreeItem parent = (TreeItem) display.getWidget (itemID);
TreeItem item = _getItem (parent, (int)/*64*/index, true);
return item.handle.id;
}
+@Override
void outlineView_didClickTableColumn (long /*int*/ id, long /*int*/ sel, long /*int*/ outlineView, long /*int*/ tableColumn) {
TreeColumn column = getColumn (new id (tableColumn));
if (column == null) return; /* either CHECK column or firstColumn in 0-column Tree */
column.sendSelectionEvent (SWT.Selection);
}
+@Override
long /*int*/ outlineView_objectValueForTableColumn_byItem (long /*int*/ id, long /*int*/ sel, long /*int*/ outlineView, long /*int*/ tableColumn, long /*int*/ itemID) {
TreeItem item = (TreeItem) display.getWidget (itemID);
checkData (item);
@@ -2102,20 +2143,24 @@ long /*int*/ outlineView_objectValueForTableColumn_byItem (long /*int*/ id, long
return item.createString (0).id;
}
+@Override
boolean outlineView_isItemExpandable (long /*int*/ id, long /*int*/ sel, long /*int*/ outlineView, long /*int*/ item) {
if (item == 0) return true;
return ((TreeItem) display.getWidget (item)).itemCount != 0;
}
+@Override
long /*int*/ outlineView_numberOfChildrenOfItem (long /*int*/ id, long /*int*/ sel, long /*int*/ outlineView, long /*int*/ item) {
if (item == 0) return itemCount;
return ((TreeItem) display.getWidget (item)).itemCount;
}
+@Override
boolean outlineView_shouldExpandItem_item (long /*int*/ id, long /*int*/ sel, long /*int*/ arg0, long /*int*/ arg1) {
return shouldExpand;
}
+@Override
boolean outlineView_shouldReorderColumn_toColumn(long /*int*/ id, long /*int*/ sel, long /*int*/ aTableView, long /*int*/ currentColIndex, long /*int*/ newColIndex) {
// Check column should never move and no column can be dragged to the left of it, if present.
if ((style & SWT.CHECK) != 0) {
@@ -2134,6 +2179,7 @@ boolean outlineView_shouldReorderColumn_toColumn(long /*int*/ id, long /*int*/ s
return true;
}
+@Override
boolean outlineView_shouldTrackCell_forTableColumn_item(long /*int*/ id, long /*int*/ sel, long /*int*/ table, long /*int*/ cell, long /*int*/ tableColumn, long /*int*/ item) {
if ((style & SWT.CHECK) != 0) {
if (new NSCell(cell).isKindOfClass(OS.class_NSButtonCell)) return true;
@@ -2143,6 +2189,7 @@ boolean outlineView_shouldTrackCell_forTableColumn_item(long /*int*/ id, long /*
return widget.isRowSelected(rowIndex);
}
+@Override
void outlineView_willDisplayCell_forTableColumn_item (long /*int*/ id, long /*int*/ sel, long /*int*/ outlineView, long /*int*/ cell, long /*int*/ tableColumn, long /*int*/ itemID) {
if (checkColumn != null && tableColumn == checkColumn.id) return;
TreeItem item = (TreeItem) display.getWidget(itemID);
@@ -2208,6 +2255,7 @@ void outlineView_willDisplayCell_forTableColumn_item (long /*int*/ id, long /*in
}
}
+@Override
void outlineViewColumnDidMove (long /*int*/ id, long /*int*/ sel, long /*int*/ aNotification) {
NSNotification notification = new NSNotification (aNotification);
NSDictionary userInfo = notification.userInfo ();
@@ -2236,6 +2284,7 @@ void outlineViewColumnDidMove (long /*int*/ id, long /*int*/ sel, long /*int*/ a
headerView.setNeedsDisplay(true);
}
+@Override
void outlineViewColumnDidResize (long /*int*/ id, long /*int*/ sel, long /*int*/ aNotification) {
NSNotification notification = new NSNotification (aNotification);
NSDictionary userInfo = notification.userInfo ();
@@ -2265,6 +2314,7 @@ void outlineViewColumnDidResize (long /*int*/ id, long /*int*/ sel, long /*int*/
}
}
+@Override
void scrollClipViewToPoint (long /*int*/ id, long /*int*/ sel, long /*int*/ clipView, NSPoint point) {
if (shouldScroll) {
super.scrollClipViewToPoint(id, sel, clipView, point);
@@ -2280,6 +2330,7 @@ void scrollClipViewToPoint (long /*int*/ id, long /*int*/ sel, long /*int*/ clip
}
}
+@Override
void sendSelection () {
if (ignoreSelect) return;
NSOutlineView widget = (NSOutlineView) view;
@@ -2296,16 +2347,19 @@ void sendSelection () {
}
}
+@Override
void outlineViewSelectionDidChange (long /*int*/ id, long /*int*/ sel, long /*int*/ notification) {
if (didSelect) return;
sendSelection ();
}
+@Override
void outlineViewSelectionIsChanging (long /*int*/ id, long /*int*/ sel, long /*int*/ notification) {
didSelect = true;
sendSelection ();
}
+@Override
void outlineView_setObjectValue_forTableColumn_byItem (long /*int*/ id, long /*int*/ sel, long /*int*/ outlineView, long /*int*/ object, long /*int*/ tableColumn, long /*int*/ itemID) {
if (checkColumn != null && tableColumn == checkColumn.id) {
TreeItem item = (TreeItem) display.getWidget (itemID);
@@ -2318,10 +2372,12 @@ void outlineView_setObjectValue_forTableColumn_byItem (long /*int*/ id, long /*i
}
}
+@Override
boolean outlineView_writeItems_toPasteboard(long /*int*/ id, long /*int*/ sel, long /*int*/ arg0, long /*int*/ arg1, long /*int*/ arg2) {
return sendMouseEvent(NSApplication.sharedApplication().currentEvent(), SWT.DragDetect, true);
}
+@Override
void register () {
super.register ();
display.addWidget (headerView, this);
@@ -2329,6 +2385,7 @@ void register () {
if (buttonCell != null) display.addWidget (buttonCell, this);
}
+@Override
void releaseChildren (boolean destroy) {
for (int i=0; i<items.length; i++) {
TreeItem item = items [i];
@@ -2349,6 +2406,7 @@ void releaseChildren (boolean destroy) {
super.releaseChildren (destroy);
}
+@Override
void releaseHandle () {
super.releaseHandle ();
if (headerView != null) headerView.release ();
@@ -2363,6 +2421,7 @@ void releaseHandle () {
buttonCell = null;
}
+@Override
void releaseWidget () {
super.releaseWidget ();
sortColumn = null;
@@ -2441,6 +2500,7 @@ public void removeTreeListener (TreeListener listener) {
eventTable.unhook (SWT.Collapse, listener);
}
+@Override
void reskinChildren (int flags) {
if (items != null) {
for (int i=0; i<items.length; i++) {
@@ -2457,6 +2517,7 @@ void reskinChildren (int flags) {
super.reskinChildren (flags);
}
+@Override
void setImage (long /*int*/ id, long /*int*/ sel, long /*int*/ arg0) {
OS.object_setInstanceVariable(id, Display.SWT_IMAGE, arg0);
}
@@ -2542,6 +2603,7 @@ public void select (TreeItem item) {
set.release();
}
+@Override
void selectRowIndexes_byExtendingSelection (long /*int*/ id, long /*int*/ sel, long /*int*/ indexes, boolean extend) {
if (preventSelect && !ignoreSelect) return;
if ((style & SWT.SINGLE) != 0 && !ignoreSelect) {
@@ -2551,6 +2613,7 @@ void selectRowIndexes_byExtendingSelection (long /*int*/ id, long /*int*/ sel, l
super.selectRowIndexes_byExtendingSelection (id, sel, indexes, extend);
}
+@Override
void sendDoubleSelection() {
NSOutlineView outlineView = (NSOutlineView)view;
int rowIndex = (int)/*64*/outlineView.clickedRow ();
@@ -2571,6 +2634,7 @@ void sendDoubleSelection() {
}
}
+@Override
boolean sendKeyEvent (NSEvent nsEvent, int type) {
boolean result = super.sendKeyEvent (nsEvent, type);
if (!result) return result;
@@ -2622,6 +2686,7 @@ void sendMeasureItem (TreeItem item, boolean selected, int columnIndex, NSSize s
}
}
+@Override
boolean sendMouseEvent(NSEvent nsEvent, int type, boolean send) {
if (type == SWT.DragDetect) {
dragDetected = true;
@@ -2683,6 +2748,7 @@ void selectItems (TreeItem[] items, boolean ignoreDisposed) {
set.release();
}
+@Override
NSRect titleRectForBounds (long /*int*/ id, long /*int*/ sel, NSRect cellFrame) {
NSImage image = new NSCell(id).image();
if (image != null) {
@@ -2693,6 +2759,7 @@ NSRect titleRectForBounds (long /*int*/ id, long /*int*/ sel, NSRect cellFrame)
return cellFrame;
}
+@Override
void setBackgroundColor(NSColor nsColor) {
((NSTableView) view).setBackgroundColor (nsColor);
}
@@ -2770,6 +2837,7 @@ public void setColumnOrder (int [] order) {
}
}
+@Override
void setFont (NSFont font) {
super.setFont (font);
setItemHeight (null, font, !hooks (SWT.MeasureItem));
@@ -2937,6 +3005,7 @@ public void setLinesVisible (boolean show) {
((NSOutlineView) view).setGridStyleMask(show ? OS.NSTableViewSolidVerticalGridLineMask : OS.NSTableViewGridNone);
}
+@Override
public void setRedraw (boolean redraw) {
checkWidget ();
super.setRedraw (redraw);
@@ -2983,10 +3052,12 @@ boolean setScrollWidth (TreeItem item) {
return false;
}
+@Override
void setShouldExpandItem (long /*int*/ id, long /*int*/ sel, boolean shouldExpand) {
this.shouldExpand = shouldExpand;
}
+@Override
void setShouldScrollClipView (long /*int*/ id, long /*int*/ sel, boolean shouldScroll) {
this.shouldScroll = shouldScroll;
}
@@ -3252,6 +3323,7 @@ public void showSelection () {
}
}
+@Override
void updateCursorRects (boolean enabled) {
super.updateCursorRects (enabled);
if (headerView == null) return;
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 4d9c155f7a..f56d4bd52b 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
@@ -189,20 +189,24 @@ static int checkStyle (int style) {
return checkBits (style, SWT.LEFT, SWT.CENTER, SWT.RIGHT, 0, 0, 0);
}
+@Override
protected void checkSubclass () {
if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
}
+@Override
void deregister () {
super.deregister ();
display.removeWidget (nsColumn.headerCell());
}
+@Override
void destroyWidget () {
parent.destroyItem (this);
releaseHandle ();
}
+@Override
void drawInteriorWithFrame_inView (long /*int*/ id, long /*int*/ sel, NSRect cellRect, long /*int*/ view) {
/*
* Feature in Cocoa. When the last column in a tree does not reach the
@@ -307,6 +311,7 @@ public int getAlignment () {
return SWT.LEFT;
}
+@Override
String getNameText () {
return getText ();
}
@@ -440,6 +445,7 @@ public void pack () {
setWidth (width);
}
+@Override
void releaseHandle () {
super.releaseHandle ();
if (nsColumn != null) {
@@ -450,6 +456,7 @@ void releaseHandle () {
parent = null;
}
+@Override
void releaseWidget () {
super.releaseWidget ();
if (parent.sortColumn == this) {
@@ -539,6 +546,7 @@ public void setAlignment (int alignment) {
parent.view.setNeedsDisplayInRect (rect);
}
+@Override
public void setImage (Image image) {
checkWidget();
if (image != null && image.isDisposed ()) {
@@ -595,6 +603,7 @@ public void setResizable (boolean resizable) {
nsColumn.setResizingMask(resizable ? OS.NSTableColumnUserResizingMask : OS.NSTableColumnNoResizing);
}
+@Override
public void setText (String string) {
checkWidget ();
if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
@@ -658,6 +667,7 @@ public void setWidth (int width) {
nsColumn.setWidth (width);
}
+@Override
String tooltipText () {
return toolTipText;
}
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 880838fe67..2fb28aa664 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
@@ -292,6 +292,7 @@ int calculateWidth (int index, GC gc) {
return width;
}
+@Override
protected void checkSubclass () {
if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
}
@@ -371,22 +372,26 @@ NSObject createString(int index) {
return NSString.stringWith(text != null ? text : "");
}
+@Override
void dealloc (long /*int*/ id, long /*int*/ sel) {
OS.object_setInstanceVariable(id, Display.SWT_OBJECT, 0);
super.destroyJNIRef();
super.dealloc(id, sel);
}
+@Override
void deregister () {
super.deregister ();
//This is done in #dealloc
// display.removeWidget (handle);
}
+@Override
void destroyJNIRef () {
//Do nothing - see #dealloc
}
+@Override
void destroyWidget () {
parent.destroyItem (this);
releaseHandle ();
@@ -661,6 +666,7 @@ public boolean getGrayed () {
return grayed;
}
+@Override
public Image getImage () {
checkWidget ();
if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
@@ -798,6 +804,7 @@ public TreeItem [] getItems () {
return result;
}
+@Override
String getNameText () {
if ((parent.style & SWT.VIRTUAL) != 0) {
if (!cached) return "*virtual*"; //$NON-NLS-1$
@@ -837,6 +844,7 @@ public TreeItem getParentItem () {
return parentItem;
}
+@Override
public String getText () {
checkWidget ();
if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
@@ -941,6 +949,7 @@ public int indexOf (TreeItem item) {
return -1;
}
+@Override
boolean isDrawing () {
return getDrawing() && parent.isDrawing ();
}
@@ -968,11 +977,13 @@ void redraw (int columnIndex) {
outlineView.setNeedsDisplayInRect (rect);
}
+@Override
void register () {
super.register ();
display.addWidget (handle, this);
}
+@Override
void release(boolean destroy) {
TreeItem[] selectedItems = null;
Tree parent = this.parent;
@@ -983,6 +994,7 @@ void release(boolean destroy) {
if (selectedItems != null) parent.selectItems (selectedItems, true);
}
+@Override
void releaseChildren (boolean destroy) {
for (int i=0; i<items.length; i++) {
TreeItem item = items [i];
@@ -995,6 +1007,7 @@ void releaseChildren (boolean destroy) {
super.releaseChildren (destroy);
}
+@Override
void releaseHandle () {
super.releaseHandle ();
if (handle != null) handle.autorelease ();
@@ -1003,6 +1016,7 @@ void releaseHandle () {
parent = null;
}
+@Override
void releaseWidget () {
super.releaseWidget ();
strings = null;
@@ -1392,6 +1406,7 @@ public void setImage (int index, Image image) {
if (0 <= index && index < count) redraw (index);
}
+@Override
public void setImage (Image image) {
checkWidget ();
setImage (0, image);
@@ -1480,6 +1495,7 @@ public void setText (int index, String string) {
if (0 <= index && index < count) redraw (index);
}
+@Override
public void setText (String string) {
checkWidget ();
setText (0, string);

Back to the top