package net.sourceforge.phpdt.ltk.ui.actions;
import net.sourceforge.phpdt.internal.ui.util.PHPFileUtil;
-import net.sourceforge.phpdt.ltk.core.RenamePropertyInfo;
-import net.sourceforge.phpdt.ltk.core.RenamePropertyProcessor;
-import net.sourceforge.phpdt.ltk.core.RenamePropertyRefactoring;
+import net.sourceforge.phpdt.ltk.core.RenameIdentifierDelegate;
+import net.sourceforge.phpdt.ltk.core.RenameIdentifierInfo;
+import net.sourceforge.phpdt.ltk.core.RenamePHPProcessor;
+import net.sourceforge.phpdt.ltk.core.RenameIdentifierRefactoring;
import net.sourceforge.phpdt.ltk.ui.UITexts;
-import net.sourceforge.phpdt.ltk.ui.wizards.RenamePropertyWizard;
+import net.sourceforge.phpdt.ltk.ui.wizards.RenameIdentifierWizard;
import net.sourceforge.phpeclipse.phpeditor.PHPEditor;
import net.sourceforge.phpeclipse.phpeditor.php.PHPWordExtractor;
* This action is declared in the <code>plugin.xml</code>.
* </p>
*
- * @author Leif Frenzel
*/
public class RenamePHPIdentifier implements IEditorActionDelegate {
-// private static final String EXT_PROPERTIES = "properties"; //$NON-NLS-1$
-
private ISelection selection;
private IEditorPart targetEditor;
- private boolean onPropertiesFile;
+ private boolean onPHPFile;
- private RenamePropertyInfo info = new RenamePropertyInfo();
+ private RenameIdentifierInfo info = new RenameIdentifierInfo();
// interface methods of IEditorActionDelegate
// ///////////////////////////////////////////
public void setActiveEditor(final IAction action, final IEditorPart targetEditor) {
this.targetEditor = targetEditor;
- onPropertiesFile = false;
+ onPHPFile = false;
IFile file = getFile();
if (file != null && PHPFileUtil.isPHPFile(file)) {
- onPropertiesFile = true;
+ onPHPFile = true;
}
}
public void run(final IAction action) {
- if (!onPropertiesFile) {
+ if (!onPHPFile) {
refuse();
} else {
if (selection != null && selection instanceof ITextSelection) {
}
private void openWizard() {
- RefactoringProcessor processor = new RenamePropertyProcessor(info);
- RenamePropertyRefactoring ref = new RenamePropertyRefactoring(processor);
- RenamePropertyWizard wizard = new RenamePropertyWizard(ref, info);
+ RenameIdentifierDelegate delegate = new RenameIdentifierDelegate( info );
+ RefactoringProcessor processor = new RenamePHPProcessor(info, delegate);
+ RenameIdentifierRefactoring ref = new RenameIdentifierRefactoring(processor);
+ RenameIdentifierWizard wizard = new RenameIdentifierWizard(ref, info);
RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(wizard);
try {
String titleForFailedChecks = ""; //$NON-NLS-1$