1
/*******************************************************************************
2
* Copyright (c) 2005, 2008 Wind River Systems, Inc and others.
3
* All rights reserved. This program and the accompanying materials
4
* are made available under the terms of the Eclipse Public License v1.0
5
* which accompanies this distribution, and is available at
6
* http://www.eclipse.org/legal/epl-v10.html
9
* Markus Schorn - initial API and implementation
10
*******************************************************************************/
11
package org.eclipse.cdt.internal.ui.refactoring.rename;
13
import java.util.ArrayList;
15
import org.eclipse.core.runtime.IProgressMonitor;
16
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
20
* Rename processor that sets up the input page for renaming a global entity.
22
public class CRenameMacroProcessor extends CRenameGlobalProcessor {
24
public CRenameMacroProcessor(CRenameProcessor processor, String name) {
25
super(processor, name);
26
setAvailableOptions(CRefactory.OPTION_ASK_SCOPE |
27
CRefactory.OPTION_IN_CODE |
28
CRefactory.OPTION_IN_COMMENT |
29
CRefactory.OPTION_IN_PREPROCESSOR_DIRECTIVE);
33
protected int getAcceptedLocations(int selectedOptions) {
34
return selectedOptions | CRefactory.OPTION_IN_MACRO_DEFINITION;
38
protected void analyzeTextMatches(ArrayList<CRefactoringMatch> matches, IProgressMonitor monitor,
39
RefactoringStatus status) {
40
for (CRefactoringMatch m : matches) {
41
if ((m.getLocation() & CRefactory.OPTION_IN_PREPROCESSOR_DIRECTIVE) != 0) {
42
m.setASTInformation(CRefactoringMatch.AST_REFERENCE);
45
super.analyzeTextMatches(matches, monitor, status);