当前位置: 首页>>代码示例>>Java>>正文


Java Embedded类代码示例

本文整理汇总了Java中com.vaadin.ui.Embedded的典型用法代码示例。如果您正苦于以下问题:Java Embedded类的具体用法?Java Embedded怎么用?Java Embedded使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Embedded类属于com.vaadin.ui包,在下文中一共展示了Embedded类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的com.vaadin.ui.Embedded类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。