aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti2013-02-27 13:51:08 (EST)
committerLakshmi Shanmugam2013-02-28 03:26:23 (EST)
commit83dec070121dae8c4091abaf144f34488bfe5e38 (patch)
tree4bdb39ae9ef6d39d89ad67d616450c73f08714e1
parent4d8e317cea05db9b5278d6a4d298d508f6069284 (diff)
downloadeclipse.platform.swt-83dec070121dae8c4091abaf144f34488bfe5e38.zip
eclipse.platform.swt-83dec070121dae8c4091abaf144f34488bfe5e38.tar.gz
eclipse.platform.swt-83dec070121dae8c4091abaf144f34488bfe5e38.tar.bz2
Bug 328010 - In cocoa, Help menu can not display Search menu item in chinese language.
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras7
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSApplication.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMenu.java7
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java11
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages.properties1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages_pt._properties1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages_pt_BR._properties1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages_zh._properties1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages_zh_TW._properties1
10 files changed, 35 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras
index ec555be..7500c9f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras
@@ -158,6 +158,10 @@
<arg swt_gen="true"></arg>
<retval swt_gen="true"></retval>
</method>
+ <method selector="setHelpMenu:" swt_gen="true">
+ <arg swt_gen="true"></arg>
+ <retval swt_gen="true"></retval>
+ </method>
<method selector="setMainMenu:" swt_gen="true">
<arg swt_gen="true"></arg>
<retval swt_gen="true"></retval>
@@ -1842,6 +1846,9 @@
<arg swt_gen="true"></arg>
<retval swt_gen="true"></retval>
</method>
+ <method selector="title" swt_gen="true">
+ <retval swt_gen="true"></retval>
+ </method>
</class>
<class name="NSMenuItem" swt_gen="mixed">
<method selector="action" swt_gen="true">
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSApplication.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSApplication.java
index d273488..c52a6c2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSApplication.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSApplication.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -136,6 +136,10 @@ public void setDelegate(id anObject) {
OS.objc_msgSend(this.id, OS.sel_setDelegate_, anObject != null ? anObject.id : 0);
}
+public void setHelpMenu(NSMenu helpMenu) {
+ OS.objc_msgSend(this.id, OS.sel_setHelpMenu_, helpMenu != null ? helpMenu.id : 0);
+}
+
public void setMainMenu(NSMenu aMenu) {
OS.objc_msgSend(this.id, OS.sel_setMainMenu_, aMenu != null ? aMenu.id : 0);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMenu.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMenu.java
index aa1301f..56ecf4e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMenu.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMenu.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -101,4 +101,9 @@ public void setTitle(NSString aString) {
OS.objc_msgSend(this.id, OS.sel_setTitle_, aString != null ? aString.id : 0);
}
+public NSString title() {
+ long /*int*/ result = OS.objc_msgSend(this.id, OS.sel_title);
+ return result != 0 ? new NSString(result) : null;
+}
+
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
index 05ae835..dc3560e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
@@ -1911,6 +1911,7 @@ public static final long /*int*/ sel_setHasVerticalScroller_ = sel_registerName(
public static final long /*int*/ sel_setHeadIndent_ = sel_registerName("setHeadIndent:");
public static final long /*int*/ sel_setHeaderCell_ = sel_registerName("setHeaderCell:");
public static final long /*int*/ sel_setHeaderView_ = sel_registerName("setHeaderView:");
+public static final long /*int*/ sel_setHelpMenu_ = sel_registerName("setHelpMenu:");
public static final long /*int*/ sel_setHidden_ = sel_registerName("setHidden:");
public static final long /*int*/ sel_setHiddenUntilMouseMoves_ = sel_registerName("setHiddenUntilMouseMoves:");
public static final long /*int*/ sel_setHidesOnDeactivate_ = sel_registerName("setHidesOnDeactivate:");
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
index 77ecd9b..230fc2b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
@@ -4474,6 +4474,17 @@ void setMenuBar (Menu menu) {
for (int i = 0; i < items.length; i++) {
MenuItem item = items[i];
NSMenuItem nsItem = item.nsItem;
+
+ /*
+ * Bug in cocoa. Cocoa does not seem to detect the help
+ * menu for languages other than english. The fix is to detect
+ * it ourselves.
+ */
+ NSMenu submenu = nsItem.submenu();
+ if (submenu != null && submenu.title().getString().equals(SWT.getMessage("SWT_Help"))) {
+ application.setHelpMenu(submenu);
+ }
+
nsItem.setMenu(null);
menubar.addItem(nsItem);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages.properties b/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages.properties
index a5c0a0f..43f0477 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages.properties
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages.properties
@@ -12,6 +12,7 @@ SWT_Yes=Yes
SWT_No=No
SWT_OK=OK
SWT_Cancel=Cancel
+SWT_Help=Ajuda
SWT_Abort=Abort
SWT_Retry=Retry
SWT_Ignore=Ignore
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages_pt._properties b/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages_pt._properties
index 58e89c9..fb14bea 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages_pt._properties
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages_pt._properties
@@ -3,6 +3,7 @@ SWT_Yes=Sim
SWT_No=N\u00e3o
SWT_OK=OK
SWT_Cancel=Cancelar
+SWT_Help=Ajuda
SWT_Abort=Abortar
SWT_Retry=Tentar Novamente
SWT_Ignore=Ignorar
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages_pt_BR._properties b/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages_pt_BR._properties
index 43993f6..afb3df2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages_pt_BR._properties
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages_pt_BR._properties
@@ -3,6 +3,7 @@ SWT_Yes=Sim
SWT_No=N\u00e3o
SWT_OK=OK
SWT_Cancel=Cancelar
+SWT_Help=Ajuda
SWT_Abort=Interromper
SWT_Retry=Tentar novamente
SWT_Ignore=Ignorar
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages_zh._properties b/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages_zh._properties
index 236247b..5603cf9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages_zh._properties
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages_zh._properties
@@ -3,6 +3,7 @@ SWT_Yes=\u662f
SWT_No=\u5426
SWT_OK=\u786e\u5b9a
SWT_Cancel=\u53d6\u6d88
+SWT_Help=\u5E2E\u52A9
SWT_Abort=\u653e\u5f03
SWT_Retry=\u91cd\u8bd5
SWT_Ignore=\u5ffd\u7565
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages_zh_TW._properties b/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages_zh_TW._properties
index 05e2d8e..8c15f70 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages_zh_TW._properties
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages_zh_TW._properties
@@ -2,6 +2,7 @@
SWT_Yes=\u662f
SWT_No=\u5426
SWT_OK=\u78ba\u5b9a
+SWT_Help=\u8f14\u52a9\u8aaa\u660e
SWT_Cancel=\u53d6\u6d88
SWT_Abort=\u4e2d\u6b62
SWT_Retry=\u91cd\u8a66