Search in sources :

Example 26 with ImageResource

use of com.google.gwt.resources.client.ImageResource in project rstudio by rstudio.

the class CompileOutputPane method createMainToolbar.

@Override
protected Toolbar createMainToolbar() {
    Toolbar toolbar = new Toolbar();
    fileLabel_ = new ToolbarFileLabel(toolbar, 200);
    ImageResource showLogImage = new ImageResource2x(StandardIcons.INSTANCE.show_log2x());
    if (hasLogs_) {
        showLogButton_ = new ToolbarButton("View Log", showLogImage, (ClickHandler) null);
        showLogButton_.getElement().getStyle().setMarginBottom(3, Unit.PX);
        showLogButton_.setTitle(logTitle_);
        showLogSeparator_ = toolbar.addLeftSeparator();
        setShowLogVisible(false);
        toolbar.addLeftWidget(showLogButton_);
    }
    compilePanel_.connectToolbar(toolbar);
    return toolbar;
}
Also used : ImageResource(com.google.gwt.resources.client.ImageResource) ImageResource2x(org.rstudio.core.client.resources.ImageResource2x)

Example 27 with ImageResource

use of com.google.gwt.resources.client.ImageResource in project rstudio by rstudio.

the class CodeBrowserEditingTargetWidget method createToolbar.

private Toolbar createToolbar() {
    Toolbar toolbar = new EditingTargetToolbar(commands_, true);
    toolbar.addLeftWidget(commands_.printSourceDoc().createToolbarButton());
    toolbar.addLeftSeparator();
    toolbar.addLeftWidget(findReplace_.createFindReplaceButton());
    ImageResource icon = new ImageResource2x(ThemeResources.INSTANCE.codeTransform2x());
    ToolbarPopupMenu menu = new ToolbarPopupMenu();
    menu.addItem(commands_.goToHelp().createMenuItem(false));
    menu.addItem(commands_.goToFunctionDefinition().createMenuItem(false));
    ToolbarButton codeTools = new ToolbarButton("", icon, menu);
    codeTools.setTitle("Code Tools");
    toolbar.addLeftWidget(codeTools);
    toolbar.addRightWidget(commands_.executeCode().createToolbarButton());
    toolbar.addRightSeparator();
    toolbar.addRightWidget(commands_.executeLastCode().createToolbarButton());
    return toolbar;
}
Also used : ToolbarButton(org.rstudio.core.client.widget.ToolbarButton) EditingTargetToolbar(org.rstudio.studio.client.workbench.views.source.editors.EditingTargetToolbar) ImageResource(com.google.gwt.resources.client.ImageResource) ToolbarPopupMenu(org.rstudio.core.client.widget.ToolbarPopupMenu) ImageResource2x(org.rstudio.core.client.resources.ImageResource2x) EditingTargetToolbar(org.rstudio.studio.client.workbench.views.source.editors.EditingTargetToolbar) SecondaryToolbar(org.rstudio.core.client.widget.SecondaryToolbar) Toolbar(org.rstudio.core.client.widget.Toolbar)

Example 28 with ImageResource

use of com.google.gwt.resources.client.ImageResource in project rstudio by rstudio.

the class Source method fireDocTabsChanged.

private void fireDocTabsChanged() {
    if (!initialized_)
        return;
    // ensure we have a tab order (we want the popup list to match the order
    // of the tabs)
    syncTabOrder();
    String[] ids = new String[editors_.size()];
    ImageResource[] icons = new ImageResource[editors_.size()];
    String[] names = new String[editors_.size()];
    String[] paths = new String[editors_.size()];
    for (int i = 0; i < ids.length; i++) {
        EditingTarget target = editors_.get(tabOrder_.get(i));
        ids[i] = target.getId();
        icons[i] = target.getIcon();
        names[i] = target.getName().getValue();
        paths[i] = target.getPath();
    }
    events_.fireEvent(new DocTabsChangedEvent(ids, icons, names, paths));
    view_.manageChevronVisibility();
}
Also used : ImageResource(com.google.gwt.resources.client.ImageResource) TextEditingTarget(org.rstudio.studio.client.workbench.views.source.editors.text.TextEditingTarget) EditingTarget(org.rstudio.studio.client.workbench.views.source.editors.EditingTarget) DataEditingTarget(org.rstudio.studio.client.workbench.views.source.editors.data.DataEditingTarget) CodeBrowserEditingTarget(org.rstudio.studio.client.workbench.views.source.editors.codebrowser.CodeBrowserEditingTarget) JSONString(com.google.gwt.json.client.JSONString) JsArrayString(com.google.gwt.core.client.JsArrayString)

Example 29 with ImageResource

use of com.google.gwt.resources.client.ImageResource in project playn by threerings.

the class HtmlAssets method getImage.

protected HtmlImage getImage(String path, Scale scale) {
    String url = pathPrefix + path;
    AutoClientBundleWithLookup clientBundle = getBundle(path);
    if (clientBundle != null) {
        String key = getKey(path);
        ImageResource resource = (ImageResource) getResource(key, clientBundle);
        if (resource != null) {
            url = resource.getSafeUri().asString();
        }
    }
    return adaptImage(url, scale);
}
Also used : ImageResource(com.google.gwt.resources.client.ImageResource) AutoClientBundleWithLookup(playn.core.AutoClientBundleWithLookup)

Example 30 with ImageResource

use of com.google.gwt.resources.client.ImageResource in project perun by CESNET.

the class PerunAppStateCell method render.

@Override
public void render(com.google.gwt.cell.client.Cell.Context context, String status, SafeHtmlBuilder sb) {
    // selects the image according to the status
    ImageResource ir = null;
    if (status.equalsIgnoreCase("NEW")) {
        ir = NEW;
    } else if (status.equalsIgnoreCase("VERIFIED")) {
        ir = VERIFIED;
    } else if (status.equalsIgnoreCase("APPROVED")) {
        ir = APPROVED;
    } else if (status.equalsIgnoreCase("REJECTED")) {
        ir = REJECTED;
    }
    // if status not available
    if (ir == null) {
        return;
    }
    // append the image
    Element imageElement = new Image(ir).getElement();
    imageElement.setTitle(status);
    SafeHtml image = SafeHtmlUtils.fromSafeConstant((imageElement.getString()));
    sb.appendHtmlConstant("<div class=\"" + "customClickableTextCell" + "\">");
    sb.append(image);
    sb.appendHtmlConstant("</div>");
}
Also used : ImageResource(com.google.gwt.resources.client.ImageResource) SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) Element(com.google.gwt.dom.client.Element) Image(com.google.gwt.user.client.ui.Image)

Aggregations

ImageResource (com.google.gwt.resources.client.ImageResource)34 ImageResource2x (org.rstudio.core.client.resources.ImageResource2x)9 Element (com.google.gwt.dom.client.Element)6 Image (com.google.gwt.user.client.ui.Image)6 SafeHtml (com.google.gwt.safehtml.shared.SafeHtml)5 Column (com.google.gwt.user.cellview.client.Column)5 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)4 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)4 Test (org.junit.Test)4 ImageResourceCell (com.google.gwt.cell.client.ImageResourceCell)3 JavaScriptObject (com.google.gwt.core.client.JavaScriptObject)3 GwtTestTest (com.googlecode.gwt.test.GwtTestTest)3 ArrayList (java.util.ArrayList)3 Context (com.google.gwt.cell.client.Cell.Context)2 JsArray (com.google.gwt.core.client.JsArray)2 JsArrayString (com.google.gwt.core.client.JsArrayString)2 NativeEvent (com.google.gwt.dom.client.NativeEvent)2 SafeHtmlBuilder (com.google.gwt.safehtml.shared.SafeHtmlBuilder)2 ListHandler (com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler)2 HTML (com.google.gwt.user.client.ui.HTML)2