Search in sources :

Example 6 with ToolbarButton

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

the class PaneManager method createConsole.

private LogicalWindow createConsole() {
    PrimaryWindowFrame frame = new PrimaryWindowFrame("Console", null);
    ToolbarButton goToWorkingDirButton = commands_.goToWorkingDir().createToolbarButton();
    goToWorkingDirButton.addStyleName(ThemeResources.INSTANCE.themeStyles().windowFrameToolbarButton());
    LogicalWindow logicalWindow = new LogicalWindow(frame, new MinimizedWindowFrame("Console"));
    consoleTabPanel_ = new ConsoleTabPanel(frame, logicalWindow, consolePane_, compilePdfTab_, findOutputTab_, sourceCppTab_, renderRmdTab_, deployContentTab_, markersTab_, terminalTab_, eventBus_, goToWorkingDirButton);
    return logicalWindow;
}
Also used : ToolbarButton(org.rstudio.core.client.widget.ToolbarButton) MinimizedWindowFrame(org.rstudio.core.client.theme.MinimizedWindowFrame) LogicalWindow(org.rstudio.core.client.layout.LogicalWindow) PrimaryWindowFrame(org.rstudio.core.client.theme.PrimaryWindowFrame)

Example 7 with ToolbarButton

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

the class WebApplicationHeader method initCommandsPanel.

private void initCommandsPanel(final SessionInfo sessionInfo) {
    // add username 
    if (sessionInfo.getShowIdentity()) {
        ToolbarLabel usernameLabel = new ToolbarLabel();
        usernameLabel.getElement().getStyle().setMarginRight(2, Unit.PX);
        if (!BrowseCap.isFirefox())
            usernameLabel.getElement().getStyle().setMarginTop(2, Unit.PX);
        String userIdentity = sessionInfo.getUserIdentity();
        usernameLabel.setTitle(userIdentity);
        userIdentity = userIdentity.split("@")[0];
        usernameLabel.setText(userIdentity);
        headerBarCommandsPanel_.add(usernameLabel);
        ToolbarButton signOutButton = new ToolbarButton(new ImageResource2x(RESOURCES.signOut2x()), new ClickHandler() {

            public void onClick(ClickEvent event) {
                eventBus_.fireEvent(new LogoutRequestedEvent());
            }
        });
        signOutButton.setTitle("Sign out");
        headerBarCommandsPanel_.add(signOutButton);
        headerBarCommandsPanel_.add(signOutSeparator_ = createCommandSeparator());
    }
    overlay_.addCommands(this);
    headerBarCommandsPanel_.add(commands_.quitSession().createToolbarButton());
}
Also used : ToolbarButton(org.rstudio.core.client.widget.ToolbarButton) LogoutRequestedEvent(org.rstudio.studio.client.application.events.LogoutRequestedEvent) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ToolbarLabel(org.rstudio.core.client.widget.ToolbarLabel) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) ImageResource2x(org.rstudio.core.client.resources.ImageResource2x)

Example 8 with ToolbarButton

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

the class CompilePanel method connectToolbar.

public void connectToolbar(Toolbar toolbar) {
    Commands commands = RStudioGinjector.INSTANCE.getCommands();
    ImageResource stopImage = commands.interruptR().getImageResource();
    stopButton_ = new ToolbarButton(stopImage, null);
    stopButton_.setVisible(false);
    toolbar.addRightWidget(stopButton_);
    showOutputButton_ = new LeftRightToggleButton("Output", "Issues", false);
    showOutputButton_.setVisible(false);
    showOutputButton_.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            showOutputButton_.setVisible(false);
            showErrorsButton_.setVisible(true);
            panel_.setWidget(outputDisplay_.asWidget());
            outputDisplay_.scrollToBottom();
        }
    });
    toolbar.addRightWidget(showOutputButton_);
    showErrorsButton_ = new LeftRightToggleButton("Output", "Issues", true);
    showErrorsButton_.setVisible(false);
    showErrorsButton_.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            showOutputButton_.setVisible(true);
            showErrorsButton_.setVisible(false);
            panel_.setWidget(errorList_);
        }
    });
    toolbar.addRightWidget(showErrorsButton_);
}
Also used : ToolbarButton(org.rstudio.core.client.widget.ToolbarButton) ImageResource(com.google.gwt.resources.client.ImageResource) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) Commands(org.rstudio.studio.client.workbench.commands.Commands) LeftRightToggleButton(org.rstudio.core.client.widget.LeftRightToggleButton)

Example 9 with ToolbarButton

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

the class PlotsToolbar method installStandardUI.

private void installStandardUI() {
    // plot history navigation
    addLeftWidget(commands_.previousPlot().createToolbarButton());
    addLeftWidget(commands_.nextPlot().createToolbarButton());
    addLeftSeparator();
    // popout current plot
    addLeftWidget(commands_.zoomPlot().createToolbarButton());
    addLeftSeparator();
    // export commands
    ToolbarPopupMenu exportMenu = new ToolbarPopupMenu();
    exportMenu.addItem(commands_.savePlotAsImage().createMenuItem(false));
    exportMenu.addItem(commands_.savePlotAsPdf().createMenuItem(false));
    exportMenu.addSeparator();
    exportMenu.addItem(commands_.copyPlotToClipboard().createMenuItem(false));
    ToolbarButton exportButton = new ToolbarButton("Export", new ImageResource2x(StandardIcons.INSTANCE.export_menu2x()), exportMenu);
    addLeftWidget(exportButton);
    addLeftSeparator();
    addLeftWidget(commands_.removePlot().createToolbarButton());
    addLeftSeparator();
    // clear all plots
    addLeftWidget(commands_.clearPlots().createToolbarButton());
    // publish
    addRightWidget(publishButton_);
    // refresh
    addRightSeparator();
    addRightWidget(commands_.refreshPlot().createToolbarButton());
}
Also used : ToolbarButton(org.rstudio.core.client.widget.ToolbarButton) ToolbarPopupMenu(org.rstudio.core.client.widget.ToolbarPopupMenu) ImageResource2x(org.rstudio.core.client.resources.ImageResource2x)

Example 10 with ToolbarButton

use of org.rstudio.core.client.widget.ToolbarButton 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)

Aggregations

ToolbarButton (org.rstudio.core.client.widget.ToolbarButton)24 ToolbarPopupMenu (org.rstudio.core.client.widget.ToolbarPopupMenu)13 ImageResource2x (org.rstudio.core.client.resources.ImageResource2x)11 Toolbar (org.rstudio.core.client.widget.Toolbar)10 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)8 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)7 RSConnectPublishButton (org.rstudio.studio.client.rsconnect.ui.RSConnectPublishButton)5 SecondaryToolbar (org.rstudio.core.client.widget.SecondaryToolbar)4 ImageResource (com.google.gwt.resources.client.ImageResource)3 SuggestOracle (com.google.gwt.user.client.ui.SuggestOracle)3 SearchWidget (org.rstudio.core.client.widget.SearchWidget)3 ToolbarLabel (org.rstudio.core.client.widget.ToolbarLabel)3 JsArrayString (com.google.gwt.core.client.JsArrayString)2 KeyDownEvent (com.google.gwt.event.dom.client.KeyDownEvent)2 KeyDownHandler (com.google.gwt.event.dom.client.KeyDownHandler)2 ArrayList (java.util.ArrayList)2 WindowEx (org.rstudio.core.client.dom.WindowEx)2 CanFocus (org.rstudio.core.client.widget.CanFocus)2 FindTextBox (org.rstudio.core.client.widget.FindTextBox)2 SlideNavigationToolbarMenu (org.rstudio.studio.client.common.presentation.SlideNavigationToolbarMenu)2