Search in sources :

Example 46 with ImageResource2x

use of org.rstudio.core.client.resources.ImageResource2x in project rstudio by rstudio.

the class StatusBarElementWidget method setShowArrows.

public void setShowArrows(boolean showArrows) {
    if (showArrows ^ arrows_ != null) {
        if (showArrows) {
            Resources res = GWT.create(Resources.class);
            arrows_ = new Image(new ImageResource2x(res.upDownArrow2x()));
            add(arrows_);
        } else {
            arrows_.removeFromParent();
            arrows_ = null;
        }
    }
}
Also used : ImageResource2x(org.rstudio.core.client.resources.ImageResource2x) Image(com.google.gwt.user.client.ui.Image)

Example 47 with ImageResource2x

use of org.rstudio.core.client.resources.ImageResource2x in project rstudio by rstudio.

the class GitPane method createMainToolbar.

@Override
protected Toolbar createMainToolbar() {
    ToolbarPopupMenu moreMenu = new ToolbarPopupMenu();
    moreMenu.addItem(commands_.vcsRevert().createMenuItem(false));
    moreMenu.addItem(commands_.vcsIgnore().createMenuItem(false));
    moreMenu.addSeparator();
    moreMenu.addItem(commands_.showShellDialog().createMenuItem(false));
    Toolbar toolbar = new Toolbar();
    toolbar.addLeftWidget(commands_.vcsDiff().createToolbarButton());
    toolbar.addLeftSeparator();
    toolbar.addLeftWidget(commands_.vcsCommit().createToolbarButton());
    toolbar.addLeftSeparator();
    toolbar.addLeftWidget(pullButton_ = commands_.vcsPull().createToolbarButton());
    toolbar.addLeftSeparator();
    toolbar.addLeftWidget(pushButton_ = commands_.vcsPush().createToolbarButton());
    toolbar.addLeftSeparator();
    toolbar.addLeftWidget(historyButton_ = commands_.vcsShowHistory().createToolbarButton());
    toolbar.addLeftSeparator();
    toolbar.addLeftWidget(moreButton_ = new ToolbarButton("More", new ImageResource2x(StandardIcons.INSTANCE.more_actions2x()), moreMenu));
    toolbar.addRightWidget(createBranchToolbarButton_);
    toolbar.addRightSeparator();
    toolbar.addRightWidget(switchBranchToolbarButton_);
    toolbar.addRightSeparator();
    toolbar.addRightWidget(new ToolbarButton(commands_.vcsRefresh().getImageResource(), new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            table_.showProgress();
            commands_.vcsRefresh().execute();
        }
    }));
    return toolbar;
}
Also used : CheckoutBranchToolbarButton(org.rstudio.studio.client.workbench.views.vcs.CheckoutBranchToolbarButton) CreateBranchToolbarButton(org.rstudio.studio.client.workbench.views.vcs.CreateBranchToolbarButton) ToolbarButton(org.rstudio.core.client.widget.ToolbarButton) ToolbarPopupMenu(org.rstudio.core.client.widget.ToolbarPopupMenu) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) ImageResource2x(org.rstudio.core.client.resources.ImageResource2x) Toolbar(org.rstudio.core.client.widget.Toolbar)

Example 48 with ImageResource2x

use of org.rstudio.core.client.resources.ImageResource2x in project rstudio by rstudio.

the class GitReviewPanel method showContextMenu.

@Override
public void showContextMenu(final int clientX, final int clientY, Command openSelectedCommand) {
    final ToolbarPopupMenu menu = new ToolbarPopupMenu();
    MenuItem stageMenu = new MenuItem(AppCommand.formatMenuLabel(new ImageResource2x(RES.stage2x()), "Stage", ""), true, new Command() {

        @Override
        public void execute() {
            stageFilesButton_.click();
        }
    });
    if (stageFilesButton_.isEnabled()) {
        menu.addItem(stageMenu);
        menu.addSeparator();
    }
    MenuItem revertMenu = new MenuItem(AppCommand.formatMenuLabel(new ImageResource2x(RES.discard2x()), "Revert...", ""), true, new Command() {

        @Override
        public void execute() {
            revertFilesButton_.click();
        }
    });
    if (revertFilesButton_.isEnabled())
        menu.addItem(revertMenu);
    MenuItem ignoreMenu = new MenuItem(AppCommand.formatMenuLabel(new ImageResource2x(RES.ignore2x()), "Ignore...", ""), true, new Command() {

        @Override
        public void execute() {
            ignoreButton_.click();
        }
    });
    if (ignoreButton_.isEnabled())
        menu.addItem(ignoreMenu);
    menu.addSeparator();
    MenuItem openMenu = new MenuItem(AppCommand.formatMenuLabel(null, "Open File", ""), true, openSelectedCommand);
    menu.addItem(openMenu);
    menu.setPopupPositionAndShow(new PositionCallback() {

        @Override
        public void setPosition(int offsetWidth, int offsetHeight) {
            menu.setPopupPosition(clientX, clientY);
        }
    });
}
Also used : PositionCallback(com.google.gwt.user.client.ui.PopupPanel.PositionCallback) AppCommand(org.rstudio.core.client.command.AppCommand) Command(com.google.gwt.user.client.Command) ScheduledCommand(com.google.gwt.core.client.Scheduler.ScheduledCommand) ImageResource2x(org.rstudio.core.client.resources.ImageResource2x)

Aggregations

ImageResource2x (org.rstudio.core.client.resources.ImageResource2x)48 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)13 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)13 ToolbarButton (org.rstudio.core.client.widget.ToolbarButton)11 ToolbarPopupMenu (org.rstudio.core.client.widget.ToolbarPopupMenu)10 ImageResource (com.google.gwt.resources.client.ImageResource)9 Image (com.google.gwt.user.client.ui.Image)7 Toolbar (org.rstudio.core.client.widget.Toolbar)6 Style (com.google.gwt.dom.client.Style)4 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)4 JsArrayString (com.google.gwt.core.client.JsArrayString)3 Element (com.google.gwt.dom.client.Element)3 SafeHtmlBuilder (com.google.gwt.safehtml.shared.SafeHtmlBuilder)3 TextColumn (com.google.gwt.user.cellview.client.TextColumn)3 Event (com.google.gwt.user.client.Event)3 HTML (com.google.gwt.user.client.ui.HTML)3 Label (com.google.gwt.user.client.ui.Label)3 MessageDialogImages (org.rstudio.core.client.widget.images.MessageDialogImages)3 TableRowElement (com.google.gwt.dom.client.TableRowElement)2 Column (com.google.gwt.user.cellview.client.Column)2