com.vaadin.ui.Embedded.setMimeType()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(139)

本文整理了Java中com.vaadin.ui.Embedded.setMimeType()方法的一些代码示例,展示了Embedded.setMimeType()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Embedded.setMimeType()方法的具体详情如下:
包路径:com.vaadin.ui.Embedded
类名称:Embedded
方法名:setMimeType

Embedded.setMimeType介绍

[英]Sets the mimeType, the MIME-Type of the object.
[中]设置MIME类型,即对象的MIME类型。

代码示例

代码示例来源:origin: com.haulmont.cuba/cuba-web

@Override
public void setMIMEType(String mt) {
  component.setMimeType(mt);
}

代码示例来源:origin: stackoverflow.com

Embedded e = new Embedded(null, new ExternalResource(
        "http://www.youtube.com/v/meXvxkn1Y_8&hl=en_US&fs=1&"));
e.setMimeType("application/x-shockwave-flash");
e.setParameter("allowFullScreen", "true");
e.setWidth("320px");
e.setHeight("265px");
addComponent(e);

代码示例来源:origin: com.haulmont.cuba/cuba-web

@Override
public void resetSource() {
  resource = null;
  component.markAsDirty();
  component.setMimeType("image/png");
  component.setType(com.vaadin.ui.Embedded.TYPE_IMAGE);
  component.setSource(new StreamResource(new EmptyStreamSource(), UUID.randomUUID() + ".png"));
}

代码示例来源:origin: korpling/ANNIS

emb.setMimeType("image/png");
emb.setSizeFull();
emb.setStandby("loading image");

代码示例来源:origin: korpling/ANNIS

@Override
public ImagePanel createComponent(final VisualizerInput visInput, VisualizationToggle visToggle)
{
 final ByteArrayOutputStream out = new ByteArrayOutputStream();
 writeOutput(visInput, out);
 String fileName = "vis_" + UUID.randomUUID().toString() + ".png";
 StreamResource resource = new StreamResource(new StreamResource.StreamSource()
  {
   @Override
   public InputStream getStream()
   {
    return new ByteArrayInputStream(out.toByteArray());
   }
  }, fileName);
 Embedded emb = new Embedded("", resource);
 emb.setMimeType(getContentType());
 emb.setSizeUndefined();
 emb.setStandby("loading image");
 emb.setAlternateText("Visualization of the result");
 
 return new ImagePanel(emb);
}

代码示例来源:origin: nz.co.senanque/madura-workflow-vaadin

@PostConstruct
public void init() {
  
  final Window me = this;
  MessageSourceAccessor messageSourceAccessor= new MessageSourceAccessor(m_messageSource);
  Layout main = new VerticalLayout();
  setContent(main);
  main.setWidth("400px");
  Embedded embedded = new Embedded();
  embedded.setImmediate(false);
  embedded.setWidth("-1px");
  embedded.setHeight("-1px");
  embedded.setSource(new com.vaadin.server.ThemeResource("images/logo.jpg"));
  embedded.setType(1);
  embedded.setMimeType("image/gif");
  main.addComponent(embedded);
  main.addComponent(new Label(messageSourceAccessor.getMessage("about.text")));
  Label aboutInfoLabel = new Label(m_aboutInfo.toString(),ContentMode.HTML);
  main.addComponent(aboutInfoLabel);
  Button OK = new Button(messageSourceAccessor.getMessage("OK"));
  OK.setClickShortcut( KeyCode.ENTER ) ;
  OK.addStyleName( ValoTheme.BUTTON_PRIMARY ) ;
  main.addComponent(OK);
  OK.addClickListener(new ClickListener(){
    private static final long serialVersionUID = 1L;
    public void buttonClick(ClickEvent event) {
      me.close();
    }});
}

相关文章