com.vaadin.ui.Embedded Java Examples

The following examples show how to use com.vaadin.ui.Embedded. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ImagePreviewCropWindow.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
private void displayPreviewImage() {
    previewPhoto.removeAllComponents();
    if (scaleImageData != null && scaleImageData.length > 0) {
        Embedded previewImage = new Embedded(null, new ByteArrayImageResource(scaleImageData, "image/png"));
        previewImage.setWidth("100px");
        previewPhoto.addComponent(previewImage);
    } else {
        previewPhoto.addComponent(ELabel.fontIcon(VaadinIcons.QUESTION_CIRCLE).withStyleName("icon-48px").withUndefinedWidth());
    }
}
 
Example #2
Source File: ListPane.java    From jdal with Apache License 2.0 5 votes vote down vote up
public MenuItem(ComponentHolder holder) {
	HorizontalLayout layout = new HorizontalLayout();
	layout.setSpacing(true);
	setContent(layout);
	Embedded e = new Embedded("", holder.getIcon());
	layout.addComponent(e);
	Label l = new Label(holder.getName());
	l.setStyleName(Reindeer.LABEL_H2);
	layout.addComponent(l);
	layout.setComponentAlignment(l, Alignment.BOTTOM_LEFT);
	layout.setComponentAlignment(e, Alignment.BOTTOM_LEFT);
	setStyleName("menuItem");
	this.component = holder.getComponent();
}
 
Example #3
Source File: XacmlAdminConsole.java    From XACML with MIT License 4 votes vote down vote up
@AutoGenerated
private HorizontalLayout buildHorizontalLayout_1() {
	// common part: create layout
	horizontalLayout_1 = new HorizontalLayout();
	horizontalLayout_1.setImmediate(false);
	horizontalLayout_1.setWidth("100.0%");
	horizontalLayout_1.setHeight("40px");
	horizontalLayout_1.setMargin(false);
	
	// embedded_1
	embedded_1 = new Embedded();
	embedded_1.setImmediate(false);
	embedded_1.setWidth("30px");
	embedded_1.setHeight("30px");
	embedded_1.setSource(new ThemeResource("img/att.png"));
	embedded_1.setType(1);
	embedded_1.setMimeType("image/png");
	horizontalLayout_1.addComponent(embedded_1);
	horizontalLayout_1.setComponentAlignment(embedded_1, new Alignment(33));
	
	// caption
	caption = new Label();
	caption.setImmediate(false);
	caption.setWidth("-1px");
	caption.setHeight("-1px");
	caption.setValue("AT&T Policy Engine Admin Console");
	horizontalLayout_1.addComponent(caption);
	horizontalLayout_1.setExpandRatio(caption, 1.0f);
	horizontalLayout_1.setComponentAlignment(caption, new Alignment(33));
	
	// labelWelcome
	labelWelcome = new Label();
	labelWelcome.setImmediate(false);
	labelWelcome.setWidth("-1px");
	labelWelcome.setHeight("40px");
	labelWelcome.setValue("Label");
	horizontalLayout_1.addComponent(labelWelcome);
	horizontalLayout_1.setComponentAlignment(labelWelcome,
			new Alignment(34));
	
	return horizontalLayout_1;
}