本文整理汇总了Java中org.eclipse.jdt.ui.cleanup.CleanUpOptions类的典型用法代码示例。如果您正苦于以下问题:Java CleanUpOptions类的具体用法?Java CleanUpOptions怎么用?Java CleanUpOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CleanUpOptions类属于org.eclipse.jdt.ui.cleanup包,在下文中一共展示了CleanUpOptions类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getCleanUpOptions
import org.eclipse.jdt.ui.cleanup.CleanUpOptions; //导入依赖的package包/类
private static Map<String, String> getCleanUpOptions(IBinding binding, boolean removeAll) {
Map<String, String> result = new Hashtable<String, String>();
result.put(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_MEMBERS, CleanUpOptions.TRUE);
switch (binding.getKind()) {
case IBinding.TYPE:
result.put(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_TYPES, CleanUpOptions.TRUE);
break;
case IBinding.METHOD:
if (((IMethodBinding) binding).isConstructor()) {
result.put(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_CONSTRUCTORS, CleanUpOptions.TRUE);
} else {
result.put(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_METHODS, CleanUpOptions.TRUE);
}
break;
case IBinding.VARIABLE:
if (removeAll) return null;
result.put(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_FELDS, CleanUpOptions.TRUE);
result.put(CleanUpConstants.REMOVE_UNUSED_CODE_LOCAL_VARIABLES, CleanUpOptions.TRUE);
break;
}
return result;
}
开发者ID:eclipse,项目名称:che,代码行数:26,代码来源:UnusedCodeFix.java
示例2: getUnnecessaryNLSTagProposals
import org.eclipse.jdt.ui.cleanup.CleanUpOptions; //导入依赖的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);
}
}
开发者ID:eclipse,项目名称:che,代码行数:23,代码来源:LocalCorrectionsSubProcessor.java
示例3: addUnnecessaryCastProposal
import org.eclipse.jdt.ui.cleanup.CleanUpOptions; //导入依赖的package包/类
public static void addUnnecessaryCastProposal(
IInvocationContext context, IProblemLocation problem, Collection<ICommandAccess> proposals) {
IProposableFix fix = UnusedCodeFix.createRemoveUnusedCastFix(context.getASTRoot(), problem);
if (fix != null) {
Image image = JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
Map<String, String> options = new Hashtable<String, String>();
options.put(CleanUpConstants.REMOVE_UNNECESSARY_CASTS, CleanUpOptions.TRUE);
FixCorrectionProposal proposal =
new FixCorrectionProposal(
fix,
new UnnecessaryCodeCleanUp(options),
IProposalRelevance.REMOVE_UNUSED_CAST,
image,
context);
proposals.add(proposal);
}
}
开发者ID:eclipse,项目名称:che,代码行数:18,代码来源:LocalCorrectionsSubProcessor.java
示例4: addUnqualifiedFieldAccessProposal
import org.eclipse.jdt.ui.cleanup.CleanUpOptions; //导入依赖的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
示例5: addRemoveRedundantTypeArgumentsProposals
import org.eclipse.jdt.ui.cleanup.CleanUpOptions; //导入依赖的package包/类
public static void addRemoveRedundantTypeArgumentsProposals(
IInvocationContext context, IProblemLocation problem, Collection<ICommandAccess> proposals) {
IProposableFix fix =
TypeParametersFix.createRemoveRedundantTypeArgumentsFix(context.getASTRoot(), problem);
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 HashMap<String, String>();
options.put(CleanUpConstants.USE_TYPE_ARGUMENTS, CleanUpOptions.TRUE);
options.put(CleanUpConstants.REMOVE_REDUNDANT_TYPE_ARGUMENTS, CleanUpOptions.TRUE);
FixCorrectionProposal proposal =
new FixCorrectionProposal(
fix,
new TypeParametersCleanUp(options),
IProposalRelevance.REMOVE_REDUNDANT_TYPE_ARGUMENTS,
image,
context);
proposals.add(proposal);
}
}
开发者ID:eclipse,项目名称:che,代码行数:23,代码来源:LocalCorrectionsSubProcessor.java
示例6: addOverrideAnnotationProposal
import org.eclipse.jdt.ui.cleanup.CleanUpOptions; //导入依赖的package包/类
public static void addOverrideAnnotationProposal(
IInvocationContext context, IProblemLocation problem, Collection<ICommandAccess> proposals) {
IProposableFix fix = Java50Fix.createAddOverrideAnnotationFix(context.getASTRoot(), problem);
if (fix != null) {
Image image = JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
Map<String, String> options = new Hashtable<String, String>();
options.put(CleanUpConstants.ADD_MISSING_ANNOTATIONS, CleanUpOptions.TRUE);
options.put(CleanUpConstants.ADD_MISSING_ANNOTATIONS_OVERRIDE, CleanUpOptions.TRUE);
options.put(
CleanUpConstants.ADD_MISSING_ANNOTATIONS_OVERRIDE_FOR_INTERFACE_METHOD_IMPLEMENTATION,
CleanUpOptions.TRUE);
FixCorrectionProposal proposal =
new FixCorrectionProposal(
fix,
new Java50CleanUp(options),
IProposalRelevance.ADD_OVERRIDE_ANNOTATION,
image,
context);
proposals.add(proposal);
}
}
开发者ID:eclipse,项目名称:che,代码行数:22,代码来源:ModifierCorrectionSubProcessor.java
示例7: addDeprecatedAnnotationProposal
import org.eclipse.jdt.ui.cleanup.CleanUpOptions; //导入依赖的package包/类
public static void addDeprecatedAnnotationProposal(
IInvocationContext context, IProblemLocation problem, Collection<ICommandAccess> proposals) {
IProposableFix fix = Java50Fix.createAddDeprectatedAnnotation(context.getASTRoot(), problem);
if (fix != null) {
Image image = JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
Map<String, String> options = new Hashtable<String, String>();
options.put(CleanUpConstants.ADD_MISSING_ANNOTATIONS, CleanUpOptions.TRUE);
options.put(CleanUpConstants.ADD_MISSING_ANNOTATIONS_DEPRECATED, CleanUpOptions.TRUE);
FixCorrectionProposal proposal =
new FixCorrectionProposal(
fix,
new Java50CleanUp(options),
IProposalRelevance.ADD_DEPRECATED_ANNOTATION,
image,
context);
proposals.add(proposal);
}
}
开发者ID:eclipse,项目名称:che,代码行数:19,代码来源:ModifierCorrectionSubProcessor.java
示例8: getRemoveBlockProposals
import org.eclipse.jdt.ui.cleanup.CleanUpOptions; //导入依赖的package包/类
private static boolean getRemoveBlockProposals(
IInvocationContext context,
ASTNode coveringNode,
Collection<ICommandAccess> resultingCollections) {
IProposableFix[] fixes =
ControlStatementsFix.createRemoveBlockFix(context.getASTRoot(), coveringNode);
if (fixes != null) {
if (resultingCollections == null) {
return true;
}
Map<String, String> options = new Hashtable<String, String>();
options.put(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS, CleanUpOptions.TRUE);
options.put(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NEVER, CleanUpOptions.TRUE);
ICleanUp cleanUp = new ControlStatementsCleanUp(options);
for (int i = 0; i < fixes.length; i++) {
IProposableFix fix = fixes[i];
Image image = JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
FixCorrectionProposal proposal =
new FixCorrectionProposal(
fix, cleanUp, IProposalRelevance.REMOVE_BLOCK_FIX, image, context);
resultingCollections.add(proposal);
}
return true;
}
return false;
}
开发者ID:eclipse,项目名称:che,代码行数:27,代码来源:QuickAssistProcessor.java
示例9: getConvertForLoopProposal
import org.eclipse.jdt.ui.cleanup.CleanUpOptions; //导入依赖的package包/类
private static boolean getConvertForLoopProposal(
IInvocationContext context, ASTNode node, Collection<ICommandAccess> resultingCollections) {
ForStatement forStatement = getEnclosingForStatementHeader(node);
if (forStatement == null) return false;
if (resultingCollections == null) return true;
IProposableFix fix =
ConvertLoopFix.createConvertForLoopToEnhancedFix(context.getASTRoot(), forStatement);
if (fix == null) return false;
Image image = JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
Map<String, String> options = new HashMap<String, String>();
options.put(
CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED, CleanUpOptions.TRUE);
ICleanUp cleanUp = new ConvertLoopCleanUp(options);
FixCorrectionProposal proposal =
new FixCorrectionProposal(
fix, cleanUp, IProposalRelevance.CONVERT_FOR_LOOP_TO_ENHANCED, image, context);
proposal.setCommandId(CONVERT_FOR_LOOP_ID);
resultingCollections.add(proposal);
return true;
}
开发者ID:eclipse,项目名称:che,代码行数:25,代码来源:QuickAssistProcessor.java
示例10: getConvertIterableLoopProposal
import org.eclipse.jdt.ui.cleanup.CleanUpOptions; //导入依赖的package包/类
private static boolean getConvertIterableLoopProposal(
IInvocationContext context, ASTNode node, Collection<ICommandAccess> resultingCollections) {
ForStatement forStatement = getEnclosingForStatementHeader(node);
if (forStatement == null) return false;
if (resultingCollections == null) return true;
IProposableFix fix =
ConvertLoopFix.createConvertIterableLoopToEnhancedFix(context.getASTRoot(), forStatement);
if (fix == null) return false;
Image image = JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
Map<String, String> options = new HashMap<String, String>();
options.put(
CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED, CleanUpOptions.TRUE);
ICleanUp cleanUp = new ConvertLoopCleanUp(options);
FixCorrectionProposal proposal =
new FixCorrectionProposal(
fix, cleanUp, IProposalRelevance.CONVERT_ITERABLE_LOOP_TO_ENHANCED, image, context);
proposal.setCommandId(CONVERT_FOR_LOOP_ID);
resultingCollections.add(proposal);
return true;
}
开发者ID:eclipse,项目名称:che,代码行数:25,代码来源:QuickAssistProcessor.java
示例11: loadSaveParticipantOptions
import org.eclipse.jdt.ui.cleanup.CleanUpOptions; //导入依赖的package包/类
public static Map<String, String> loadSaveParticipantOptions(IScopeContext context) {
IEclipsePreferences node;
if (hasSettingsInScope(context)) {
node= context.getNode(JavaUI.ID_PLUGIN);
} else {
IScopeContext instanceScope= InstanceScope.INSTANCE;
if (hasSettingsInScope(instanceScope)) {
node= instanceScope.getNode(JavaUI.ID_PLUGIN);
} else {
return JavaPlugin.getDefault().getCleanUpRegistry().getDefaultOptions(CleanUpConstants.DEFAULT_SAVE_ACTION_OPTIONS).getMap();
}
}
Map<String, String> result= new HashMap<String, String>();
Set<String> keys= JavaPlugin.getDefault().getCleanUpRegistry().getDefaultOptions(CleanUpConstants.DEFAULT_SAVE_ACTION_OPTIONS).getKeys();
for (Iterator<String> iterator= keys.iterator(); iterator.hasNext();) {
String key= iterator.next();
result.put(key, node.get(SAVE_PARTICIPANT_KEY_PREFIX + key, CleanUpOptions.FALSE));
}
return result;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:23,代码来源:CleanUpPreferenceUtil.java
示例12: getCleanUpOptions
import org.eclipse.jdt.ui.cleanup.CleanUpOptions; //导入依赖的package包/类
private static Map<String, String> getCleanUpOptions(IBinding binding, boolean removeAll) {
Map<String, String> result= new Hashtable<String, String>();
result.put(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_MEMBERS, CleanUpOptions.TRUE);
switch (binding.getKind()) {
case IBinding.TYPE:
result.put(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_TYPES, CleanUpOptions.TRUE);
break;
case IBinding.METHOD:
if (((IMethodBinding) binding).isConstructor()) {
result.put(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_CONSTRUCTORS, CleanUpOptions.TRUE);
} else {
result.put(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_METHODS, CleanUpOptions.TRUE);
}
break;
case IBinding.VARIABLE:
if (removeAll)
return null;
result.put(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_FELDS, CleanUpOptions.TRUE);
result.put(CleanUpConstants.REMOVE_UNUSED_CODE_LOCAL_VARIABLES, CleanUpOptions.TRUE);
break;
}
return result;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:27,代码来源:UnusedCodeFix.java
示例13: getRemoveBlockProposals
import org.eclipse.jdt.ui.cleanup.CleanUpOptions; //导入依赖的package包/类
private static boolean getRemoveBlockProposals(IInvocationContext context, ASTNode coveringNode, Collection<ICommandAccess> resultingCollections) {
IProposableFix[] fixes= ControlStatementsFix.createRemoveBlockFix(context.getASTRoot(), coveringNode);
if (fixes != null) {
if (resultingCollections == null) {
return true;
}
Map<String, String> options= new Hashtable<String, String>();
options.put(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS, CleanUpOptions.TRUE);
options.put(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NEVER, CleanUpOptions.TRUE);
ICleanUp cleanUp= new ControlStatementsCleanUp(options);
for (int i= 0; i < fixes.length; i++) {
IProposableFix fix= fixes[i];
Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
FixCorrectionProposal proposal= new FixCorrectionProposal(fix, cleanUp, IProposalRelevance.REMOVE_BLOCK_FIX, image, context);
resultingCollections.add(proposal);
}
return true;
}
return false;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:21,代码来源:QuickAssistProcessor.java
示例14: getConvertForLoopProposal
import org.eclipse.jdt.ui.cleanup.CleanUpOptions; //导入依赖的package包/类
private static boolean getConvertForLoopProposal(IInvocationContext context, ASTNode node, Collection<ICommandAccess> resultingCollections) {
ForStatement forStatement= getEnclosingForStatementHeader(node);
if (forStatement == null)
return false;
if (resultingCollections == null)
return true;
IProposableFix fix= ConvertLoopFix.createConvertForLoopToEnhancedFix(context.getASTRoot(), forStatement);
if (fix == null)
return false;
Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
Map<String, String> options= new HashMap<String, String>();
options.put(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED, CleanUpOptions.TRUE);
ICleanUp cleanUp= new ConvertLoopCleanUp(options);
FixCorrectionProposal proposal= new FixCorrectionProposal(fix, cleanUp, IProposalRelevance.CONVERT_FOR_LOOP_TO_ENHANCED, image, context);
proposal.setCommandId(CONVERT_FOR_LOOP_ID);
resultingCollections.add(proposal);
return true;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:23,代码来源:QuickAssistProcessor.java
示例15: getConvertIterableLoopProposal
import org.eclipse.jdt.ui.cleanup.CleanUpOptions; //导入依赖的package包/类
private static boolean getConvertIterableLoopProposal(IInvocationContext context, ASTNode node, Collection<ICommandAccess> resultingCollections) {
ForStatement forStatement= getEnclosingForStatementHeader(node);
if (forStatement == null)
return false;
if (resultingCollections == null)
return true;
IProposableFix fix= ConvertLoopFix.createConvertIterableLoopToEnhancedFix(context.getASTRoot(), forStatement);
if (fix == null)
return false;
Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
Map<String, String> options= new HashMap<String, String>();
options.put(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED, CleanUpOptions.TRUE);
ICleanUp cleanUp= new ConvertLoopCleanUp(options);
FixCorrectionProposal proposal= new FixCorrectionProposal(fix, cleanUp, IProposalRelevance.CONVERT_ITERABLE_LOOP_TO_ENHANCED, image, context);
proposal.setCommandId(CONVERT_FOR_LOOP_ID);
resultingCollections.add(proposal);
return true;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:23,代码来源:QuickAssistProcessor.java
示例16: getMakeVariableDeclarationFinalProposals
import org.eclipse.jdt.ui.cleanup.CleanUpOptions; //导入依赖的package包/类
private static boolean getMakeVariableDeclarationFinalProposals(IInvocationContext context, Collection<ICommandAccess> resultingCollections) {
SelectionAnalyzer analyzer= new SelectionAnalyzer(Selection.createFromStartLength(context.getSelectionOffset(), context.getSelectionLength()), false);
context.getASTRoot().accept(analyzer);
ASTNode[] selectedNodes= analyzer.getSelectedNodes();
if (selectedNodes.length == 0)
return false;
IProposableFix fix= VariableDeclarationFix.createChangeModifierToFinalFix(context.getASTRoot(), selectedNodes);
if (fix == null)
return false;
if (resultingCollections == null)
return true;
Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
Map<String, String> options= new Hashtable<String, String>();
options.put(CleanUpConstants.VARIABLE_DECLARATIONS_USE_FINAL, CleanUpOptions.TRUE);
options.put(CleanUpConstants.VARIABLE_DECLARATIONS_USE_FINAL_LOCAL_VARIABLES, CleanUpOptions.TRUE);
options.put(CleanUpConstants.VARIABLE_DECLARATIONS_USE_FINAL_PARAMETERS, CleanUpOptions.TRUE);
options.put(CleanUpConstants.VARIABLE_DECLARATIONS_USE_FINAL_PRIVATE_FIELDS, CleanUpOptions.TRUE);
VariableDeclarationCleanUp cleanUp= new VariableDeclarationCleanUp(options);
FixCorrectionProposal proposal= new FixCorrectionProposal(fix, cleanUp, IProposalRelevance.MAKE_VARIABLE_DECLARATION_FINAL, image, context);
resultingCollections.add(proposal);
return true;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:26,代码来源:QuickAssistProcessor.java
示例17: getRemoveExtraParenthesesProposals
import org.eclipse.jdt.ui.cleanup.CleanUpOptions; //导入依赖的package包/类
private static boolean getRemoveExtraParenthesesProposals(IInvocationContext context, ASTNode covering, ArrayList<ASTNode> coveredNodes, Collection<ICommandAccess> resultingCollections) {
ArrayList<ASTNode> nodes;
if (context.getSelectionLength() == 0 && covering instanceof ParenthesizedExpression) {
nodes= new ArrayList<ASTNode>();
nodes.add(covering);
} else {
nodes= coveredNodes;
}
if (nodes.isEmpty())
return false;
IProposableFix fix= ExpressionsFix.createRemoveUnnecessaryParenthesisFix(context.getASTRoot(), nodes.toArray(new ASTNode[nodes.size()]));
if (fix == null)
return false;
if (resultingCollections == null)
return true;
Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_REMOVE);
Map<String, String> options= new Hashtable<String, String>();
options.put(CleanUpConstants.EXPRESSIONS_USE_PARENTHESES, CleanUpOptions.TRUE);
options.put(CleanUpConstants.EXPRESSIONS_USE_PARENTHESES_NEVER, CleanUpOptions.TRUE);
FixCorrectionProposal proposal= new FixCorrectionProposal(fix, new ExpressionsCleanUp(options), IProposalRelevance.REMOVE_EXTRA_PARENTHESES, image, context);
resultingCollections.add(proposal);
return true;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:27,代码来源:AdvancedQuickAssistProcessor.java
示例18: getAddParanoidalParenthesesProposals
import org.eclipse.jdt.ui.cleanup.CleanUpOptions; //导入依赖的package包/类
private static boolean getAddParanoidalParenthesesProposals(IInvocationContext context, ArrayList<ASTNode> coveredNodes, Collection<ICommandAccess> resultingCollections) {
IProposableFix fix= ExpressionsFix.createAddParanoidalParenthesisFix(context.getASTRoot(), coveredNodes.toArray(new ASTNode[coveredNodes.size()]));
if (fix == null)
return false;
if (resultingCollections == null)
return true;
// add correction proposal
Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CAST);
Map<String, String> options= new Hashtable<String, String>();
options.put(CleanUpConstants.EXPRESSIONS_USE_PARENTHESES, CleanUpOptions.TRUE);
options.put(CleanUpConstants.EXPRESSIONS_USE_PARENTHESES_ALWAYS, CleanUpOptions.TRUE);
FixCorrectionProposal proposal= new FixCorrectionProposal(fix, new ExpressionsCleanUp(options), IProposalRelevance.ADD_PARANOIDAL_PARENTHESES, image, context);
resultingCollections.add(proposal);
return true;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:19,代码来源:AdvancedQuickAssistProcessor.java
示例19: setWorkingValues
import org.eclipse.jdt.ui.cleanup.CleanUpOptions; //导入依赖的package包/类
@Override
public void setWorkingValues(Map<String, String> workingValues) {
super.setWorkingValues(workingValues);
final CleanUpOptions options= new CleanUpOptions(workingValues) {
/*
* @see org.eclipse.jdt.internal.ui.fix.CleanUpOptions#setOption(java.lang.String, java.lang.String)
*/
@Override
public void setOption(String key, String value) {
super.setOption(key, value);
doUpdatePreview();
notifyValuesModified();
}
};
SafeRunner.run(new ISafeRunnable() {
public void handleException(Throwable exception) {
ContributedCleanUpTabPage.this.handleException(exception);
}
public void run() throws Exception {
fContribution.setOptions(options);
}
});
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:27,代码来源:ContributedCleanUpTabPage.java
示例20: getSelectedCleanUpsText
import org.eclipse.jdt.ui.cleanup.CleanUpOptions; //导入依赖的package包/类
private String getSelectedCleanUpsText(CleanUpOptions options) {
StringBuffer buf= new StringBuffer();
final ICleanUp[] cleanUps= JavaPlugin.getDefault().getCleanUpRegistry().createCleanUps();
for (int i= 0; i < cleanUps.length; i++) {
cleanUps[i].setOptions(options);
String[] descriptions= cleanUps[i].getStepDescriptions();
if (descriptions != null) {
for (int j= 0; j < descriptions.length; j++) {
if (buf.length() > 0) {
buf.append('\n');
}
buf.append(descriptions[j]);
}
}
}
String string= buf.toString();
return string;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:20,代码来源:CleanUpSaveParticipantPreferenceConfiguration.java
注:本文中的org.eclipse.jdt.ui.cleanup.CleanUpOptions类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论