All pastes #759102 Raw Edit

Something

public text v1 · immutable
·published 2007-11-02 20:55 UTC
rendered paste body
package org.jboss.ide.eclipse.as.core.util;

import java.util.ArrayList;
import java.util.Arrays;

import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;

public class ModuleUtil {
	public static ArrayList getShallowChildren(IServer server, IModule[] root) {
		ArrayList list = new ArrayList();
		IModule[] children = server.getChildModules(root, new NullProgressMonitor());
		// children is { aWar, bWar, cWar } projects
		for( int i = 0; i < children.length; i++ ) {
			ArrayList inner = new ArrayList();
			inner.addAll(Arrays.asList(root));
			inner.add(children[i]);
			IModule[] innerMods = (IModule[]) inner.toArray(new IModule[inner.size()]);
			list.add(innerMods);
		}
		return list;
	}
	
	public static void getDeepChildren(IServer server, IModule[] mod) {
		ArrayList checked = new ArrayList();
		ArrayList shallow = getShallowChildren(server, mod);
		System.out.println("tmp");
	}
}