BrightSide Workbench Full Report + Source Code
org.turro.attach.zul.PreviewButton Class Reference
Inheritance diagram for org.turro.attach.zul.PreviewButton:
Collaboration diagram for org.turro.attach.zul.PreviewButton:

Public Member Functions

 PreviewButton (Attachment attachment)
 
void onEvent (Event event) throws Exception
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 41 of file attach/zul/PreviewButton.java.

Constructor & Destructor Documentation

◆ PreviewButton()

org.turro.attach.zul.PreviewButton.PreviewButton ( Attachment  attachment)

Definition at line 45 of file attach/zul/PreviewButton.java.

45  {
46  this.attachment = attachment;
47  setImage(Images.getImage("eye"));
48  setTooltiptext(I_.get("Preview"));
49  addEventListener(Events.ON_CLICK, this);
50  }
Here is the call graph for this function:

Member Function Documentation

◆ onEvent()

void org.turro.attach.zul.PreviewButton.onEvent ( Event  event) throws Exception

Definition at line 53 of file attach/zul/PreviewButton.java.

53  {
54  Preview preview = Preview.from(new ByteArrayInputStream(
55  LoadContent.getContent(attachment)), attachment.getFileExtension());
56  File result = preview.get();
57  if(result != null) {
58  BufferedImage bi = ImageIO.read(result);
59  Image image = new Image();
60  image.setContent(bi);
61  Windows.title(attachment.getFileName())
62  .page(getPage())
63  .adaptWidth(bi.getWidth())
64  .adaptHeight(bi.getHeight())
65  .addComponent(image)
66  .closeable()
67  .onClose(w -> preview.close())
68  .show();
69  }
70  }
Here is the call graph for this function:

The documentation for this class was generated from the following file: