Search in sources :

Example 36 with VoidServerRequestCallback

use of org.rstudio.studio.client.server.VoidServerRequestCallback in project rstudio by rstudio.

the class FindOutputPresenter method stop.

private void stop() {
    if (currentFindHandle_ != null) {
        server_.stopFind(currentFindHandle_, new VoidServerRequestCallback());
        currentFindHandle_ = null;
    }
    view_.setStopSearchButtonVisible(false);
}
Also used : VoidServerRequestCallback(org.rstudio.studio.client.server.VoidServerRequestCallback)

Example 37 with VoidServerRequestCallback

use of org.rstudio.studio.client.server.VoidServerRequestCallback in project rstudio by rstudio.

the class Source method getEditorContext.

private void getEditorContext(String id, String path, DocDisplay docDisplay) {
    AceEditor editor = (AceEditor) docDisplay;
    Selection selection = editor.getNativeSelection();
    Range[] ranges = selection.getAllRanges();
    JsArray<DocumentSelection> docSelections = JavaScriptObject.createArray().cast();
    for (int i = 0; i < ranges.length; i++) {
        docSelections.push(DocumentSelection.create(ranges[i], editor.getTextForRange(ranges[i])));
    }
    id = StringUtil.notNull(id);
    path = StringUtil.notNull(path);
    GetEditorContextEvent.SelectionData data = GetEditorContextEvent.SelectionData.create(id, path, editor.getCode(), docSelections);
    server_.getEditorContextCompleted(data, new VoidServerRequestCallback());
}
Also used : GetEditorContextEvent(org.rstudio.studio.client.events.GetEditorContextEvent) DocumentSelection(org.rstudio.studio.client.events.GetEditorContextEvent.DocumentSelection) Selection(org.rstudio.studio.client.workbench.views.source.editors.text.ace.Selection) VoidServerRequestCallback(org.rstudio.studio.client.server.VoidServerRequestCallback) AceEditor(org.rstudio.studio.client.workbench.views.source.editors.text.AceEditor) Range(org.rstudio.studio.client.workbench.views.source.editors.text.ace.Range) DocumentSelection(org.rstudio.studio.client.events.GetEditorContextEvent.DocumentSelection)

Example 38 with VoidServerRequestCallback

use of org.rstudio.studio.client.server.VoidServerRequestCallback in project rstudio by rstudio.

the class Plots method onRemovePlot.

void onRemovePlot() {
    // delete plot gesture indicates we are done with locator
    safeClearLocator();
    // confirm
    globalDisplay_.showYesNoMessage(GlobalDisplay.MSG_QUESTION, "Remove Plot", "Are you sure you want to remove the current plot?", new ProgressOperation() {

        public void execute(final ProgressIndicator indicator) {
            indicator.onProgress("Removing plot...");
            server_.removePlot(new VoidServerRequestCallback(indicator));
        }
    }, true);
    view_.bringToFront();
}
Also used : ProgressOperation(org.rstudio.core.client.widget.ProgressOperation) ProgressIndicator(org.rstudio.core.client.widget.ProgressIndicator) VoidServerRequestCallback(org.rstudio.studio.client.server.VoidServerRequestCallback)

Example 39 with VoidServerRequestCallback

use of org.rstudio.studio.client.server.VoidServerRequestCallback in project rstudio by rstudio.

the class NotebookQueueState method dequeueChunk.

public void dequeueChunk(int preambleRow) {
    // find the chunk's ID
    String chunkId = notebook_.getRowChunkId(preambleRow);
    if (StringUtil.isNullOrEmpty(chunkId))
        return;
    notebook_.cleanChunkExecState(chunkId);
    // clear from the execution queue and update display
    for (int i = 0; i < queue_.getUnits().length(); i++) {
        if (queue_.getUnits().get(i).getChunkId() == chunkId) {
            NotebookQueueUnit unit = queue_.getUnits().get(i);
            queue_.removeUnit(unit);
            server_.updateNotebookExecQueue(unit, NotebookDocQueue.QUEUE_OP_DELETE, "", new VoidServerRequestCallback());
            break;
        }
    }
}
Also used : NotebookQueueUnit(org.rstudio.studio.client.rmarkdown.model.NotebookQueueUnit) VoidServerRequestCallback(org.rstudio.studio.client.server.VoidServerRequestCallback)

Example 40 with VoidServerRequestCallback

use of org.rstudio.studio.client.server.VoidServerRequestCallback in project rstudio by rstudio.

the class NotebookQueueState method queueChunkRange.

private void queueChunkRange(ChunkExecUnit chunk) {
    NotebookQueueUnit unit = unitFromScope(chunk);
    renderLineState(chunk.getScope().getBodyStart().getRow(), unit.getPendingLines(), ChunkRowExecState.LINE_QUEUED);
    notebook_.setChunkState(chunk.getScope(), ChunkContextToolbar.STATE_QUEUED);
    queue_.addUnit(unit);
    server_.updateNotebookExecQueue(unit, NotebookDocQueue.QUEUE_OP_ADD, "", new VoidServerRequestCallback());
}
Also used : NotebookQueueUnit(org.rstudio.studio.client.rmarkdown.model.NotebookQueueUnit) VoidServerRequestCallback(org.rstudio.studio.client.server.VoidServerRequestCallback)

Aggregations

VoidServerRequestCallback (org.rstudio.studio.client.server.VoidServerRequestCallback)44 ProgressIndicator (org.rstudio.core.client.widget.ProgressIndicator)14 Handler (org.rstudio.core.client.command.Handler)8 FileSystemItem (org.rstudio.core.client.files.FileSystemItem)7 ServerError (org.rstudio.studio.client.server.ServerError)7 Command (com.google.gwt.user.client.Command)6 Operation (org.rstudio.core.client.widget.Operation)4 ProgressOperation (org.rstudio.core.client.widget.ProgressOperation)4 Void (org.rstudio.studio.client.server.Void)4 JsArrayString (com.google.gwt.core.client.JsArrayString)3 ScheduledCommand (com.google.gwt.core.client.Scheduler.ScheduledCommand)3 ValueChangeHandler (com.google.gwt.event.logical.shared.ValueChangeHandler)3 ArrayList (java.util.ArrayList)3 AppCommand (org.rstudio.core.client.command.AppCommand)3 ProgressOperationWithInput (org.rstudio.core.client.widget.ProgressOperationWithInput)3 EditingTarget (org.rstudio.studio.client.workbench.views.source.editors.EditingTarget)3 CodeBrowserEditingTarget (org.rstudio.studio.client.workbench.views.source.editors.codebrowser.CodeBrowserEditingTarget)3 DataEditingTarget (org.rstudio.studio.client.workbench.views.source.editors.data.DataEditingTarget)3 TextEditingTarget (org.rstudio.studio.client.workbench.views.source.editors.text.TextEditingTarget)3 RepeatingCommand (com.google.gwt.core.client.Scheduler.RepeatingCommand)2