Search in sources :

Example 26 with IpnbFilePanel

use of org.jetbrains.plugins.ipnb.editor.panels.IpnbFilePanel in project intellij-community by JetBrains.

the class IpnbCodePanel method finishExecution.

public void finishExecution() {
    final Application application = ApplicationManager.getApplication();
    application.invokeAndWait(() -> {
        final String promptText = IpnbEditorUtil.prompt(myCell.getPromptNumber(), IpnbEditorUtil.PromptType.In);
        myPromptLabel.setText(promptText);
        final IpnbFilePanel filePanel = myParent.getIpnbFilePanel();
        setEditing(false);
        filePanel.revalidateAndRepaint();
        if (mySelectNext) {
            filePanel.selectNext(this, true);
        }
    }, ModalityState.stateForComponent(this));
}
Also used : IpnbFilePanel(org.jetbrains.plugins.ipnb.editor.panels.IpnbFilePanel) Application(com.intellij.openapi.application.Application)

Example 27 with IpnbFilePanel

use of org.jetbrains.plugins.ipnb.editor.panels.IpnbFilePanel in project intellij-community by JetBrains.

the class IpnbCodePanel method updateCellView.

@Override
public void updateCellView() {
    myViewPanel.removeAll();
    final JComponent panel = createViewPanel();
    myViewPanel.add(panel);
    final IpnbFilePanel filePanel = myParent.getIpnbFilePanel();
    filePanel.revalidate();
    filePanel.repaint();
}
Also used : IpnbFilePanel(org.jetbrains.plugins.ipnb.editor.panels.IpnbFilePanel)

Example 28 with IpnbFilePanel

use of org.jetbrains.plugins.ipnb.editor.panels.IpnbFilePanel in project intellij-community by JetBrains.

the class IpnbRunCellAction method actionPerformed.

@Override
public void actionPerformed(@NotNull AnActionEvent event) {
    final DataContext context = event.getDataContext();
    final IpnbFileEditor ipnbEditor = IpnbFileEditor.DATA_KEY.getData(context);
    if (ipnbEditor != null) {
        final IpnbFilePanel component = ipnbEditor.getIpnbFilePanel();
        runCell(component, true);
    }
}
Also used : DataContext(com.intellij.openapi.actionSystem.DataContext) IpnbFilePanel(org.jetbrains.plugins.ipnb.editor.panels.IpnbFilePanel) IpnbFileEditor(org.jetbrains.plugins.ipnb.editor.IpnbFileEditor)

Example 29 with IpnbFilePanel

use of org.jetbrains.plugins.ipnb.editor.panels.IpnbFilePanel in project intellij-community by JetBrains.

the class IpnbSaveAction method saveAndCheckpoint.

public static void saveAndCheckpoint(@NotNull final IpnbFileEditor editor) {
    final IpnbFilePanel filePanel = editor.getIpnbFilePanel();
    IpnbParser.saveIpnbFile(filePanel);
    final VirtualFile file = editor.getVirtualFile();
    file.refresh(false, false);
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) IpnbFilePanel(org.jetbrains.plugins.ipnb.editor.panels.IpnbFilePanel)

Aggregations

IpnbFilePanel (org.jetbrains.plugins.ipnb.editor.panels.IpnbFilePanel)29 IpnbFileEditor (org.jetbrains.plugins.ipnb.editor.IpnbFileEditor)19 DataContext (com.intellij.openapi.actionSystem.DataContext)16 IpnbEditablePanel (org.jetbrains.plugins.ipnb.editor.panels.IpnbEditablePanel)9 FileEditor (com.intellij.openapi.fileEditor.FileEditor)8 Editor (com.intellij.openapi.editor.Editor)5 IpnbCodePanel (org.jetbrains.plugins.ipnb.editor.panels.code.IpnbCodePanel)5 IpnbCell (org.jetbrains.plugins.ipnb.format.cells.IpnbCell)3 IpnbEditableCell (org.jetbrains.plugins.ipnb.format.cells.IpnbEditableCell)3 Application (com.intellij.openapi.application.Application)2 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 PsiFile (com.intellij.psi.PsiFile)2 NotNull (org.jetbrains.annotations.NotNull)2 IpnbCodeSourcePanel (org.jetbrains.plugins.ipnb.editor.panels.code.IpnbCodeSourcePanel)2 Disposable (com.intellij.openapi.Disposable)1 CustomShortcutSet (com.intellij.openapi.actionSystem.CustomShortcutSet)1 EditorMouseAdapter (com.intellij.openapi.editor.event.EditorMouseAdapter)1 EditorMouseEvent (com.intellij.openapi.editor.event.EditorMouseEvent)1 Project (com.intellij.openapi.project.Project)1 ResolveResult (com.intellij.psi.ResolveResult)1