Search in sources :

Example 6 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 7 with Toolbar

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

the class HTMLPreviewPanel method createToolbar.

private Toolbar createToolbar(Commands commands) {
    Toolbar toolbar = new Toolbar();
    toolbar.addLeftWidget(new ToolbarLabel("Preview: "));
    fileLabel_ = new ToolbarLabel();
    fileLabel_.addStyleName(ThemeStyles.INSTANCE.subtitle());
    fileLabel_.getElement().getStyle().setMarginRight(7, Unit.PX);
    toolbar.addLeftWidget(fileLabel_);
    toolbar.addLeftSeparator();
    toolbar.addLeftWidget(commands.openHtmlExternal().createToolbarButton());
    showLogButtonSeparator_ = toolbar.addLeftSeparator();
    showLogButton_ = commands.showHtmlPreviewLog().createToolbarButton();
    toolbar.addLeftWidget(showLogButton_);
    saveHtmlPreviewAsSeparator_ = toolbar.addLeftSeparator();
    if (Desktop.isDesktop()) {
        saveHtmlPreviewAs_ = commands.saveHtmlPreviewAs().createToolbarButton();
        toolbar.addLeftWidget(saveHtmlPreviewAs_);
    } else {
        ToolbarPopupMenu menu = new ToolbarPopupMenu();
        menu.addItem(commands.saveHtmlPreviewAs().createMenuItem(false));
        menu.addItem(commands.saveHtmlPreviewAsLocalFile().createMenuItem(false));
        saveHtmlPreviewAs_ = toolbar.addLeftWidget(new ToolbarButton("Save As", commands.saveSourceDoc().getImageResource(), menu));
    }
    publishButtonSeparator_ = toolbar.addLeftSeparator();
    toolbar.addLeftWidget(publishButton_ = new RSConnectPublishButton(RSConnect.CONTENT_TYPE_DOCUMENT, true, null));
    findTextBox_ = new FindTextBox("Find");
    findTextBox_.setIconVisible(true);
    findTextBox_.setOverrideWidth(120);
    findTextBox_.getElement().getStyle().setMarginRight(6, Unit.PX);
    toolbar.addRightWidget(findTextBox_);
    findTextBox_.addKeyDownHandler(new KeyDownHandler() {

        @Override
        public void onKeyDown(KeyDownEvent event) {
            // enter key triggers a find
            if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
                event.preventDefault();
                event.stopPropagation();
                findInTopic(findTextBox_.getValue().trim(), findTextBox_);
                findTextBox_.focus();
            } else if (event.getNativeKeyCode() == KeyCodes.KEY_ESCAPE) {
                findTextBox_.setValue("");
            }
        }

        private void findInTopic(String term, CanFocus findInputSource) {
            // get content window
            WindowEx contentWindow = previewFrame_.getWindow();
            if (contentWindow == null)
                return;
            if (!contentWindow.find(term, false, false, true, false)) {
                RStudioGinjector.INSTANCE.getGlobalDisplay().showMessage(MessageDialog.INFO, "Find in Page", "No occurences found", findInputSource);
            }
        }
    });
    refreshButtonSeparator_ = toolbar.addRightSeparator();
    refreshButton_ = toolbar.addRightWidget(commands.refreshHtmlPreview().createToolbarButton());
    return toolbar;
}
Also used : ToolbarButton(org.rstudio.core.client.widget.ToolbarButton) ToolbarPopupMenu(org.rstudio.core.client.widget.ToolbarPopupMenu) KeyDownEvent(com.google.gwt.event.dom.client.KeyDownEvent) ToolbarLabel(org.rstudio.core.client.widget.ToolbarLabel) RSConnectPublishButton(org.rstudio.studio.client.rsconnect.ui.RSConnectPublishButton) KeyDownHandler(com.google.gwt.event.dom.client.KeyDownHandler) CanFocus(org.rstudio.core.client.widget.CanFocus) WindowEx(org.rstudio.core.client.dom.WindowEx) FindTextBox(org.rstudio.core.client.widget.FindTextBox) Toolbar(org.rstudio.core.client.widget.Toolbar)

Example 8 with Toolbar

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

the class ConsolePane method createMainToolbar.

@Override
protected Toolbar createMainToolbar() {
    Toolbar toolbar = new Toolbar();
    workingDir_ = new Label();
    workingDir_.setStyleName(ThemeStyles.INSTANCE.subtitle());
    toolbar.addLeftWidget(workingDir_);
    toolbar.addLeftWidget(commands_.goToWorkingDir().createToolbarButton());
    consoleInterruptButton_ = commands_.interruptR().createToolbarButton();
    consoleClearButton_ = commands_.consoleClear().createToolbarButton();
    consoleClearButton_.setVisible(false);
    profilerInterruptButton_ = ConsoleInterruptProfilerButton.CreateProfilerButton();
    profilerInterruptButton_.setVisible(false);
    toolbar.addRightWidget(profilerInterruptButton_);
    toolbar.addRightWidget(consoleInterruptButton_);
    toolbar.addRightWidget(consoleClearButton_);
    return toolbar;
}
Also used : Label(com.google.gwt.user.client.ui.Label) SecondaryToolbar(org.rstudio.core.client.widget.SecondaryToolbar) Toolbar(org.rstudio.core.client.widget.Toolbar)

Example 9 with Toolbar

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

the class EnvironmentPane method createMainToolbar.

// WorkbenchPane overrides -------------------------------------------------
@Override
protected Toolbar createMainToolbar() {
    Toolbar toolbar = new Toolbar();
    toolbar.addLeftWidget(commands_.loadWorkspace().createToolbarButton());
    toolbar.addLeftWidget(commands_.saveWorkspace().createToolbarButton());
    toolbar.addLeftSeparator();
    toolbar.addLeftWidget(createImportMenu());
    toolbar.addLeftSeparator();
    toolbar.addLeftWidget(commands_.clearWorkspace().createToolbarButton());
    ToolbarPopupMenu menu = new ToolbarPopupMenu();
    menu.addItem(createViewMenuItem(EnvironmentObjects.OBJECT_LIST_VIEW));
    menu.addItem(createViewMenuItem(EnvironmentObjects.OBJECT_GRID_VIEW));
    viewButton_ = new ToolbarButton(nameOfViewType(EnvironmentObjects.OBJECT_LIST_VIEW), imageOfViewType(EnvironmentObjects.OBJECT_LIST_VIEW), menu);
    toolbar.addRightWidget(viewButton_);
    toolbar.addRightSeparator();
    toolbar.addRightWidget(commands_.refreshEnvironment().createToolbarButton());
    return toolbar;
}
Also used : ToolbarButton(org.rstudio.core.client.widget.ToolbarButton) ToolbarPopupMenu(org.rstudio.core.client.widget.ToolbarPopupMenu) SecondaryToolbar(org.rstudio.core.client.widget.SecondaryToolbar) Toolbar(org.rstudio.core.client.widget.Toolbar)

Example 10 with Toolbar

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

the class HelpPane method createMainToolbar.

@Override
protected Toolbar createMainToolbar() {
    Toolbar toolbar = new Toolbar();
    toolbar.addLeftWidget(commands_.helpBack().createToolbarButton());
    toolbar.addLeftWidget(commands_.helpForward().createToolbarButton());
    toolbar.addLeftWidget(commands_.helpHome().createToolbarButton());
    toolbar.addLeftSeparator();
    toolbar.addLeftWidget(commands_.printHelp().createToolbarButton());
    toolbar.addLeftSeparator();
    toolbar.addLeftWidget(commands_.helpPopout().createToolbarButton());
    toolbar.addRightWidget(searchProvider_.get().getSearchWidget());
    toolbar.addRightSeparator();
    toolbar.addRightWidget(commands_.refreshHelp().createToolbarButton());
    return toolbar;
}
Also used : 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