Search in sources :

Example 71 with Image

use of com.google.gwt.user.client.ui.Image 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)

Example 72 with Image

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

the class PerunAppTypeCell 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("INITIAL")) {
        ir = INITIAL;
    } else if (status.equalsIgnoreCase("EXTENSION")) {
        ir = EXTENSION;
    }
    // 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)

Example 73 with Image

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

the class WhetherEnabledCell method render.

@Override
public void render(com.google.gwt.cell.client.Cell.Context context, Boolean enabled, SafeHtmlBuilder sb) {
    // selects the image according to the status
    ImageResource ir = null;
    if (enabled) {
        ir = ENABLED;
    } else {
        ir = DISABLED;
    }
    // if status not available
    if (ir == null) {
        return;
    }
    // append the image
    Element imageElement = new Image(ir).getElement();
    imageElement.setTitle(String.valueOf(enabled));
    SafeHtml image = SafeHtmlUtils.fromSafeConstant((imageElement.getString()));
    sb.append(image);
}
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)

Example 74 with Image

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

the class DashboardsTable method populate.

protected void populate(final int row, final DashboardInfo k) {
    if (k.isDefault()) {
        table.setWidget(row, 1, new Image(Gerrit.RESOURCES.greenCheck()));
        final FlexCellFormatter fmt = table.getFlexCellFormatter();
        fmt.getElement(row, 1).setTitle(Util.C.dashboardDefaultToolTip());
    }
    table.setWidget(row, 2, new Anchor(k.path(), "#" + PageLinks.toProjectDashboard(new Project.NameKey(k.project()), k.id())));
    table.setText(row, 3, k.title() != null ? k.title() : k.path());
    table.setText(row, 4, k.description());
    if (k.definingProject() != null && !k.definingProject().equals(k.project())) {
        table.setWidget(row, 5, new Anchor(k.definingProject(), "#" + PageLinks.toProjectDashboards(new Project.NameKey(k.definingProject()))));
    }
    setRowItem(row, k);
}
Also used : Anchor(com.google.gwt.user.client.ui.Anchor) FlexCellFormatter(com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter) Image(com.google.gwt.user.client.ui.Image)

Example 75 with Image

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

the class StringListPanel method setInfo.

public void setInfo(String msg) {
    if (info == null && titlePanel != null) {
        info = new Image(Gerrit.RESOURCES.info());
        titlePanel.add(info);
    }
    if (info != null) {
        info.setTitle(msg);
    }
}
Also used : 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