本文整理汇总了Java中com.intellij.psi.javadoc.PsiDocComment.delete方法的典型用法代码示例。如果您正苦于以下问题:Java PsiDocComment.delete方法的具体用法?Java PsiDocComment.delete怎么用?Java PsiDocComment.delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.psi.javadoc.PsiDocComment
的用法示例。
在下文中一共展示了PsiDocComment.delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: clearMethod
import com.intellij.psi.javadoc.PsiDocComment; //导入方法依赖的package包/类
private void clearMethod(PsiMethod method) throws IncorrectOperationException {
LOG.assertTrue(!method.isPhysical());
PsiCodeBlock codeBlock = JavaPsiFacade.getInstance(method.getProject()).getElementFactory().createCodeBlock();
if (method.getBody() != null) {
method.getBody().replace(codeBlock);
}
else {
method.add(codeBlock);
}
if (!myToCopyJavaDoc) {
final PsiDocComment docComment = method.getDocComment();
if (docComment != null) {
docComment.delete();
}
}
}
示例2: implementMethodInClass
import com.intellij.psi.javadoc.PsiDocComment; //导入方法依赖的package包/类
private static void implementMethodInClass(@NotNull PsiMethod method,
@NotNull PsiClass aClass) {
final PsiMethod newMethod = (PsiMethod)aClass.add(method);
final PsiDocComment comment = newMethod.getDocComment();
if (comment != null) {
comment.delete();
}
final PsiModifierList modifierList = newMethod.getModifierList();
modifierList.setModifierProperty(PsiModifier.ABSTRACT, false);
final Project project = aClass.getProject();
final CodeStyleSettings codeStyleSettings =
CodeStyleSettingsManager.getSettings(project);
if (codeStyleSettings.INSERT_OVERRIDE_ANNOTATION &&
PsiUtil.isLanguageLevel6OrHigher(aClass)) {
modifierList.addAnnotation("java.lang.Override");
}
final PsiElementFactory factory =
JavaPsiFacade.getElementFactory(project);
final PsiCodeBlock codeBlock = factory.createCodeBlock();
newMethod.add(codeBlock);
}
示例3: deleteDocComment
import com.intellij.psi.javadoc.PsiDocComment; //导入方法依赖的package包/类
public static void deleteDocComment(PsiMethod result) {
PsiDocComment comment = result.getDocComment();
if (comment != null){
comment.delete();
}
}