Search in sources :

Example 61 with Image

use of com.google.gwt.user.client.ui.Image in project rstudio by rstudio.

the class ModifyKeyboardShortcutsWidget method embedIcon.

private void embedIcon(Element el, ImageResource res, String toolTipText, int maskedIndex) {
    Image icon = new Image(res);
    icon.addStyleName(RES.dataGridStyle().icon());
    icon.setTitle(toolTipText);
    icon.getElement().setAttribute("__rstudio_masked_index", String.valueOf(maskedIndex));
    bindNativeClickToShowToolTip(icon.getElement(), toolTipText);
    el.appendChild(icon.getElement());
}
Also used : Image(com.google.gwt.user.client.ui.Image)

Example 62 with Image

use of com.google.gwt.user.client.ui.Image in project rstudio by rstudio.

the class FullscreenPopupPanel method addCloseButton.

private void addCloseButton(NineUpBorder border) {
    Image closeIcon = new Image(new ImageResource2x(RES.close2x()));
    closeIcon.getElement().getStyle().setCursor(Style.Cursor.POINTER);
    closeIcon.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            close();
        }
    });
    LayoutPanel layoutPanel = border.getLayoutPanel();
    layoutPanel.add(closeIcon);
    layoutPanel.setWidgetTopHeight(closeIcon, 15, Unit.PX, closeIcon.getHeight(), Unit.PX);
    layoutPanel.setWidgetRightWidth(closeIcon, 27, Unit.PX, closeIcon.getWidth(), Unit.PX);
}
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) Image(com.google.gwt.user.client.ui.Image) LayoutPanel(com.google.gwt.user.client.ui.LayoutPanel)

Example 63 with Image

use of com.google.gwt.user.client.ui.Image in project rstudio by rstudio.

the class ProgressImage method show.

public void show(boolean show) {
    if (!show) {
        panel_.setWidget(null);
        setVisible(false);
    } else {
        final Image img = new Image(image_);
        panel_.setWidget(img);
        setVisible(true);
    }
}
Also used : Image(com.google.gwt.user.client.ui.Image)

Example 64 with Image

use of com.google.gwt.user.client.ui.Image in project rstudio by rstudio.

the class RSConnect method onRSConnectDeploymentFailed.

@Override
public void onRSConnectDeploymentFailed(final RSConnectDeploymentFailedEvent event) {
    String failedPath = event.getData().getPath();
    // if this looks like an API call, process the path to get the 'bare'
    // server URL
    int pos = failedPath.indexOf("__api__");
    if (pos < 1) {
        // if not, just get the host
        pos = failedPath.indexOf("/", 10) + 1;
    }
    if (pos > 0) {
        failedPath = failedPath.substring(0, pos);
    }
    final String serverUrl = failedPath;
    new ModalDialogBase() {

        @Override
        protected Widget createMainWidget() {
            setText("Publish Failed");
            addOkButton(new ThemedButton("OK", new ClickHandler() {

                @Override
                public void onClick(ClickEvent arg0) {
                    closeDialog();
                }
            }));
            HorizontalPanel panel = new HorizontalPanel();
            Image errorImage = new Image(new ImageResource2x(MessageDialogImages.INSTANCE.dialog_error2x()));
            errorImage.getElement().getStyle().setMarginTop(1, Unit.EM);
            errorImage.getElement().getStyle().setMarginRight(1, Unit.EM);
            panel.add(errorImage);
            panel.add(new HTML("<p>Your content could not be published because " + "of a problem on the server.</p>" + "<p>More information may be available on the server's home " + "page:</p>" + "<p><a href=\"" + serverUrl + "\">" + serverUrl + "</a>" + "</p>" + "<p>If the error persists, contact the server's " + "administrator.</p>" + "<p><small>Error code: " + event.getData().getHttpStatus() + "</small></p>"));
            return panel;
        }
    }.showModal();
}
Also used : ThemedButton(org.rstudio.core.client.widget.ThemedButton) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) ModalDialogBase(org.rstudio.core.client.widget.ModalDialogBase) Widget(com.google.gwt.user.client.ui.Widget) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) ImageResource2x(org.rstudio.core.client.resources.ImageResource2x) HTML(com.google.gwt.user.client.ui.HTML) JsArrayString(com.google.gwt.core.client.JsArrayString) Image(com.google.gwt.user.client.ui.Image)

Example 65 with Image

use of com.google.gwt.user.client.ui.Image in project rstudio by rstudio.

the class ConsoleInterruptProfilerButton method CreateProfilerButton.

public static Image CreateProfilerButton() {
    ImageResource icon = new ImageResource2x(FileIconResources.INSTANCE.iconProfiler2x());
    Image button = new Image(icon);
    button.addStyleName(ThemeResources.INSTANCE.themeStyles().toolbarButtonLeftImage());
    button.getElement().getStyle().setMarginRight(4, Unit.PX);
    button.setTitle("Profiling Code");
    return button;
}
Also used : ImageResource(com.google.gwt.resources.client.ImageResource) ImageResource2x(org.rstudio.core.client.resources.ImageResource2x) Image(com.google.gwt.user.client.ui.Image)

Aggregations

Image (com.google.gwt.user.client.ui.Image)98 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)28 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)28 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)15 Test (org.junit.Test)13 FlexTable (com.google.gwt.user.client.ui.FlexTable)12 HTML (com.google.gwt.user.client.ui.HTML)10 Element (com.google.gwt.dom.client.Element)8 Label (com.google.gwt.user.client.ui.Label)8 ImageResource2x (org.rstudio.core.client.resources.ImageResource2x)7 SmallLabel (org.uberfire.ext.widgets.common.client.common.SmallLabel)7 ImageResource (com.google.gwt.resources.client.ImageResource)6 Widget (com.google.gwt.user.client.ui.Widget)6 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)5 Style (com.google.gwt.dom.client.Style)4 Anchor (com.google.gwt.user.client.ui.Anchor)4 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)4 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)3 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)3 ValueChangeEvent (com.google.gwt.event.logical.shared.ValueChangeEvent)3