Search in sources :

Example 11 with ToolbarButton

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

the class ShinyApplicationPanel method initToolbar.

@Override
protected void initToolbar(Toolbar toolbar, Commands commands) {
    urlBox_ = new Label("");
    Style style = urlBox_.getElement().getStyle();
    style.setColor("#606060");
    urlBox_.addStyleName(ThemeStyles.INSTANCE.selectableText());
    urlBox_.getElement().getStyle().setMarginRight(7, Unit.PX);
    toolbar.addLeftWidget(urlBox_);
    toolbar.addLeftSeparator();
    ToolbarButton popoutButton = commands.viewerPopout().createToolbarButton();
    popoutButton.setText("Open in Browser");
    toolbar.addLeftWidget(popoutButton);
    toolbar.addLeftSeparator();
    ToolbarButton refreshButton = commands.reloadShinyApp().createToolbarButton();
    refreshButton.setLeftImage(commands.viewerRefresh().getImageResource());
    refreshButton.getElement().getStyle().setMarginTop(1, Unit.PX);
    toolbar.addLeftWidget(refreshButton);
    publishButton_ = new RSConnectPublishButton(RSConnect.CONTENT_TYPE_NONE, true, null);
    toolbar.addRightWidget(publishButton_);
}
Also used : ToolbarButton(org.rstudio.core.client.widget.ToolbarButton) RSConnectPublishButton(org.rstudio.studio.client.rsconnect.ui.RSConnectPublishButton) Label(com.google.gwt.user.client.ui.Label) Style(com.google.gwt.dom.client.Style)

Example 12 with ToolbarButton

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

the class TextEditingTargetFindReplace method createFindReplaceButton.

public Widget createFindReplaceButton() {
    if (findReplaceBar_ == null) {
        findReplaceButton_ = new ToolbarButton(FindReplaceBar.getFindIcon(), new ClickHandler() {

            public void onClick(ClickEvent event) {
                if (findReplaceBar_ == null)
                    showFindReplace(true);
                else
                    hideFindReplace();
            }
        });
        String title = showReplace_ ? "Find/Replace" : "Find";
        findReplaceButton_.setTitle(title);
    }
    return findReplaceButton_;
}
Also used : ToolbarButton(org.rstudio.core.client.widget.ToolbarButton) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent)

Example 13 with ToolbarButton

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

the class TerminalPopupMenu method getToolbarButton.

public ToolbarButton getToolbarButton() {
    if (toolbarButton_ == null) {
        String buttonText = "Terminal";
        toolbarButton_ = new ToolbarButton(buttonText, StandardIcons.INSTANCE.empty_command(), this, false);
        setNoActiveTerminal();
    }
    return toolbarButton_;
}
Also used : ToolbarButton(org.rstudio.core.client.widget.ToolbarButton)

Example 14 with ToolbarButton

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

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

the class GlobalToolbar method completeInitialization.

public void completeInitialization(SessionInfo sessionInfo) {
    StandardIcons icons = StandardIcons.INSTANCE;
    if (sessionInfo.isVcsEnabled()) {
        addLeftSeparator();
        ToolbarPopupMenu vcsMenu = new ToolbarPopupMenu();
        vcsMenu.addItem(commands_.vcsFileDiff().createMenuItem(false));
        vcsMenu.addItem(commands_.vcsFileLog().createMenuItem(false));
        vcsMenu.addItem(commands_.vcsFileRevert().createMenuItem(false));
        vcsMenu.addSeparator();
        vcsMenu.addItem(commands_.vcsViewOnGitHub().createMenuItem(false));
        vcsMenu.addItem(commands_.vcsBlameOnGitHub().createMenuItem(false));
        vcsMenu.addSeparator();
        vcsMenu.addItem(commands_.vcsCommit().createMenuItem(false));
        vcsMenu.addSeparator();
        vcsMenu.addItem(commands_.vcsPull().createMenuItem(false));
        vcsMenu.addItem(commands_.vcsCleanup().createMenuItem(false));
        vcsMenu.addItem(commands_.vcsPush().createMenuItem(false));
        vcsMenu.addSeparator();
        vcsMenu.addItem(commands_.vcsShowHistory().createMenuItem(false));
        vcsMenu.addSeparator();
        vcsMenu.addItem(commands_.versionControlProjectSetup().createMenuItem(false));
        ImageResource vcsIcon = null;
        if (sessionInfo.getVcsName().equals(VCSConstants.GIT_ID))
            vcsIcon = new ImageResource2x(icons.git2x());
        else if (sessionInfo.getVcsName().equals(VCSConstants.SVN_ID))
            vcsIcon = new ImageResource2x(icons.svn2x());
        ToolbarButton vcsButton = new ToolbarButton(null, vcsIcon, vcsMenu);
        vcsButton.setTitle("Version control");
        addLeftWidget(vcsButton);
    }
    // zoom button
    addLeftSeparator();
    ToolbarPopupMenu paneLayoutMenu = new ToolbarPopupMenu();
    paneLayoutMenu.addItem(commands_.layoutEndZoom().createMenuItem(false));
    paneLayoutMenu.addSeparator();
    paneLayoutMenu.addItem(commands_.layoutConsoleOnLeft().createMenuItem(false));
    paneLayoutMenu.addItem(commands_.layoutConsoleOnRight().createMenuItem(false));
    paneLayoutMenu.addSeparator();
    paneLayoutMenu.addItem(commands_.paneLayout().createMenuItem(false));
    paneLayoutMenu.addSeparator();
    paneLayoutMenu.addItem(commands_.layoutZoomSource().createMenuItem(false));
    paneLayoutMenu.addItem(commands_.layoutZoomConsole().createMenuItem(false));
    paneLayoutMenu.addItem(commands_.layoutZoomHelp().createMenuItem(false));
    paneLayoutMenu.addSeparator();
    paneLayoutMenu.addItem(commands_.layoutZoomHistory().createMenuItem(false));
    paneLayoutMenu.addItem(commands_.layoutZoomFiles().createMenuItem(false));
    paneLayoutMenu.addItem(commands_.layoutZoomPlots().createMenuItem(false));
    paneLayoutMenu.addItem(commands_.layoutZoomPackages().createMenuItem(false));
    paneLayoutMenu.addItem(commands_.layoutZoomEnvironment().createMenuItem(false));
    paneLayoutMenu.addItem(commands_.layoutZoomViewer().createMenuItem(false));
    paneLayoutMenu.addItem(commands_.layoutZoomVcs().createMenuItem(false));
    paneLayoutMenu.addItem(commands_.layoutZoomBuild().createMenuItem(false));
    paneLayoutMenu.addItem(commands_.layoutZoomConnections().createMenuItem(false));
    ImageResource paneLayoutIcon = new ImageResource2x(ThemeResources.INSTANCE.paneLayoutIcon2x());
    ToolbarButton paneLayoutButton = new ToolbarButton(null, paneLayoutIcon, paneLayoutMenu);
    paneLayoutButton.setTitle("Workspace Panes");
    addLeftWidget(paneLayoutButton);
    // addins menu
    ToolbarPopupMenu addinsMenu = new ToolbarPopupMenu();
    addinsMenu.addItem(commands_.addinsMru0().createMenuItem(false));
    addinsMenu.addItem(commands_.addinsMru1().createMenuItem(false));
    addinsMenu.addItem(commands_.addinsMru2().createMenuItem(false));
    addinsMenu.addItem(commands_.addinsMru3().createMenuItem(false));
    addinsMenu.addItem(commands_.addinsMru4().createMenuItem(false));
    addinsMenu.addItem(commands_.addinsMru5().createMenuItem(false));
    addinsMenu.addItem(commands_.addinsMru6().createMenuItem(false));
    addinsMenu.addItem(commands_.addinsMru7().createMenuItem(false));
    addinsMenu.addItem(commands_.addinsMru8().createMenuItem(false));
    addinsMenu.addItem(commands_.addinsMru9().createMenuItem(false));
    addinsMenu.addItem(commands_.addinsMru10().createMenuItem(false));
    addinsMenu.addItem(commands_.addinsMru11().createMenuItem(false));
    addinsMenu.addItem(commands_.addinsMru12().createMenuItem(false));
    addinsMenu.addItem(commands_.addinsMru13().createMenuItem(false));
    addinsMenu.addItem(commands_.addinsMru14().createMenuItem(false));
    addinsMenu.addSeparator();
    addinsMenu.addItem(commands_.browseAddins().createMenuItem(false));
    addLeftSeparator();
    ToolbarButton addinsButton = new ToolbarButton("Addins", CoreResources.INSTANCE.iconEmpty(), addinsMenu);
    addLeftWidget(addinsButton);
    // project popup menu
    ProjectPopupMenu projectMenu = new ProjectPopupMenu(sessionInfo, commands_);
    addRightWidget(projectMenu.getToolbarButton());
}
Also used : StandardIcons(org.rstudio.studio.client.common.icons.StandardIcons) ToolbarButton(org.rstudio.core.client.widget.ToolbarButton) ToolbarPopupMenu(org.rstudio.core.client.widget.ToolbarPopupMenu) ImageResource(com.google.gwt.resources.client.ImageResource) ImageResource2x(org.rstudio.core.client.resources.ImageResource2x)

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