Search in sources :

Example 16 with ImageResource2x

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

the class CheckForUpdatesDialog method addTableColumns.

protected void addTableColumns(CellTable<PendingAction> table) {
    TextColumn<PendingAction> nameColumn = new TextColumn<PendingAction>() {

        public String getValue(PendingAction action) {
            return action.getActionInfo().getPackageName();
        }
    };
    table.addColumn(nameColumn, "Package");
    table.setColumnWidth(nameColumn, 28, Unit.PCT);
    TextColumn<PendingAction> installedColumn = new TextColumn<PendingAction>() {

        public String getValue(PendingAction action) {
            return action.getActionInfo().getInstalled();
        }
    };
    table.addColumn(installedColumn, "Installed");
    table.setColumnWidth(installedColumn, 28, Unit.PCT);
    TextColumn<PendingAction> availableColumn = new TextColumn<PendingAction>() {

        public String getValue(PendingAction action) {
            return action.getActionInfo().getAvailable();
        }
    };
    table.addColumn(availableColumn, "Available");
    table.setColumnWidth(availableColumn, 28, Unit.PCT);
    ImageButtonColumn<PendingAction> newsColumn = new ImageButtonColumn<PendingAction>(new ImageResource2x(ThemeResources.INSTANCE.newsButton2x()), new OperationWithInput<PendingAction>() {

        public void execute(PendingAction action) {
            GlobalDisplay.NewWindowOptions options = new GlobalDisplay.NewWindowOptions();
            options.setName("_rstudio_package_news");
            globalDisplay_.openWindow(action.getActionInfo().getNewsUrl(), options);
        }
    }, "Show package NEWS") {

        @Override
        protected boolean showButton(PendingAction action) {
            return !StringUtil.isNullOrEmpty(action.getActionInfo().getNewsUrl());
        }
    };
    table.addColumn(newsColumn, "NEWS");
    table.setColumnWidth(newsColumn, 16, Unit.PCT);
}
Also used : GlobalDisplay(org.rstudio.studio.client.common.GlobalDisplay) ImageResource2x(org.rstudio.core.client.resources.ImageResource2x) TextColumn(com.google.gwt.user.cellview.client.TextColumn) ImageButtonColumn(org.rstudio.core.client.cellview.ImageButtonColumn)

Example 17 with ImageResource2x

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

the class PlotsToolbar method installStandardUI.

private void installStandardUI() {
    // plot history navigation
    addLeftWidget(commands_.previousPlot().createToolbarButton());
    addLeftWidget(commands_.nextPlot().createToolbarButton());
    addLeftSeparator();
    // popout current plot
    addLeftWidget(commands_.zoomPlot().createToolbarButton());
    addLeftSeparator();
    // export commands
    ToolbarPopupMenu exportMenu = new ToolbarPopupMenu();
    exportMenu.addItem(commands_.savePlotAsImage().createMenuItem(false));
    exportMenu.addItem(commands_.savePlotAsPdf().createMenuItem(false));
    exportMenu.addSeparator();
    exportMenu.addItem(commands_.copyPlotToClipboard().createMenuItem(false));
    ToolbarButton exportButton = new ToolbarButton("Export", new ImageResource2x(StandardIcons.INSTANCE.export_menu2x()), exportMenu);
    addLeftWidget(exportButton);
    addLeftSeparator();
    addLeftWidget(commands_.removePlot().createToolbarButton());
    addLeftSeparator();
    // clear all plots
    addLeftWidget(commands_.clearPlots().createToolbarButton());
    // publish
    addRightWidget(publishButton_);
    // refresh
    addRightSeparator();
    addRightWidget(commands_.refreshPlot().createToolbarButton());
}
Also used : ToolbarButton(org.rstudio.core.client.widget.ToolbarButton) ToolbarPopupMenu(org.rstudio.core.client.widget.ToolbarPopupMenu) ImageResource2x(org.rstudio.core.client.resources.ImageResource2x)

Example 18 with ImageResource2x

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

the class RSConnectDeploy method applySource.

private void applySource() {
    // show the description of what we're about to publish
    if (source_.isSelfContained() && source_.isStatic() && !source_.isWebsiteRmd()) {
        filePanel_.setVisible(false);
        descriptionPanel_.setVisible(true);
        if (contentType_ == RSConnect.CONTENT_TYPE_PLOT || contentType_ == RSConnect.CONTENT_TYPE_HTML) {
            descriptionImage_.setResource(new ImageResource2x(RSConnectResources.INSTANCE.previewPlot2x()));
        } else if (contentType_ == RSConnect.CONTENT_TYPE_PRES) {
            descriptionImage_.setResource(new ImageResource2x(RSConnectResources.INSTANCE.previewPresentation2x()));
        } else {
            descriptionImage_.setResource(new ImageResource2x(RSConnectResources.INSTANCE.previewDoc2x()));
        }
    }
    // (for apps and documents--other content types use temporary filenames)
    if (appName_.getTitle().isEmpty()) {
        if (contentType_ == RSConnect.CONTENT_TYPE_APP || contentType_ == RSConnect.CONTENT_TYPE_APP_SINGLE || contentType_ == RSConnect.CONTENT_TYPE_DOCUMENT) {
            // set the app name to the filename
            String appTitle = FilePathUtils.fileNameSansExtension(source_.getSourceFile());
            // as the content name rather than the file
            if (contentType_ == RSConnect.CONTENT_TYPE_DOCUMENT && appTitle.toLowerCase().equals("index")) {
                appTitle = FilePathUtils.fileNameSansExtension(source_.getDeployDir());
            }
            setUnsanitizedAppName(appTitle);
        } else if (contentType_ == RSConnect.CONTENT_TYPE_WEBSITE) {
            setUnsanitizedAppName(FilePathUtils.fileNameSansExtension(source_.getWebsiteDir()));
        }
    }
    ImageResource illustration = null;
    if (contentType_ == RSConnect.CONTENT_TYPE_APP)
        illustration = new ImageResource2x(RESOURCES.publishShinyIllustration2x());
    else if (contentType_ == RSConnect.CONTENT_TYPE_PLOT)
        illustration = new ImageResource2x(RESOURCES.publishPlotIllustration2x());
    else if (contentType_ == RSConnect.CONTENT_TYPE_DOCUMENT)
        illustration = new ImageResource2x(RESOURCES.publishRmdIllustration2x());
    else if (contentType_ == RSConnect.CONTENT_TYPE_HTML)
        illustration = new ImageResource2x(RESOURCES.publishHTMLIllustration2x());
    else if (contentType_ == RSConnect.CONTENT_TYPE_PRES)
        illustration = new ImageResource2x(RESOURCES.publishPresentationIllustration2x());
    if (illustration != null)
        deployIllustration_.setResource(illustration);
}
Also used : ImageResource(com.google.gwt.resources.client.ImageResource) ImageResource2x(org.rstudio.core.client.resources.ImageResource2x)

Example 19 with ImageResource2x

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

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

the class SVNStatusRenderer method render.

@Override
public SafeHtml render(String str) {
    if (str.length() != 1)
        return SafeHtmlUtils.fromString(str);
    ImageResource2x img = imgForStatus(str.charAt(0));
    if (img == null)
        return SafeHtmlUtils.fromString(str);
    SafeHtmlBuilder builder = new SafeHtmlBuilder();
    builder.append(SafeHtmlUtils.fromTrustedString("<span " + "class=\"" + ctRes_.cellTableStyle().status() + "\" " + "title=\"" + SafeHtmlUtils.htmlEscape(descForStatus(str)) + "\">"));
    builder.append(img.getSafeHtml());
    builder.appendHtmlConstant("</span>");
    return builder.toSafeHtml();
}
Also used : ImageResource2x(org.rstudio.core.client.resources.ImageResource2x) SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder)

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