BrightSide Workbench Full Report + Source Code
org.turro.zkoss.text.RepositoryContent Class Reference
Inheritance diagram for org.turro.zkoss.text.RepositoryContent:
Collaboration diagram for org.turro.zkoss.text.RepositoryContent:

Public Member Functions

File getFolder ()
 
void setFolder (File folder)
 
String getMatchFilter ()
 
void setMatchFilter (String matchFilter)
 
void showContent ()
 
void upload (final Command command)
 
void addMedias (Media[] medias)
 

Static Public Attributes

static final String IMAGE_FILTER = ".*(\\.jpg|\\.jpeg|\\.png|\\.gif)"
 

Detailed Description

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

Definition at line 44 of file RepositoryContent.java.

Member Function Documentation

◆ addMedias()

void org.turro.zkoss.text.RepositoryContent.addMedias ( Media[]  medias)

Definition at line 104 of file RepositoryContent.java.

104  {
105  if(medias == null || medias.length == 0) return;
106  for(Media media : medias) {
107  Medias.toFolder(media, folder);
108  }
109  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFolder()

File org.turro.zkoss.text.RepositoryContent.getFolder ( )

Definition at line 53 of file RepositoryContent.java.

53  {
54  return folder;
55  }

◆ getMatchFilter()

String org.turro.zkoss.text.RepositoryContent.getMatchFilter ( )

Definition at line 62 of file RepositoryContent.java.

62  {
63  return matchFilter;
64  }

◆ setFolder()

void org.turro.zkoss.text.RepositoryContent.setFolder ( File  folder)

Definition at line 57 of file RepositoryContent.java.

57  {
58  this.folder = folder;
59  Folder.from(folder).ensure();
60  }
Here is the caller graph for this function:

◆ setMatchFilter()

void org.turro.zkoss.text.RepositoryContent.setMatchFilter ( String  matchFilter)

Definition at line 66 of file RepositoryContent.java.

66  {
67  this.matchFilter = matchFilter;
68  }
Here is the caller graph for this function:

◆ showContent()

void org.turro.zkoss.text.RepositoryContent.showContent ( )

Definition at line 70 of file RepositoryContent.java.

70  {
71  if(folder != null && folder.exists()) {
72  getChildren().clear();
73  for(File file : folder.listFiles(new FileFilter() {
74  @Override
75  public boolean accept(File pathname) {
76  return pathname.isFile() && !pathname.isHidden() && pathname.getName().matches(matchFilter);
77  }
78  })) {
79  appendChild(createBox(file));
80  }
81  }
82  }
Here is the caller graph for this function:

◆ upload()

void org.turro.zkoss.text.RepositoryContent.upload ( final Command  command)

Definition at line 84 of file RepositoryContent.java.

84  {
85  if(!folder.exists()) {
86  folder.mkdirs();
87  }
88  Fileupload.get(100, new EventListener<UploadEvent>() {
89  @Override
90  public void onEvent(UploadEvent event) {
91  addMedias(event.getMedias());
92  if(command != null) {
93  try {
94  command.execute(null);
95  } catch (Exception ex) {
96  Logger.getLogger(RepositoryContent.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
97  }
98  }
99  }
100  });
101  }
Here is the call graph for this function:

Member Data Documentation

◆ IMAGE_FILTER

final String org.turro.zkoss.text.RepositoryContent.IMAGE_FILTER = ".*(\\.jpg|\\.jpeg|\\.png|\\.gif)"
static

Definition at line 47 of file RepositoryContent.java.


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