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

Public Member Functions

 FilePreview (File file)
 
void onEvent (OpenEvent event) throws Exception
 

Detailed Description

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

Definition at line 35 of file FilePreview.java.

Constructor & Destructor Documentation

◆ FilePreview()

org.turro.file.zul.tree.FilePreview.FilePreview ( File  file)

Definition at line 39 of file FilePreview.java.

39  {
40  this.file = file;
41  addEventListener(Events.ON_OPEN, this);
42  }

Member Function Documentation

◆ onEvent()

void org.turro.file.zul.tree.FilePreview.onEvent ( OpenEvent  event) throws Exception

Definition at line 45 of file FilePreview.java.

45  {
46  getChildren().clear();
47  Preview preview = Preview.from(file);
48  File result = preview.get();
49  if(result != null) {
50  BufferedImage bi = ImageIO.read(result);
51  setHeight((bi.getHeight() + 12) + "px");
52  setWidth((bi.getWidth() + 12) + "px");
53  Image image = new Image();
54  image.setContent(bi);
55  appendChild(image);
56  preview.close();
57  }
58  }

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