BrightSide Workbench Full Report + Source Code
org.turro.elephant.configuration.FilesTree Class Reference
Inheritance diagram for org.turro.elephant.configuration.FilesTree:
Collaboration diagram for org.turro.elephant.configuration.FilesTree:

Public Member Functions

FilesItem getSelectedFile ()
 
FilesItem getSelectedFileParent ()
 
FilesItem getSelectedFolder ()
 
void selectFile (File file, Treeitem parent)
 
void afterCompose ()
 

Detailed Description

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

Definition at line 33 of file FilesTree.java.

Member Function Documentation

◆ afterCompose()

void org.turro.elephant.configuration.FilesTree.afterCompose ( )

Definition at line 61 of file FilesTree.java.

61  {
62  Treechildren children = new Treechildren();
63  appendChild(children);
64  FilesItem configuration = new FilesItem(null, I_.get("Configuration"), null);
65  configuration.addFile(new FilesItem(new File(
66  ElephantContext.getRealPath("/WEB-INF/elephant/conf/site.xml")),
67  null, null));
68  configuration.addFile(new FilesItem(new File(
69  ElephantContext.getRealPath("/WEB-INF/elephant/conf/shop.xml")),
70  null, null));
71  configuration.addFile(new FilesItem(new File(
72  ElephantContext.getRealPath("/WEB-INF/elephant/conf")),
73  I_.get("Properties"), ".*\\.properties"));
74  configuration.addFile(new FilesItem(new File(
75  ElephantContext.getRealPath("/WEB-INF/classes")),
76  I_.get("Resources"), "by-key-site_en\\.properties"));
77  configuration.addFile(new FilesItem(new File(
78  ElephantContext.getRealPath("/WEB-INF/elephant/conf")),
79  I_.get("Search"), "dao-search.*\\.xml"));
80  configuration.addFile(new FilesItem(new File(
81  ElephantContext.getRealPath("/WEB-INF/elephant/conf")),
82  "JSON", ".*\\.json"));
83  configuration.addFile(new FilesItem(new File(
84  ElephantContext.getRealPath("/WEB-INF/elephant/conf/mail")),
85  "Mail providers", ".*\\.json"));
86  File scripts = new File(ElephantContext.getRealPath("/WEB-INF/elephant/scripts"));
87  if(scripts.exists()) {
88  configuration.addFile(new FilesItem(scripts,
89  "Scripts", ".*\\.js"));
90  }
91  children.appendChild(configuration);
92  File support = new File(ElephantContext.getRealPath("/WEB-INF/elephant/support"));
93  if(support.exists()) {
94  children.appendChild(new FilesItem(support,
95  I_.get("Support"), null));
96  }
97  FilesItem css = new FilesItem(null, I_.get("Cascading Style Sheets"), null);
98  FilesItem cssTmpl = new FilesItem(null, I_.get("Templates"), null);
99  cssTmpl.addFile(new FilesItem(new File(
100  ElephantContext.getRealPath("/_internal/css/elephant-branding-semantic.css")),
101  null, null));
102  css.addFile(cssTmpl);
103  children.appendChild(css);
104  File tmplMail = new File(ElephantContext.getRealPath("/WEB-INF/elephant/templates-mail"));
105  if(tmplMail.exists()) {
106  children.appendChild(new FilesItem(tmplMail,
107  I_.get("Templates") + "-mail", null));
108  }
109  File tmplSemantic = new File(ElephantContext.getRealPath("/WEB-INF/elephant/templates-semantic"));
110  if(tmplSemantic.exists()) {
111  children.appendChild(new FilesItem(tmplSemantic,
112  I_.get("Templates") + "-semantic", null));
113  }
114  File tmplSemanticApp = new File(ElephantContext.getRealPath("/WEB-INF/elephant/templates-semantic-app"));
115  if(tmplSemanticApp.exists()) {
116  children.appendChild(new FilesItem(tmplSemanticApp,
117  I_.get("Templates") + "-semantic-app", null));
118  }
119  File reports = new File(ElephantContext.getRealPath("/WEB-INF/elephant/reports/financials"));
120  if(reports.exists()) {
121  children.appendChild(new FilesItem(reports,
122  I_.get("Reports"), null));
123  }
124  File tou = new File(ElephantContext.getRealPath("/_internal/terms"));
125  if(tou.exists()) {
126  children.appendChild(new FilesItem(tou,
127  I_.get("Terms of Use"), null));
128  }
129  FilesItem wiki = new FilesItem(null, "Wiki", null);
130  File wtmpl = new File(ElephantContext.getRealPath("/WEB-INF/elephant/wiki/templates"));
131  if(wtmpl.exists()) {
132  wiki.addFile(new FilesItem(wtmpl, "Templates", ".*\\.wiki"));
133  }
134  File wsnip = new File(ElephantContext.getRealPath("/WEB-INF/elephant/wiki/snippets"));
135  if(wsnip.exists()) {
136  wiki.addFile(new FilesItem(wsnip, "Snippets", ".*\\.wiki"));
137  }
138  children.appendChild(wiki);
139  }
Here is the call graph for this function:

◆ getSelectedFile()

FilesItem org.turro.elephant.configuration.FilesTree.getSelectedFile ( )

Definition at line 35 of file FilesTree.java.

35  {
36  return (FilesItem) getSelectedItem();
37  }
Here is the caller graph for this function:

◆ getSelectedFileParent()

FilesItem org.turro.elephant.configuration.FilesTree.getSelectedFileParent ( )

Definition at line 39 of file FilesTree.java.

39  {
40  return (FilesItem) getSelectedItem().getParentItem();
41  }
Here is the caller graph for this function:

◆ getSelectedFolder()

FilesItem org.turro.elephant.configuration.FilesTree.getSelectedFolder ( )

Definition at line 43 of file FilesTree.java.

43  {
44  FilesItem folder = getSelectedFile();
45  if(folder != null && folder.getCurrentFile().isFile()) {
46  folder = getSelectedFileParent();
47  }
48  return folder;
49  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ selectFile()

void org.turro.elephant.configuration.FilesTree.selectFile ( File  file,
Treeitem  parent 
)

Definition at line 51 of file FilesTree.java.

51  {
52  for(Treeitem ti : parent.getTreechildren().getItems()) {
53  if(file.equals(ti.getValue())) {
54  setSelectedItem(ti);
55  return;
56  }
57  }
58  }
Here is the caller graph for this function:

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