1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
   |  
// j'ai supposé que j'ai inséré mon widget dans un CellPanel
public  List<Widget> getWidgetCollection(CellPanel cp) {
		List<Widget> collection = new ArrayList<Widget>();
		int nbr = cp.getWidgetCount();
		for (int i = 0; i < nbr; i++) {
			collection.add(cp.getWidget(i));
			Type type=cp.getWidget(i).getClass().getGenericSuperclass();
			try {
				if (type instanceof CellPanel)  // je veux vérifier si j'ai encore un CellPanel qui contient d'autre composant
					collection=fusionList(collection,getWidgetCollection((CellPanel)cp.getWidget(i))); // récursivité
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		return collection;
	} | 
Partager