throw new IllegalArgumentException("jars are null");
if(className == null)
throw new IllegalArgumentException("className is null");
UIDescriptor desc = new UIDescriptor();
desc.role = role;
UIFactoryTypes types ;
MarshalledObject factory;
URL[] urls = new URL[jars.length];
for(int i = 0; i < urls.length; i++) {
urls[i] = new URL(codebase+(codebase.endsWith("/")?"":"/")+jars[i]);
}
if(typeName.equals(JComponentFactory.TYPE_NAME)) {
types = new UIFactoryTypes( Collections.singleton(JComponentFactory.TYPE_NAME));
factory = new MarshalledObject<UIComponentFactory>(new UIComponentFactory(urls, className));
desc.toolkit = JComponentFactory.TOOLKIT;
} else if(typeName.equals(JDialogFactory.TYPE_NAME)) {
types = new UIFactoryTypes(
Collections.singleton(JDialogFactory.TYPE_NAME));
factory = new MarshalledObject<UIDialogFactory>(new UIDialogFactory(urls, className));
desc.toolkit = JDialogFactory.TOOLKIT;
} else if(typeName.equals(JFrameFactory.TYPE_NAME)) {
types = new UIFactoryTypes(
Collections.singleton(JFrameFactory.TYPE_NAME));
factory = new MarshalledObject<UIFrameFactory>(new UIFrameFactory(urls, className));
desc.toolkit = JFrameFactory.TOOLKIT;
} else if(typeName.equals(JWindowFactory.TYPE_NAME)) {
types = new UIFactoryTypes(
Collections.singleton(JWindowFactory.TYPE_NAME));
factory = new MarshalledObject<UIWindowFactory>(new UIWindowFactory(urls, className));
desc.toolkit = JWindowFactory.TOOLKIT;
} else {
throw new IllegalArgumentException("unknown typeName "+typeName);