From: mbowie Date: Fri, 1 Feb 2008 06:18:02 +0000 (+0000) Subject: Replaces default modifier key for OS X users with SWT.COMMAND rather than SWT.CTRL... X-Git-Url: http://git.phpeclipse.com?hp=eca22bdda865d38300248e20f47870cacdf4df96 Replaces default modifier key for OS X users with SWT.COMMAND rather than SWT.CTRL. This change is not retro-active for existing preferences, uses in that case will need to change their modifier manually. This resolves the ticket #549. (Although changing the modifier manually would also do the trick.) --- diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/ui/PreferenceConstants.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/ui/PreferenceConstants.java index d3414ec..1dfe2cf 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/ui/PreferenceConstants.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/ui/PreferenceConstants.java @@ -17,6 +17,7 @@ import net.sourceforge.phpeclipse.IPreferenceConstants; import net.sourceforge.phpeclipse.PHPeclipsePlugin; import net.sourceforge.phpeclipse.phpeditor.util.PHPColorProvider; +import org.eclipse.core.runtime.Platform; import org.eclipse.jface.action.Action; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.PreferenceConverter; @@ -2954,7 +2955,10 @@ public class PreferenceConstants { store.setDefault(PreferenceConstants.EDITOR_CTRL_ALT_SHIFT_HOVER, PreferenceConstants.EDITOR_DEFAULT_HOVER_CONFIGURED_ID); - String ctrl = Action.findModifierString(SWT.CTRL); + int modifier = SWT.CTRL; + if (Platform.getOS().equals(Platform.OS_MACOSX)) + modifier = SWT.COMMAND; + String ctrl = Action.findModifierString(modifier); store .setDefault( PreferenceConstants.EDITOR_TEXT_HOVER_MODIFIERS, @@ -2962,7 +2966,7 @@ public class PreferenceConstants { store .setDefault( PreferenceConstants.EDITOR_TEXT_HOVER_MODIFIER_MASKS, - "net.sourceforge.phpdt.ui.BestMatchHover;0;net.sourceforge.phpdt.ui.JavaSourceHover;" + SWT.CTRL); //$NON-NLS-1$ + "net.sourceforge.phpdt.ui.BestMatchHover;0;net.sourceforge.phpdt.ui.JavaSourceHover;" + modifier); //$NON-NLS-1$ store.setDefault(PreferenceConstants.EDITOR_SHOW_TEXT_HOVER_AFFORDANCE, true); @@ -2973,7 +2977,7 @@ public class PreferenceConstants { store .setDefault( PreferenceConstants.EDITOR_BROWSER_LIKE_LINKS_KEY_MODIFIER_MASK, - SWT.CTRL); + modifier); // mark occurrences store.setDefault(PreferenceConstants.EDITOR_MARK_OCCURRENCES, true);