Java Code Examples for com.google.gwt.user.client.ui.Image

The following are top voted examples for showing how to use com.google.gwt.user.client.ui.Image. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: unitimes   File: TimePreferenceCell.java   Source Code and License 6 votes vote down vote up
@Override
public void refresh() {
	clear();
	RoomCookie cookie = RoomCookie.getInstance();
	if (iPattern != null && !iPattern.isEmpty() && !cookie.isGridAsText()) {
		final Image availability = new Image(GWT.getHostPageBaseURL() + "pattern?pref=" + iPattern + "&v=" + (cookie.areRoomsHorizontal() ? "0" : "1") + (cookie.hasMode() ? "&s=" + cookie.getMode() : ""));
		availability.setStyleName("grid");
		add(availability);
	} else {
		for (PreferenceInfo p: iPreferences) {
			P prf = new P("prf");
			prf.setText(p.getOwnerName());
			PreferenceInterface preference = iProperties.getPreference(p.getPreference());
			if (preference != null) {
				prf.getElement().getStyle().setColor(preference.getColor());
				prf.setTitle(preference.getName() + " " + p.getOwnerName());
			}
			add(prf);
		}
	}
}
 
Example 2
Project: unitimes   File: SolverPage.java   Source Code and License 6 votes vote down vote up
public SolverStatus() {
	super("unitime-SolverStatus");
	iStatus = new P("status-label");
	iIcon = new Image(RESOURCES.helpIcon()); iIcon.addStyleName("status-icon");
	iIcon.setVisible(false);
	add(iStatus); add(iIcon);
	RPC.execute(new PageNameRpcRequest("Solver Status"), new AsyncCallback<PageNameInterface>() {
		@Override
		public void onFailure(Throwable caught) {}
		@Override
		public void onSuccess(final PageNameInterface result) {
			iIcon.setTitle(MESSAGES.pageHelp(result.getName()));
			iIcon.setVisible(true);
			iIcon.addClickHandler(new ClickHandler() {
				@Override
				public void onClick(ClickEvent event) {
					if (result.getHelpUrl() == null || result.getHelpUrl().isEmpty()) return;
					UniTimeFrameDialog.openDialog(MESSAGES.pageHelp(result.getName()), result.getHelpUrl());
				}
			});
		}
	});
}
 
Example 3
Project: unitimes   File: WebTable.java   Source Code and License 6 votes vote down vote up
public IconCell(ImageResource resource, final String title, String text) {
	super(null);
	iIcon = new Image(resource);
	iIcon.setTitle(title);
	iIcon.setAltText(title);
	if (text != null && !text.isEmpty()) {
		iLabel = new HTML(text, false);
		iPanel = new HorizontalPanel();
		iPanel.setStyleName("icon");
		iPanel.add(iIcon);
		iPanel.add(iLabel);
		iIcon.getElement().getStyle().setPaddingRight(3, Unit.PX);
		iPanel.setCellVerticalAlignment(iIcon, HasVerticalAlignment.ALIGN_MIDDLE);
	}
	iIcon.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			event.stopPropagation();
			UniTimeConfirmationDialog.info(title);
		}
	});
}
 
Example 4
Project: unitimes   File: WebTable.java   Source Code and License 6 votes vote down vote up
public IconsCell add(ImageResource resource, final String title) {
	if (resource == null) return this;
	Image icon = new Image(resource);
	icon.setTitle(title);
	icon.setAltText(title);
	if (iPanel.getWidgetCount() > 0)
		icon.getElement().getStyle().setPaddingLeft(3, Unit.PX);
	iPanel.add(icon);
	iPanel.setCellVerticalAlignment(icon, HasVerticalAlignment.ALIGN_MIDDLE);
	if (title != null && !title.isEmpty()) {
		icon.addClickHandler(new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				event.stopPropagation();
				UniTimeConfirmationDialog.info(title);
			}
		});
	}
	return this;
}
 
Example 5
Project: unitimes   File: WebTable.java   Source Code and License 6 votes vote down vote up
public NoteCell(String text, final String title) {
	super(null);
	if (Window.getClientWidth() <= 800 && title != null && !title.isEmpty()) {
		iIcon = new Image(RESOURCES.note());
		iIcon.setTitle(title);
		iIcon.setAltText(title);
		iIcon.addClickHandler(new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				event.stopPropagation();
				UniTimeConfirmationDialog.info(title);
			}
		});
	} else {
		iNote = new P("unitime-Note");
		iNote.setHTML(text);
		if (title != null) iNote.setTitle(title);
	}
}
 
Example 6
Project: unitimes   File: PageLabelImpl.java   Source Code and License 6 votes vote down vote up
public PageLabelImpl() {
       iName = new P("text");
       
	iHelp = new Image(RESOURCES.help());
	iHelp.addStyleName("icon");
	iHelp.setVisible(false);
	
	add(iName);
	add(iHelp);
	
	iHelp.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			if (iUrl == null || iUrl.isEmpty()) return;
			UniTimeFrameDialog.openDialog(MESSAGES.pageHelp(getText()), iUrl);
		}
	});
}
 
Example 7
Project: sig-seguimiento-vehiculos   File: ActionBar.java   Source Code and License 6 votes vote down vote up
public ActionBar() {
	super();
	setWidth(300);
	setHeaderVisible(false);
	addStyleName(ThemeStyles.get().style().borderBottom());
	setPosition(0, 0);
	getElement().getStyle().setPosition(Position.ABSOLUTE);
	HorizontalPanel horizontalGroup = new HorizontalPanel();
	horizontalGroup.add(getMenuButton());
	horizontalGroup.add(new SeparatorToolItem());
	Image image = new Image(ImageProvider.INSTANCE.menulogoGeowe());
	horizontalGroup.add(image);
	horizontalGroup.add(new SeparatorToolItem());
	horizontalGroup.add(new SeparatorToolItem());						
	horizontalGroup.add(getGeocodingButton());
	setWidget(horizontalGroup);		
}
 
Example 8
Project: appinventor-extensions   File: DropDownButton.java   Source Code and License 6 votes vote down vote up
public DropDownButton(String widgetName, Image icon, List<DropDownItem> toolbarItems,
                      boolean rightAlign) {
  super(icon);  // icon for button

  this.menu = new ContextMenu();
  this.items = new ArrayList<MenuItem>();
  this.rightAlign = rightAlign;

  for (DropDownItem item : toolbarItems) {
    if (item != null) {
      addItem(item);
    } else {
      menu.addSeparator();
    }
  }

  addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
      menu.setPopupPositionAndShow(new DropDownPositionCallback(getElement()));
    }
  });
}
 
Example 9
Project: appinventor-extensions   File: Icon.java   Source Code and License 6 votes vote down vote up
/**
 * Creates a new icon with the specified caption.
 *
 * @param image  image shown on icon (preferably 16 x 16px)
 * @param caption  caption shown below image
 */
public Icon(Image image, String caption) {

  panel = new VerticalPanel() {
    @Override
    public void onBrowserEvent(Event event) {
      Icon.this.onBrowserEvent(event);
    }
  };
  panel.add(image);
  panel.setCellHorizontalAlignment(image, VerticalPanel.ALIGN_CENTER);
  captionLabel = new Label(caption);
  panel.add(captionLabel);

  initWidget(panel);

  setStylePrimaryName("ode-Icon");
}
 
Example 10
Project: appinventor-extensions   File: TopPanel.java   Source Code and License 6 votes vote down vote up
private void addLogo(HorizontalPanel panel) {
  // Logo should be a link to App Inv homepage. Currently, after the user
  // has logged in, the top level *is* ODE; so for now don't make it a link.
  // Add timestamp to logo url to get around browsers that agressively cache
  // the image! This same trick is used in StorageUtil.getFilePath().
  Image logo = new Image(LOGO_IMAGE_URL + "?t=" + System.currentTimeMillis());
  logo.setSize("40px", "40px");
  logo.setStyleName("ode-Logo");
  String logoUrl = ode.getSystemConfig().getLogoUrl();
  if (!Strings.isNullOrEmpty(logoUrl)) {
    logo.addClickHandler(new WindowOpenClickHandler(logoUrl));
  }
  panel.add(logo);
  panel.setCellWidth(logo, "50px");
  Label title = new Label("MIT App Inventor");
  title.setStyleName("ode-LogoText");
  VerticalPanel titleContainer = new VerticalPanel();
  titleContainer.add(title);
  panel.add(titleContainer);
  panel.setCellWidth(titleContainer, "180px");
  panel.setCellHorizontalAlignment(logo, HorizontalPanel.ALIGN_LEFT);
  panel.setCellVerticalAlignment(logo, HorizontalPanel.ALIGN_MIDDLE);
}
 
Example 11
Project: appinventor-extensions   File: TemplateUploadWizard.java   Source Code and License 6 votes vote down vote up
@Override
  public void render(Context context, TemplateInfo template, SafeHtmlBuilder sb) {
  if (template == null)
    return;
  sb.appendHtmlConstant("<table>");

  // Add the thumbnail image, if available, or a default image.
  sb.appendHtmlConstant("<tr><td rowspan='3'>");
  if ( !template.thumbStr.equals("") )   {
    String src = hostUrl + TEMPLATES_ROOT_DIRECTORY +   template.name + "/" + template.thumbStr;
    sb.appendHtmlConstant("<img style='width:32px' src='" + src + "'>");
  } else {
    ImageResource imgResource = Ode.getImageBundle().appInventorLogo();
    Image img = new Image(imgResource);
    String url = img.getUrl();
    sb.appendHtmlConstant("<img style='width:32px' src='" + url + "'>");
  }
  sb.appendHtmlConstant("</td>");

  // Add the name and description.
  sb.appendHtmlConstant("<td style='font-size:95%;'>");
  sb.appendEscaped(template.name);
  sb.appendHtmlConstant("</td></tr><tr><td>");
  sb.appendEscaped(template.subtitle);
  sb.appendHtmlConstant("</td></tr></table>");
}
 
Example 12
Project: appinventor-extensions   File: GalleryAppBox.java   Source Code and License 6 votes vote down vote up
/**
 * Creates new Gallery app box.
 */
private GalleryAppBox() {
  gContainer = new FlowPanel();
  final HorizontalPanel container = new HorizontalPanel();
  container.setWidth("100%");
  container.setSpacing(0);
  container.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
  HorizontalPanel panel = new HorizontalPanel();
  Image image = new Image();
  image.setResource(Ode.getImageBundle().waitingIcon());
  panel.add(image);
  Label label = new Label();
  label.setText(Ode.getMessages().defaultRpcMessage());
  panel.add(label);
  gContainer.add(panel);
  this.add(gContainer);
}
 
Example 13
Project: appinventor-extensions   File: BlockSelectorBox.java   Source Code and License 6 votes vote down vote up
/**
 * Constructs a tree item for built-in blocks.
 *
 * @return tree item
 */
public TreeItem getBuiltInBlocksTree() {
  initBundledImages();
  TreeItem builtinNode = new TreeItem(new HTML("<span>" + MESSAGES.builtinBlocksLabel()
      + "</span>"));
  for (final String drawerName : BUILTIN_DRAWER_NAMES) {
    Image drawerImage = new Image(bundledImages.get(drawerName));
    TreeItem itemNode = new TreeItem(new HTML("<span>" + drawerImage
        + getBuiltinDrawerNames(drawerName) + "</span>"));
    SourceStructureExplorerItem sourceItem = new BlockSelectorItem() {
      @Override
      public void onSelected() {
        fireBuiltinDrawerSelected(drawerName);
      }
    };
    itemNode.setUserObject(sourceItem);
    builtinNode.addItem(itemNode);
  }
  builtinNode.setState(true);
  return builtinNode;
}
 
Example 14
Project: appinventor-extensions   File: SimpleComponentDescriptor.java   Source Code and License 6 votes vote down vote up
public static Image getImageFromPath(String iconPath, String packageName, long projectId) {
  if (!imagesInitialized) {
    initBundledImages();
  }
  if (iconPath.startsWith("aiwebres/") && packageName != null) {
    // icon for extension
    Image image = new Image(StorageUtil.getFileUrl(projectId,
        "assets/external_comps/" + packageName + "/" + iconPath));
    image.setWidth("16px");
    image.setHeight("16px");
    return image;
  }
  if (bundledImages.containsKey(iconPath)) {
    return new Image(bundledImages.get(iconPath));
  } else {
    return new Image(iconPath);
  }
}
 
Example 15
Project: LAS   File: LASAnnotationsButton.java   Source Code and License 6 votes vote down vote up
public LASAnnotationsButton() {
	mainPanel.add(layoutPanel);
	annotationsButton = new ToggleButton(new Image(GWT.getModuleBaseURL()+"../images/i_off.png"), 
			new Image(GWT.getModuleBaseURL()+"../images/i_on.png"), new ClickHandler() {

				@Override
				public void onClick(ClickEvent event) {
					if ( annotationsButton.isDown() ) {	
						setOpen(true);
						annotationsButton.setTitle(DEFAULT_UP_TOOLTIP);
					} else {
						setOpen(false);
						annotationsButton.setTitle(DEFAULT_DOWN_TOOLTIP);
					}						
				}
		
	});
	annotationsButton.setTitle(DEFAULT_UP_TOOLTIP);
	annotationsButton.setStylePrimaryName("OL_MAP-ToggleButton");
	annotationsButton.addStyleDependentName("WIDTH");
	initWidget(annotationsButton);
}
 
Example 16
Project: LAS   File: OutputPanel.java   Source Code and License 6 votes vote down vote up
public void setImage(String image_url, String link_url) {
    final String url = link_url;
    Image image = new Image(image_url);
    image.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {

            Window.open(url, "_blank", "scrollbars=1");

        }

    });
    image.setTitle("  Click to Enlarge.  Images will size with browser.");
    grid.setWidget(plotRow, 0, image);
}
 
Example 17
Project: LAS   File: LASAnnotationsButtonPanelImpl.java   Source Code and License 6 votes vote down vote up
public LASAnnotationsButtonPanelImpl(String outputPanelID) {
    setName(outputPanelID);
    String moduleBaseURL = GWT.getModuleBaseURL();
    String upImageURL = moduleBaseURL + "../images/i_off.png";
    Image upImage = new Image(upImageURL);
    String downImageURL = moduleBaseURL + "../images/i_on.png";
    Image downImage = new Image(downImageURL);
    button = new ToggleButton(
            upImage,
            downImage);
    button.setTitle("Plot Annotations");
    button.setStylePrimaryName("OL_MAP-ToggleButton");
    button.addStyleDependentName("WIDTH");

    button.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
        public void onValueChange(ValueChangeEvent<Boolean> event) {
            annotations.setVisible(button.isDown());
        }
    });

    initWidget(button);
}
 
Example 18
Project: LAS   File: IESafeImage.java   Source Code and License 6 votes vote down vote up
/**
 * 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;
}
 
Example 19
Project: LAS   File: IESafeImage.java   Source Code and License 6 votes vote down vote up
/**
 * 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;
}
 
Example 20
Project: document-management-system   File: TableImages.java   Source Code and License 6 votes vote down vote up
@Override
public AbstractImagePrototype scrollTableAscending() {
	return new AbstractImagePrototype() {
		public void applyTo(Image image) {
			image.setUrl("img/sort_asc.gif");
		}

		public Image createImage() {
			return new Image("img/sort_asc.gif");
		}

		public String getHTML() {
			return "<img border=\"0\" src=\"img/sort_asc.gif\"/>";
		}
	};
}
 
Example 21
Project: document-management-system   File: TableImages.java   Source Code and License 6 votes vote down vote up
@Override
public AbstractImagePrototype scrollTableDescending() {
	return new AbstractImagePrototype() {
		public void applyTo(Image image) {
			image.setUrl("img/sort_desc.gif");
		}

		public Image createImage() {
			return new Image("img/sort_desc.gif");
		}

		public String getHTML() {
			return "<img border=\"0\" src=\"img/sort_desc.gif\"/>";
		}
	};
}
 
Example 22
Project: document-management-system   File: TableImages.java   Source Code and License 6 votes vote down vote up
@Override
public AbstractImagePrototype scrollTableFillWidth() {
	return new AbstractImagePrototype() {
		public void applyTo(Image image) {
			image.setUrl("img/fill_width.gif");
		}

		public Image createImage() {
			return new Image("img/fill_width.gif");
		}

		public String getHTML() {
			return "<img border=\"0\" src=\"img/fill_width.gif\"/>";
		}
	};
}
 
Example 23
Project: document-management-system   File: WorkflowManager.java   Source Code and License 6 votes vote down vote up
/**
 * WorkflowManager
 */
public WorkflowManager() {
	workflowGraph = new Image();
	scrollGraphPanel = new ScrollPanel(workflowGraph);
	toolbar = new TabToolbarWorkflow(this);
	workflowTable = new WorkflowTable(this);
	workflowDetailTable = new WorkflowDetailTable();
	vPanel = new VerticalPanel();
	vPanel.add(toolbar); // Always visible

	toolbar.setHeight("" + TOOLBAR_HEADER + "px");
	toolbar.setWidth("100%");
	vPanel.setCellHeight(toolbar, "" + TOOLBAR_HEADER + "px");

	initWidget(vPanel);
}
 
Example 24
Project: document-management-system   File: Status.java   Source Code and License 6 votes vote down vote up
/**
 * The status
 */
public Status() {
	super(false, true);
	hPanel = new HorizontalPanel();
	image = new Image(OKMBundleResources.INSTANCE.indicator());
	msg = new HTML("");
	space = new HTML("");

	hPanel.add(image);
	hPanel.add(msg);
	hPanel.add(space);

	hPanel.setCellVerticalAlignment(image, HasAlignment.ALIGN_MIDDLE);
	hPanel.setCellVerticalAlignment(msg, HasAlignment.ALIGN_MIDDLE);
	hPanel.setCellHorizontalAlignment(image, HasAlignment.ALIGN_CENTER);
	hPanel.setCellWidth(image, "30px");
	hPanel.setCellWidth(space, "7px");

	hPanel.setHeight("25px");

	msg.setStyleName("okm-NoWrap");

	super.hide();
	setWidget(hPanel);
}
 
Example 25
Project: document-management-system   File: FuturamaWalking.java   Source Code and License 6 votes vote down vote up
/**
 * FuturamaWalking
 */
public FuturamaWalking() {
	// Establishes auto-close when click outside
	super(false, false);
	left = -180;
	top = Window.getClientHeight() - 80 - 21;

	vPanel = new VerticalPanel();
	vPanel.setWidth("186px");
	vPanel.setHeight("80px");

	logo = new Image("img/eastereggs/futurama_walking.gif");
	vPanel.add(logo);

	setPopupPosition(left, top);

	hide();
	setWidget(vPanel);
}
 
Example 26
Project: document-management-system   File: Status.java   Source Code and License 6 votes vote down vote up
/**
 * Status
 */
public Status() {
	super(false, true);
	hPanel = new HorizontalPanel();
	image = new Image(OKMBundleResources.INSTANCE.indicator());
	msg = new HTML("");
	space = new HTML("");

	hPanel.add(image);
	hPanel.add(msg);
	hPanel.add(space);

	hPanel.setCellVerticalAlignment(image, HasAlignment.ALIGN_MIDDLE);
	hPanel.setCellVerticalAlignment(msg, HasAlignment.ALIGN_MIDDLE);
	hPanel.setCellHorizontalAlignment(image, HasAlignment.ALIGN_CENTER);
	hPanel.setCellWidth(image, "30px");
	hPanel.setCellWidth(space, "7px");

	hPanel.setHeight("25px");

	msg.setStyleName("okm-NoWrap");

	super.hide();
	setWidget(hPanel);
}
 
Example 27
Project: firefly   File: GridCmd.java   Source Code and License 6 votes vote down vote up
@Override
public Image createCmdImage() {

    VisIconCreator ic= VisIconCreator.Creator.getInstance();
    String iStr= this.getIconProperty();
    if (iStr!=null) {

        if (iStr.equals("grid.on.Icon"))  {
            return new Image(ic.getGridOn());
        }
        else if (iStr.equals("grid.off.Icon"))  {
            return new Image(ic.getGridOff());
        }
        else if (iStr.equals("grid.Icon"))  {
            return new Image(ic.getGridOff());
        }
    }
    return null;
}
 
Example 28
Project: sweng15   File: GWTModuleLoader.java   Source Code and License 6 votes vote down vote up
/**
 * Create main VerticalPanel, add it to the RootPanel and display a loading message
 */
private void buildLoadScreen() {
	// Create new main vertical panel to which all other GUI panels shall be added
	mainVerPanel = new VerticalPanel();

	// Add header image
	Image image = new Image();
	image.setUrl("/images/header.png");
	mainVerPanel.add(image);

	// Add loading label
	Label loadingLabel = new Label("Loading Application. Please wait...");
	mainVerPanel.add(loadingLabel);

	// Vertical Panel Settings
	mainVerPanel.setSpacing(25);

	// Insert the main vertical panel into a scroll panel to allow for scrolling
	ScrollPanel sp = new ScrollPanel();
	sp.add(mainVerPanel);

	// Add main vertical panel inside scroll panel to root panel
	RootPanel.get().add(sp);
}
 
Example 29
Project: blogwt   File: GalleryPart.java   Source Code and License 6 votes vote down vote up
/**
 * @param line
 */
public void addImageWithLine (String line) {
	if (line.length() > 0) {
		ConfigLine config = parseConfigLine(line);

		if (config.url != null && config.url.length() > 0) {
			Image image = new Image(config.url);

			if (config.name != null) {
				image.setTitle(config.name);
				image.setAltText(config.caption);
			}

			((HTMLPanel) this.getWidget()).add(image);

			if (config.caption != null) {
				((HTMLPanel) this.getWidget())
						.add(new HTMLPanel(SafeHtmlUtils.fromTrustedString(
								PostHelper.makeMarkup(config.caption))));
			}
		}
	}
}
 
Example 30
Project: unitime   File: WebTable.java   Source Code and License 6 votes vote down vote up
public IconCell(ImageResource resource, final String title, String text) {
	super(null);
	iIcon = new Image(resource);
	iIcon.setTitle(title);
	iIcon.setAltText(title);
	if (text != null && !text.isEmpty()) {
		iLabel = new HTML(text, false);
		iPanel = new HorizontalPanel();
		iPanel.setStyleName("icon");
		iPanel.add(iIcon);
		iPanel.add(iLabel);
		iIcon.getElement().getStyle().setPaddingRight(3, Unit.PX);
		iPanel.setCellVerticalAlignment(iIcon, HasVerticalAlignment.ALIGN_MIDDLE);
	}
	iIcon.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			event.stopPropagation();
			UniTimeConfirmationDialog.info(title);
		}
	});
}
 
Example 31
Project: unitime   File: SolverPage.java   Source Code and License 6 votes vote down vote up
public SolverStatus() {
	super("unitime-SolverStatus");
	iStatus = new P("status-label");
	iIcon = new Image(RESOURCES.helpIcon()); iIcon.addStyleName("status-icon");
	iIcon.setVisible(false);
	add(iStatus); add(iIcon);
	RPC.execute(new PageNameRpcRequest("Solver Status"), new AsyncCallback<PageNameInterface>() {
		@Override
		public void onFailure(Throwable caught) {}
		@Override
		public void onSuccess(final PageNameInterface result) {
			iIcon.setTitle(MESSAGES.pageHelp(result.getName()));
			iIcon.setVisible(true);
			iIcon.addClickHandler(new ClickHandler() {
				@Override
				public void onClick(ClickEvent event) {
					if (result.getHelpUrl() == null || result.getHelpUrl().isEmpty()) return;
					UniTimeFrameDialog.openDialog(MESSAGES.pageHelp(result.getName()), result.getHelpUrl());
				}
			});
		}
	});
}
 
Example 32
Project: ontobrowser   File: CodeListView.java   Source Code and License 6 votes vote down vote up
public CodeListView(EventBus eventBus, OntoBrowserServiceAsync service) {
	super(eventBus,service);
	
	Image emptyListWidget = new Image(ImageResources.INSTANCE.spinner());
	emptyListWidget.setStyleName("float-right");
	list.setEmptyListWidget(emptyListWidget);
	list.setKeyboardPagingPolicy(KeyboardPagingPolicy.CURRENT_PAGE);
	list.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED);
	list.setSelectionModel(selection);
	selection.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
		public void onSelectionChange(SelectionChangeEvent event) {
			Term selected = selection.getSelectedObject();
			if(selected != null) {
				History.newItem(selected.getReferenceId());
			}
		}
	});
			
	codelistContainer.add(list);
	
	initWidget(codelistContainer);
	addStyleName("padded-border vert-scroll");
	eventBus.addHandler(ViewTermEvent.TYPE, this);
}
 
Example 33
Project: gerrit   File: ProjectInfoScreen.java   Source Code and License 6 votes vote down vote up
private void addWidget(LabeledWidgetsGrid g, Widget w, ConfigParameterInfo param) {
  if (param.description() != null || param.warning() != null) {
    HorizontalPanel p = new HorizontalPanel();
    p.add(new Label(getDisplayName(param)));
    if (param.description() != null) {
      Image infoImg = new Image(Gerrit.RESOURCES.info());
      infoImg.setTitle(param.description());
      p.add(infoImg);
    }
    if (param.warning() != null) {
      Image warningImg = new Image(Gerrit.RESOURCES.warning());
      warningImg.setTitle(param.warning());
      p.add(warningImg);
    }
    p.add(new Label(":"));
    g.add(p, w);
  } else {
    g.add(getDisplayName(param), w);
  }
}
 
Example 34
Project: sandbox-frame   File: ProjectViewImpl.java   Source Code and License 6 votes vote down vote up
@Override
public void setPlatforms(List<Platform> platforms) {
    for (int i=0;i<platforms.size();i++) {
        Platform platform = platforms.get(i);
        Image image = new Image(Utils.getPlatformIcon(platform));
        image.setTitle(Utils.getPlatformText(platform));
        image.getElement().getStyle().setVerticalAlign(VerticalAlign.MIDDLE);
        Label label = new Label(Utils.getPlatformText(platform));
        platformsPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
        platformsPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
        platformsPanel.add(image);
        platformsPanel.setCellWidth(image, "32px");
        platformsPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
        platformsPanel.add(label);
        if (i < platforms.size()-1) {
            label.getElement().getStyle().setPaddingRight(10, Unit.PX);
        }
        label.getElement().getStyle().setPaddingLeft(8, Unit.PX);
    }
}
 
Example 35
Project: fullmetalgalaxy   File: MAppPresences.java   Source Code and License 6 votes vote down vote up
@Override
public void onChannelMessage(Object p_message)
{
  // redraw widget according to new presenceRoom
  PresenceRoom newPresenceRoom = (PresenceRoom)p_message;
  m_panel.clear();
  Set<String> pseudoList = new HashSet<String>();
  for( Presence presence : newPresenceRoom )
  {
    if( !pseudoList.contains( presence.getPseudo() ) )
    {
      pseudoList.add( presence.getPseudo() );
      Panel panel = new HorizontalPanel();
      Image image = new Image( presence.getAvatarUrl() );
      image.setPixelSize( 32, 32 );
      image.setAltText( presence.getPseudo() );
      image.setTitle( presence.getPseudo() );
      panel.add( image );
      panel.add( new Label(presence.getPseudo()) );
      m_panel.add( panel );
    }
  }
}
 
Example 36
Project: gerrit   File: ProjectsTable.java   Source Code and License 6 votes vote down vote up
protected void populateState(int row, ProjectInfo k) {
  Image state = new Image();
  switch (k.state()) {
    case HIDDEN:
      state.setResource(Gerrit.RESOURCES.redNot());
      state.setTitle(com.google.gerrit.client.admin.Util.toLongString(k.state()));
      table.setWidget(row, ProjectsTable.C_STATE, state);
      break;
    case READ_ONLY:
      state.setResource(Gerrit.RESOURCES.readOnly());
      state.setTitle(com.google.gerrit.client.admin.Util.toLongString(k.state()));
      table.setWidget(row, ProjectsTable.C_STATE, state);
      break;
    case ACTIVE:
    default:
      // Intentionally left blank, do not show an icon when active.
      break;
  }
}
 
Example 37
Project: sandbox-frame   File: ProjectBundleViewImpl.java   Source Code and License 6 votes vote down vote up
@Override
public void setFeatures(List<Feature> features) {
    for (int i=0;i<features.size();i++) {
        Feature feature = features.get(i);
        Image image = new Image(Utils.getFeatureIcon(feature));
        image.setTitle(Utils.getFeatureText(feature));
        image.getElement().getStyle().setVerticalAlign(VerticalAlign.MIDDLE);
        Label label = new Label(Utils.getFeatureText(feature));
        featuresPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
        featuresPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
        featuresPanel.add(image);
        featuresPanel.setCellWidth(image, "32px");
        featuresPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
        featuresPanel.add(label);
        if (i < features.size()-1) {
            label.getElement().getStyle().setPaddingRight(10, Unit.PX);
        }
        label.getElement().getStyle().setPaddingLeft(8, Unit.PX);
        
    }
}
 
Example 38
Project: gerrit   File: ProjectInfoScreen.java   Source Code and License 6 votes vote down vote up
private CheckBox renderCheckBox(LabeledWidgetsGrid g, ConfigParameterInfo param) {
  CheckBox checkBox = new CheckBox(getDisplayName(param));
  checkBox.setValue(Boolean.parseBoolean(param.value()));
  HorizontalPanel p = new HorizontalPanel();
  p.add(checkBox);
  if (param.description() != null) {
    Image infoImg = new Image(Gerrit.RESOURCES.info());
    infoImg.setTitle(param.description());
    p.add(infoImg);
  }
  if (param.warning() != null) {
    Image warningImg = new Image(Gerrit.RESOURCES.warning());
    warningImg.setTitle(param.warning());
    p.add(warningImg);
  }
  g.add((String) null, p);
  saveEnabler.listenTo(checkBox);
  return checkBox;
}
 
Example 39
Project: unitime   File: WebTable.java   Source Code and License 6 votes vote down vote up
public IconsCell add(ImageResource resource, final String title) {
	if (resource == null) return this;
	Image icon = new Image(resource);
	icon.setTitle(title);
	icon.setAltText(title);
	if (iPanel.getWidgetCount() > 0)
		icon.getElement().getStyle().setPaddingLeft(3, Unit.PX);
	iPanel.add(icon);
	iPanel.setCellVerticalAlignment(icon, HasVerticalAlignment.ALIGN_MIDDLE);
	if (title != null && !title.isEmpty()) {
		icon.addClickHandler(new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				event.stopPropagation();
				UniTimeConfirmationDialog.info(title);
			}
		});
	}
	return this;
}
 
Example 40
Project: unitime   File: PageLabelImpl.java   Source Code and License 6 votes vote down vote up
public PageLabelImpl() {
       iName = new P("text");
       
	iHelp = new Image(RESOURCES.help());
	iHelp.addStyleName("icon");
	iHelp.setVisible(false);
	
	add(iName);
	add(iHelp);
	
	iHelp.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			if (iUrl == null || iUrl.isEmpty()) return;
			UniTimeFrameDialog.openDialog(MESSAGES.pageHelp(getText()), iUrl);
		}
	});
}
 
Example 41
Project: scheduling-portal   File: VisualizationViewImage.java   Source Code and License 6 votes vote down vote up
void draw() {
    int bw = 40 + icow;
    this.failedRect = overlay.new Rect(x + w - bw + 1 - icod, y, bw + 2, h, 5);
    this.failedRect.attr("fill", "90-#f3decb-#eeeeee");
    this.failedRect.attr("stroke", "#f49987");
    this.failedRect.hide();

    this.runningRect = overlay.new Rect(x - 1, y + 24, w, 45, 5);
    this.runningRect.attr("stroke", "green");
    this.runningRect.hide();

    String runningImgUrl = SchedulerImages.instance.running_24().getSafeUri().asString();
    String finishedImgUrl = SchedulerImages.instance.finished_14().getSafeUri().asString();
    String failedImgUrl = SchedulerImages.instance.cancel_14().getSafeUri().asString();

    this.runningImg = overlay.new Image(runningImgUrl, x + w - icow2 - 4, y + yRunningOff, icow2, icow2);
    this.runningImg.hide();
    this.finishedImg = overlay.new Image(finishedImgUrl, x + w - icow - 4 - icod, y + yFinishedOff, icow, icow);
    this.finishedImg.hide();
    this.failedImg = overlay.new Image(failedImgUrl, x + w - icow - 4 - icod, y + yFailedOff, icow, icow);
    this.failedImg.hide();
}
 
Example 42
Project: djvu-html5   File: DataStore.java   Source Code and License 6 votes vote down vote up
private CanvasElement prepareMissingTileImage() {
	int tileSize = DjvuContext.getTileSize();
	CanvasElement canvas = createImage(tileSize, tileSize);
	Context2d context2d = canvas.getContext2d();
	context2d.setFillStyle("white");
	context2d.fillRect(0, 0, canvas.getWidth(), canvas.getHeight());
	Image image = new Image();
	final ImageElement imageElement = image.getElement().cast();
	imageElement.getStyle().setProperty("visibility", "hidden");
	Event.setEventListener(imageElement, event -> {
		if (Event.ONLOAD == event.getTypeInt()) {
			missingTileImage.getContext2d().drawImage(imageElement, 0, 0);
			RootPanel.get().getElement().removeChild(imageElement);
		}
	});
	RootPanel.get().getElement().appendChild(imageElement);
	image.setUrl(getBlankImageUrl());
	return canvas;
}
 
Example 43
Project: firefly   File: SelectAreaCmd.java   Source Code and License 6 votes vote down vote up
@Override
public Image createCmdImage() {

    VisIconCreator ic= VisIconCreator.Creator.getInstance();
    String iStr= this.getIconProperty();
    if (iStr!=null) {

        if (iStr.equals("SelectArea.on.Icon"))  {
            return new Image(ic.getSelectAreaOn());
        }
        else if (iStr.equals("SelectArea.off.Icon"))  {
            return new Image(ic.getSelectAreaOff());
        }
        else if (iStr.equals("SelectArea.Icon"))  {
            return new Image(ic.getSelectAreaOff());
        }
    }
    return null;
}
 
Example 44
Project: unitime   File: TimePreferenceCell.java   Source Code and License 6 votes vote down vote up
@Override
public void refresh() {
	clear();
	RoomCookie cookie = RoomCookie.getInstance();
	if (iPattern != null && !iPattern.isEmpty() && !cookie.isGridAsText()) {
		final Image availability = new Image(GWT.getHostPageBaseURL() + "pattern?pref=" + iPattern + "&v=" + (cookie.areRoomsHorizontal() ? "0" : "1") + (cookie.hasMode() ? "&s=" + cookie.getMode() : ""));
		availability.setStyleName("grid");
		add(availability);
	} else {
		for (PreferenceInfo p: iPreferences) {
			P prf = new P("prf");
			prf.setText(p.getOwnerName());
			PreferenceInterface preference = iProperties.getPreference(p.getPreference());
			if (preference != null) {
				prf.getElement().getStyle().setColor(preference.getColor());
				prf.setTitle(preference.getName() + " " + p.getOwnerName());
			}
			add(prf);
		}
	}
}
 
Example 45
Project: firefly   File: ActivePointToolCmd.java   Source Code and License 6 votes vote down vote up
@Override
public Image createCmdImage() {

    VisIconCreator ic= VisIconCreator.Creator.getInstance();
    String iStr= this.getIconProperty();
    if (iStr!=null) {

        if (iStr.equals(_onIcon))  {
            return new Image(ic.getDistanceOn());
        }
        else if (iStr.equals(_offIcon))  {
            return new Image(ic.getDistanceOff());
        }
        else if (iStr.equals(CommandName+".Icon"))  {
            return new Image(ic.getDistanceOff());
        }
    }
    return null;
}
 
Example 46
Project: gerrit   File: WebLinkInfo.java   Source Code and License 6 votes vote down vote up
public final Anchor toAnchor() {
  Anchor a = new Anchor();
  a.setHref(url());
  if (target() != null && !target().isEmpty()) {
    a.setTarget(target());
  }
  if (imageUrl() != null && !imageUrl().isEmpty()) {
    Image img = new Image();
    img.setAltText(name());
    img.setUrl(imageUrl());
    img.setTitle(name());
    a.getElement().appendChild(img.getElement());
  } else {
    a.setText("(" + name() + ")");
  }
  return a;
}
 
Example 47
Project: unitime   File: WebTable.java   Source Code and License 6 votes vote down vote up
public NoteCell(String text, final String title) {
	super(null);
	if (Window.getClientWidth() <= 800 && title != null && !title.isEmpty()) {
		iIcon = new Image(RESOURCES.note());
		iIcon.setTitle(title);
		iIcon.setAltText(title);
		iIcon.addClickHandler(new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				event.stopPropagation();
				UniTimeConfirmationDialog.info(title);
			}
		});
	} else {
		iNote = new P("unitime-Note");
		iNote.setHTML(text);
		if (title != null) iNote.setTitle(title);
	}
}
 
Example 48
Project: firefly   File: TileDrawer.java   Source Code and License 6 votes vote down vote up
public void onLoad(LoadEvent ev) {
    final Image imw = (Image) ev.getSource();
    Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
        public void execute() {
            if (_imageWidget.getWidgetIndex(imw) > -1) {
                imw.setPixelSize(_tile._width, _tile._height);
                ViewPortPt addPt= _plot.getViewPortCoords(new ScreenPt(_tile._x, _tile._y));
                _imageWidget.setWidgetPosition(imw, addPt.getIX(), addPt.getIY());
                if (!_firstReloadComplete) {
                    onFirstLoadComplete();
                    _firstReloadComplete = true;
                }
            }
        }
    });
}
 
Example 49
Project: sc2gears   File: ApiUser.java   Source Code and License 6 votes vote down vote up
private static DialogBox createWaitingDialog( final String message ) {
	final DialogBox dialogBox = new DialogBox();
	dialogBox.setText( "Info" );
	
	final HorizontalPanel hp = new HorizontalPanel();
	DOM.setStyleAttribute( hp.getElement(), "padding", "20px" );
	hp.setHeight( "20px" );
	hp.add( new Image( "/images/loading.gif" ) );
	hp.add( ClientUtils.createHorizontalEmptyWidget( 5 ) );
	hp.add( new Label( message ) );
	dialogBox.setWidget( hp );
	
	dialogBox.center();
	
	return dialogBox;
}
 
Example 50
Project: sc2gears   File: User.java   Source Code and License 6 votes vote down vote up
private static DialogBox createWaitingDialog( final String message ) {
	final DialogBox dialogBox = new DialogBox();
	dialogBox.setText( "Info" );
	
	final HorizontalPanel hp = new HorizontalPanel();
	DOM.setStyleAttribute( hp.getElement(), "padding", "20px" );
	hp.setHeight( "20px" );
	hp.add( new Image( "/images/loading.gif" ) );
	hp.add( ClientUtils.createHorizontalEmptyWidget( 5 ) );
	hp.add( new Label( message ) );
	dialogBox.setWidget( hp );
	
	dialogBox.center();
	
	return dialogBox;
}
 
Example 51
Project: fullmetalgalaxy   File: WgtBoardLayerLocked.java   Source Code and License 6 votes vote down vote up
private Image addImage()
{
  AbstractImagePrototype imageprototype = AbstractImagePrototype.create( Icons.s_instance
      .strategy_padlock() );
  if( GameEngine.model().getZoomDisplayed().getValue() == EnuZoom.Medium )
  {
    imageprototype = AbstractImagePrototype.create( Icons.s_instance.tactic_padlock() );
  }
  Image image = null;
  if( !m_unusedImages.isEmpty() )
  {
    image = m_unusedImages.iterator().next();
    imageprototype.applyTo( image );
    image.setVisible( true );
    m_unusedImages.remove( image );
  }
  else
  {
    image = imageprototype.createImage();
    add( image );
    DOM.setStyleAttribute( image.getElement(), "zIndex", "1000" );
    image.addStyleName( "transparent50" );
  }
  m_usedImages.add( image );
  return image;
}
 
Example 52
Project: empiria.player   File: SourceListViewItemContentFactory.java   Source Code and License 5 votes vote down vote up
public IsWidget createSourceListContentWidget(SourcelistItemType type, String content, InlineBodyGeneratorSocket inlineBodyGeneratorSocket) {
    switch (type) {
        case IMAGE:
            return new Image(content);
        case TEXT:
            return new Label(content);
        case COMPLEX_TEXT:
            Node node = getNode(content);
            return inlineBodyGeneratorSocket.generateInlineBody(node);
    }

    return new Widget();
}
 
Example 53
Project: empiria.player   File: ContentPreloader.java   Source Code and License 5 votes vote down vote up
public void setPreloader() {
    RootPanel preloaderWidget = rootPanelDelegate.getRootPanel(MAIN_PRELOADER_ID);
    if (preloaderWidget == null) {
        ImageResource progressImage = progressBundle.getProgressImage();
        mainPreloader = new Image(progressImage);
    } else {
        mainPreloader = Image.wrap(preloaderWidget.getElement());
    }
    RootPanel rootPanel = rootPanelDelegate.getRootPanel();
    rootPanel.add(mainPreloader);

    int halfWidth = windowDelegate.getClientWidth() / 2;
    int halfHeight = windowDelegate.getClientHeight() / 2;
    centerMainPreloader(halfWidth, halfHeight, mainPreloader.getElement());
}
 
Example 54
Project: DrowGutt   File: CanvasWidget.java   Source Code and License 5 votes vote down vote up
public void drawImage2(final String url, final Double offsetX,
                       final Double offsetY, final Double imageWidth,
                       final Double imageHeight) {
    ctx.drawImage(ImageElement.as(new Image(url).getElement()),
            offsetX, offsetY, imageWidth, imageHeight);

}
 
Example 55
Project: DrowGutt   File: CanvasWidget.java   Source Code and License 5 votes vote down vote up
public void drawImage3(final String url, final Double sourceX,
                       final Double sourceY, final Double sourceWidth,
                       final Double sourceHeight, final Double destX,
                       final Double destY, final Double destWidth,
                       final Double destHeight) {
    ctx.drawImage(ImageElement.as(new Image(url).getElement()),
            sourceX, sourceY, sourceWidth, sourceHeight,
            destX, destY, destWidth, destHeight);
}
 
Example 56
Project: unitimes   File: InstructorsTable.java   Source Code and License 5 votes vote down vote up
protected Widget getCell(final InstructorInterface instructor, final InstructorsColumn column, final int idx) {
	switch (column) {
	case ID:
		if (instructor.getExternalId() == null) {
			Image warning = new Image(RESOURCES.warning());
			warning.setTitle(MESSAGES.warnInstructorHasNoExternalId(instructor.getFormattedName()));
			return warning;
		} else {
			return new Label(instructor.getExternalId());
		}
	case NAME:
		return new Label(instructor.getFormattedName());
	case POSITION:
		return new Label(instructor.getPosition() == null ? "" : instructor.getPosition().getLabel());
	case TEACHING_PREF:
		if (instructor.getTeachingPreference() == null) {
			return new Label("");
		} else {
			Label pref = new Label(instructor.getTeachingPreference().getName());
			if (instructor.getTeachingPreference().getColor() != null)
				pref.getElement().getStyle().setColor(instructor.getTeachingPreference().getColor());
			return pref;
		}
	case MAX_LOAD:
		return new Label(instructor.hasMaxLoad() ? NumberFormat.getFormat(CONSTANTS.teachingLoadFormat()).format(instructor.getMaxLoad()) : "");
	case SELECTION:
		return new SelectableCell(instructor);
	case ATTRIBUTES:
		AttributeTypeInterface type = iProperties.getAttributeTypes().get(idx);
		List<AttributeInterface> attributes = instructor.getAttributes(type);
		if (!attributes.isEmpty() && !isColumnVisible(getCellIndex(column) + idx)) {
			setColumnVisible(getCellIndex(column) + idx, true);
		}
		return new AttributesCell(attributes);
	default:
		return null;
	}
}
 
Example 57
Project: unitimes   File: SimpleEditPage.java   Source Code and License 5 votes vote down vote up
private void setDetailsVisible(Long recordId, boolean show) {
	if (!hasDetails()) return;
	for (int i = 0; i < iTable.getRowCount(); i++) {
		Record r = iTable.getData(i);
		if (r == null) continue;
		if (r.getUniqueId().equals(recordId)) {
			Image details = (Image)((MyCell)iTable.getWidget(i, 0)).getInnerWidget();
			details.setResource(show ? RESOURCES.treeOpen() : RESOURCES.treeClosed());
			r.setField(0, show ? "-" : "+");
		} else if (String.valueOf(recordId).equals(r.getField(0))) {
			iTable.getRowFormatter().setVisible(i, show);
		}
	}
	saveOrder();
}
 
Example 58
Project: unitimes   File: CurriculumEdit.java   Source Code and License 5 votes vote down vote up
Check(boolean value, String onMessage, String offMessage) {
	Image image = new Image(value ? RESOURCES.on() : RESOURCES.off());
	image.addStyleName("image");
	add(image);
	InlineHTML text = new InlineHTML(value ? onMessage : offMessage);
	text.addStyleName("message");
	add(text);
	if (value)
		addStyleName("check-enabled");
	else
		addStyleName("check-disabled");
}
 
Example 59
Project: unitimes   File: RoomsTable.java   Source Code and License 5 votes vote down vote up
protected P getPopupWidget() {
	if (iPopupWidget == null) {
		iPopupWidget = new P("unitime-RoomPictureHint");
		Image image = new Image(GWT.getHostPageBaseURL() + "picture?id=" + iPicture.getUniqueId());
		image.setStyleName("picture");
		iPopupWidget.add(image);
		P caption = new P("caption");
		caption.setText(iPicture.getName() + (iPicture.getPictureType() == null ? "" : " (" + iPicture.getPictureType().getAbbreviation() + ")"));
		iPopupWidget.add(caption);
	}
	return iPopupWidget;
}
 
Example 60
Project: unitimes   File: RoomsTable.java   Source Code and License 5 votes vote down vote up
LinkCell(RoomPictureInterface picture) {
super(new Image(RESOURCES.download()), GWT.getHostPageBaseURL() + "picture?id=" + picture.getUniqueId());
setStyleName("link");
setTitle(picture.getName() + (picture.getPictureType() == null ? "" : " (" + picture.getPictureType().getLabel() + ")"));
setText(picture.getName() + (picture.getPictureType() == null ? "" : " (" + picture.getPictureType().getAbbreviation() + ")"));
      setTarget("_blank");
      sinkEvents(Event.ONCLICK);
  }