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

Public Member Functions

 PreviewButton (File file)
 
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 38 of file file/zul/PreviewButton.java.

Constructor & Destructor Documentation

◆ PreviewButton()

org.turro.file.zul.PreviewButton.PreviewButton ( File  file)

Definition at line 42 of file file/zul/PreviewButton.java.

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

Member Function Documentation

◆ onEvent()

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

Definition at line 50 of file file/zul/PreviewButton.java.

50  {
51  Preview preview = Preview.from(file);
52  File result = preview.get();
53  if(result != null) {
54  BufferedImage bi = ImageIO.read(result);
55  Image image = new Image();
56  image.setContent(bi);
57  Windows.title(getTooltiptext())
58  .page(getPage())
59  .adaptWidth(bi.getWidth())
60  .adaptHeight(bi.getHeight())
61  .addComponent(image)
62  .closeable()
63  .onClose(w -> preview.close())
64  .show();
65  }
66  }
Here is the call graph for this function:

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