X-Git-Url: http://git.phpeclipse.com
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/ui/wizards/NewTypeWizardPage.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/ui/wizards/NewTypeWizardPage.java
index 582eda6..8105380 100644
--- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/ui/wizards/NewTypeWizardPage.java
+++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/ui/wizards/NewTypeWizardPage.java
@@ -18,6 +18,7 @@ import net.sourceforge.phpdt.core.IBuffer;
import net.sourceforge.phpdt.core.ICompilationUnit;
import net.sourceforge.phpdt.core.IJavaElement;
import net.sourceforge.phpdt.core.IPackageFragment;
+import net.sourceforge.phpdt.core.IPackageFragmentRoot;
import net.sourceforge.phpdt.core.ISourceRange;
import net.sourceforge.phpdt.core.IType;
import net.sourceforge.phpdt.core.ToolFactory;
@@ -28,6 +29,7 @@ import net.sourceforge.phpdt.externaltools.internal.ui.StatusInfo;
import net.sourceforge.phpdt.internal.corext.codemanipulation.StubUtility;
import net.sourceforge.phpdt.internal.corext.template.php.JavaContext;
import net.sourceforge.phpdt.internal.corext.template.php.Templates;
+import net.sourceforge.phpdt.internal.corext.util.JavaModelUtil;
import net.sourceforge.phpdt.internal.ui.PHPUiImages;
import net.sourceforge.phpdt.internal.ui.util.SWTUtil;
import net.sourceforge.phpdt.internal.ui.wizards.NewWizardMessages;
@@ -43,6 +45,7 @@ import net.sourceforge.phpdt.internal.ui.wizards.dialogfields.Separator;
import net.sourceforge.phpdt.internal.ui.wizards.dialogfields.StringButtonDialogField;
import net.sourceforge.phpdt.internal.ui.wizards.dialogfields.StringButtonStatusDialogField;
import net.sourceforge.phpdt.internal.ui.wizards.dialogfields.StringDialogField;
+import net.sourceforge.phpdt.ui.CodeGeneration;
import net.sourceforge.phpdt.ui.PreferenceConstants;
import net.sourceforge.phpeclipse.PHPeclipsePlugin;
@@ -75,8 +78,8 @@ import org.eclipse.swt.widgets.Control;
* example usage of NewTypeWizardPage
.
*
null
if a type comment
* is not desired
*/
- // protected String getTypeComment(ICompilationUnit parentCU) {
- // if (PreferenceConstants.getPreferenceStore().getBoolean(PreferenceConstants.CODEGEN_ADD_COMMENTS)) {
- // try {
- // StringBuffer typeName= new StringBuffer();
- // if (isEnclosingTypeSelected()) {
- // typeName.append(JavaModelUtil.getTypeQualifiedName(getEnclosingType())).append('.');
- // }
- // typeName.append(getTypeName());
- // String comment= CodeGeneration.getTypeComment(parentCU, typeName.toString(), String.valueOf('\n'));
- // if (comment != null && isValidComment(comment)) {
- // return comment;
- // }
- // } catch (CoreException e) {
- // PHPeclipsePlugin.log(e);
- // }
- // }
- // return null;
- // }
+ protected String getTypeComment(ICompilationUnit parentCU) {
+ if (PreferenceConstants.getPreferenceStore().getBoolean(PreferenceConstants.CODEGEN_ADD_COMMENTS)) {
+ try {
+ StringBuffer typeName= new StringBuffer();
+ if (isEnclosingTypeSelected()) {
+ typeName.append(JavaModelUtil.getTypeQualifiedName(getEnclosingType())).append('.');
+ }
+ typeName.append(getTypeName());
+ String comment= CodeGeneration.getTypeComment(parentCU, typeName.toString(), String.valueOf('\n'));
+ if (comment != null && isValidComment(comment)) {
+ return comment;
+ }
+ } catch (CoreException e) {
+ PHPeclipsePlugin.log(e);
+ }
+ }
+ return null;
+ }
/**
* @deprecated Use getTemplate(String,ICompilationUnit,int)