Search in sources :

Example 1 with FileEditor

use of com.intellij.openapi.fileEditor.FileEditor in project intellij-community by JetBrains.

the class IpnbAddCellAboveAction method actionPerformed.

@Override
public void actionPerformed(@NotNull AnActionEvent event) {
    final DataContext context = event.getDataContext();
    final FileEditor editor = PlatformDataKeys.FILE_EDITOR.getData(context);
    if (editor instanceof IpnbFileEditor) {
        final IpnbFilePanel component = ((IpnbFileEditor) editor).getIpnbFilePanel();
        addCell(component);
    }
}
Also used : DataContext(com.intellij.openapi.actionSystem.DataContext) FileEditor(com.intellij.openapi.fileEditor.FileEditor) IpnbFileEditor(org.jetbrains.plugins.ipnb.editor.IpnbFileEditor) IpnbFilePanel(org.jetbrains.plugins.ipnb.editor.panels.IpnbFilePanel) IpnbFileEditor(org.jetbrains.plugins.ipnb.editor.IpnbFileEditor)

Example 2 with FileEditor

use of com.intellij.openapi.fileEditor.FileEditor in project intellij-community by JetBrains.

the class IpnbHeadingCellActionBase method actionPerformed.

@Override
public void actionPerformed(@NotNull AnActionEvent event) {
    final DataContext context = event.getDataContext();
    final FileEditor editor = PlatformDataKeys.FILE_EDITOR.getData(context);
    if (editor instanceof IpnbFileEditor) {
        changeTypeToHeading((IpnbFileEditor) editor);
    }
}
Also used : DataContext(com.intellij.openapi.actionSystem.DataContext) FileEditor(com.intellij.openapi.fileEditor.FileEditor) IpnbFileEditor(org.jetbrains.plugins.ipnb.editor.IpnbFileEditor) IpnbFileEditor(org.jetbrains.plugins.ipnb.editor.IpnbFileEditor)

Example 3 with FileEditor

use of com.intellij.openapi.fileEditor.FileEditor in project intellij-community by JetBrains.

the class IpnbMoveCellDownAction method actionPerformed.

@Override
public void actionPerformed(@NotNull AnActionEvent event) {
    final DataContext context = event.getDataContext();
    final FileEditor editor = PlatformDataKeys.FILE_EDITOR.getData(context);
    if (editor instanceof IpnbFileEditor) {
        final IpnbFilePanel ipnbFilePanel = ((IpnbFileEditor) editor).getIpnbFilePanel();
        CommandProcessor.getInstance().executeCommand(ipnbFilePanel.getProject(), () -> ApplicationManager.getApplication().runWriteAction(() -> ipnbFilePanel.moveCell(true)), "Ipnb.moveCell", new Object());
    }
}
Also used : DataContext(com.intellij.openapi.actionSystem.DataContext) FileEditor(com.intellij.openapi.fileEditor.FileEditor) IpnbFileEditor(org.jetbrains.plugins.ipnb.editor.IpnbFileEditor) IpnbFilePanel(org.jetbrains.plugins.ipnb.editor.panels.IpnbFilePanel) IpnbFileEditor(org.jetbrains.plugins.ipnb.editor.IpnbFileEditor)

Example 4 with FileEditor

use of com.intellij.openapi.fileEditor.FileEditor in project intellij-community by JetBrains.

the class IpnbMoveCellUpAction method actionPerformed.

@Override
public void actionPerformed(@NotNull AnActionEvent event) {
    final DataContext context = event.getDataContext();
    final FileEditor editor = PlatformDataKeys.FILE_EDITOR.getData(context);
    if (editor instanceof IpnbFileEditor) {
        final IpnbFilePanel ipnbFilePanel = ((IpnbFileEditor) editor).getIpnbFilePanel();
        CommandProcessor.getInstance().executeCommand(ipnbFilePanel.getProject(), new Runnable() {

            public void run() {
                ApplicationManager.getApplication().runWriteAction(new Runnable() {

                    public void run() {
                        ipnbFilePanel.moveCell(false);
                    }
                });
            }
        }, "Ipnb.moveCell", new Object());
    }
}
Also used : DataContext(com.intellij.openapi.actionSystem.DataContext) FileEditor(com.intellij.openapi.fileEditor.FileEditor) IpnbFileEditor(org.jetbrains.plugins.ipnb.editor.IpnbFileEditor) IpnbFilePanel(org.jetbrains.plugins.ipnb.editor.panels.IpnbFilePanel) IpnbFileEditor(org.jetbrains.plugins.ipnb.editor.IpnbFileEditor)

Example 5 with FileEditor

use of com.intellij.openapi.fileEditor.FileEditor in project intellij-community by JetBrains.

the class IpnbPasteCellAction method actionPerformed.

@Override
public void actionPerformed(@NotNull AnActionEvent event) {
    final DataContext context = event.getDataContext();
    final FileEditor editor = PlatformDataKeys.FILE_EDITOR.getData(context);
    if (editor instanceof IpnbFileEditor) {
        final IpnbFilePanel component = ((IpnbFileEditor) editor).getIpnbFilePanel();
        pasteCell(component);
    }
}
Also used : DataContext(com.intellij.openapi.actionSystem.DataContext) FileEditor(com.intellij.openapi.fileEditor.FileEditor) IpnbFileEditor(org.jetbrains.plugins.ipnb.editor.IpnbFileEditor) IpnbFilePanel(org.jetbrains.plugins.ipnb.editor.panels.IpnbFilePanel) IpnbFileEditor(org.jetbrains.plugins.ipnb.editor.IpnbFileEditor)

Aggregations

FileEditor (com.intellij.openapi.fileEditor.FileEditor)157 VirtualFile (com.intellij.openapi.vfs.VirtualFile)62 TextEditor (com.intellij.openapi.fileEditor.TextEditor)59 Editor (com.intellij.openapi.editor.Editor)43 Project (com.intellij.openapi.project.Project)40 FileEditorManager (com.intellij.openapi.fileEditor.FileEditorManager)37 Nullable (org.jetbrains.annotations.Nullable)21 DataContext (com.intellij.openapi.actionSystem.DataContext)20 PsiFile (com.intellij.psi.PsiFile)19 Document (com.intellij.openapi.editor.Document)15 NotNull (org.jetbrains.annotations.NotNull)14 IpnbFileEditor (org.jetbrains.plugins.ipnb.editor.IpnbFileEditor)14 LightVirtualFile (com.intellij.testFramework.LightVirtualFile)10 OpenFileDescriptor (com.intellij.openapi.fileEditor.OpenFileDescriptor)9 IpnbFilePanel (org.jetbrains.plugins.ipnb.editor.panels.IpnbFilePanel)8 StructureViewBuilder (com.intellij.ide.structureView.StructureViewBuilder)7 StructureViewComponent (com.intellij.ide.structureView.newStructureView.StructureViewComponent)6 BlobExplorerFileEditor (com.microsoft.intellij.helpers.storage.BlobExplorerFileEditor)6 QueueFileEditor (com.microsoft.intellij.helpers.storage.QueueFileEditor)6 TableFileEditor (com.microsoft.intellij.helpers.storage.TableFileEditor)6