本文整理汇总了Java中org.eclipse.jdt.internal.ui.fix.CodeStyleCleanUp类的典型用法代码示例。如果您正苦于以下问题:Java CodeStyleCleanUp类的具体用法?Java CodeStyleCleanUp怎么用?Java CodeStyleCleanUp使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CodeStyleCleanUp类属于org.eclipse.jdt.internal.ui.fix包,在下文中一共展示了CodeStyleCleanUp类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addUnqualifiedFieldAccessProposal
import org.eclipse.jdt.internal.ui.fix.CodeStyleCleanUp; //导入依赖的package包/类
public static void addUnqualifiedFieldAccessProposal(
IInvocationContext context, IProblemLocation problem, Collection<ICommandAccess> proposals) {
IProposableFix fix = CodeStyleFix.createAddFieldQualifierFix(context.getASTRoot(), problem);
if (fix != null) {
Image image = JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
Map<String, String> options = new HashMap<String, String>();
options.put(CleanUpConstants.MEMBER_ACCESSES_NON_STATIC_FIELD_USE_THIS, CleanUpOptions.TRUE);
options.put(
CleanUpConstants.MEMBER_ACCESSES_NON_STATIC_FIELD_USE_THIS_ALWAYS, CleanUpOptions.TRUE);
FixCorrectionProposal proposal =
new FixCorrectionProposal(
fix,
new CodeStyleCleanUp(options),
IProposalRelevance.ADD_FIELD_QUALIFIER,
image,
context);
proposal.setCommandId(ADD_FIELD_QUALIFICATION_ID);
proposals.add(proposal);
}
}
示例2: addUnqualifiedFieldAccessProposal
import org.eclipse.jdt.internal.ui.fix.CodeStyleCleanUp; //导入依赖的package包/类
public static void addUnqualifiedFieldAccessProposal(IInvocationContext context, IProblemLocation problem, Collection<ICommandAccess> proposals) {
IProposableFix fix= CodeStyleFix.createAddFieldQualifierFix(context.getASTRoot(), problem);
if (fix != null) {
Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
Map<String, String> options= new HashMap<String, String>();
options.put(CleanUpConstants.MEMBER_ACCESSES_NON_STATIC_FIELD_USE_THIS, CleanUpOptions.TRUE);
options.put(CleanUpConstants.MEMBER_ACCESSES_NON_STATIC_FIELD_USE_THIS_ALWAYS, CleanUpOptions.TRUE);
FixCorrectionProposal proposal= new FixCorrectionProposal(fix, new CodeStyleCleanUp(options), IProposalRelevance.ADD_FIELD_QUALIFIER, image, context);
proposal.setCommandId(ADD_FIELD_QUALIFICATION_ID);
proposals.add(proposal);
}
}
示例3: addUnqualifiedFieldAccessProposal
import org.eclipse.jdt.internal.ui.fix.CodeStyleCleanUp; //导入依赖的package包/类
public static void addUnqualifiedFieldAccessProposal(IInvocationContext context, IProblemLocation problem, Collection<ICommandAccess> proposals) {
IProposableFix fix= CodeStyleFix.createAddFieldQualifierFix(context.getASTRoot(), problem);
if (fix != null) {
Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
Map<String, String> options= new HashMap<String, String>();
options.put(CleanUpConstants.MEMBER_ACCESSES_NON_STATIC_FIELD_USE_THIS, CleanUpOptions.TRUE);
options.put(CleanUpConstants.MEMBER_ACCESSES_NON_STATIC_FIELD_USE_THIS_ALWAYS, CleanUpOptions.TRUE);
FixCorrectionProposal proposal= new FixCorrectionProposal(fix, new CodeStyleCleanUp(options), 8, image, context);
proposal.setCommandId(ADD_FIELD_QUALIFICATION_ID);
proposals.add(proposal);
}
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:13,代码来源:LocalCorrectionsSubProcessor.java
示例4: createPreviewCleanUps
import org.eclipse.jdt.internal.ui.fix.CodeStyleCleanUp; //导入依赖的package包/类
@Override
protected AbstractCleanUp[] createPreviewCleanUps(Map<String, String> values) {
return new AbstractCleanUp[] {
new CodeStyleCleanUp(values)
};
}