ASTNode selectedNode= problem.getCoveringNode(context.getASTRoot()); if (selectedNode != null) { ASTNode node= ASTNodes.getParent(selectedNode, ASTNode.IMPORT_DECLARATION); if (node instanceof ImportDeclaration) { ASTRewrite rewrite= ASTRewrite.create(node.getAST());  rewrite.remove(node, null);  String label= CorrectionMessages.ReorgCorrectionsSubProcessor_unusedimport_description; Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_DELETE_IMPORT);  ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal(label, cu, rewrite, 6, image); proposals.add(proposal); } }
	public static void removeImportStatementProposals(IInvocationContext context, IProblemLocation problem, Collection proposals) {		final ICompilationUnit cu= context.getCompilationUnit();		ASTNode selectedNode= problem.getCoveringNode(context.getASTRoot());		if (selectedNode != null) {			ASTNode node= ASTNodes.getParent(selectedNode, ASTNode.IMPORT_DECLARATION);			if (node instanceof ImportDeclaration) {				ASTRewrite rewrite= ASTRewrite.create(node.getAST());				rewrite.remove(node, null);				String label= CorrectionMessages.ReorgCorrectionsSubProcessor_unusedimport_description;				Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_DELETE_IMPORT);				ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal(label, cu, rewrite, 6, image);				proposals.add(proposal);			}		}		String name= CorrectionMessages.ReorgCorrectionsSubProcessor_organizeimports_description;		ChangeCorrectionProposal proposal= new ChangeCorrectionProposal(name, null, 5, JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE)) {			public void apply(IDocument document) {				IEditorInput input= new FileEditorInput((IFile) cu.getResource());				IWorkbenchPage p= JavaPlugin.getActivePage();				if (p == null) {					return;				}				IEditorPart part= p.findEditor(input);				if (part instanceof JavaEditor) {					OrganizeImportsAction action= new OrganizeImportsAction((JavaEditor) part);					action.run(cu);				}			}		};		proposals.add(proposal);	}