19 package org.turro.elephant.configuration;
21 import java.io.BufferedReader;
23 import java.io.FileReader;
24 import java.io.IOException;
25 import java.util.logging.Level;
26 import java.util.logging.Logger;
27 import org.turro.action.Plugins;
28 import org.turro.annotation.ElephantPlugin;
29 import org.turro.elephant.context.Application;
30 import org.turro.elephant.context.ElephantContext;
31 import org.turro.elephant.impl.util.Files;
32 import org.turro.elephant.util.Images;
33 import org.turro.plugin.command.SelfSummaryPlugin;
34 import org.turro.zkoss.label.LabelTypes;
35 import org.turro.zkoss.layout.GroupboxArrow;
36 import org.zkoss.zk.ui.util.Clients;
37 import org.zkoss.zul.Hlayout;
38 import org.zkoss.zul.Image;
39 import org.zkoss.zul.Label;
52 Clients.showBusy(
"Calculating usage...");
55 final File file =
Files.
file(
"/WEB-INF/space-usage.txt");
59 protected void doFillContent() {
60 Label label =
new Label(getFileContent(file));
65 Hlayout hbox =
new Hlayout();
67 hbox.setSclass(
"z-valign-middle");
68 hbox.setValign(
"middle");
77 private String getFileContent(File file) {
79 try (BufferedReader br =
new BufferedReader(
new FileReader(file))) {
81 while ((line = br.readLine()) !=
null) {
82 content += line +
"\n";
84 }
catch (IOException ex) {
85 Logger.getLogger(SpaceUsageSelfSummary.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
Object addResult(String key, Object value)
static Map< String, Object > execute(String name, Map params)
boolean isInRole(String role)
static Application getApplication()
static File file(IConstructor constructor, String file)
static String getImage(String image)
static Label getSoftLabel(String value)
void setCaption(Component comp)
void setOpen(boolean open)