if(type != null){
JavaUI.revealInEditor(JavaUI.openInEditor(type), (IJavaElement)type);
} else {
if(superClass != null && superClass == ClickPlugin.CLICK_PAGE_CLASS){
// Opens the new page creation wizard
NewClickPageWizard wizard = new NewClickPageWizard();
wizard.init(PlatformUI.getWorkbench(), new StructuredSelection(project));
wizard.setInitialClassName(className);
if(textFileName != null){
wizard.setInitialPageName(textFileName.getText());
}
WizardDialog dialog = new WizardDialog(text.getShell(), wizard);
dialog.open();
} else {
// Opens the new java class creation wizard
NewClassWizard wizard = new NewClassWizard();
wizard.init(PlatformUI.getWorkbench(), new StructuredSelection(project));
if(superClass != null){
if(superClass == ClickPlugin.CLICK_CONTROL_IF
|| superClass == ClickPlugin.CLICK_PAGE_INTERCEPTOR_IF
|| superClass.endsWith("Service")){
wizard.addInterface(superClass);
} else {
wizard.setSuperClass(superClass);
}
}
wizard.setClassName(className);
WizardDialog dialog = new WizardDialog(text.getShell(), wizard);
dialog.open();
}
}
}