Author: bbrossaud Date: 2010-06-24 17:57:55 +0200 (Thu, 24 Jun 2010) New Revision: 156 Url: http://nuiton.org/repositories/revision/wikitty/156 Log: can add wikittyService properties Added: trunk/wikitty-ui-zk/src/main/java/org/nuiton/wikitty/ui/Data.java trunk/wikitty-ui-zk/src/main/java/org/nuiton/wikitty/ui/LoginController.java trunk/wikitty-ui-zk/src/main/java/org/nuiton/wikitty/ui/ProxyModel.java trunk/wikitty-ui-zk/src/main/java/org/nuiton/wikitty/ui/WikittyController.java trunk/wikitty-ui-zk/src/main/webapp/wikitty.zul Removed: trunk/wikitty-ui-zk/src/main/java/org/nuiton/wikitty/ui/Controller.java Modified: trunk/wikitty-ui-zk/src/main/java/org/nuiton/wikitty/ui/WikittyZkConfig.java trunk/wikitty-ui-zk/src/main/webapp/index.zul Deleted: trunk/wikitty-ui-zk/src/main/java/org/nuiton/wikitty/ui/Controller.java =================================================================== --- trunk/wikitty-ui-zk/src/main/java/org/nuiton/wikitty/ui/Controller.java 2010-06-24 14:13:27 UTC (rev 155) +++ trunk/wikitty-ui-zk/src/main/java/org/nuiton/wikitty/ui/Controller.java 2010-06-24 15:57:55 UTC (rev 156) @@ -1,139 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package org.nuiton.wikitty.ui; - -import java.util.ArrayList; -import java.util.List; -import java.util.Set; -import org.nuiton.wikitty.Wikitty; -import org.nuiton.wikitty.WikittyExtension; -import org.zkoss.zk.ui.util.GenericForwardComposer; -import org.zkoss.zul.ListModel; -import org.zkoss.zul.Listbox; -import org.zkoss.zul.Listitem; -import org.zkoss.zul.ListitemRenderer; - -/** - * - * @author sherkhan - */ -public class Controller extends GenericForwardComposer { - - protected Model _model = new Model(); - protected List<WikittyExtension> _extensions = new ArrayList<WikittyExtension>(); - protected WikittyExtension _selectedExtension; - protected WikittyExtension _selectedNewExtension; - protected Listbox formListBox; - protected WikittyForm _wikittyForm = new WikittyForm(); - protected Listbox wikittiesListBox; - protected WikittyModel _wikittyModel = new WikittyModel(); - - public Controller() { - _extensions = _model.retrieveWikittyExtensions(); - } - - /* - * Events - */ - public void onClick$addNewInput() { - _wikittyForm.addNewInput(formListBox); - } - - public void onClick$deleteInput() { - _wikittyForm.deleteInput(formListBox); - } - - public void onClick$add() { - Wikitty newWikitty = _wikittyForm.retriveWikittyInForm(formListBox); - _model.create(newWikitty); - } - - public void onClick$update() { - if (_wikittyForm.isSelected()) { - Wikitty newWikitty = _wikittyForm.retriveWikittyInForm(formListBox); - _model.update(newWikitty); - } - } - - public void onClick$delete() { - Set<Listitem> items = wikittiesListBox.getSelectedItems(); - for (Listitem item : items) { - Wikitty wikitty = (Wikitty) item.getValue(); - _model.deleteWikittyById(wikitty.getId()); - _wikittyModel.removeData(wikitty); - } - wikittiesListBox.setSelectedIndex(0); - } - - public void onClick$addNewExtension() { - _wikittyForm.addExtension(_selectedNewExtension); - } - - /* - * Renderers - */ - public ListitemRenderer getWikittyRenderer() { - return new ListitemRenderer() { - - @Override - public void render(Listitem item, Object data) throws Exception { - item.setValue(data); - item.setLabel(((Wikitty) data).getId()); - } - }; - } - - /* - * Getters - */ - public List<WikittyExtension> getExtensions() { - return _extensions; - } - - public WikittyExtension getSelectedExtension() { - return _selectedExtension; - } - - public WikittyExtension getSelectedNewExtension() { - return _selectedNewExtension; - } - - public WikittyForm getWikittyForm() { - return _wikittyForm; - } - - public ListModel getWikittyModel() { - return _wikittyModel; - } - - public Wikitty getSelectedWikitty() { - return _wikittyForm.getWikitty(); - } - - /* - * Setters - */ - public void setSelectedExtension(WikittyExtension current) { - _wikittyForm.setHoldExtensions(current); - List<Wikitty> list = _model.retrieveWikittiesByExtensionName(current.getName()); - _wikittyModel.setWikitties(list); - } - - public void setSelectedNewExtension(WikittyExtension current) { - _selectedNewExtension = current; - } - - public void setSelectedWikitty(Wikitty current) { - _wikittyForm.setWikitty(current); - } - - private void debbug(String debug) { - throw new UnsupportedOperationException(debug); - } - - /* - * Methods - */ -} Added: trunk/wikitty-ui-zk/src/main/java/org/nuiton/wikitty/ui/Data.java =================================================================== --- trunk/wikitty-ui-zk/src/main/java/org/nuiton/wikitty/ui/Data.java (rev 0) +++ trunk/wikitty-ui-zk/src/main/java/org/nuiton/wikitty/ui/Data.java 2010-06-24 15:57:55 UTC (rev 156) @@ -0,0 +1,125 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package org.nuiton.wikitty.ui; + +/** + * + * @author sherkhan + */ +public class Data { + + protected String _path = ""; + protected String _name = ""; + protected String _db = ""; + protected String _driver = ""; + protected String _solr = ""; + protected String _URL = ""; + protected String _login = ""; + protected String _password = ""; + + public Data(String name, String db, String driver, String solr, String url, String login, String password) { + setName(name); + setDb(db); + setDriver(driver); + setSolr(solr); + setURL(url); + setLogin(login); + setPassword(password); + } + + /* + * Setters + */ + public void setPath(String path) { + if (path == null) { + path = ""; + } + _path = path; + } + + public void setName(String name) { + if (name == null) { + name = ""; + } + _name = name; + } + + public void setDb(String db) { + if (db == null) { + db = ""; + } + _db = db; + } + + public void setSolr(String solr) { + if (solr == null) { + solr = ""; + } + _solr = solr; + } + + public void setURL(String URL) { + if (URL == null) { + URL = ""; + } + _URL = URL; + } + + public void setLogin(String login) { + if (login == null) { + login = ""; + } + _login = login; + } + + public void setPassword(String password) { + if (password == null) { + password = ""; + } + _password = password; + } + + public void setDriver(String driver) { + if (driver == null) { + driver = ""; + } + _driver = driver; + } + + /* + * Getters + */ + public String getPath() { + return _path; + } + + public String getName() { + return _name; + } + + public String getDb() { + return _db; + } + + public String getDriver() { + return _driver; + } + + public String getSolr() { + return _solr; + } + + public String getUrl() { + return _URL; + } + + public String getLogin() { + return _login; + } + + public String getPassword() { + return _password; + } +} Added: trunk/wikitty-ui-zk/src/main/java/org/nuiton/wikitty/ui/LoginController.java =================================================================== --- trunk/wikitty-ui-zk/src/main/java/org/nuiton/wikitty/ui/LoginController.java (rev 0) +++ trunk/wikitty-ui-zk/src/main/java/org/nuiton/wikitty/ui/LoginController.java 2010-06-24 15:57:55 UTC (rev 156) @@ -0,0 +1,227 @@ +package org.nuiton.wikitty.ui; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; +import java.util.Set; +import org.apache.commons.lang.UnhandledException; +import org.nuiton.util.ApplicationConfig; +import org.nuiton.util.ArgumentsParserException; +import org.zkoss.zk.ui.util.GenericForwardComposer; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Listbox; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; +import org.zkoss.zul.Textbox; +import org.zkoss.zul.Window; + +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +/** + * + * @author sherkhan + */ +public class LoginController extends GenericForwardComposer { + + protected ProxyModel _proxyModel = new ProxyModel(); + protected Listbox dataList; + protected ApplicationConfig _config = new ApplicationConfig(); + protected Properties _properties = new Properties(); + protected Window win; + + public LoginController() throws IOException { + initConfig(); + loadProperties(); + createProxyDatas(); + } + + public void initConfig() { + _config.setConfigFileName("wikitty-ui-zk.properties"); + try { + _config.parse(new String[]{}); + } catch (ArgumentsParserException ex) { + throw new UnhandledException(ex); + } + } + + protected void saveNewData(Data data) throws FileNotFoundException, IOException { + String name = ""; + String path = ""; + for (int count = 0; name != null; ++count) { + path = "data" + count; + name = _properties.getProperty(path + ".name"); + } + _properties.setProperty(path + ".name", data.getName()); + String db = data.getDb(); + if (!db.isEmpty()) { + _properties.setProperty(path + ".db", db); + } + String driver = data.getDriver(); + if (!driver.isEmpty()) { + _properties.setProperty(path + ".driver", driver); + } + String solr = data.getSolr(); + if (!solr.isEmpty()) { + _properties.setProperty(path + ".solr", solr); + } + String url = data.getUrl(); + if (!url.isEmpty()) { + _properties.setProperty(path + ".url", url); + } + String login = data.getLogin(); + if (!login.isEmpty()) { + _properties.setProperty(path + ".login", login); + } + String password = data.getPassword(); + if (!password.isEmpty()) { + _properties.setProperty(path + ".password", password); + } + data.setPath(path); + saveProperties(); + createProxyDatas(); + } + + protected void loadProperties() throws IOException { + String filePath = _config.getOption("wikitty-ui-zk.filePath"); + File file = new File(filePath); + if (!file.exists()) { + file.createNewFile(); + } + InputStream stream = new FileInputStream(file); + _properties.load(stream); + stream.close(); + } + + protected void saveProperties() throws IOException { + String filePath = _config.getOption("wikitty-ui-zk.filePath"); + File file = new File(filePath); + if (!file.exists()) { + file.createNewFile(); + } + OutputStream stream = new FileOutputStream(file); + _properties.store(stream, null); + stream.close(); + } + + protected void createProxyDatas() { + List<Data> datas = new ArrayList<Data>(); + String name = ""; + for (int count = 0; name != null; ++count) { + String path = "data" + count; + name = _properties.getProperty(path + ".name"); + if (name != null) { + String db = _properties.getProperty(path + ".db"); + String solr = _properties.getProperty(path + ".solr"); + String driver = _properties.getProperty(path + ".driver"); + String url = _properties.getProperty(path + "url"); + String login = _properties.getProperty(path + "login"); + String password = _properties.getProperty(path + "password"); + Data data = new Data(name, db, driver, solr, url, login, password); + data.setPath(path); + datas.add(data); + } + } + _proxyModel.setProxyDatas(datas); + } + + protected void removeDataFromProperties(Data data) { + String path = data.getPath(); + if (_properties.containsKey(path + ".name")) { + _properties.remove(path + ".name"); + } + if (_properties.containsKey(path + ".db")) { + _properties.remove(path + ".db"); + } + if (_properties.containsKey(path + ".driver")) { + _properties.remove(path + ".driver"); + } + if (_properties.containsKey(path + ".solr")) { + _properties.remove(path + ".solr"); + } + if (_properties.containsKey(path + ".url")) { + _properties.remove(path + ".url"); + } + if (_properties.containsKey(path + ".login")) { + _properties.remove(path + ".login"); + } + if (_properties.containsKey(path + ".password")) { + _properties.remove(path + ".password"); + } + } + + /* + * Events + */ + public void onClick$select() { + Listitem item = dataList.getSelectedItem(); + if (item != null) { + Data data = (Data) item.getValue(); + //WikittyZkConfig config = WikittyZkConfig.getInstance(); + } + } + + public void onClick$add() throws FileNotFoundException, IOException { + String name = ((Textbox) win.getFellow("Name")).getValue(); + String db = ((Textbox) win.getFellow("Db")).getValue(); + String solr = ((Textbox) win.getFellow("Solr")).getValue(); + String login = ((Textbox) win.getFellow("Login")).getValue(); + String password = ((Textbox) win.getFellow("Password")).getValue(); + String driver = ""; + Combobox box = (Combobox) win.getFellow("driver"); + Comboitem item = box.getSelectedItem(); + if (item != null) { + driver = item.getLabel(); + } + if (!name.isEmpty() && !db.isEmpty() && !solr.isEmpty() && !driver.isEmpty()) { + Data data = new Data(name, db, driver, solr, null, login, password); + saveNewData(data); + } + } + + public void onClick$delete() throws IOException { + Set<Listitem> set = dataList.getSelectedItems(); + List<Listitem> items = new ArrayList<Listitem>(set); + if (items != null) { + for (Listitem item : items) { + Data data = (Data) item.getValue(); + removeDataFromProperties(data); + _proxyModel.removeData(data); + } + saveProperties(); + } + } + + /* + * Renderers + */ + public ListitemRenderer getDataRenderer() { + return new ListitemRenderer() { + + @Override + public void render(Listitem item, Object data) throws Exception { + item.setValue(data); + item.setLabel(((Data) data).getName()); + } + }; + } + /* + * Setters + */ + + /* + * Getters + */ + public ProxyModel getProxyModel() { + return _proxyModel; + } +} Added: trunk/wikitty-ui-zk/src/main/java/org/nuiton/wikitty/ui/ProxyModel.java =================================================================== --- trunk/wikitty-ui-zk/src/main/java/org/nuiton/wikitty/ui/ProxyModel.java (rev 0) +++ trunk/wikitty-ui-zk/src/main/java/org/nuiton/wikitty/ui/ProxyModel.java 2010-06-24 15:57:55 UTC (rev 156) @@ -0,0 +1,55 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package org.nuiton.wikitty.ui; + +import java.util.ArrayList; +import java.util.List; +import org.zkoss.zkplus.databind.BindingListModel; +import org.zkoss.zul.AbstractListModel; +import org.zkoss.zul.event.ListDataEvent; + +/** + * + * @author sherkhan + */ +public class ProxyModel extends AbstractListModel implements BindingListModel { + + protected List<Data> _proxyDatas = new ArrayList<Data>(); + + @Override + public Object getElementAt(int index) { + return _proxyDatas.get(index); + } + + @Override + public int getSize() { + return _proxyDatas.size(); + } + + @Override + public int indexOf(Object obj) { + return _proxyDatas.indexOf(obj); + } + + public void setProxyDatas(List<Data> fieldExtensions) { + _proxyDatas = fieldExtensions; + fireEvent(ListDataEvent.CONTENTS_CHANGED, -1, -1); + } + + public void addData(Data newData) { + _proxyDatas.add(newData); + fireEvent(ListDataEvent.INTERVAL_ADDED, _proxyDatas.size() - 1, _proxyDatas.size() - 1); + } + + public void removeData(Data data) { + int interval = _proxyDatas.indexOf(data); + _proxyDatas.remove(data); + fireEvent(ListDataEvent.INTERVAL_REMOVED, interval, interval); + } + + public void reload() { + fireEvent(ListDataEvent.CONTENTS_CHANGED, -1, -1); + } +} Copied: trunk/wikitty-ui-zk/src/main/java/org/nuiton/wikitty/ui/WikittyController.java (from rev 146, trunk/wikitty-ui-zk/src/main/java/org/nuiton/wikitty/ui/Controller.java) =================================================================== --- trunk/wikitty-ui-zk/src/main/java/org/nuiton/wikitty/ui/WikittyController.java (rev 0) +++ trunk/wikitty-ui-zk/src/main/java/org/nuiton/wikitty/ui/WikittyController.java 2010-06-24 15:57:55 UTC (rev 156) @@ -0,0 +1,139 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package org.nuiton.wikitty.ui; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import org.nuiton.wikitty.Wikitty; +import org.nuiton.wikitty.WikittyExtension; +import org.zkoss.zk.ui.util.GenericForwardComposer; +import org.zkoss.zul.ListModel; +import org.zkoss.zul.Listbox; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author sherkhan + */ +public class WikittyController extends GenericForwardComposer { + + protected Model _model = new Model(); + protected List<WikittyExtension> _extensions = new ArrayList<WikittyExtension>(); + protected WikittyExtension _selectedExtension; + protected WikittyExtension _selectedNewExtension; + protected Listbox formListBox; + protected WikittyForm _wikittyForm = new WikittyForm(); + protected Listbox wikittiesListBox; + protected WikittyModel _wikittyModel = new WikittyModel(); + + public WikittyController() { + _extensions = _model.retrieveWikittyExtensions(); + } + + /* + * Events + */ + public void onClick$addNewInput() { + _wikittyForm.addNewInput(formListBox); + } + + public void onClick$deleteInput() { + _wikittyForm.deleteInput(formListBox); + } + + public void onClick$add() { + Wikitty newWikitty = _wikittyForm.retriveWikittyInForm(formListBox); + _model.create(newWikitty); + } + + public void onClick$update() { + if (_wikittyForm.isSelected()) { + Wikitty newWikitty = _wikittyForm.retriveWikittyInForm(formListBox); + _model.update(newWikitty); + } + } + + public void onClick$delete() { + Set<Listitem> items = wikittiesListBox.getSelectedItems(); + for (Listitem item : items) { + Wikitty wikitty = (Wikitty) item.getValue(); + _model.deleteWikittyById(wikitty.getId()); + _wikittyModel.removeData(wikitty); + } + wikittiesListBox.setSelectedIndex(0); + } + + public void onClick$addNewExtension() { + _wikittyForm.addExtension(_selectedNewExtension); + } + + /* + * Renderers + */ + public ListitemRenderer getWikittyRenderer() { + return new ListitemRenderer() { + + @Override + public void render(Listitem item, Object data) throws Exception { + item.setValue(data); + item.setLabel(((Wikitty) data).getId()); + } + }; + } + + /* + * Getters + */ + public List<WikittyExtension> getExtensions() { + return _extensions; + } + + public WikittyExtension getSelectedExtension() { + return _selectedExtension; + } + + public WikittyExtension getSelectedNewExtension() { + return _selectedNewExtension; + } + + public WikittyForm getWikittyForm() { + return _wikittyForm; + } + + public ListModel getWikittyModel() { + return _wikittyModel; + } + + public Wikitty getSelectedWikitty() { + return _wikittyForm.getWikitty(); + } + + /* + * Setters + */ + public void setSelectedExtension(WikittyExtension current) { + _wikittyForm.setHoldExtensions(current); + List<Wikitty> list = _model.retrieveWikittiesByExtensionName(current.getName()); + _wikittyModel.setWikitties(list); + } + + public void setSelectedNewExtension(WikittyExtension current) { + _selectedNewExtension = current; + } + + public void setSelectedWikitty(Wikitty current) { + _wikittyForm.setWikitty(current); + } + + private void debbug(String debug) { + throw new UnsupportedOperationException(debug); + } + + /* + * Methods + */ +} Modified: trunk/wikitty-ui-zk/src/main/java/org/nuiton/wikitty/ui/WikittyZkConfig.java =================================================================== --- trunk/wikitty-ui-zk/src/main/java/org/nuiton/wikitty/ui/WikittyZkConfig.java 2010-06-24 14:13:27 UTC (rev 155) +++ trunk/wikitty-ui-zk/src/main/java/org/nuiton/wikitty/ui/WikittyZkConfig.java 2010-06-24 15:57:55 UTC (rev 156) @@ -46,6 +46,8 @@ for (Option o : Option.values()) { if (o.defaultValue != null) { setDefaultOption(o.key, o.defaultValue); + System.out.println("\nkey =====>" + o.key); + System.out.println("value =====>" + o.defaultValue); } } } @@ -54,8 +56,8 @@ if (instance == null) { try { instance = new WikittyZkConfig(); - instance.parse(new String[]{}); - instance.setDataDirInSystemProps(); + //instance.parse(new String[]{}); + // instance.setDataDirInSystemProps(); } catch (Exception e) { throw new UnhandledException(e); } @@ -100,6 +102,7 @@ } System.setProperty(Option.DATA_DIR.key, value); env.put(Option.DATA_DIR.key, value); + System.out.println(Option.DATA_DIR.key); } } Modified: trunk/wikitty-ui-zk/src/main/webapp/index.zul =================================================================== --- trunk/wikitty-ui-zk/src/main/webapp/index.zul 2010-06-24 14:13:27 UTC (rev 155) +++ trunk/wikitty-ui-zk/src/main/webapp/index.zul 2010-06-24 15:57:55 UTC (rev 156) @@ -1,48 +1,53 @@ <?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit"?> -<window id="win" title="To do list" width="800px" border="normal" apply="org.nuiton.wikitty.ui.Controller"> +<window id="win" title="To do list" width="800px" border="normal" apply="org.nuiton.wikitty.ui.LoginController"> + <groupbox> + <caption label="Database names" /> + <listbox multiple="true" id="dataList" rows="8" model="@{win$composer.proxyModel}" itemRenderer="@{win$composer.dataRenderer}" > - <listbox id="extensionListBox" multiple="true" rows="8" model="@{win$composer.extensions, load-after='add.onClick, update.onClick'}" - selectedItem="@{win$composer.selectedExtension}"> - - <listhead> - <listheader label="Name" /> - <listheader label="Version" /> - </listhead> - - <listitem self="@{each='extension'}"> - <listcell label="@{extension.name}" /> - <listcell label="@{extension.version}" /> - </listitem> - </listbox> - - <groupbox> - <caption label="extensions" /> - <listbox id="formListBox" rows="10" model="@{win$composer.wikittyForm.formModel}" itemRenderer="@{win$composer.wikittyForm.fieldExtensionRenderer}"> <listhead sizable="true"> - <listheader label="Extension" /> - <listheader label="Type" /> - <listheader label="Content" /> + <listheader label="name" /> </listhead> - </listbox> - <button id="add" label="Add" width="36px" height="24px"/> - <button id="update" label="Update" width="46px" height="24px"/> - <button id="addNewInput" label="New input" width="56px" height="24px" /> - <button id="deleteInput" label="Delete input" width="56px" height="24px" /> - <listbox id="newExtension" rows="1" mold="select" model="@{win$composer.extensions}" selectedItem="@{win$composer.selectedNewExtension}"> - <listitem self="@{each='newExtension'}"> - <listcell label="@{newExtension.name}"/> - </listitem> </listbox> - <button id="addNewExtension" label="Add extension" width="66px" height="24px"/> + <button id="select" label="Select" width="36px" height="24px" /> + <button id="delete" label="Delete" width="36px" height="24px" /> </groupbox> <groupbox> - <caption label="wikitties" /> - <listbox id="wikittiesListBox" rows="8" model="@{win$composer.wikittyModel}" itemRenderer="@{win$composer.wikittyRenderer}" selectedItem="@{win$composer.selectedWikitty}"> - </listbox> - <button id="delete" label="Delete" width="46px" height="24px"/> + <vbox> + <label value="Name" /> + <textbox id="Name"/> + <label value="DB" /> + <textbox id="Db" /> + <combobox id="driver"> + <comboitem label="org.h2.Driver" /> + <comboitem label="mySQL" /> + </combobox> + <label value="Solr" /> + <textbox id="Solr" /> + </vbox> + <vbox> + <label value="Login" /> + <textbox id="Login" /> + <label value="Password" /> + <textbox id="Password" /> + </vbox> + <button id="add" label="Add" width="36px" height="24px" /> </groupbox> + <groupbox> + <vbox> + <label value="Name" /> + <textbox id="distantName"/> + <label value="URL" /> + <textbox id="distantURL" /> + <label value="Login" /> + <textbox id="distantLogin"/> + <label value="Password" /> + <textbox id="distantPassword" /> + </vbox> + <button id="distantAdd" label="Add" width="36px" height="24px" /> + </groupbox> + </window> \ No newline at end of file Copied: trunk/wikitty-ui-zk/src/main/webapp/wikitty.zul (from rev 146, trunk/wikitty-ui-zk/src/main/webapp/index.zul) =================================================================== --- trunk/wikitty-ui-zk/src/main/webapp/wikitty.zul (rev 0) +++ trunk/wikitty-ui-zk/src/main/webapp/wikitty.zul 2010-06-24 15:57:55 UTC (rev 156) @@ -0,0 +1,48 @@ +<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit"?> + +<window id="win" title="To do list" width="800px" border="normal" apply="org.nuiton.wikitty.ui.WikittyController"> + + <listbox id="extensionListBox" multiple="true" rows="8" model="@{win$composer.extensions, load-after='add.onClick, update.onClick'}" + selectedItem="@{win$composer.selectedExtension}"> + + <listhead> + <listheader label="Name" /> + <listheader label="Version" /> + </listhead> + + <listitem self="@{each='extension'}"> + <listcell label="@{extension.name}" /> + <listcell label="@{extension.version}" /> + </listitem> + </listbox> + + <groupbox> + <caption label="wikitties" /> + <listbox id="wikittiesListBox" rows="8" model="@{win$composer.wikittyModel}" itemRenderer="@{win$composer.wikittyRenderer}" selectedItem="@{win$composer.selectedWikitty}"> + </listbox> + <button id="delete" label="Delete" width="46px" height="24px"/> + </groupbox> + + <groupbox> + <caption label="extensions" /> + <listbox id="formListBox" rows="10" model="@{win$composer.wikittyForm.formModel}" itemRenderer="@{win$composer.wikittyForm.fieldExtensionRenderer}"> + <listhead sizable="true"> + <listheader label="Extension" /> + <listheader label="Type" /> + <listheader label="Content" /> + </listhead> + </listbox> + <button id="add" label="Add" width="36px" height="24px"/> + <button id="update" label="Update" width="46px" height="24px"/> + <button id="addNewInput" label="New input" width="56px" height="24px" /> + <button id="deleteInput" label="Delete input" width="56px" height="24px" /> + + <listbox id="newExtension" rows="1" mold="select" model="@{win$composer.extensions}" selectedItem="@{win$composer.selectedNewExtension}"> + <listitem self="@{each='newExtension'}"> + <listcell label="@{newExtension.name}"/> + </listitem> + </listbox> + <button id="addNewExtension" label="Add extension" width="66px" height="24px"/> + </groupbox> + +</window> \ No newline at end of file
participants (1)
-
bbrossaudï¼ users.nuiton.org