Search in sources :

Example 1 with Toolbar

use of org.rstudio.core.client.widget.Toolbar in project rstudio by rstudio.

the class PresentationPane method createMainToolbar.

@Override
protected Toolbar createMainToolbar() {
    boolean isTutorial = session_.getSessionInfo().getPresentationState().isTutorial();
    Toolbar toolbar = new Toolbar();
    slideNavigationMenu_ = new SlideNavigationToolbarMenu(toolbar);
    slideNavigationMenu_.setEditButtonVisible(!isTutorial);
    toolbar.addLeftSeparator();
    toolbar.addLeftWidget(commands_.presentationFullscreen().createToolbarButton());
    // More
    if (!isTutorial) {
        ToolbarPopupMenu moreMenu = new ToolbarPopupMenu();
        moreMenu.addItem(commands_.clearPresentationCache().createMenuItem(false));
        moreMenu.addSeparator();
        moreMenu.addItem(commands_.presentationViewInBrowser().createMenuItem(false));
        moreMenu.addItem(commands_.presentationSaveAsStandalone().createMenuItem(false));
        ToolbarButton moreButton = new ToolbarButton("More", new ImageResource2x(StandardIcons.INSTANCE.more_actions2x()), moreMenu);
        toolbar.addRightWidget(moreButton);
        // Create the publish button and wire it to our HTML generator
        publishButton_ = new RSConnectPublishButton(RSConnect.CONTENT_TYPE_PRES, false, null);
        publishButton_.setPublishHtmlSource(new PublishHtmlSource() {

            @Override
            public void generatePublishHtml(final CommandWithArg<String> onCompleted) {
                server_.createPresentationRPubsSource(new SimpleRequestCallback<PresentationRPubsSource>() {

                    @Override
                    public void onResponseReceived(PresentationRPubsSource source) {
                        onCompleted.execute(source.getSourceFilePath());
                    }

                    @Override
                    public void onError(ServerError error) {
                        display_.showErrorMessage("Error Saving Presentation", Presentation.getErrorMessage(error));
                    }
                });
            }

            @Override
            public String getTitle() {
                return "Presentation:\n" + getPresentationTitle();
            }
        });
        toolbar.addRightSeparator();
        toolbar.addRightWidget(publishButton_);
    } else {
        toolbar.addRightWidget(commands_.tutorialFeedback().createToolbarButton());
    }
    toolbar.addRightSeparator();
    toolbar.addRightWidget(refreshButton_ = commands_.refreshPresentation().createToolbarButton());
    progressButton_ = new ToolbarButton(CoreResources.INSTANCE.progress_gray(), new ClickHandler() {

        @Override
        public void onClick(ClickEvent e) {
        }
    });
    toolbar.addRightWidget(progressButton_);
    progressButton_.setVisible(false);
    return toolbar;
}
Also used : ServerError(org.rstudio.studio.client.server.ServerError) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) SimpleRequestCallback(org.rstudio.studio.client.common.SimpleRequestCallback) ToolbarButton(org.rstudio.core.client.widget.ToolbarButton) ToolbarPopupMenu(org.rstudio.core.client.widget.ToolbarPopupMenu) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) RSConnectPublishButton(org.rstudio.studio.client.rsconnect.ui.RSConnectPublishButton) PublishHtmlSource(org.rstudio.studio.client.rsconnect.model.PublishHtmlSource) ImageResource2x(org.rstudio.core.client.resources.ImageResource2x) SlideNavigationToolbarMenu(org.rstudio.studio.client.common.presentation.SlideNavigationToolbarMenu) PresentationRPubsSource(org.rstudio.studio.client.workbench.views.presentation.model.PresentationRPubsSource) Toolbar(org.rstudio.core.client.widget.Toolbar)

Example 2 with Toolbar

use of org.rstudio.core.client.widget.Toolbar in project rstudio by rstudio.

the class ProfilerEditingTargetWidget method createToolbar.

private Toolbar createToolbar(Commands commands, PublishHtmlSource publishHtmlSource) {
    Toolbar toolbar = new EditingTargetToolbar(commands, true);
    toolbar.addLeftWidget(commands.gotoProfileSource().createToolbarButton());
    toolbar.addLeftWidget(commands.saveProfileAs().createToolbarButton());
    toolbar.addRightWidget(publishButton_ = new RSConnectPublishButton(RSConnect.CONTENT_TYPE_DOCUMENT, true, null));
    publishButton_.setPublishHtmlSource(publishHtmlSource);
    publishButton_.setContentType(RSConnect.CONTENT_TYPE_HTML);
    return toolbar;
}
Also used : EditingTargetToolbar(org.rstudio.studio.client.workbench.views.source.editors.EditingTargetToolbar) RSConnectPublishButton(org.rstudio.studio.client.rsconnect.ui.RSConnectPublishButton) EditingTargetToolbar(org.rstudio.studio.client.workbench.views.source.editors.EditingTargetToolbar) Toolbar(org.rstudio.core.client.widget.Toolbar)

Example 3 with Toolbar

use of org.rstudio.core.client.widget.Toolbar in project rstudio by rstudio.

the class TerminalPane method createMainToolbar.

@Override
protected Toolbar createMainToolbar() {
    Toolbar toolbar = new Toolbar();
    activeTerminalToolbarButton_ = new TerminalPopupMenu(terminals_);
    toolbar.addLeftWidget(activeTerminalToolbarButton_.getToolbarButton());
    toolbar.addLeftSeparator();
    toolbar.addLeftWidget(commands_.previousTerminal().createToolbarButton());
    toolbar.addLeftWidget(commands_.nextTerminal().createToolbarButton());
    toolbar.addLeftSeparator();
    terminalTitle_ = new Label();
    terminalTitle_.setStyleName(ThemeStyles.INSTANCE.subtitle());
    toolbar.addLeftWidget(terminalTitle_);
    toolbar.addRightWidget(commands_.clearTerminalScrollbackBuffer().createToolbarButton());
    commands_.previousTerminal().setEnabled(false);
    commands_.nextTerminal().setEnabled(false);
    commands_.closeTerminal().setEnabled(false);
    commands_.renameTerminal().setEnabled(false);
    commands_.closeTerminal().setEnabled(false);
    commands_.clearTerminalScrollbackBuffer().setEnabled(false);
    return toolbar;
}
Also used : Label(com.google.gwt.user.client.ui.Label) Toolbar(org.rstudio.core.client.widget.Toolbar)

Example 4 with Toolbar

use of org.rstudio.core.client.widget.Toolbar in project rstudio by rstudio.

the class SVNPane method createMainToolbar.

@Override
protected Toolbar createMainToolbar() {
    Toolbar toolbar = new Toolbar();
    toolbar.addLeftWidget(commands_.vcsDiff().createToolbarButton());
    toolbar.addLeftSeparator();
    toolbar.addLeftWidget(commands_.vcsAddFiles().createToolbarButton());
    toolbar.addLeftWidget(commands_.vcsRemoveFiles().createToolbarButton());
    toolbar.addLeftSeparator();
    toolbar.addLeftWidget(commands_.vcsCommit().createToolbarButton());
    toolbar.addLeftSeparator();
    ToolbarPopupMenu moreMenu = new ToolbarPopupMenu();
    moreMenu.addItem(commands_.vcsRevert().createMenuItem(false));
    moreMenu.addItem(commands_.vcsIgnore().createMenuItem(false));
    moreMenu.addSeparator();
    moreMenu.addItem(commands_.vcsResolve().createMenuItem(false));
    moreMenu.addSeparator();
    moreMenu.addItem(commands_.vcsPull().createMenuItem(false));
    moreMenu.addItem(commands_.vcsCleanup().createMenuItem(false));
    moreMenu.addSeparator();
    moreMenu.addItem(commands_.vcsShowHistory().createMenuItem(false));
    moreMenu.addSeparator();
    moreMenu.addItem(commands_.showShellDialog().createMenuItem(false));
    toolbar.addLeftWidget(new ToolbarButton("More", new ImageResource2x(StandardIcons.INSTANCE.more_actions2x()), moreMenu));
    toolbar.addLeftSeparator();
    toolbar.addRightWidget(commands_.vcsRefresh().createToolbarButton());
    return toolbar;
}
Also used : ToolbarButton(org.rstudio.core.client.widget.ToolbarButton) ToolbarPopupMenu(org.rstudio.core.client.widget.ToolbarPopupMenu) ImageResource2x(org.rstudio.core.client.resources.ImageResource2x) Toolbar(org.rstudio.core.client.widget.Toolbar)

Example 5 with Toolbar

use of org.rstudio.core.client.widget.Toolbar in project rstudio by rstudio.

the class ConnectionsPane method createMainToolbar.

@Override
protected Toolbar createMainToolbar() {
    toolbar_ = new Toolbar();
    searchWidget_ = new SearchWidget(new SuggestOracle() {

        @Override
        public void requestSuggestions(Request request, Callback callback) {
            // no suggestions
            callback.onSuggestionsReady(request, new Response(new ArrayList<Suggestion>()));
        }
    });
    backToConnectionsButton_ = new ToolbarButton(commands_.helpBack().getImageResource(), (ClickHandler) null);
    backToConnectionsButton_.setTitle("View all connections");
    // connect meuu
    ToolbarPopupMenu connectMenu = new ToolbarPopupMenu();
    connectMenu.addItem(connectMenuItem(commands_.historySendToConsole().getImageResource(), "R Console", ConnectionOptions.CONNECT_R_CONSOLE));
    connectMenu.addSeparator();
    connectMenu.addItem(connectMenuItem(commands_.newSourceDoc().getImageResource(), "New R Script", ConnectionOptions.CONNECT_NEW_R_SCRIPT));
    connectMenu.addItem(connectMenuItem(commands_.newRNotebook().getImageResource(), "New R Notebook", ConnectionOptions.CONNECT_NEW_R_NOTEBOOK));
    if (BrowseCap.INSTANCE.canCopyToClipboard()) {
        connectMenu.addSeparator();
        connectMenu.addItem(connectMenuItem(commands_.copyPlotToClipboard().getImageResource(), "Copy to Clipboard", ConnectionOptions.CONNECT_COPY_TO_CLIPBOARD));
    }
    connectMenuButton_ = new ToolbarButton("Connect", commands_.newConnection().getImageResource(), connectMenu);
    // manage connect menu visibility
    connectMenuButton_.setVisible(!commands_.disconnectConnection().isVisible());
    commands_.disconnectConnection().addVisibleChangedHandler(new VisibleChangedHandler() {

        @Override
        public void onVisibleChanged(AppCommand command) {
            connectMenuButton_.setVisible(!commands_.disconnectConnection().isVisible());
        }
    });
    installConnectionsToolbar();
    return toolbar_;
}
Also used : SearchWidget(org.rstudio.core.client.widget.SearchWidget) ArrayList(java.util.ArrayList) VisibleChangedHandler(org.rstudio.core.client.command.VisibleChangedHandler) ToolbarButton(org.rstudio.core.client.widget.ToolbarButton) AppCommand(org.rstudio.core.client.command.AppCommand) AnimationCallback(com.google.gwt.layout.client.Layout.AnimationCallback) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ToolbarPopupMenu(org.rstudio.core.client.widget.ToolbarPopupMenu) SuggestOracle(com.google.gwt.user.client.ui.SuggestOracle) Toolbar(org.rstudio.core.client.widget.Toolbar) SecondaryToolbar(org.rstudio.core.client.widget.SecondaryToolbar)

Aggregations

Toolbar (org.rstudio.core.client.widget.Toolbar)15 ToolbarButton (org.rstudio.core.client.widget.ToolbarButton)10 ToolbarPopupMenu (org.rstudio.core.client.widget.ToolbarPopupMenu)10 ImageResource2x (org.rstudio.core.client.resources.ImageResource2x)6 SecondaryToolbar (org.rstudio.core.client.widget.SecondaryToolbar)5 RSConnectPublishButton (org.rstudio.studio.client.rsconnect.ui.RSConnectPublishButton)4 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)3 EditingTargetToolbar (org.rstudio.studio.client.workbench.views.source.editors.EditingTargetToolbar)3 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)2 Label (com.google.gwt.user.client.ui.Label)2 SuggestOracle (com.google.gwt.user.client.ui.SuggestOracle)2 ArrayList (java.util.ArrayList)2 SearchWidget (org.rstudio.core.client.widget.SearchWidget)2 PublishHtmlSource (org.rstudio.studio.client.rsconnect.model.PublishHtmlSource)2 ServerError (org.rstudio.studio.client.server.ServerError)2 JsArrayString (com.google.gwt.core.client.JsArrayString)1 KeyDownEvent (com.google.gwt.event.dom.client.KeyDownEvent)1 KeyDownHandler (com.google.gwt.event.dom.client.KeyDownHandler)1 AnimationCallback (com.google.gwt.layout.client.Layout.AnimationCallback)1 ImageResource (com.google.gwt.resources.client.ImageResource)1