Shell shell = JavaPlugin.getActiveWorkbenchShell();
WizardDialog dialog = new WizardDialog(shell, wizard);
dialog.create();
dialog.getShell().setText("New");
IWizardPage[] pages = wizard.getPages();
NewTypeWizardPage page = (NewTypeWizardPage) pages[0];
String markerMessage = marker.getAttribute(MESSAGE_ATTRIBUTE_KEY, "");
IJavaProject javaProject = JdtUtils.getJavaProject(marker.getResource());
IPackageFragmentRoot sourcePackageFragmentRoot = null;
String packageName = extractPackageNameFromMessage(markerMessage);
try {
sourcePackageFragmentRoot = inferPackageFragmentRoot(javaProject, packageName);
if (sourcePackageFragmentRoot != null) {
page.setPackageFragmentRoot(sourcePackageFragmentRoot, true);
IPackageFragment packageFragment = sourcePackageFragmentRoot.getPackageFragment(packageName);
if (packageFragment != null) {
page.setPackageFragment(packageFragment, true);
}
}
}
catch (CoreException e) {
StatusHandler.log(e.getStatus());
}
page.setTypeName(extractClassNameFromMessage(markerMessage), true);
if (dialog.open() == Window.OK) {
IType createdType = (IType) wizard.getCreatedElement();
String fullyQualifiedClassName = createdType.getFullyQualifiedName();
updateXmlBeanClass(marker, fullyQualifiedClassName);