Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti2013-02-27 18:51:08 +0000
committerSilenio Quarti2013-02-27 18:51:08 +0000
commita6ea095a16f72ca5deb1a7074e00ce6f47794bfb (patch)
tree066d7b9118db091ec4eb7376c0d3f014b15f1949 /bundles
parent55bec4cf2651738824fee3f0adede6b94a473ed3 (diff)
downloadeclipse.platform.swt-a6ea095a16f72ca5deb1a7074e00ce6f47794bfb.tar.gz
eclipse.platform.swt-a6ea095a16f72ca5deb1a7074e00ce6f47794bfb.tar.xz
eclipse.platform.swt-a6ea095a16f72ca5deb1a7074e00ce6f47794bfb.zip
Bug 328010 - In cocoa, Help menu can not display Search menu item in chinese language.
Diffstat (limited to 'bundles')
-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 ec555be824..7500c9fb46 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 d273488c24..c52a6c20db 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 aa1301f814..56ecf4e62b 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 05ae8350a4..dc3560ee25 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 77ecd9bf5b..230fc2b2aa 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 a5c0a0f9f4..43f0477280 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 58e89c993a..fb14bea595 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 43993f630f..afb3df26aa 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 236247b552..5603cf90d1 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 05e2d8e8b9..8c15f70ad7 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

Back to the top