Search in sources :

Example 1 with SlideNavigationChangedEvent

use of org.rstudio.studio.client.common.presentation.events.SlideNavigationChangedEvent in project rstudio by rstudio.

the class Presentation method initPresentationNavigator.

private void initPresentationNavigator(JavaScriptObject jsNavigator) {
    // record current slides
    SlideNavigation navigation = jsNavigator.cast();
    handlerManager_.fireEvent(new SlideNavigationChangedEvent(navigation));
}
Also used : SlideNavigationChangedEvent(org.rstudio.studio.client.common.presentation.events.SlideNavigationChangedEvent) SlideNavigation(org.rstudio.studio.client.common.presentation.model.SlideNavigation)

Example 2 with SlideNavigationChangedEvent

use of org.rstudio.studio.client.common.presentation.events.SlideNavigationChangedEvent in project rstudio by rstudio.

the class RmdOutputPanel method showOutput.

@Override
public void showOutput(RmdPreviewParams params, boolean enablePublish, boolean refresh) {
    // remember output parameters
    outputParms_ = params;
    // remember target file (for invoking editor)
    targetFile_ = FileSystemItem.createFile(params.getTargetFile());
    // slide navigation (may be null)
    slideNavigation_ = params.getResult().getSlideNavigation();
    handlerManager_.fireEvent(new SlideNavigationChangedEvent(slideNavigation_));
    slideChangeMonitor_.cancel();
    // file label
    if (params.isShinyDocument()) {
        fileLabel_.setVisible(false);
        fileLabelSeparator_.setVisible(false);
        shinyUrl_ = StringUtil.makeAbsoluteUrl(params.getOutputUrl());
        isShiny_ = true;
    } else {
        fileLabel_.setVisible(true);
        fileLabelSeparator_.setVisible(true);
        fileLabel_.setText(FileSystemItem.createFile(params.getOutputFile()).getName());
        isShiny_ = false;
    }
    publishButton_.setRmdPreview(params);
    // find text box
    boolean showFind = params.getResult().isHtml() && !params.getResult().isHtmlPresentation();
    findTextBox_.setVisible(showFind);
    findSeparator_.setVisible(showFind);
    // when refreshing, reapply the current scroll position and anchor
    scrollPosition_ = refresh ? getScrollPosition() : params.getScrollPosition();
    // get the URL to load
    String url = getDocumentUrl();
    // restore anchor if necessary
    if (params.getResult().getRestoreAnchor()) {
        String anchor = "";
        if (params.getResult().getPreviewSlide() > 0)
            anchor = String.valueOf(params.getResult().getPreviewSlide());
        // by the preview_slide
        if (anchor.length() == 0)
            anchor = params.getAnchor();
        // add the anchor if necessary
        if (anchor.length() > 0)
            url += "#" + anchor;
    }
    showUrl(url);
}
Also used : SlideNavigationChangedEvent(org.rstudio.studio.client.common.presentation.events.SlideNavigationChangedEvent)

Aggregations

SlideNavigationChangedEvent (org.rstudio.studio.client.common.presentation.events.SlideNavigationChangedEvent)2 SlideNavigation (org.rstudio.studio.client.common.presentation.model.SlideNavigation)1