org.zkoss.bind.converter.sys.TreeSelectedItemConverter Maven / Gradle / Ivy
/* TreeSelectedItemConverter.java
Purpose:
Description:
History:
Aug 17, 2011 6:10:20 PM, Created by henrichen
Copyright (C) 2011 Potix Corporation. All Rights Reserved.
*/
package org.zkoss.bind.converter.sys;
import java.util.Iterator;
import org.zkoss.bind.BindContext;
import org.zkoss.bind.Converter;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.UiException;
import org.zkoss.zul.Tree;
import org.zkoss.zul.TreeModel;
import org.zkoss.zul.Treeitem;
import org.zkoss.zul.ext.TreeSelectableModel;
/**
* Convert tree selected treeitem to bean and vice versa.
* @author henrichen
* @author dennis
* @since 6.0.0
*/
public class TreeSelectedItemConverter implements Converter, java.io.Serializable {
private static final long serialVersionUID = 201109261823L;
public Object coerceToUi(Object val, Component comp, BindContext ctx) {
Tree tree = (Tree) comp;
final TreeModel