BrightSide Workbench Full Report + Source Code
CalendarProcess.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2012 Lluis TurrĂ³ Cutiller <http://www.turro.org/>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Affero General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Affero General Public License for more details.
14  *
15  * You should have received a copy of the GNU Affero General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 package org.turro.calendar;
20 
21 import java.util.Collection;
22 import java.util.logging.Level;
23 import java.util.logging.Logger;
24 import org.turro.command.Command;
25 import org.turro.elephant.context.ElephantContext;
26 import org.turro.i18n.I_;
27 import org.turro.zkoss.dialog.SelectionDialog;
28 import org.turro.zul.frame.Framework;
29 import org.zkoss.zk.ui.Component;
30 import org.zkoss.zk.ui.HtmlBasedComponent;
31 import org.zkoss.zk.ui.ext.AfterCompose;
32 import org.zkoss.zul.Vlayout;
33 
38 public class CalendarProcess extends Vlayout implements AfterCompose {
39 
40  private Collection solutions;
41 
42  public CalendarProcess(Collection solutions) {
43  this.solutions = solutions;
44  }
45 
46  public void process(Command command) {
47  if(solutions != null) {
48  for(Object solution : solutions) {
49  if(solution instanceof HtmlBasedComponent) {
50  appendChild((HtmlBasedComponent) solution);
51  }
52  }
53  }
54  if(!getChildren().isEmpty()) {
56  I_.get("New"), this, "300px", "70%", null);
57  }
58  if(command != null) try {
59  command.execute(null);
60  } catch (Exception ex) {
61  Logger.getLogger(CalendarProcess.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
62  }
63  }
64 
65  @Override
66  public void afterCompose() {
67  for(Component c : getChildren()) {
68  if(c instanceof AfterCompose) {
69  ((AfterCompose) c).afterCompose();
70  }
71  }
72  }
73 
74 }
CalendarProcess(Collection solutions)
static String get(String msg)
Definition: I_.java:41
static void showComponent(Page page, String title, Component component, String width, String height, final Command command)
static Framework getCurrent()
Definition: Framework.java:203