本文整理汇总了Java中org.eclipse.jdt.internal.ui.fix.StringCleanUp类的典型用法代码示例。如果您正苦于以下问题:Java StringCleanUp类的具体用法?Java StringCleanUp怎么用?Java StringCleanUp使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StringCleanUp类属于org.eclipse.jdt.internal.ui.fix包,在下文中一共展示了StringCleanUp类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getUnnecessaryNLSTagProposals
import org.eclipse.jdt.internal.ui.fix.StringCleanUp; //导入依赖的package包/类
public static void getUnnecessaryNLSTagProposals(
IInvocationContext context, IProblemLocation problem, Collection<ICommandAccess> proposals)
throws CoreException {
IProposableFix fix = StringFix.createFix(context.getASTRoot(), problem, true, false);
if (fix != null) {
Image image =
JavaPluginImages.get(
JavaPluginImages
.IMG_TOOL_DELETE); // JavaPlugin.getDefault().getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE);
Map<String, String> options = new Hashtable<String, String>();
options.put(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS, CleanUpOptions.TRUE);
FixCorrectionProposal proposal =
new FixCorrectionProposal(
fix,
new StringCleanUp(options),
IProposalRelevance.UNNECESSARY_NLS_TAG,
image,
context);
proposal.setCommandId(REMOVE_UNNECESSARY_NLS_TAG_ID);
proposals.add(proposal);
}
}
示例2: addNLSProposals
import org.eclipse.jdt.internal.ui.fix.StringCleanUp; //导入依赖的package包/类
public static void addNLSProposals(IInvocationContext context, IProblemLocation problem, Collection<ICommandAccess> proposals) throws CoreException {
final ICompilationUnit cu= context.getCompilationUnit();
if (cu == null || !cu.exists()){
return;
}
String name= CorrectionMessages.LocalCorrectionsSubProcessor_externalizestrings_description;
ChangeCorrectionProposal proposal= new ChangeCorrectionProposal(name, null, IProposalRelevance.EXTERNALIZE_STRINGS, JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE)) {
@Override
public void apply(IDocument document) {
ExternalizeWizard.open(cu, JavaPlugin.getActiveWorkbenchShell());
}
@Override
public Object getAdditionalProposalInfo(IProgressMonitor monitor) {
return CorrectionMessages.LocalCorrectionsSubProcessor_externalizestrings_additional_info;
}
};
proposals.add(proposal);
IProposableFix fix= StringFix.createFix(context.getASTRoot(), problem, false, true);
if (fix != null) {
Image image= JavaPluginImages.get(JavaPluginImages.IMG_OBJS_NLS_NEVER_TRANSLATE);
Map<String, String> options= new Hashtable<String, String>();
options.put(CleanUpConstants.ADD_MISSING_NLS_TAGS, CleanUpOptions.TRUE);
FixCorrectionProposal addNLS= new FixCorrectionProposal(fix, new StringCleanUp(options), IProposalRelevance.ADD_MISSING_NLS_TAGS, image, context);
addNLS.setCommandId(ADD_NON_NLS_ID);
proposals.add(addNLS);
}
}
示例3: getUnnecessaryNLSTagProposals
import org.eclipse.jdt.internal.ui.fix.StringCleanUp; //导入依赖的package包/类
public static void getUnnecessaryNLSTagProposals(IInvocationContext context, IProblemLocation problem, Collection<ICommandAccess> proposals) throws CoreException {
IProposableFix fix= StringFix.createFix(context.getASTRoot(), problem, true, false);
if (fix != null) {
Image image= JavaPlugin.getDefault().getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE);
Map<String, String> options= new Hashtable<String, String>();
options.put(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS, CleanUpOptions.TRUE);
FixCorrectionProposal proposal= new FixCorrectionProposal(fix, new StringCleanUp(options), IProposalRelevance.UNNECESSARY_NLS_TAG, image, context);
proposal.setCommandId(REMOVE_UNNECESSARY_NLS_TAG_ID);
proposals.add(proposal);
}
}
示例4: createPreviewCleanUps
import org.eclipse.jdt.internal.ui.fix.StringCleanUp; //导入依赖的package包/类
@Override
protected AbstractCleanUp[] createPreviewCleanUps(Map<String, String> values) {
return new AbstractCleanUp[] {
new UnusedCodeCleanUp(values),
new UnnecessaryCodeCleanUp(values),
new StringCleanUp(values)
};
}
示例5: addNLSProposals
import org.eclipse.jdt.internal.ui.fix.StringCleanUp; //导入依赖的package包/类
public static void addNLSProposals(IInvocationContext context, IProblemLocation problem, Collection<ICommandAccess> proposals) throws CoreException {
final ICompilationUnit cu= context.getCompilationUnit();
if (cu == null || !cu.exists()){
return;
}
String name= CorrectionMessages.LocalCorrectionsSubProcessor_externalizestrings_description;
ChangeCorrectionProposal proposal= new ChangeCorrectionProposal(name, null, 4, JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE)) {
@Override
public void apply(IDocument document) {
ExternalizeWizard.open(cu, JavaPlugin.getActiveWorkbenchShell());
}
@Override
public Object getAdditionalProposalInfo(IProgressMonitor monitor) {
return CorrectionMessages.LocalCorrectionsSubProcessor_externalizestrings_additional_info;
}
};
proposals.add(proposal);
IProposableFix fix= StringFix.createFix(context.getASTRoot(), problem, false, true);
if (fix != null) {
Image image= JavaPluginImages.get(JavaPluginImages.IMG_OBJS_NLS_NEVER_TRANSLATE);
Map<String, String> options= new Hashtable<String, String>();
options.put(CleanUpConstants.ADD_MISSING_NLS_TAGS, CleanUpOptions.TRUE);
FixCorrectionProposal addNLS= new FixCorrectionProposal(fix, new StringCleanUp(options), 5, image, context);
addNLS.setCommandId(ADD_NON_NLS_ID);
proposals.add(addNLS);
}
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:31,代码来源:LocalCorrectionsSubProcessor.java
示例6: getUnnecessaryNLSTagProposals
import org.eclipse.jdt.internal.ui.fix.StringCleanUp; //导入依赖的package包/类
public static void getUnnecessaryNLSTagProposals(IInvocationContext context, IProblemLocation problem, Collection<ICommandAccess> proposals) throws CoreException {
IProposableFix fix= StringFix.createFix(context.getASTRoot(), problem, true, false);
if (fix != null) {
Image image= JavaPlugin.getDefault().getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE);
Map<String, String> options= new Hashtable<String, String>();
options.put(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS, CleanUpOptions.TRUE);
FixCorrectionProposal proposal= new FixCorrectionProposal(fix, new StringCleanUp(options), 6, image, context);
proposal.setCommandId(REMOVE_UNNECESSARY_NLS_TAG_ID);
proposals.add(proposal);
}
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:12,代码来源:LocalCorrectionsSubProcessor.java