~ubuntu-branches/debian/sid/eclipse-cdt/sid

« back to all changes in this revision

Viewing changes to results/plugins/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/CRenameMacroProcessor.java

  • Committer: Package Import Robot
  • Author(s): Jakub Adam
  • Date: 2011-10-06 21:15:04 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20111006211504-8dutmljjih0zikfv
Tags: 8.0.1-1
* New upstream release.
* Split the JNI packages into a separate architecture dependent
  package and made eclipse-cdt architecture independent.
* Install JNI libraries into multiarch aware location
* Bumped Standards-Version to 3.9.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
7
 
 *
8
 
 * Contributors:
9
 
 * Markus Schorn - initial API and implementation 
10
 
 *******************************************************************************/
11
 
package org.eclipse.cdt.internal.ui.refactoring.rename;
12
 
 
13
 
import java.util.ArrayList;
14
 
 
15
 
import org.eclipse.core.runtime.IProgressMonitor;
16
 
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
17
 
 
18
 
 
19
 
/**
20
 
 * Rename processor that sets up the input page for renaming a global entity.
21
 
 */
22
 
public class CRenameMacroProcessor extends CRenameGlobalProcessor {
23
 
 
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);
30
 
    }
31
 
    
32
 
    @Override
33
 
        protected int getAcceptedLocations(int selectedOptions) {
34
 
        return selectedOptions | CRefactory.OPTION_IN_MACRO_DEFINITION;
35
 
    }
36
 
 
37
 
    @Override
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);
43
 
            }
44
 
        }
45
 
        super.analyzeTextMatches(matches, monitor, status);
46
 
    }
47
 
}