Search in sources :

Example 1 with LeftRightToggleButton

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

Aggregations

ClickEvent (com.google.gwt.event.dom.client.ClickEvent)1 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)1 ImageResource (com.google.gwt.resources.client.ImageResource)1 LeftRightToggleButton (org.rstudio.core.client.widget.LeftRightToggleButton)1 ToolbarButton (org.rstudio.core.client.widget.ToolbarButton)1 Commands (org.rstudio.studio.client.workbench.commands.Commands)1