mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
USE_REFLECTION_TO_ACCESS_JDK7
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.openapi;
|
||||
|
||||
import com.intellij.Patches;
|
||||
import com.intellij.ide.ui.UISettings;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
@@ -202,6 +203,8 @@ abstract class MnemonicWrapper<T extends Component> implements Runnable, Propert
|
||||
// TODO: HACK because of Java7 required:
|
||||
// replace later with KeyEvent.getExtendedKeyCodeForChar(ch)
|
||||
private static int getExtendedKeyCodeForChar(int ch) {
|
||||
//noinspection ConstantConditions
|
||||
assert Patches.USE_REFLECTION_TO_ACCESS_JDK7;
|
||||
try {
|
||||
Method method = KeyEvent.class.getMethod("getExtendedKeyCodeForChar", int.class);
|
||||
if (!method.isAccessible()) {
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.ui;
|
||||
|
||||
import com.intellij.Patches;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
|
||||
@@ -137,6 +138,8 @@ public class KeyStrokeAdapter implements KeyListener {
|
||||
// TODO: HACK because of Java7 required:
|
||||
// replace later with event.getExtendedKeyCode()
|
||||
private static int getExtendedKeyCode(KeyEvent event) {
|
||||
//noinspection ConstantConditions
|
||||
assert Patches.USE_REFLECTION_TO_ACCESS_JDK7;
|
||||
try {
|
||||
Method method = KeyEvent.class.getMethod("getExtendedKeyCode");
|
||||
if (!method.isAccessible()) {
|
||||
|
||||
Reference in New Issue
Block a user