Greg Sheremeta has uploaded a new change for review. Change subject: userportal, webadmin: rename AbstractLinkColumnWithTooltip -> AbstractLinkColumn ......................................................................
userportal, webadmin: rename AbstractLinkColumnWithTooltip -> AbstractLinkColumn (Patch 4b of 12) No logic changes. Just a rename. Change-Id: Ia49e1b78d977751f7551774182e3b78073f09e03 Signed-off-by: Greg Sheremeta <[email protected]> --- A frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/cell/DecoratedImageResourceCell.java R frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/cell/LinkCell.java M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/AbstractLinkColumnWithTooltip.java 3 files changed, 45 insertions(+), 5 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/07/38607/1 diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/cell/DecoratedImageResourceCell.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/cell/DecoratedImageResourceCell.java new file mode 100644 index 0000000..814eae8 --- /dev/null +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/cell/DecoratedImageResourceCell.java @@ -0,0 +1,40 @@ +package org.ovirt.engine.ui.common.widget.table.cell; + +import org.ovirt.engine.ui.common.widget.ImageWithDecorator; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.safehtml.client.SafeHtmlTemplates; +import com.google.gwt.safehtml.shared.SafeHtml; +import com.google.gwt.safehtml.shared.SafeHtmlBuilder; +import com.google.gwt.safehtml.shared.SafeHtmlUtils; +import com.google.gwt.user.client.ui.AbstractImagePrototype; + +public class DecoratedImageResourceCell extends AbstractTitlePanelCell<ImageWithDecorator> { + + interface CellTemplate extends SafeHtmlTemplates { + @Template("<div style=\"position: relative; left: 0; top: 0;\"><span style=\"position: relative; left: 0px; top: 0px;\">{0}</span><span style=\"position: absolute; left: {2}px; top: {3}px;\">{1}</span></div>") + SafeHtml doubleImageContainer(SafeHtml imageHtml, SafeHtml decoratorHtml, int left, int top); + } + + private static final CellTemplate template = GWT.create(CellTemplate.class); + + @Override + public void render(Context context, ImageWithDecorator value, SafeHtmlBuilder sb) { + if (value != null) { + SafeHtml mainImageHtml = SafeHtmlUtils.fromTrustedString(""); //$NON-NLS-1$ + SafeHtml decorateImageHtml = SafeHtmlUtils.fromTrustedString(""); //$NON-NLS-1$ + if (value.getImage() != null) { + mainImageHtml = + SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(value.getImage()).getHTML()); + } + if (value.getDecorator() != null) { + decorateImageHtml = + SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(value.getDecorator()).getHTML()); + } + sb.append(template.doubleImageContainer(mainImageHtml, + decorateImageHtml, + value.getDecoratorPositionLeft(), + value.getDecoratorPositionTop())); + } + } +} diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/cell/LinkCellWithTooltip.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/cell/LinkCell.java similarity index 93% rename from frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/cell/LinkCellWithTooltip.java rename to frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/cell/LinkCell.java index 2858c01..2e2b57c 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/cell/LinkCellWithTooltip.java +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/cell/LinkCell.java @@ -14,9 +14,9 @@ * passed to a ValueUpdater. */ @SuppressWarnings("deprecation") -public class LinkCellWithTooltip extends TextCellWithTooltip { +public class LinkCell extends TextCellWithTooltip { - public LinkCellWithTooltip(int maxTextLength) { + public LinkCell(int maxTextLength) { super(maxTextLength, BrowserEvents.MOUSEOVER, BrowserEvents.CLICK); } diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/AbstractLinkColumnWithTooltip.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/AbstractLinkColumnWithTooltip.java index e3ad25d..5a77e14 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/AbstractLinkColumnWithTooltip.java +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/AbstractLinkColumnWithTooltip.java @@ -1,12 +1,12 @@ package org.ovirt.engine.ui.common.widget.table.column; -import org.ovirt.engine.ui.common.widget.table.cell.LinkCellWithTooltip; +import org.ovirt.engine.ui.common.widget.table.cell.LinkCell; import org.ovirt.engine.ui.common.widget.table.cell.TextCellWithTooltip; import com.google.gwt.cell.client.FieldUpdater; /** - * Column for displaying links using {@link LinkCellWithTooltip}. + * Column for displaying links using {@link LinkCell}. * * @param <T> * the row type. @@ -22,7 +22,7 @@ } public AbstractLinkColumnWithTooltip(int maxTextLength, FieldUpdater<T, String> fieldUpdater) { - super(new LinkCellWithTooltip(maxTextLength)); + super(new LinkCell(maxTextLength)); setFieldUpdater(fieldUpdater); } -- To view, visit https://gerrit.ovirt.org/38607 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia49e1b78d977751f7551774182e3b78073f09e03 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Greg Sheremeta <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
