use of org.rstudio.studio.client.workbench.views.source.editors.text.ChunkOutputWidget in project rstudio by rstudio.
the class TextEditingTargetNotebook method onLineWidgetRemoved.
@Override
public void onLineWidgetRemoved(LineWidget widget) {
for (ChunkOutputUi output : outputs_.values()) {
// to keep the output pinned to the end of the chunk
if (output.moving())
continue;
if (output.getLineWidget() == widget && !output.moving()) {
// save scope and widget
int terminalLine = widget.getRow() - 1;
Scope scope = docDisplay_.getCurrentChunk(Position.create(terminalLine, 1));
ChunkOutputWidget outputWidget = output.getOutputWidget();
// clean up old widget
output.remove();
outputs_.remove(output.getChunkId());
// is identical)
if (scope != null && scope.getEnd().getRow() == terminalLine) {
ChunkDefinition def = (ChunkDefinition) widget.getData();
def.setRow(terminalLine);
widget.setRow(terminalLine);
ChunkOutputUi newOutput = new ChunkOutputUi(docUpdateSentinel_.getId(), docDisplay_, def, this, outputWidget);
outputs_.put(output.getChunkId(), newOutput);
return;
}
break;
}
}
}
Aggregations