Search in sources :

Example 26 with ImageResource2x

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

the class MiniDialogPopupPanel method commonInit.

private void commonInit() {
    addStyleName(ThemeStyles.INSTANCE.miniDialogPopupPanel());
    verticalPanel_ = new VerticalPanel();
    verticalPanel_.setStyleName(ThemeStyles.INSTANCE.miniDialogContainer());
    // title bar
    HorizontalPanel titleBar = new HorizontalPanel();
    titleBar.setWidth("100%");
    captionLabel_ = new Label();
    captionLabel_.setStyleName(ThemeStyles.INSTANCE.miniDialogCaption());
    titleBar.add(captionLabel_);
    titleBar.setCellHorizontalAlignment(captionLabel_, HasHorizontalAlignment.ALIGN_LEFT);
    HorizontalPanel toolsPanel = new HorizontalPanel();
    toolsPanel.setStyleName(ThemeStyles.INSTANCE.miniDialogTools());
    ToolbarButton hideButton = new ToolbarButton(new ImageResource2x(ThemeResources.INSTANCE.closeChevron2x()), new ClickHandler() {

        public void onClick(ClickEvent event) {
            MiniDialogPopupPanel.this.hideMiniDialog();
        }
    });
    hideButton.setTitle("Close");
    toolsPanel.add(hideButton);
    titleBar.add(toolsPanel);
    titleBar.setCellHorizontalAlignment(toolsPanel, HasHorizontalAlignment.ALIGN_RIGHT);
    verticalPanel_.add(titleBar);
    // main widget
    verticalPanel_.add(createMainWidget());
    setWidget(verticalPanel_);
}
Also used : VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) Label(com.google.gwt.user.client.ui.Label) ImageResource2x(org.rstudio.core.client.resources.ImageResource2x)

Example 27 with ImageResource2x

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

the class ModifyKeyboardShortcutsWidget method addConflictCommandStyles.

private void addConflictCommandStyles(int index, int maskedIndex, KeyboardShortcutEntry conflictsWith) {
    Element shortcutCell = table_.getRowElement(index).getChild(1).cast();
    embedIcon(shortcutCell, new ImageResource2x(ThemeResources.INSTANCE.syntaxWarning2x()), "Conflicts with command: ", maskedIndex);
    shortcutCell.addClassName(RES.dataGridStyle().conflictRow());
}
Also used : Element(com.google.gwt.dom.client.Element) TableRowElement(com.google.gwt.dom.client.TableRowElement) ImageResource2x(org.rstudio.core.client.resources.ImageResource2x)

Example 28 with ImageResource2x

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

the class ModifyKeyboardShortcutsWidget method addMaskedCommandStyles.

private void addMaskedCommandStyles(int index, int maskedIndex, KeyboardShortcutEntry maskedBy) {
    Element shortcutCell = table_.getRowElement(index).getChild(1).cast();
    embedIcon(shortcutCell, new ImageResource2x(ThemeResources.INSTANCE.syntaxInfo2x()), "Masked by RStudio command: ", maskedIndex);
    shortcutCell.addClassName(RES.dataGridStyle().maskedEditorCommandCell());
}
Also used : Element(com.google.gwt.dom.client.Element) TableRowElement(com.google.gwt.dom.client.TableRowElement) ImageResource2x(org.rstudio.core.client.resources.ImageResource2x)

Example 29 with ImageResource2x

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

the class Toolbar method addPopupMenu.

private Widget addPopupMenu(final MenuLabel menuLabel, final MenuSource menuSource, boolean left) {
    final Widget label = menuLabel.asWidget();
    label.setStylePrimaryName("rstudio-StrongLabel");
    label.getElement().getStyle().setCursor(Style.Cursor.DEFAULT);
    label.getElement().getStyle().setOverflow(Overflow.HIDDEN);
    if (left)
        addLeftWidget(label);
    else
        addRightWidget(label);
    Image image = new Image(new ImageResource2x(ThemeResources.INSTANCE.menuDownArrow2x()));
    image.getElement().getStyle().setMarginLeft(5, Unit.PX);
    image.getElement().getStyle().setMarginRight(8, Unit.PX);
    image.getElement().getStyle().setMarginBottom(2, Unit.PX);
    if (left)
        addLeftWidget(image);
    else
        addRightWidget(image);
    final ClickHandler clickHandler = new ClickHandler() {

        public void onClick(ClickEvent event) {
            ToolbarPopupMenu menu = menuSource.getMenu();
            menu.showRelativeTo(label);
            menu.getElement().getStyle().setPaddingTop(3, Style.Unit.PX);
        }
    };
    menuLabel.addClickHandler(clickHandler);
    image.addClickHandler(clickHandler);
    return image;
}
Also used : ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) ImageResource2x(org.rstudio.core.client.resources.ImageResource2x)

Example 30 with ImageResource2x

use of org.rstudio.core.client.resources.ImageResource2x 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

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