org.zkoss.bind.converter.sys.TreeSelectedItemsConverter Maven / Gradle / Ivy
/* TreeSelectedItemsConverter.java
Purpose:
Description:
History:
Aug 17, 2011 6:10:20 PM, Created by dennis
Copyright (C) 2011 Potix Corporation. All Rights Reserved.
*/
package org.zkoss.bind.converter.sys;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Set;
import org.zkoss.bind.BindContext;
import org.zkoss.bind.Converter;
import org.zkoss.lang.Classes;
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 dennis
* @since 6.0.0
*/
public class TreeSelectedItemsConverter implements Converter, java.io.Serializable {
private static final long serialVersionUID = 201108171811L;
@SuppressWarnings("unchecked")
public Object coerceToUi(Object val, Component comp, BindContext ctx) {
Tree tree = (Tree) comp;
final TreeModel