"open in opposite group" action (IDEA-84182)

This commit is contained in:
Dmitry Jemerov
2013-10-18 12:05:31 +02:00
parent 44b7c27280
commit 0ddc96a438
4 changed files with 36 additions and 2 deletions
@@ -42,11 +42,15 @@ public class MoveEditorToOppositeTabGroupAction extends AnAction implements Dumb
final EditorWithProviderComposite editorComposite = window.getSelectedEditor();
final HistoryEntry entry = editorComposite.currentStateAsHistoryEntry();
((FileEditorManagerImpl)FileEditorManagerEx.getInstanceEx(project)).openFileImpl3(siblings[0], vFile, true, entry, true);
window.closeFile(vFile);
closeOldFile(vFile, window);
}
}
}
protected void closeOldFile(VirtualFile vFile, EditorWindow window) {
window.closeFile(vFile);
}
@Override
public void update(AnActionEvent e) {
final Presentation presentation = e.getPresentation();
@@ -0,0 +1,27 @@
/*
* Copyright 2000-2013 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.openapi.fileEditor.impl;
import com.intellij.openapi.vfs.VirtualFile;
/**
* @author yole
*/
public class OpenEditorInOppositeTabGroupAction extends MoveEditorToOppositeTabGroupAction {
@Override
protected void closeOldFile(VirtualFile vFile, EditorWindow window) {
}
}
@@ -963,7 +963,9 @@ action.ChangeInspectionProfile.description=Change current editor inspection prof
action.ChangeCustomizationSchema.text=Switch Customization Scheme
action.ChangeCustomizationSchema.description=Change Current Customization Scheme
action.MoveEditorToOppositeTabGroup.text=_Move To Opposite Group
action.MoveEditorToOppositeTabGroup.description=Move Editor To Opposite Tab Group
action.MoveEditorToOppositeTabGroup.description=Move editor to opposite tab group
action.OpenEditorInOppositeTabGroup.text=_Open In Opposite Group
action.OpenEditorInOppositeTabGroup.description=Open a copy of this editor in the opposite tab group
action.ModuleSettings.text=Module _Settings
action.ModuleSettings.description=Open settings dialog for selected module
group.MoveModuleToGroup.text=Move Module to Group
@@ -472,6 +472,7 @@
<reference ref="SplitVertically"/>
<reference ref="SplitHorizontally"/>
<action id="MoveEditorToOppositeTabGroup" class="com.intellij.openapi.fileEditor.impl.MoveEditorToOppositeTabGroupAction"/>
<action id="OpenEditorInOppositeTabGroup" class="com.intellij.openapi.fileEditor.impl.OpenEditorInOppositeTabGroupAction"/>
<reference ref="ChangeSplitOrientation"/>
<reference ref="PinActiveTab"/>
<reference ref="TabsPlacementGroup"/>