use of org.jetbrains.plugins.ipnb.editor.IpnbFileEditor in project intellij-community by JetBrains.
the class IpnbSplitCellAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
final DataContext context = e.getDataContext();
final IpnbFileEditor ipnbEditor = IpnbFileEditor.DATA_KEY.getData(context);
if (ipnbEditor != null) {
final IpnbFilePanel ipnbFilePanel = ipnbEditor.getIpnbFilePanel();
splitCell(ipnbFilePanel);
}
}
use of org.jetbrains.plugins.ipnb.editor.IpnbFileEditor in project intellij-community by JetBrains.
the class IpnbConnectionManager method executeCell.
public void executeCell(@NotNull final IpnbCodePanel codePanel) {
final IpnbFileEditor fileEditor = codePanel.getFileEditor();
final VirtualFile virtualFile = fileEditor.getVirtualFile();
final String path = virtualFile.getPath();
if (!hasConnection(path)) {
startConnection(codePanel, fileEditor, path);
} else {
IpnbConnection connection = myKernels.get(path);
if (!connection.isAlive()) {
myKernels.remove(path);
startConnection(codePanel, fileEditor, path);
} else {
final String messageId = connection.execute(codePanel.getCell().getSourceAsString());
myUpdateMap.put(messageId, codePanel);
}
}
}
use of org.jetbrains.plugins.ipnb.editor.IpnbFileEditor 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);
}
}
use of org.jetbrains.plugins.ipnb.editor.IpnbFileEditor 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);
}
}
use of org.jetbrains.plugins.ipnb.editor.IpnbFileEditor in project intellij-community by JetBrains.
the class IpnbMergeCellAboveAction method update.
@Override
public void update(AnActionEvent e) {
final DataContext context = e.getDataContext();
final IpnbFileEditor ipnbEditor = IpnbFileEditor.DATA_KEY.getData(context);
if (ipnbEditor != null) {
final IpnbFilePanel ipnbFilePanel = ipnbEditor.getIpnbFilePanel();
final IpnbEditablePanel cell = ipnbFilePanel.getSelectedCellPanel();
final boolean isEnabled = cell != null && ipnbFilePanel.hasPrevCell(cell);
e.getPresentation().setEnabled(isEnabled);
}
}
Aggregations