List of usage examples for com.google.gwt.user.client.ui Image setUrl
public void setUrl(String url)
From source file:asquare.gwt.tk.client.ui.ImagePrototype.java
License:Apache License
@Override public void applyTo(Image image) { image.setUrl(m_url); }
From source file:cc.kune.common.client.ui.IconLabel.java
License:GNU Affero Public License
/** * Sets the icon clear./*from www . j a v a 2s . c o m*/ * * @param icon * the new icon clear */ private void setIconClear(final Image icon) { icon.setUrl(GWT.getModuleBaseURL() + "clear.cache.gif"); }
From source file:cc.kune.gadgetsample.client.KuneGadgetSampleMainPanel.java
License:GNU Affero Public License
/** * Instantiates a new kune gadget sample main panel. We use gin to inject the * dependencies.//from w ww.j a v a 2 s. co m * * @param eventBus * the event bus * @param wave * the wave * @param gadgetMessages * the gadget messages */ @Inject public KuneGadgetSampleMainPanel(final EventBus eventBus, final Wave wave, final KuneGadgetSampleMessages gadgetMessages) { this.messages = gadgetMessages; Scheduler.get().scheduleDeferred(new ScheduledCommand() { // We run this deferred, at the end of the gadget load @Override public void execute() { final Image avatar = new Image(); avatar.setSize(AVATAR_SIZE, AVATAR_SIZE); avatar.setTitle(wave.getViewer().getDisplayName()); avatar.setUrl(wave.getViewer().getThumbnailUrl()); final boolean lockStatus = getLockStatus(wave); final Button btn = new Button(getBtnText(lockStatus)); btn.addClickHandler(new ClickHandler() { @Override public void onClick(final ClickEvent event) { final Boolean nextStatus = !getLockStatus(wave); // We update the status of key LOCK to the inverse of the current // status wave.getState().submitValue(LOCK, nextStatus.toString()); } }); final VerticalPanel vp = new VerticalPanel(); vp.add(avatar); vp.add(btn); initWidget(vp); eventBus.addHandler(StateUpdateEvent.TYPE, new StateUpdateEventHandler() { @Override public void onUpdate(final StateUpdateEvent event) { // When the status changes we just update the text of the button btn.setText(getBtnText(Boolean.valueOf(event.getState().get(LOCK)))); } }); eventBus.addHandler(ModeChangeEvent.TYPE, new ModeChangeEventHandler() { @Override public void onUpdate(final ModeChangeEvent event) { // See the modes in // http://www.waveprotocol.org/wave-apis/google-wave-gadgets-api/reference // EDIT, VIEW, PLAYBACK, etc if (wave.isPlayback()) { // Do something } else { // Do other thing } } }); } private Boolean getLockStatus(final Wave wave) { return Boolean.parseBoolean(wave.getState().get(LOCK)); } }); }
From source file:ch.heftix.mailxel.client.AttachmentBar.java
License:Open Source License
public Image createIcon(final String filename) { Image icon = new Image("img/attach.png"); icon.setStylePrimaryName("img/mailxel-toolbar-item"); icon.setTitle(filename);//from w ww . j a v a 2s. c o m MimeTypeDescriptor mtd = MimeTypeUtil.mimeTypeByName(filename); icon.setUrl(mtd.iconUrl); return icon; }
From source file:ch.heftix.mailxel.client.IconOverviewGrid.java
License:Open Source License
private int updateGrid(final List<IconTO> icons) { // clean all except header int rows = grid.getRowCount(); for (int i = rows - 1; i >= FIRST_PAYLOAD_ROW; i--) { grid.removeRow(i);//ww w. j a v a 2s. com } int row = FIRST_PAYLOAD_ROW; for (IconTO iconTO : icons) { grid.setText(row, 0, Integer.toString(iconTO.id)); Image icon = new Image(); String url = GWT.getModuleBaseURL() + "mailxel?img=" + Integer.toString(iconTO.id); icon.setUrl(url); grid.setWidget(row, 1, icon); grid.setText(row, 2, iconTO.name); row++; } return row; }
From source file:ch.heftix.mailxel.client.MailOverviewCellTable.java
License:Open Source License
protected Image setIconForGTD(final FlexTable ft, final int row, final int categoryId, final String toolTip) { final Image res = new Image(); mailxelService.getIconForCategory(categoryId, new AsyncCallback<IconTO>() { public void onSuccess(IconTO result) { String url = DirectMailServiceUtil.getIconURL(result.id); if (null != url) { res.setUrl(url); res.setTitle(toolTip);/*from w ww . ja v a 2s . c o m*/ ft.setWidget(row, C_GTD, res); } } public void onFailure(Throwable caught) { // ignore } }); return res; }
From source file:ch.sebastienzurfluh.swissmuseum.core.client.view.pagewidget.ResourceGallery.java
License:Open Source License
public ResourceGallery(String string, String titleString, String descriptionString) { FlowPanel popup = new FlowPanel(); Image imageClone = new Image(); imageClone.setStyleName("resourceGallery-image"); setStyleName("resourceGallery"); imageClone.setUrl(string); setGlassEnabled(true);/*w ww . j a va2s. c o m*/ popup.add(imageClone); Label title = new Label(titleString); Label details = new Label(descriptionString); title.setStyleName("resourceGallery-image-title"); details.setStyleName("resourceGallery-image-details"); popup.add(title); popup.add(details); add(popup); imageClone.addClickHandler(this); }
From source file:com.audata.client.HomePanel.java
License:Open Source License
/** * Public contructor. Builds the HomePanel *//* w w w. ja v a2 s . c o m*/ public HomePanel() { final VerticalPanel verticalPanel = new VerticalPanel(); initWidget(verticalPanel); verticalPanel.setSize("100%", "100%"); final Image image = new Image(); verticalPanel.add(image); verticalPanel.setCellVerticalAlignment(image, HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.setCellHorizontalAlignment(image, HasHorizontalAlignment.ALIGN_CENTER); image.setUrl("images/title/welcome.jpg"); final HTML html = new HTML(LANG.homepage_Text()); html.setWidth("100%"); verticalPanel.add(html); html.setStyleName("audoc-welcomeText"); setSize("100%", "100%"); verticalPanel.setCellVerticalAlignment(html, HasVerticalAlignment.ALIGN_BOTTOM); }
From source file:com.dimdim.conference.ui.dialogues.client.common.AboutCommonDialog.java
License:Open Source License
private AboutCommonDialog(String title, Widget content, Vector footerButtons, String dialogName) { super(title); this.content = content; this.footerButtons = footerButtons; this.dialogName = dialogName; this.closeButtonText = UIStrings.getOKLabel(); UIResources uiResources = UIResources.getUIResources(); FlexTable productInfo = new FlexTable(); String productVersion = getProductVersion(); String premiumCatalogue = getPremiumCatalogue(); String premiumCatalogueLogo = UIStrings.getAboutPoweredLogo(); // Window.alert(premiumCatalogueLogo); productInfo.setWidget(0, 0, createTextHTML(productVersion)); productInfo.getFlexCellFormatter().setColSpan(0, 0, 3); //Window.alert(getProductVersion()); // Window.alert(premiumCatalogue); //Window.alert(uiResources.getConferenceInfo("dimdim.premiumCatalogue")); if (premiumCatalogue.equalsIgnoreCase("1")) { // Window.alert("comes here 1"); Image logo = new Image(); logo.setUrl(premiumCatalogueLogo); productInfo.setWidget(0, 3, logo); // Window.alert("comes here 2"); productInfo.setWidget(0, 4, createTextHTML( "<div style=\"color: #1b61da;\">Powered By <a href=\"http://www.dimdim.com\" target=\"_blank\"><u>Dimdim")); productInfo.getFlexCellFormatter().setColSpan(0, 4, 9); // Window.alert("comes here 3"); //productInfo.setWidth("2px"); }/*ww w .j a va 2s . c o m*/ productInfo.setStyleName("common-text"); // Window.alert("comes here 4"); buttonPanel.add(productInfo, DockPanel.WEST); // Window.alert("comes here 5"); }
From source file:com.dimdim.conference.ui.dialogues.client.common.AboutConferenceHtml.java
License:Open Source License
public AboutConferenceHtml() { // UIResources uiResources = UIResources.getUIResources(); //Window.alert("test about box html"); String aboutBoxLogo = UIStrings.getAboutLogo(); Image logo = new Image(); logo.setUrl(aboutBoxLogo); FlexTable productInfo = new FlexTable(); productInfo.setWidget(0, 0, logo);// w w w. j ava 2s . c o m setWidget(0, 10, productInfo); }