View | Details | Raw Unified | Return to bug 391389 | Differences between
and this patch

Collapse All | Expand All

(-)a/org.eclipse.ltk.ui.refactoring/src/org/eclipse/ltk/ui/refactoring/resource/RenameResourceWizard.java (-3 / +9 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2007, 2008 IBM Corporation and others.
2
 * Copyright (c) 2007, 2014 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Jerome Cambon <jerome.cambon@oracle.com> - [ltk] Rename refactoring should give more control over new file name - https://bugs.eclipse.org/391389
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.ltk.ui.refactoring.resource;
12
package org.eclipse.ltk.ui.refactoring.resource;
12
13
Lines 81-87 public class RenameResourceWizard extends RefactoringWizard { Link Here
81
			label.setLayoutData(new GridData());
82
			label.setLayoutData(new GridData());
82
83
83
			fNameField= new Text(composite, SWT.BORDER);
84
			fNameField= new Text(composite, SWT.BORDER);
84
			fNameField.setText(fRefactoringProcessor.getNewResourceName());
85
			String resourceName= fRefactoringProcessor.getNewResourceName();
86
			fNameField.setText(resourceName);
85
			fNameField.setFont(composite.getFont());
87
			fNameField.setFont(composite.getFont());
86
			fNameField.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false));
88
			fNameField.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false));
87
			fNameField.addModifyListener(new ModifyListener() {
89
			fNameField.addModifyListener(new ModifyListener() {
Lines 90-96 public class RenameResourceWizard extends RefactoringWizard { Link Here
90
				}
92
				}
91
			});
93
			});
92
94
93
			fNameField.selectAll();
95
			if ((fRefactoringProcessor.getResource().getType() == IResource.FILE) && (resourceName.lastIndexOf('.') != -1)) {
96
				fNameField.setSelection(0, resourceName.lastIndexOf('.'));
97
			} else {
98
				fNameField.selectAll();
99
			}
94
			setPageComplete(false);
100
			setPageComplete(false);
95
			setControl(composite);
101
			setControl(composite);
96
		}
102
		}

Return to bug 391389