/* * (non-Javadoc) * * @see org.eclipse.jface.bindings.keys.AbstractKeyFormatter#getKeyStrokeDelimiter() */ protected String getKeyStrokeDelimiter() { // We must do the look up every time, as our locale might change. if (Util.isWindows()) { return Util.translateString( RESOURCE_BUNDLE, WIN32_KEY_STROKE_DELIMITER_KEY, KeySequence.KEY_STROKE_DELIMITER); } return Util.translateString( RESOURCE_BUNDLE, KEY_STROKE_DELIMITER_KEY, KeySequence.KEY_STROKE_DELIMITER); }
/* * (non-Javadoc) * * @see org.eclipse.jface.bindings.keys.AbstractKeyFormatter#sortModifierKeys(int) */ protected int[] sortModifierKeys(final int modifierKeys) { final IKeyLookup lookup = KeyLookupFactory.getDefault(); final int[] sortedKeys = new int[4]; int index = 0; if (Util.isWindows()) { if ((modifierKeys & lookup.getCtrl()) != 0) { sortedKeys[index++] = lookup.getCtrl(); } if ((modifierKeys & lookup.getAlt()) != 0) { sortedKeys[index++] = lookup.getAlt(); } if ((modifierKeys & lookup.getShift()) != 0) { sortedKeys[index++] = lookup.getShift(); } } else if (Util.isGtk() || Util.isMotif()) { if ((modifierKeys & lookup.getShift()) != 0) { sortedKeys[index++] = lookup.getShift(); } if ((modifierKeys & lookup.getCtrl()) != 0) { sortedKeys[index++] = lookup.getCtrl(); } if ((modifierKeys & lookup.getAlt()) != 0) { sortedKeys[index++] = lookup.getAlt(); } } else if (Util.isMac()) { if ((modifierKeys & lookup.getShift()) != 0) { sortedKeys[index++] = lookup.getShift(); } if ((modifierKeys & lookup.getCtrl()) != 0) { sortedKeys[index++] = lookup.getCtrl(); } if ((modifierKeys & lookup.getAlt()) != 0) { sortedKeys[index++] = lookup.getAlt(); } if ((modifierKeys & lookup.getCommand()) != 0) { sortedKeys[index++] = lookup.getCommand(); } } return sortedKeys; }