本文整理汇总了Java中com.intellij.openapi.fileEditor.ex.FileEditorManagerEx.closeFile方法的典型用法代码示例。如果您正苦于以下问题:Java FileEditorManagerEx.closeFile方法的具体用法?Java FileEditorManagerEx.closeFile怎么用?Java FileEditorManagerEx.closeFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.fileEditor.ex.FileEditorManagerEx
的用法示例。
在下文中一共展示了FileEditorManagerEx.closeFile方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionPerformed
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx; //导入方法依赖的package包/类
@Override
public void actionPerformed(final AnActionEvent e) {
final FileEditorManagerEx mgr = FileEditorManagerEx.getInstanceEx(myProject);
EditorWindow window;
final VirtualFile file = (VirtualFile)myTabInfo.getObject();
if (ActionPlaces.EDITOR_TAB.equals(e.getPlace())) {
window = myWindow;
}
else {
window = mgr.getCurrentWindow();
}
if (window != null) {
if ((e.getModifiers() & InputEvent.ALT_MASK) != 0) {
window.closeAllExcept(file);
}
else {
if (window.findFileComposite(file) != null) {
mgr.closeFile(file, window);
}
}
}
}
示例2: actionPerformed
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent e) {
Project project = e.getData(CommonDataKeys.PROJECT);
FileEditorManagerEx fileEditorManager=FileEditorManagerEx.getInstanceEx(project);
VirtualFile selectedFile;
final EditorWindow window = e.getData(EditorWindow.DATA_KEY);
if (window != null){
window.closeAllExcept(e.getData(CommonDataKeys.VIRTUAL_FILE));
return;
}
selectedFile = fileEditorManager.getSelectedFiles()[0];
final VirtualFile[] siblings = fileEditorManager.getSiblings(selectedFile);
for (final VirtualFile sibling : siblings) {
if (!Comparing.equal(selectedFile, sibling)) {
fileEditorManager.closeFile(sibling);
}
}
}
示例3: actionPerformed
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx; //导入方法依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
final Project project = e.getData(CommonDataKeys.PROJECT);
FileEditorManagerEx editorManager = getEditorManager(project);
EditorWindow window = e.getData(EditorWindow.DATA_KEY);
VirtualFile file = null;
if (window == null) {
window = editorManager.getActiveWindow().getResult();
if (window != null) {
file = window.getSelectedFile();
}
}
else {
file = e.getData(CommonDataKeys.VIRTUAL_FILE);
}
if (file != null) {
editorManager.closeFile(file, window);
}
}
示例4: actionPerformed
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx; //导入方法依赖的package包/类
public void actionPerformed(final AnActionEvent e) {
final FileEditorManagerEx mgr = FileEditorManagerEx.getInstanceEx(myProject);
EditorWindow window;
final VirtualFile file = (VirtualFile)myTabInfo.getObject();
if (ActionPlaces.EDITOR_TAB.equals(e.getPlace())) {
window = myWindow;
}
else {
window = mgr.getCurrentWindow();
}
if (window != null) {
if ((e.getModifiers() & InputEvent.ALT_MASK) != 0) {
window.closeAllExcept(file);
}
else {
if (window.findFileComposite(file) != null) {
mgr.closeFile(file, window);
}
}
}
}
示例5: actionPerformed
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent e) {
Project project = e.getData(PlatformDataKeys.PROJECT);
FileEditorManagerEx fileEditorManager=FileEditorManagerEx.getInstanceEx(project);
VirtualFile selectedFile;
final EditorWindow window = e.getData(EditorWindow.DATA_KEY);
if (window != null){
window.closeAllExcept(e.getData(PlatformDataKeys.VIRTUAL_FILE));
return;
}
selectedFile = fileEditorManager.getSelectedFiles()[0];
final VirtualFile[] siblings = fileEditorManager.getSiblings(selectedFile);
for (final VirtualFile sibling : siblings) {
if (!Comparing.equal(selectedFile, sibling)) {
fileEditorManager.closeFile(sibling);
}
}
}
示例6: actionPerformed
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx; //导入方法依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
final Project project = e.getData(PlatformDataKeys.PROJECT);
FileEditorManagerEx editorManager = getEditorManager(project);
EditorWindow window = e.getData(EditorWindow.DATA_KEY);
VirtualFile file = null;
if (window == null) {
window = editorManager.getActiveWindow().getResult();
if (window != null) {
file = window.getSelectedFile();
}
}
else {
file = e.getData(PlatformDataKeys.VIRTUAL_FILE);
}
if (file != null) {
editorManager.closeFile(file, window);
}
}
示例7: setConsoleEditorEnabled
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx; //导入方法依赖的package包/类
public void setConsoleEditorEnabled(boolean consoleEditorEnabled) {
if (isConsoleEditorEnabled() == consoleEditorEnabled) return;
final FileEditorManagerEx fileManager = FileEditorManagerEx.getInstanceEx(getProject());
if (consoleEditorEnabled) {
fileManager.closeFile(myVirtualFile);
myPanel.removeAll();
myPanel.add(myHistoryViewer.getComponent());
myPanel.add(myConsoleEditor.getComponent());
myHistoryViewer.setHorizontalScrollbarVisible(false);
myCurrentEditor = myConsoleEditor;
}
else {
myPanel.removeAll();
myPanel.add(myHistoryViewer.getComponent(), BorderLayout.CENTER);
myHistoryViewer.setHorizontalScrollbarVisible(true);
}
}
示例8: actionPerformed
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx; //导入方法依赖的package包/类
@RequiredDispatchThread
@Override
public void actionPerformed(final AnActionEvent e) {
final FileEditorManagerEx mgr = FileEditorManagerEx.getInstanceEx(myProject);
consulo.fileEditor.impl.EditorWindow window;
final VirtualFile file = (VirtualFile)myTabInfo.getObject();
if (ActionPlaces.EDITOR_TAB.equals(e.getPlace())) {
window = myWindow;
}
else {
window = mgr.getCurrentWindow();
}
if (window != null) {
if (BitUtil.isSet(e.getModifiers(), InputEvent.ALT_MASK)) {
window.closeAllExcept(file);
}
else {
if (window.findFileComposite(file) != null) {
mgr.closeFile(file, window);
}
}
}
}
示例9: actionPerformed
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx; //导入方法依赖的package包/类
@RequiredDispatchThread
@Override
public void actionPerformed(@Nonnull AnActionEvent e) {
Project project = e.getData(CommonDataKeys.PROJECT);
FileEditorManagerEx fileEditorManager = FileEditorManagerEx.getInstanceEx(project);
VirtualFile selectedFile;
final EditorWindow window = e.getData(EditorWindow.DATA_KEY);
if (window != null) {
window.closeAllExcept(e.getData(PlatformDataKeys.VIRTUAL_FILE));
return;
}
selectedFile = fileEditorManager.getSelectedFiles()[0];
final VirtualFile[] siblings = fileEditorManager.getSiblings(selectedFile);
for (final VirtualFile sibling : siblings) {
if (!Comparing.equal(selectedFile, sibling)) {
fileEditorManager.closeFile(sibling);
}
}
}
示例10: actionPerformed
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx; //导入方法依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
final Project project = e.getData(CommonDataKeys.PROJECT);
FileEditorManagerEx editorManager = getEditorManager(project);
EditorWindow window = e.getData(EditorWindow.DATA_KEY);
VirtualFile file = null;
if (window == null) {
window = editorManager.getActiveWindow().getResult();
if (window != null) {
file = window.getSelectedFile();
}
}
else {
file = e.getData(PlatformDataKeys.VIRTUAL_FILE);
}
if (file != null) {
editorManager.closeFile(file, window);
}
}