/** * Returns the original height when using IE. * * @see com.google.gwt.user.client.ui.Image#getHeight() */ @Override public int getHeight() { int superHeight = super.getHeight(); logger.log(Level.INFO, "superHeight:" + superHeight); logger.log(Level.INFO, "isAttached():" + isAttached()); if ( (superHeight <= 0) ) { // If this is being run under IE the default answer may be 0 when it // shouldn't be, so return the height from a hidden and attached // temp image Image temp = new Image(this.getUrl()); temp.getElement().getStyle().setVisibility(Visibility.HIDDEN); RootPanel.get().add(temp); logger.log(Level.WARNING, "temp.isAttached():" + temp.isAttached()); int tempHeight = temp.getHeight(); logger.log(Level.WARNING, "tempHeight:" + tempHeight); temp.removeFromParent(); return tempHeight; } return superHeight; }
/** * Returns the original width when when using IE. * * @see com.google.gwt.user.client.ui.Image#getWidth() */ @Override public int getWidth() { int superWidth = super.getWidth(); logger.log(Level.INFO, "superWidth:" + superWidth); logger.log(Level.INFO, "isAttached():" + isAttached()); if ( (superWidth <= 0) ) { // If this is being run under IE the default answer may be 0 when it // shouldn't be, so return the height from a hidden and attached // temp image Image temp = new Image(this.getUrl()); temp.getElement().getStyle().setVisibility(Visibility.HIDDEN); RootPanel.get().add(temp); logger.log(Level.WARNING, "temp.isAttached():" + temp.isAttached()); int tempWidth = temp.getWidth(); logger.log(Level.WARNING, "tempWidth:" + tempWidth); temp.removeFromParent(); return tempWidth; } return superWidth; }
/** * {@inheritDoc} */ @Override public void setPopupPositionAndMakeVisible(final Element relative, final Element p) { ScheduleCommand.addCommand(new Scheduler.Task() { @Override public void execute() { p.getStyle().setLeft(relative.getAbsoluteLeft() + (relative.getOffsetWidth() - p.getOffsetWidth()) / 2, Unit.PX); int height = PositionUtil.boundHeightToScreen(p.getOffsetHeight()); int top = relative.getAbsoluteTop() + (relative.getOffsetHeight() - height) / 2; // Prevent negative top position. p.getStyle().setTop(Math.max(top, MIN_OFFSET_HEIGHT_DEFAULT), Unit.PX); p.getStyle().setHeight(height, Unit.PX); p.getStyle().setVisibility(Visibility.VISIBLE); } }); }
private void updateEditorDimensions() { mirrorDiv.setHTML(valueForMirror(myinput.getValue())); mirrorDiv.setVisible(true); mirrorDiv.getElement().getStyle().setVisibility(Visibility.VISIBLE); int height = this.mirrorDiv.getOffsetHeight(); mirrorDiv.setVisible(false); if (height > this.maxHeight) height = this.maxHeight; if (height > 0) { this.rows = (int) Math.ceil(height/lineHeight); myinput.setVisibleLines(this.rows); //myinput.setHeight(height + padding + "px"); } }
private KeyCommand setupNav(InlineHyperlink link, char key, String help, FileInfo info) { if (info != null) { final String url = url(info); link.setTargetHistoryToken(url); link.setTitle( PatchUtil.M.fileNameWithShortcutKey( FileInfo.getFileName(info.path()), Character.toString(key))); KeyCommand k = new KeyCommand(0, key, help) { @Override public void onKeyPress(KeyPressEvent event) { Gerrit.display(url); } }; keys.add(k); if (link == prev) { hasPrev = true; } else { hasNext = true; } return k; } link.getElement().getStyle().setVisibility(Visibility.HIDDEN); keys.add(new UpToChangeCommand(projectKey, patchSetId, 0, key)); return null; }
public void setThumb(double center, double width) { Style style = getElement().getStyle(); if (width >= 1) { style.setVisibility(Visibility.HIDDEN); return; } else { style.setVisibility(Visibility.VISIBLE); } if (isHorizontal) { style.setLeft(100 * (center - width / 2), Unit.PCT); style.setRight(100 * (1 - center - width / 2), Unit.PCT); } else { style.setTop(100.0 * (center - width / 2), Unit.PCT); style.setBottom(100 * (1 - center - width / 2), Unit.PCT); } }
@PostConstruct private void init() { popup = uiBinder.createAndBindUi(this); //Setup drop indicator if (dropTargetHighlight == null) { dropTargetHighlight = Document.get().createDivElement(); dropTargetHighlight.getStyle().setPosition(Style.Position.ABSOLUTE); dropTargetHighlight.getStyle().setVisibility(Visibility.HIDDEN); dropTargetHighlight.setClassName(WorkbenchResources.INSTANCE.CSS().dropTargetHighlight()); Document.get().getBody().appendChild(dropTargetHighlight); } north.ensureDebugId("CompassWidget-north"); south.ensureDebugId("CompassWidget-south"); east.ensureDebugId("CompassWidget-east"); west.ensureDebugId("CompassWidget-west"); centre.ensureDebugId("CompassWidget-centre"); }
private void displayContextPopup(final Widget target, final Widget popupContent) { if (!popupPanel.isShowing()) { popupContent.getElement().getStyle().setVisibility(Visibility.HIDDEN); } popupPanel.setWidget(popupContent); popupPanel.show(); attachRegistration = target.addAttachHandler(attachHandler); // Defer the attach event because we don't have the element's width/height at this point Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { popupPanel.attachToWidget(target); popupContent.getElement().getStyle().clearVisibility(); } }); }
/** * adding new lines to error messages */ @Override public void addErrorMsg(List<String> errorlist) { if (errorlist != null && errorlist.size() > 0) { holder.setClassName(ResourceHelper.ineformRes().style().errorMessageHolder_showError()); StringBuffer sb = new StringBuffer(html_error.getHTML()); boolean first = sb.length() == 0; for (String s : errorlist) { if (!first) sb.append("<br />"); else first = false; sb.append(s); } html_error.setHTML(sb.toString()); holder.appendChild(html_error.getElement()); shouldRemove = true; if (shouldHide) holder.getStyle().setVisibility(Visibility.VISIBLE); } }
/** * Shows the popup. * @param callingView the view which opens this popup. */ public void showPopup(HasEvidences callingView) { if (instance.isFileServiceAvailable()) { attachment.getStyle().setVisibility(Visibility.VISIBLE); } else { attachment.getStyle().setVisibility(Visibility.HIDDEN); } errorMessage.removeClassName("activeItem"); this.callingView = callingView; formPanel.reset(); attachedFileLabel.setInnerHTML("No file attached."); fileEditableContent.removeClassName("editState"); descriptionTextArea.setText(""); dia.center(); }
@UiHandler("magnifier") public void onClickMagnifier(ClickEvent event) { final Style bgstyle = fullscreen.getStyle(); final Style bgimgcontainerstyle = fullscreenimgcontainer.getStyle(); final Style bgimgstyle = fullscreenimg.getElement().getStyle(); bgstyle.setVisibility(Visibility.VISIBLE); bgimgcontainerstyle.setVisibility(Visibility.VISIBLE); bgimgstyle.setVisibility(Visibility.VISIBLE); if(bgimgstyle.getBackgroundImage() == null || bgimgstyle.getBackgroundImage().trim().isEmpty()) { bgimgstyle.setProperty("background", "url(\"./data/influence_data/" + answer.getPath() + "\") no-repeat scroll center center / contain rgba(0,0,0,0)"); bgimgstyle.setWidth(100, Unit.PCT); bgimgstyle.setHeight(90, Unit.PCT); } new Animation() { @Override protected void onUpdate(double progress) { bgstyle.setOpacity(Math.min(0.9, progress*2)); bgimgstyle.setOpacity(Math.max(0, progress*2-0.8)); } }.run(1600); }
@UiHandler("fullscreenimg") public void onFullscreenImgClicked(ClickEvent e) { final Style bgstyle = fullscreen.getStyle(); final Style bgimgstyle = fullscreenimg.getElement().getStyle(); new Animation() { @Override protected void onUpdate(double progress) { bgstyle.setOpacity(1-progress); bgimgstyle.setOpacity(Math.max(0, 1-progress*2.5)); if(progress == 1) { fullscreen.getStyle().setVisibility(Visibility.HIDDEN); fullscreenimg.getElement().getStyle().setVisibility(Visibility.HIDDEN); fullscreenimgcontainer.getStyle().setVisibility(Visibility.HIDDEN); } } }.run(1000); }
protected void handleMove(NativeEvent event) { Point movePoint = new Point(getTouchOrMouseClientX(event), getTouchOrMouseClientY(event)); updateMovingData(movePoint); setWidth(movingData.getWidth()); setHeight(movingData.getHeight()); setTop((int) movingData.getTop()); setLeft((int) movingData.getLeft()); startingPoint.getStyle().setVisibility(Visibility.HIDDEN); endingPoint.getStyle().setVisibility(Visibility.HIDDEN); internalDrawCurve(movingData); event.stopPropagation(); }
/** * {@inheritDoc} */ @Override public void setPopupPositionAndMakeVisible(Element relative, final Element p) { ScheduleCommand.addCommand(new Scheduler.Task() { @Override public void execute() { p.getStyle().setLeft((RootPanel.get().getOffsetWidth() - p.getOffsetWidth()) / 2, Unit.PX); int height = PositionUtil.boundHeightToScreen(p.getOffsetHeight()); int top = (RootPanel.get().getOffsetHeight() - height) / 2; // Prevent negative top position. p.getStyle().setTop(Math.max(top, MIN_OFFSET_HEIGHT_DEFAULT), Unit.PX); p.getStyle().setHeight(height, Unit.PX); p.getStyle().setVisibility(Visibility.VISIBLE); } }); }
void prepareTip(ToolTip toolTip, Element targetElement, ToolTipConfig config) { toolTip.getElement().getStyle().setVisibility(Visibility.HIDDEN); E_ZIndex.TOOL_TIP_1.assignTo(toolTip, config.getType()); if( toolTip.getParent() == null ) { RootPanel.get().add(toolTip); U_Debug.ASSERT(m_activeTips.indexOf(toolTip) == -1, "prepareTip1"); m_activeTips.add(toolTip); } toolTip.init(targetElement, config); }
@Override public void createCounter(CounterInfo counter, final Board board) { String id = counter.ref().toString(); SVGImageElement c = (SVGImageElement) svg.getElementById(id); if(c == null) { Element template = svg.getElementById("counter"); c = (SVGImageElement) template.cloneNode(true); c.setId(id); }else{ c.getStyle().setVisibility(Visibility.VISIBLE); } c.getHref().setBaseVal(counter.getState()); ClickHandler clickHandler = new ClickHandler() { @Override public void onClick(ClickEvent event) { counterClicked(board, event); } }; OMSVGImageElement img = OMElement.convert(c); img.addClickHandler(clickHandler); svg.getElementById("units").appendChild(c); }
private void updateSelectionRect() { SVGRectElement rect = (SVGRectElement) svg.getElementById("selection"); if (ctx.selected == null) { rect.getStyle().setVisibility(Visibility.HIDDEN); } else { SVGImageElement c = (SVGImageElement) svg.getElementById(ctx.selected.ref().toString()); if(c != null) { rect.getStyle().setVisibility(Visibility.VISIBLE); rect.getX().getBaseVal().setValue(c.getX().getBaseVal().getValue()); rect.getY().getBaseVal().setValue(c.getY().getBaseVal().getValue()); rect.getStyle().setDisplay(Display.BLOCK); bringToTop(c); c.getParentElement().insertBefore(rect, c); }else{ ClientEngine.log(ctx.selected.ref()+" not found"); } } }
private void drawFromTemplate(VisualCoords center, String templateId, String text, final String id) { SVGElement target = (SVGElement) svg.getElementById(id); if (target == null) { target = (SVGElement) svg.getElementById(templateId); target = (SVGElement) target.cloneNode(true); target.setId(id); svg.getElementById("markers").appendChild(target); } target.getStyle().setProperty("pointerEvents", "none"); target.getStyle().setVisibility(Visibility.VISIBLE); if(text != null) { SVGTSpanElement tspan = (SVGTSpanElement) target.getElementsByTagName("tspan").getItem(0); Text item = (Text) tspan.getChildNodes().getItem(0); item.setNodeValue(text); } target.setAttribute("transform", "translate(" + center.x + ", " + center.y + ")"); bringToTop(target); }
@Override protected void resetCounters() { SVGRectElement rect = (SVGRectElement) getSVGElement("selection"); rect.getStyle().setDisplay(Display.NONE); Element unitsLayer = svg.getElementById("units"); unitsLayer.appendChild(rect); for (CounterInfo ci : ctx.board.getPlaced()) { String id = ci.ref().toString(); Element element = svg.getElementById(id); if(element!=null){ element.getStyle().setVisibility(Visibility.HIDDEN); } } stackSelector.getStyle().setVisibility(Visibility.HIDDEN); OMSVGRectElement omstackSelector = OMNode.convert(stackSelector); omstackSelector.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { handler.onClicked(stackSelectorContents, stackSelectorPosition); } }); unitsLayer.appendChild(stackSelector); }
@Before public void setUp() throws Exception { ctx.display = display; doReturn(false).when(ctx).isHistoryMode(); runner = Mockito.spy(new ClientOpRunner(ctx){ @Override protected boolean ask(String msg) { return false; } @Override protected ServerEngineAsync getServerService() { return service; } @Override protected void setAjaxVisibility(Visibility visibility) { } @Override protected void reload() { } }); ctx.ops = new ArrayList<Operation>(); Mockito.reset(service); service.doThrow=true; }
private void createPosterImageLayer(Element mediaContainerElement, BaseMediaConfiguration baseMediaConfiguration) { posterImageElement = DOM.createImg(); DOM.setImgSrc(posterImageElement, baseMediaConfiguration.getPoster()); posterImageElement.getStyle().setLeft(0, Unit.PX); posterImageElement.getStyle().setTop(0, Unit.PX); posterImageElement.getStyle().setPosition(Position.ABSOLUTE); posterImageElement.getStyle().setWidth(baseMediaConfiguration.getWidth(), Unit.PX); posterImageElement.getStyle().setHeight(baseMediaConfiguration.getHeight(), Unit.PX); posterImageElement.getStyle().setPadding(0, Unit.PX); posterImageElement.getStyle().setMargin(0, Unit.PX); posterImageElement.getStyle().setVisibility(Visibility.VISIBLE); mediaContainerElement.appendChild(posterImageElement); }
public static void showAlert(String msg) { ConsoleUnit console = WebConsole.getConsoleUnit(); Element elem = DOM.getElementById("alert_popup"); DOM.getElementById("alert_popup_msg").setInnerHTML(msg); int halfHeight = (int) Math.round((double)elem.getClientHeight()/2); int halfWidth = (int) Math.round((double)elem.getClientWidth()/2); elem.getStyle().setMarginTop(-halfHeight, Unit.PX); elem.getStyle().setMarginLeft(-halfWidth, Unit.PX); DOM.getElementById("alert_popup").getStyle().setVisibility(Visibility.VISIBLE); }
@Override public void setShowMoreVisible(boolean visible) { // In order to keep the padding effect, the button always need to be present // in order to affect layout. Just make it invisible and non-clickable. if (visible) { showMore.getStyle().clearVisibility(); } else { showMore.getStyle().setVisibility(Visibility.HIDDEN); } }
/** * Get the thumbnail to load its image from the given url. * @param url */ public void loadImage(final String url) { // Remove the old double loader to stop the last double buffered load. if (onLoadHandlerRegistration != null) { onLoadHandlerRegistration.removeHandler(); onErrorHandlerRegistration.removeHandler(); // We used to set doubleLoadedImage's url to "" here. // It turns out to be a really bad thing to do. Setting an url to null // cause Wfe's bootstrap servelet to get called, which overload the server. RootPanel.get().remove(doubleLoadedImage); } // set up the handler to hide spinning wheel when loading has finished // We need to have the doubleLoadedImage created even if we are loading the image directly // in imageToLoad. This is done because we don't get a event otherwise. DoubleLoadHandler doubleLoadHandler = new DoubleLoadHandler(url); onLoadHandlerRegistration = doubleLoadedImage.addLoadHandler(doubleLoadHandler); onErrorHandlerRegistration = doubleLoadedImage.addErrorHandler(doubleLoadHandler); error.setVisible(false); doubleLoadedImage.setVisible(false); doubleLoadedImage.setUrl(url); RootPanel.get().add(doubleLoadedImage); imageToLoad.getElement().getStyle().setVisibility(Visibility.HIDDEN); // If image is empty, show the url directly. if (imageToLoad.getUrl().length() == 0) { imageToLoad.setUrl(url); } }
@Override public void setPopupPositionAndMakeVisible(Element reference, final Element popup) { Style popupStyle = popup.getStyle(); // TODO(danilatos): Do something more intelligent than arbitrary constants (which might be // susceptible to font size changes, etc) popupStyle.setLeft(popupAnchor.getAbsoluteLeft() - popup.getOffsetWidth() + 26, Unit.PX); popupStyle.setTop(popupAnchor.getAbsoluteBottom() + 5, Unit.PX); popupStyle.setVisibility(Visibility.VISIBLE); }
/** * Positions the notification widget. * @param notification */ private void positionAndShowNotificationDialog(Notification notification) { NotificationWidget widget = notification.getWidget(); int notificationIndex = notification.getIndex(); NotificationWidget relativeTo = null; if (notificationIndex > 0) { relativeTo = activeNotifications.get(notificationIndex-1).getWidget(); } // Show the widget first, but make it invisible (so GWT can do its absolute positioning mojo) widget.getElement().getStyle().setVisibility(Visibility.HIDDEN); rootPanel.add(widget); // Calculate the notification widget's position, either because this is the only one // or relative to the one below it. int bottom = NotificationConstants.MARGIN; int right = NotificationConstants.MARGIN; if (relativeTo != null) { String relativeTo_bottomStyle = relativeTo.getElement().getStyle().getBottom(); int relativeTo_bottom = new Integer(relativeTo_bottomStyle.split("px")[0]).intValue(); //$NON-NLS-1$ bottom = relativeTo_bottom + relativeTo.getOffsetHeight() + NotificationConstants.MARGIN; } // Now pin the notification to the right using fixed positioning widget.getElement().getStyle().setPosition(Position.FIXED); widget.getElement().getStyle().setBottom(bottom, Unit.PX); widget.getElement().getStyle().setRight(right, Unit.PX); widget.getElement().getStyle().setProperty("left", null); //$NON-NLS-1$ widget.getElement().getStyle().setProperty("top", null); //$NON-NLS-1$ widget.getElement().getStyle().setVisibility(Visibility.VISIBLE); }
HtmlLayerDom(Element elem) { super(); this.elem = elem; elem.getStyle().setPosition(Position.ABSOLUTE); elem.getStyle().setVisibility(Visibility.HIDDEN); elem.getStyle().setProperty(transformOriginName, "0 0"); }
void update() { if (!isSet(Flag.SHOWN)) { setFlag(Flag.SHOWN, true); elem.getStyle().setVisibility(Visibility.VISIBLE); } float m00 = transform.m00(); float m01 = transform.m01(); float m10 = transform.m10(); float m11 = transform.m11(); float m20 = transform.tx(); float m21 = transform.ty(); String matrix; if (supports3d) { matrix = "matrix3d(" + // css(m00) + "," + css(m01) + ",0,0," + // css(m10) + "," + css(m11) + ",0,0," + // "0,0,1,0," + // xlate(m20) + "," + xlate(m21) + ",0,1" + // ")"; } else { matrix = "matrix(" + // css(m00) + "," + css(m01) + "," + // css(m10) + "," + css(m11) + ", " + // xlate(m20) + "," + xlate(m21) + // ")"; } matrix += " translate(" + css(-originX) + "px," + css(-originY) + "px)"; elem.getStyle().setProperty(transformName, matrix); }
Header( KeyCommandSet keys, @Nullable Project.NameKey project, DiffObject base, DiffObject patchSetId, String path, DiffView diffSreenType, DiffPreferences prefs) { initWidget(uiBinder.createAndBindUi(this)); this.keys = keys; this.projectKey = project; this.base = base; this.patchSetId = patchSetId.asPatchSetId(); this.path = path; this.diffScreenType = diffSreenType; this.prefs = prefs; if (!Gerrit.isSignedIn()) { reviewed.getElement().getStyle().setVisibility(Visibility.HIDDEN); } SafeHtml.setInnerHTML(filePath, formatPath(path)); up.setTargetHistoryToken( PageLinks.toChange( project, patchSetId.asPatchSetId().getParentKey(), base.asString(), patchSetId.asPatchSetId().getId())); }
public PreferencesBox(DiffScreen view) { this.view = view; initWidget(uiBinder.createAndBindUi(this)); initIgnoreWhitespace(); initTheme(); if (view != null) { initMode(); } else { UIObject.setVisible(header, false); apply.getElement().getStyle().setVisibility(Visibility.HIDDEN); } }
Message(History parent, MessageInfo info) { if (info.author() != null) { avatar = new AvatarImage(info.author()); avatar.setSize("", ""); } else { avatar = new AvatarImage(); } initWidget(uiBinder.createAndBindUi(this)); header.addDomHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { setOpen(!isOpen()); } }, ClickEvent.getType()); this.history = parent; this.info = info; setName(false); date.setInnerText(FormatUtil.shortFormatDayTime(info.date())); if (info.message() != null) { String msg = info.message().trim(); summary.setInnerText(msg); message.setInnerSafeHtml( history.getCommentLinkProcessor().apply(new SafeHtmlBuilder().append(msg).wikify())); ApiGlue.fireEvent("comment", message); } else { reply.getElement().getStyle().setVisibility(Visibility.HIDDEN); } }
public EditPreferencesBox(EditScreen view) { this.view = view; initWidget(uiBinder.createAndBindUi(this)); initTheme(); initKeyMapType(); if (view == null) { UIObject.setVisible(header, false); apply.getElement().getStyle().setVisibility(Visibility.HIDDEN); } }
private void showDropTarget(int x, int y, int width, int height) { dropTargetHighlight.getStyle().setLeft(x, Unit.PX); dropTargetHighlight.getStyle().setWidth(width, Unit.PX); dropTargetHighlight.getStyle().setTop(y, Unit.PX); dropTargetHighlight.getStyle().setHeight(height, Unit.PX); dropTargetHighlight.getStyle().setVisibility(Visibility.VISIBLE); dropTargetHighlight.getStyle().setDisplay(Display.BLOCK); }
private void setSeparatorStyle(Widget separator, boolean invisible) { separator.getElement().getStyle().setDisplay(Display.INLINE_BLOCK); separator.getElement().getStyle().setWidth(separatorWidth, Style.Unit.PCT); separator.getElement().getStyle().setTextAlign(TextAlign.CENTER); separator.getElement().setInnerText(":"); separator.setStyleName("time-picker-separator"); if (invisible) { separator.getElement().getStyle().setVisibility(Visibility.HIDDEN); } }
private void setSeparatorStyleRelative(Widget separator, boolean invisible) { separator.getElement().getStyle().setDisplay(Display.INLINE_BLOCK); separator.getElement().getStyle().setWidth(separatorWidthRelative, Style.Unit.PX); separator.getElement().getStyle().setTextAlign(TextAlign.CENTER); separator.getElement().setInnerText(":"); separator.setStyleName("time-picker-separator"); if (invisible) { separator.getElement().getStyle().setVisibility(Visibility.HIDDEN); } }
private static boolean isElementVisible(Element element) { if (UIObject.isVisible(element)) { String visibility = element.getStyle().getVisibility(); if (visibility == null || !visibility.equals(Visibility.HIDDEN.getCssName())) { return true; } } return false; }
/** * clear and hide error messages */ @Override public void clearErrorMsg() { holder.setClassName(ResourceHelper.ineformRes().style().errorMessageHolder_dontShowError()); html_error.setHTML(""); if (shouldRemove) { holder.removeChild(html_error.getElement()); shouldRemove = false; } if (shouldHide) { holder.getStyle().setVisibility(Visibility.HIDDEN); } }
@Override protected AbstractCellTable<AssistedObject> createTable() { return new CellTable<AssistedObject>( DEFAULT_PAGE_SIZE, ResourceHelper.cellTableResources(), KEY_PROVIDER) { @Override public void setRowData(int start, java.util.List<? extends AssistedObject> values) { super.setRowData(start, values); if (values.size() == 0) { if (pager != null) pager.setVisible(false); if (topPager != null) topPager.setVisible(false); getTableHeadElement().getStyle().setVisibility(Visibility.HIDDEN); } else { if (pager != null) pager.setVisible(true); if (topPager != null) topPager.setVisible(true); getTableHeadElement().getStyle().setVisibility(Visibility.VISIBLE); } } }; }
public ShowImagePopup(final FileEvidence fe) { this.fe = fe; dia = new DialogBox(); dia.setGlassEnabled(true); dia.setGlassStyleName("transparent"); absolute = new AbsolutePanel(); absolute.getElement().getStyle().setOverflow(Overflow.VISIBLE); loader = new Image("./img/loader.gif"); loader.setVisible(true); loader.setWidth("42px"); loader.setHeight("42px"); img = new Image(); img.getElement().getStyle().setPosition(Position.ABSOLUTE); img.getElement().getStyle().setVisibility(Visibility.HIDDEN); img.setWidth("auto"); img.setHeight("auto"); img.getElement().getStyle().setProperty("maxWidth", "900px"); img.getElement().getStyle().setProperty("maxHeight", "620px"); addOnLoadHandler(img.getElement()); absolute.add(loader); absolute.add(img); dia.setAutoHideEnabled(true); dia.add(absolute); }