本文整理汇总了Java中com.vaadin.ui.Embedded类的典型用法代码示例。如果您正苦于以下问题:Java Embedded类的具体用法?Java Embedded怎么用?Java Embedded使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Embedded类属于com.vaadin.ui包,在下文中一共展示了Embedded类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: FileExample
import com.vaadin.ui.Embedded; //导入依赖的package包/类
public FileExample() {
setCaption("Interactive SVG");
addComponent(new MLabel(
"A simple example from an svg file using Embedded component. Unlike with Image component, the SVGs JS etc are active. The example also demonstrates how to provide a trivial server side integration API for the SVG."));
Embedded svg = new Embedded();
svg.setWidth("400px");
svg.setHeight("400px");
svg.setSource(new ClassResource("/pull.svg"));
// Expose a JS hook that pull.svg file calls when clicked
JavaScript.getCurrent().addFunction("callMyVaadinFunction", (JsonArray arguments) -> {
Notification.show("Message from SVG:" + arguments.getString(0));
});
addComponent(svg);
}
开发者ID:mstahv,项目名称:svgexamples,代码行数:17,代码来源:FileExample.java
示例2: AccountSelectionPopup
import com.vaadin.ui.Embedded; //导入依赖的package包/类
public AccountSelectionPopup(String title) {
super(title); // builds up UI
setWidth(600, UNITS_PIXELS);
setHeight(400, UNITS_PIXELS);
this.i18nManager = ExplorerApp.get().getI18nManager();
// TODO: components are eager loaded. For performance they should be lazy loaded (eg through factory)
// Imap
initImapComponent();
String imap = i18nManager.getMessage(Messages.PROFILE_ACCOUNT_IMAP);
addSelectionItem(new Embedded(null, Images.IMAP), imap, imapForm, imapClickListener);
// Alfresco
initAlfrescoComponent();
addSelectionItem(new Embedded(null, Images.ALFRESCO),
i18nManager.getMessage(Messages.PROFILE_ACCOUNT_ALFRESCO),
alfrescoForm, alfrescoClickListener);
selectionTable.select(imap);
}
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:22,代码来源:AccountSelectionPopup.java
示例3: initPicture
import com.vaadin.ui.Embedded; //导入依赖的package包/类
protected void initPicture(IdentityService identityService, boolean renderPicture, final String userName) {
if(renderPicture) {
Picture picture = identityService.getUserPicture(userName);
if(picture != null) {
Resource imageResource = new StreamResource(new InputStreamStreamSource(picture.getInputStream()),
userName + picture.getMimeType(), ExplorerApp.get());
Embedded image = new Embedded(null, imageResource);
image.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
image.setType(Embedded.TYPE_IMAGE);
image.setHeight(30, Embedded.UNITS_PIXELS);
image.setWidth(30, Embedded.UNITS_PIXELS);
image.addListener(new MouseEvents.ClickListener() {
private static final long serialVersionUID = 7341560240277898495L;
public void click(com.vaadin.event.MouseEvents.ClickEvent event) {
viewManager.showProfilePopup(userName);
}
});
addComponent(image);
setComponentAlignment(image, Alignment.MIDDLE_LEFT);
} else {
// TODO: what when no image is available?
}
}
}
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:27,代码来源:UserProfileLink.java
示例4: getDetailComponent
import com.vaadin.ui.Embedded; //导入依赖的package包/类
public Component getDetailComponent(Attachment attachment) {
VerticalLayout verticalLayout = new VerticalLayout();
verticalLayout.setSpacing(true);
verticalLayout.setMargin(true);
verticalLayout.addComponent(new Label(attachment.getDescription()));
HorizontalLayout linkLayout = new HorizontalLayout();
linkLayout.setSpacing(true);
verticalLayout.addComponent(linkLayout);
// Icon
linkLayout.addComponent(new Embedded(null, Images.RELATED_CONTENT_URL));
// Link
Link link = new Link(attachment.getUrl(), new ExternalResource(attachment.getUrl()));
link.setTargetName(ExplorerLayout.LINK_TARGET_BLANK);
linkLayout.addComponent(link);
return verticalLayout;
}
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:22,代码来源:UrlAttachmentRenderer.java
示例5: addProcessImage
import com.vaadin.ui.Embedded; //导入依赖的package包/类
protected void addProcessImage() {
ProcessDefinitionEntity processDefinitionEntity = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService)
.getDeployedProcessDefinition(processDefinition.getId());
// Only show when graphical notation is defined
if (processDefinitionEntity != null && processDefinitionEntity.isGraphicalNotationDefined()) {
Label header = new Label(i18nManager.getMessage(Messages.PROCESS_HEADER_DIAGRAM));
header.addStyleName(ExplorerLayout.STYLE_H3);
header.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK);
header.addStyleName(ExplorerLayout.STYLE_NO_LINE);
panelLayout.addComponent(header);
StreamResource diagram = new ProcessDefinitionImageStreamResourceBuilder()
.buildStreamResource(processInstance, repositoryService, runtimeService);
Embedded embedded = new Embedded(null, diagram);
embedded.setType(Embedded.TYPE_IMAGE);
panelLayout.addComponent(embedded);
}
}
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:21,代码来源:ProcessInstanceDetailPanel.java
示例6: createList
import com.vaadin.ui.Embedded; //导入依赖的package包/类
@Override
protected Table createList() {
final Table tableList = new Table();
// Listener to change right panel when clicked on a task
tableList.addListener(new Property.ValueChangeListener() {
private static final long serialVersionUID = 8811553575319455854L;
public void valueChange(ValueChangeEvent event) {
// The itemId of the table list is the tableName
String tableName = (String) event.getProperty().getValue();
setDetailComponent(new DatabaseDetailPanel(tableName));
// Update URL
ExplorerApp.get().setCurrentUriFragment(
new UriFragment(DatabaseNavigator.TABLE_URI_PART, tableName));
}
});
// Create column headers
tableList.addContainerProperty("icon", Embedded.class, null);
tableList.setColumnWidth("icon", 22);
tableList.addContainerProperty("tableName", String.class, null);
tableList.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
return tableList;
}
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:27,代码来源:DatabasePage.java
示例7: addTableName
import com.vaadin.ui.Embedded; //导入依赖的package包/类
protected void addTableName() {
HorizontalLayout header = new HorizontalLayout();
header.setWidth(100, UNITS_PERCENTAGE);
header.addStyleName(ExplorerLayout.STYLE_TITLE_BLOCK);
header.setSpacing(true);
// TODO: use right image
Embedded image = new Embedded(null, Images.DATABASE_50);
header.addComponent(image);
header.setComponentAlignment(image, Alignment.MIDDLE_LEFT);
header.setMargin(false, false, true, false);
Label name = new Label(tableName);
name.addStyleName(Reindeer.LABEL_H2);
header.addComponent(name);
header.setExpandRatio(name, 1.0f);
header.setComponentAlignment(name, Alignment.MIDDLE_LEFT);
addDetailComponent(header);
Label spacer = new Label();
spacer.setWidth(100, UNITS_PERCENTAGE);
spacer.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK);
addDetailComponent(spacer);
}
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:26,代码来源:DatabaseDetailPanel.java
示例8: GroupItem
import com.vaadin.ui.Embedded; //导入依赖的package包/类
public GroupItem(final Group group) {
Button idButton = new Button(group.getId());
idButton.addStyleName(Reindeer.BUTTON_LINK);
idButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
ExplorerApp.get().getViewManager().showGroupPage(group.getId());
}
});
addItemProperty("id", new ObjectProperty<Button>(idButton, Button.class));
if (group.getName() != null) {
addItemProperty("name", new ObjectProperty<String>(group.getName(), String.class));
}
if (group.getType() != null) {
addItemProperty("type", new ObjectProperty<String>(group.getType(), String.class));
}
Embedded deleteIcon = new Embedded(null, Images.DELETE);
deleteIcon.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
deleteIcon.addListener(new DeleteMembershipListener(identityService, userId, group.getId(), userDetailPanel));
addItemProperty("actions", new ObjectProperty<Embedded>(deleteIcon, Embedded.class));
}
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:23,代码来源:GroupsForUserQuery.java
示例9: initPageTitle
import com.vaadin.ui.Embedded; //导入依赖的package包/类
protected void initPageTitle() {
HorizontalLayout layout = new HorizontalLayout();
layout.setWidth(100, UNITS_PERCENTAGE);
layout.setSpacing(true);
layout.setMargin(false, false, true, false);
layout.addStyleName(ExplorerLayout.STYLE_TITLE_BLOCK);
addDetailComponent(layout);
Embedded userImage = new Embedded(null, Images.USER_50);
layout.addComponent(userImage);
Label userName = new Label(user.getFirstName() + " " + user.getLastName());
userName.setSizeUndefined();
userName.addStyleName(Reindeer.LABEL_H2);
layout.addComponent(userName);
layout.setComponentAlignment(userName, Alignment.MIDDLE_LEFT);
layout.setExpandRatio(userName, 1.0f);
}
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:19,代码来源:UserDetailPanel.java
示例10: initPageTitle
import com.vaadin.ui.Embedded; //导入依赖的package包/类
protected void initPageTitle() {
HorizontalLayout layout = new HorizontalLayout();
layout.setWidth(100, UNITS_PERCENTAGE);
layout.addStyleName(ExplorerLayout.STYLE_TITLE_BLOCK);
layout.setSpacing(true);
layout.setMargin(false, false, true, false);
addDetailComponent(layout);
Embedded groupImage = new Embedded(null, Images.GROUP_50);
layout.addComponent(groupImage);
Label groupName = new Label(getGroupName(group));
groupName.setSizeUndefined();
groupName.addStyleName(Reindeer.LABEL_H2);
layout.addComponent(groupName);
layout.setComponentAlignment(groupName, Alignment.MIDDLE_LEFT);
layout.setExpandRatio(groupName, 1.0f);
}
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:19,代码来源:GroupDetailPanel.java
示例11: populateSubTasks
import com.vaadin.ui.Embedded; //导入依赖的package包/类
protected void populateSubTasks(List<HistoricTaskInstance> subTasks) {
for (final HistoricTaskInstance subTask : subTasks) {
// icon
Embedded icon = new Embedded(null, Images.TASK_22);
icon.setWidth(22, UNITS_PIXELS);
icon.setWidth(22, UNITS_PIXELS);
subTaskGrid.addComponent(icon);
// Link to subtask
Button subTaskLink = new Button(subTask.getName());
subTaskLink.addStyleName(Reindeer.BUTTON_LINK);
subTaskLink.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
ExplorerApp.get().getViewManager().showTaskPage(subTask.getId());
}
});
subTaskGrid.addComponent(subTaskLink);
subTaskGrid.setComponentAlignment(subTaskLink, Alignment.MIDDLE_LEFT);
}
}
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:21,代码来源:HistoricTaskDetailPanel.java
示例12: initRelatedContentTable
import com.vaadin.ui.Embedded; //导入依赖的package包/类
protected Table initRelatedContentTable() {
Table table = new Table();
table.setWidth(100, UNITS_PERCENTAGE);
table.addStyleName(ExplorerLayout.STYLE_RELATED_CONTENT_LIST);
// Invisible by default, only shown when attachments are present
table.setVisible(false);
table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
table.addContainerProperty("type", Embedded.class, null);
table.setColumnWidth("type", 16);
table.addContainerProperty("name", Component.class, null);
relatedContentLayout.addComponent(table);
return table;
}
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:17,代码来源:HistoricTaskDetailPanel.java
示例13: addAttachmentsToTable
import com.vaadin.ui.Embedded; //导入依赖的package包/类
protected void addAttachmentsToTable(List<Attachment> attachments) {
for (Attachment attachment : attachments) {
AttachmentRenderer renderer = attachmentRendererManager.getRenderer(attachment);
Item attachmentItem = table.addItem(attachment.getId());
attachmentItem.getItemProperty("name").setValue(renderer.getOverviewComponent(attachment, this));
attachmentItem.getItemProperty("type").setValue(new Embedded(null, renderer.getImage(attachment)));
Embedded deleteButton = new Embedded(null, Images.DELETE);
deleteButton.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
deleteButton.addListener((ClickListener) new DeleteClickedListener(attachment));
attachmentItem.getItemProperty("delete").setValue(deleteButton);
}
if(table.getItemIds().size() > 0) {
table.setVisible(true);
}
table.setPageLength(table.size());
}
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:19,代码来源:TaskRelatedContentComponent.java
示例14: LebAnzeigen
import com.vaadin.ui.Embedded; //导入依赖的package包/类
public LebAnzeigen(FossaApplication app, SchuelerLaso schueler, KlasseLaso klasse) throws DocumentException, IOException {
super(app);
setCaption(" - Lernentwicklungsbericht anzeigen - ");
VerticalLayout layout = new VerticalLayout();
setWidth("800px");
setContent(layout);
layout.setSpacing(true);
Embedded embeddedPdf = new Embedded();
embeddedPdf.setType(Embedded.TYPE_BROWSER);
DateFormat dateFormat = new SimpleDateFormat("ddMMyy-HHmmss");
String dateiname = "Klasse" + klasse.getKlassenname() + "_" + schueler.getVorname() + "_" + schueler.getName() + "_" + dateFormat.format(new Date()) + ".pdf";
embeddedPdf.setSource(new LebCreator(app, schueler, klasse, dateiname).getLebResource());
embeddedPdf.setWidth(100, Sizeable.UNITS_PERCENTAGE);
embeddedPdf.setHeight("580px");
windowCloseButton.setWidth(100, Sizeable.UNITS_PERCENTAGE);
layout.addComponent(embeddedPdf);
layout.addComponent(windowCloseButton);
}
开发者ID:fossaag,项目名称:rolp,代码行数:20,代码来源:LebAnzeigen.java
示例15: buildMainLayout
import com.vaadin.ui.Embedded; //导入依赖的package包/类
@Override
public void buildMainLayout() {
Embedded logo = new Embedded(null, new ThemeResource(MAINPAGE_PANEL_ANMELDEN_LOGO_PATH));
logo.setType(Embedded.TYPE_IMAGE);
logo.setWidth("100px");
logo.setHeight("96px");
headlineApp.addComponent(logo,"logo");
headlineApp.addComponent(authorizerLayout,"authorizerLayout");
headlineApp.addStyleName("headlineApp");
layout.addComponent(headlineApp,"headlineApp");
getMainWindow().setContent(layout);
getMainWindow().addComponent(getAnimator());
if(getLoginLehrer().getIsAdmin()){
layout.addComponent(getAdminDashboard(), "admin");
} else {
layout.addComponent(main, "main");
buildAppLayout();
}
}
开发者ID:fossaag,项目名称:rolp,代码行数:23,代码来源:RolpApplication.java
示例16: getLoginButton
import com.vaadin.ui.Embedded; //导入依赖的package包/类
public static Component getLoginButton(final String openIdIdentifier, String icon, final String returnViewName) {
//final Button googleOpenIdButton = new Button("");
final Site site = ((AbstractSiteUI) UI.getCurrent()).getSite();
//googleOpenIdButton.setIcon(site.getIcon(icon));
//googleOpenIdButton.setWidth(16, Sizeable.Unit.PIXELS);
final Embedded embedded = new Embedded(null, site.getIcon(icon));
embedded.setStyleName("image-button");
embedded.addClickListener(new MouseEvents.ClickListener() {
@Override
public void click(MouseEvents.ClickEvent event) {
try {
final Company company = site.getSiteContext().getObject(Company.class);
final String authenticationUrl = OpenIdUtil.prepareAuthenticationUrl(openIdIdentifier,
company.getUrl(), returnViewName);
UI.getCurrent().getPage().setLocation(authenticationUrl);
} catch (final Exception e) {
LOGGER.error("Error in open ID discovery.", e);
Notification.show("Error in open ID discovery.", Notification.Type.ERROR_MESSAGE);
}
}
});
return embedded;
}
开发者ID:bubblecloud,项目名称:ilves,代码行数:25,代码来源:OpenIdUtil.java
示例17: attach
import com.vaadin.ui.Embedded; //导入依赖的package包/类
@Override
public void attach() {
super.attach();
int width = (int)getApplication().getMainWindow().getWidth();
int height = (int)getApplication().getMainWindow().getHeight();
/*Sets the browser and window sizes based on the main window*/
int browserWidth = (int)(sizePercentage * width), browserHeight = (int)(sizePercentage * height);
int windowWidth = browserWidth + widthCushion, windowHeight = browserHeight + heightCushion;
setWidth("" + windowWidth + "px");
setHeight("" + windowHeight + "px");
setPositionX((width - windowWidth)/2);
setPositionY((height - windowHeight)/2);
/*Changes the size of the browsers to fit within the sub-window*/
alarmsBrowser.setType(Embedded.TYPE_BROWSER);
alarmsBrowser.setWidth("" + browserWidth + "px");
alarmsBrowser.setHeight("" + browserHeight + "px");
eventsBrowser.setType(Embedded.TYPE_BROWSER);
eventsBrowser.setWidth("" + browserWidth + "px");
eventsBrowser.setHeight("" + browserHeight + "px");
}
开发者ID:qoswork,项目名称:opennmszh,代码行数:24,代码来源:EventsAlarmsWindow.java
示例18: NodeInfoWindow
import com.vaadin.ui.Embedded; //导入依赖的package包/类
/**
* The NodeInfoWindow method constructs a sub-window instance which can be added to a main window.
* The sub-window contains an embedded browser which displays the Node Info page of the currently selected
* node.
* @param node Selected node
* @param width Width of the main window
* @param height Height of the main window
* @throws MalformedURLException
*/
public NodeInfoWindow(final Node node, final URL nodeURL) throws MalformedURLException{
nodeInfoBrowser = new Embedded("", new ExternalResource(nodeURL));
String label = node == null? "" : node.getLabel();
/*Sets up window settings*/
if (label == null || label.equals("") || label.equalsIgnoreCase(noLabel)) {
label = "";
} else label = " - " + label;
setCaption("Node Info" + label);
setImmediate(true);
setResizable(false);
/*Adds the browser to the main layout*/
VerticalLayout layout = new VerticalLayout();
layout.addComponent(nodeInfoBrowser);
addComponent(layout);
}
开发者ID:qoswork,项目名称:opennmszh,代码行数:29,代码来源:NodeInfoWindow.java
示例19: attach
import com.vaadin.ui.Embedded; //导入依赖的package包/类
@Override
public void attach() {
super.attach();
int width = (int)getApplication().getMainWindow().getWidth();
int height = (int)getApplication().getMainWindow().getHeight();
/*Sets the browser and window sizes based on the main window*/
int browserWidth = (int)(sizePercentage * width), browserHeight = (int)(sizePercentage * height);
int windowWidth = browserWidth + widthCushion, windowHeight = browserHeight + heightCushion;
setWidth("" + windowWidth + "px");
setHeight("" + windowHeight + "px");
setPositionX((width - windowWidth)/2);
setPositionY((height - windowHeight)/2);
/*Sets the size of the browser to fit within the sub-window*/
nodeInfoBrowser.setType(Embedded.TYPE_BROWSER);
nodeInfoBrowser.setWidth("" + browserWidth + "px");
nodeInfoBrowser.setHeight("" + browserHeight + "px");
}
开发者ID:qoswork,项目名称:opennmszh,代码行数:21,代码来源:NodeInfoWindow.java
示例20: ResourceGraphsWindow
import com.vaadin.ui.Embedded; //导入依赖的package包/类
/**
* The ResourceGraphsWindow method constructs a sub-window instance which can be added to a
* main window. The sub-window contains an embedded browser which displays the Resource Graphs
* page of the currently selected node
* @param node Selected node
* @param width Width of the main window
* @param height Height of the main window
* @throws MalformedURLException
*/
public ResourceGraphsWindow(final Node node, final URL nodeURL) throws MalformedURLException{
rgBrowser = new Embedded("", new ExternalResource(nodeURL));
String label = node == null? "" : node.getLabel();
/*Sets up window settings*/
if (label == null || label.equals("") || label.equalsIgnoreCase(noLabel)) {
label = "";
} else {
label = " - " + label;
}
setCaption("Resource Graphs" + label);
setImmediate(true);
setResizable(false);
/*Adds the browser component to the main layout*/
VerticalLayout layout = new VerticalLayout();
layout.addComponent(rgBrowser);
addComponent(layout);
}
开发者ID:qoswork,项目名称:opennmszh,代码行数:31,代码来源:ResourceGraphsWindow.java
注:本文中的com.vaadin.ui.Embedded类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论