Skip to content

Commit 88f0009

Browse files
author
mgricken
committed
This change to the MacPlatform class allows special treatment for
keyboard mnemonics, which do not work correctly on Mac OS. Currently, they are just being ignored, which seems to agree with the Mac OS user interface standard not to provide mnemonics such as Alt-F for opening the file menu. M platform/src-mac/edu/rice/cs/drjava/platform/MacPlatform.java M platform/classes/base-windows/edu/rice/cs/drjava/platform/WindowsPlatform.class M platform/classes/base-mac/edu/rice/cs/drjava/platform/MacPlatform$1$1.class M platform/classes/base-mac/edu/rice/cs/drjava/platform/MacPlatform.class M platform/classes/base-mac/edu/rice/cs/drjava/platform/MacPlatform$1.class git-svn-id: file:///tmp/test-svn/trunk@4526 fe72c1cf-3628-48e9-8b72-1c46755d3cff
1 parent cf5f5e0 commit 88f0009

File tree

5 files changed

+54
-0
lines changed

5 files changed

+54
-0
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

platform/src-mac/edu/rice/cs/drjava/platform/MacPlatform.java

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,58 @@ public boolean isMacPlatform() {
146146
return true;
147147
}
148148

149+
/** Set the keyboard mnemonic for the component in a way that is consistent with
150+
* the current platform. On Mac OS, the Alt-? mnemonics are broken, so we do not
151+
* set them.
152+
* @param obj the component whose mnemonic should be set
153+
* @param mnemonic the key code which represents the mnemonic
154+
* @see javax.swing.AbstractButton#setMnemonic(int)
155+
* @see java.awt.event.KeyEvent */
156+
public void setMnemonic(javax.swing.AbstractButton obj, int mnemonic) {
157+
// on Mac OS, the Alt-? mnemonics are broken, so we do not set them
158+
}
159+
160+
/** Set the keyboard mnemonic for the component in a way that is consistent with
161+
* the current platform. On Mac OS, the Alt-? mnemonics are broken, so we do not
162+
* set them.
163+
* @param obj the component whose mnemonic should be set
164+
* @param mnemonic a char specifying the mnemonic value
165+
* @see javax.swing.AbstractButton#setMnemonic(char) */
166+
public void setMnemonic(javax.swing.AbstractButton obj, char mnemonic) {
167+
// on Mac OS, the Alt-? mnemonics are broken, so we do not set them
168+
}
169+
170+
/** Set the keyboard mnemonic for the component in a way that is consistent with
171+
* the current platform. On Mac OS, the Alt-? mnemonics are broken, so we do not
172+
* set them.
173+
* @param obj the component whose mnemonic should be set
174+
* @param mnemonic the key code which represents the mnemonic
175+
* @see javax.swing.ButtonModel#setMnemonic(int)
176+
* @see java.awt.event.KeyEvent */
177+
public void setMnemonic(javax.swing.ButtonModel obj, int mnemonic) {
178+
// on Mac OS, the Alt-? mnemonics are broken, so we do not set them
179+
}
180+
181+
/** Set the keyboard mnemonic for the component in a way that is consistent with
182+
* the current platform. On Mac OS, the Alt-? mnemonics are broken, so we do not
183+
* set them.
184+
* @param obj the component whose mnemonic should be set
185+
* @param tabIndex the index of the tab that the mnemonic refers to
186+
* @param mnemonic the key code which represents the mnemonic
187+
* @see javax.swing.JTabbedPane#setMnemonic(int,int)
188+
* @see java.awt.event.KeyEvent */
189+
public void setMnemonic(javax.swing.JTabbedPane obj, int tabIndex, int mnemonic) {
190+
// on Mac OS, the Alt-? mnemonics are broken, so we do not set them
191+
}
192+
193+
/** Set the keyboard mnemonic for the component in a way that is consistent with
194+
* the current platform. On Mac OS, the Alt-? mnemonics are broken, so we do not
195+
* set them.
196+
* @param obj the component whose mnemonic should be set
197+
* @param mnemonic the key code which represents the mnemonic
198+
* @see javax.swing.JTabbedPane#setMnemonic(int)
199+
* @see java.awt.event.KeyEvent */
200+
public void setMnemonic(javax.swing.JTabbedPane obj, int mnemonic) {
201+
// on Mac OS, the Alt-? mnemonics are broken, so we do not set them
202+
}
149203
}

0 commit comments

Comments
 (0)