use of org.jetbrains.plugins.ipnb.editor.panels.IpnbEditablePanel in project intellij-community by JetBrains.
the class IpnbUnresolvedReferenceSkipper method unusedImportShouldBeSkipped.
@Override
public boolean unusedImportShouldBeSkipped(@NotNull final PyImportedNameDefiner importNameDefiner) {
final PsiFile file = importNameDefiner.getContainingFile();
if (file instanceof IpnbPyFragment) {
final IpnbFilePanel panel = ((IpnbPyFragment) file).getFilePanel();
final List<IpnbEditablePanel> panels = panel.getIpnbPanels();
for (IpnbEditablePanel editablePanel : panels) {
if (!(editablePanel instanceof IpnbCodePanel))
continue;
final Editor editor = ((IpnbCodePanel) editablePanel).getEditor();
final IpnbPyFragment psiFile = (IpnbPyFragment) PsiDocumentManager.getInstance(importNameDefiner.getProject()).getPsiFile(editor.getDocument());
if (psiFile == null)
continue;
final MyVisitor visitor = new MyVisitor(importNameDefiner);
psiFile.accept(visitor);
if (visitor.used)
return true;
}
}
return false;
}
use of org.jetbrains.plugins.ipnb.editor.panels.IpnbEditablePanel in project intellij-community by JetBrains.
the class IpnbRunAllCellsAction method runCells.
private static void runCells(List<IpnbEditablePanel> cells, IpnbFilePanel ipnbFilePanel) {
for (IpnbEditablePanel cell : cells) {
cell.runCell(true);
ipnbFilePanel.revalidate();
ipnbFilePanel.repaint();
IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> {
IdeFocusManager.getGlobalInstance().requestFocus(ipnbFilePanel, true);
});
}
}
Aggregations