Example usage for com.intellij.openapi.actionSystem CommonShortcuts getCloseActiveWindow

List of usage examples for com.intellij.openapi.actionSystem CommonShortcuts getCloseActiveWindow

Introduction

In this page you can find the example usage for com.intellij.openapi.actionSystem CommonShortcuts getCloseActiveWindow.

Prototype

public static ShortcutSet getCloseActiveWindow() 

Source Link

Usage

From source file:com.intellij.diff.impl.DiffWindowBase.java

License:Apache License

protected void init() {
    if (myWrapper != null)
        return;/*from  w w w . ja  v a  2  s .  c  om*/

    myProcessor = createProcessor();

    String dialogGroupKey = myProcessor.getContextUserData(DiffUserDataKeys.DIALOG_GROUP_KEY);
    if (dialogGroupKey == null)
        dialogGroupKey = "DiffContextDialog";

    myWrapper = new WindowWrapperBuilder(DiffUtil.getWindowMode(myHints),
            new MyPanel(myProcessor.getComponent())).setProject(myProject).setParent(myHints.getParent())
                    .setDimensionServiceKey(dialogGroupKey).setOnShowCallback(new Runnable() {
                        @Override
                        public void run() {
                            myProcessor.updateRequest();
                            myProcessor.requestFocus(); // TODO: not needed for modal dialogs. Make a flag in WindowWrapperBuilder ?
                        }
                    }).build();
    myWrapper.setImage(ImageLoader.loadFromResource("/diff/Diff.png"));
    Disposer.register(myWrapper, myProcessor);

    new DumbAwareAction() {
        public void actionPerformed(final AnActionEvent e) {
            myWrapper.close();
        }
    }.registerCustomShortcutSet(CommonShortcuts.getCloseActiveWindow(), myProcessor.getComponent());
}

From source file:com.vladsch.MissingInActions.util.CommonUIShortcuts.java

License:Apache License

public static ShortcutSet getCloseActiveWindow() {
    return CommonShortcuts.getCloseActiveWindow();
}