protected void createTypeMembers(IType type, ImportsManager imports, IProgressMonitor monitor) throws CoreException {
boolean doMain= isCreateMain();
boolean doConstr= isCreateConstructors();
boolean doInherited= isCreateInherited();
createInheritedMethods(type, doConstr, doInherited, imports, new SubProgressMonitor(monitor, 1));
if (doMain) {
StringBuffer buf= new StringBuffer();
final String lineDelim= "\n";
String comment= CodeGeneration.getMethodComment(type.getCompilationUnit(), type.getTypeQualifiedName('.'), "main", new String[] {"args"}, new String[0], Signature.createTypeSignature("void", true), null, lineDelim);
if (comment != null) {
buf.append(comment);
buf.append(lineDelim);
}
buf.append("public static void main(");
buf.append(imports.addImport("java.lang.String"));
buf.append("[] args) {");
buf.append(lineDelim);
final String content= CodeGeneration.getMethodBodyContent(type.getCompilationUnit(), type.getTypeQualifiedName('.'), "main", false, "", lineDelim);
if (content != null && content.length() != 0)
buf.append(content);
buf.append(lineDelim);
buf.append("}");
type.createMethod(buf.toString(), null, false, null);
}
if (monitor != null) {
monitor.done();
}
}