String classBody = ii.next().trim();
String className = jj.next().trim();
a = new ApexClassWizard(true, allPackages);
ApexClassWizardPage ap = new ApexClassWizardPage(a);
ApexClassModel apexClassModel = (ApexClassModel) ap.getComponentWizardModel();
a.init(currentWorkBench, initialSelection);
Component apexComponent = apexClassModel.getComponent();
apexComponent.setBodyFromTemplateString(classBody);
apexComponent.setName(className);
if (!ap.getComponentController().isNameUniqueLocalCheck()) {
throw new IOException("There is already a class named " + className);
}
}
Iterator<String> i = generator.getAllClasses().iterator();
Iterator<String> j = generator.getAllClassNames().iterator();
while (i.hasNext() && j.hasNext()) //this loop for creating apex classes by programmatically using the ApexClassWizard
{
String classBody = i.next();
String className = j.next();
a = new ApexClassWizard(true, allPackages);
ApexClassWizardPage ap = new ApexClassWizardPage(a);
ApexClassModel apexClassModel = (ApexClassModel) ap.getComponentWizardModel();
a.init(currentWorkBench, initialSelection);
Component apexComponent = apexClassModel.getComponent();
//set the body and class name of the component
apexComponent.setBodyFromTemplateString(classBody);
apexComponent.setName(className);