Search in sources :

Example 1 with ChunkSatelliteCacheEditorStyleEvent

use of org.rstudio.studio.client.workbench.views.source.editors.text.events.ChunkSatelliteCacheEditorStyleEvent in project rstudio by rstudio.

the class TextEditingTargetNotebook method onEditorThemeStyleChanged.

// Event handlers ----------------------------------------------------------
@Override
public void onEditorThemeStyleChanged(EditorThemeStyleChangedEvent event) {
    // update cached style 
    editorStyle_ = event.getStyle();
    ChunkOutputWidget.cacheEditorStyle(editorStyle_.getColor(), editorStyle_.getBackgroundColor(), DomUtils.extractCssValue("ace_editor", "color"));
    for (ChunkOutputUi output : outputs_.values()) {
        output.getOutputWidget().applyCachedEditorStyle();
    }
    events_.fireEvent(new ChunkSatelliteCacheEditorStyleEvent(docUpdateSentinel_.getId(), editorStyle_.getColor(), editorStyle_.getBackgroundColor(), DomUtils.extractCssValue("ace_editor", "color")));
    // update if currently executing
    if (queue_.isExecuting()) {
        NotebookQueueUnit unit = queue_.executingUnit();
        if (unit != null) {
            setChunkExecuting(unit.getChunkId(), unit.getExecMode(), unit.getExecScope());
        }
    }
}
Also used : NotebookQueueUnit(org.rstudio.studio.client.rmarkdown.model.NotebookQueueUnit) ChunkSatelliteCacheEditorStyleEvent(org.rstudio.studio.client.workbench.views.source.editors.text.events.ChunkSatelliteCacheEditorStyleEvent)

Example 2 with ChunkSatelliteCacheEditorStyleEvent

use of org.rstudio.studio.client.workbench.views.source.editors.text.events.ChunkSatelliteCacheEditorStyleEvent in project rstudio by rstudio.

the class TextEditingTargetNotebook method onChunkSatelliteWindowOpened.

@Override
public void onChunkSatelliteWindowOpened(ChunkSatelliteWindowOpenedEvent event) {
    String docId = event.getDocId();
    String chunkId = event.getChunkId();
    if (docId != docUpdateSentinel_.getId())
        return;
    events_.fireEvent(new ChunkSatelliteCacheEditorStyleEvent(docId, editorStyle_.getColor(), editorStyle_.getBackgroundColor(), DomUtils.extractCssValue("ace_editor", "color")));
    refreshSatelliteChunk(chunkId);
}
Also used : ChunkSatelliteCacheEditorStyleEvent(org.rstudio.studio.client.workbench.views.source.editors.text.events.ChunkSatelliteCacheEditorStyleEvent)

Aggregations

ChunkSatelliteCacheEditorStyleEvent (org.rstudio.studio.client.workbench.views.source.editors.text.events.ChunkSatelliteCacheEditorStyleEvent)2 NotebookQueueUnit (org.rstudio.studio.client.rmarkdown.model.NotebookQueueUnit)1