use CommonShortcuts.ESCAPE

This commit is contained in:
Konstantin Bulenkov
2014-11-28 15:34:38 +01:00
parent 768e56dc3b
commit e65a4ceabb
4 changed files with 9 additions and 11 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@ import com.intellij.ide.FrameStateManager;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CustomShortcutSet;
import com.intellij.openapi.actionSystem.CommonShortcuts;
import com.intellij.openapi.keymap.KeymapUtil;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.Weighted;
@@ -289,7 +289,7 @@ public class TipManager implements Disposable, PopupMenuListener {
});
final HideTooltipAction hide = new HideTooltipAction();
hide.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0)), myComponent);
hide.registerCustomShortcutSet(CommonShortcuts.ESCAPE, myComponent);
Disposer.register(this, new Disposable() {
@Override
public void dispose() {
@@ -438,7 +438,7 @@ public class DialogWrapperPeerImpl extends DialogWrapperPeer implements FocusTra
final AnCancelAction anCancelAction = new AnCancelAction();
final JRootPane rootPane = getRootPane();
anCancelAction.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0)), rootPane);
anCancelAction.registerCustomShortcutSet(CommonShortcuts.ESCAPE, rootPane);
myDisposeActions.add(new Runnable() {
@Override
public void run() {
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@ import com.intellij.designer.propertyTable.PropertyEditor;
import com.intellij.designer.propertyTable.PropertyEditorListener;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CustomShortcutSet;
import com.intellij.openapi.actionSystem.CommonShortcuts;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.ModalityState;
import com.intellij.openapi.diagnostic.Logger;
@@ -40,7 +40,6 @@ import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import java.awt.*;
import java.awt.event.FocusEvent;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.List;
@@ -125,7 +124,7 @@ public class InplaceEditingLayer extends JComponent {
public void actionPerformed(AnActionEvent e) {
finishEditing(false);
}
}.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0)), myInplaceComponent);
}.registerCustomShortcutSet(CommonShortcuts.ESCAPE, myInplaceComponent);
myEditors = new ArrayList<PropertyEditor>();
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,7 +34,6 @@ import java.awt.dnd.DragSourceListener;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.KeyEvent;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -89,7 +88,7 @@ public class PalettePanel extends JPanel implements DataProvider, PaletteToolWin
public void actionPerformed(AnActionEvent e) {
clearActiveItem();
}
}.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0)), scrollPane);
}.registerCustomShortcutSet(CommonShortcuts.ESCAPE, scrollPane);
if (!ApplicationManager.getApplication().isHeadlessEnvironment()) {
DragSource.getDefaultDragSource().addDragSourceListener(myDragSourceListener);