当前位置: 首页>>代码示例>>Java>>正文


Java CodeStyleCleanUp类代码示例

本文整理汇总了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);
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:21,代码来源:LocalCorrectionsSubProcessor.java

示例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);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:13,代码来源:LocalCorrectionsSubProcessor.java

示例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)
       };
   }
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:7,代码来源:MemberAccessesTabPage.java


注:本文中的org.eclipse.jdt.internal.ui.fix.CodeStyleCleanUp类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。