Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 157145

Summary: New PHP File wizard
Product: z_Archived Reporter: Ivan Shumkov <ivan>
Component: PDTAssignee: PHP UI <php.ui-inbox>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P2 CC: bask8625, jb_bugzilla
Version: unspecifiedKeywords: plan
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Ivan Shumkov CLA 2006-09-13 05:09:19 EDT
My be add wizard for creating php files?
1. Flat php file
2. Class php file
...

In current mechanizm field with file name must be focused first. See JDT new file wizards.
Comment 1 Jake Billo CLA 2006-10-13 13:45:33 EDT
This seems to be more of a usability issue regarding the "new PHP file" wizard, and is present in 0.2.4 and 0.2.5 as well. I also find it a bit of a nuisance that the "file name" field is not given focus by default.

While I'm not sure how to propose a patch to this, here's my solution:
in PHPFileCreationWizardPage.java, in the org.eclipse.php.ui.wizards package, the setInitialFileName method should have two lines added: 

	protected void setInitialFileName(final String fileName) {
		fileText.setText(fileName); // this line already exists
		fileText.setSelection(0, fileText.getText().indexOf(".")); // add
		fileText.forceFocus(); // add
	}

This will highlight the initial file name before the .php extension, allowing a user to type in "index" or whatever file name they'd like, right after launching the wizard.

Of course, this fix won't work correctly if the default filename (as set by the wizard) ever contains more than one period, but it's a start.
Comment 2 Charlie Surface CLA 2006-11-02 10:55:22 EST
I agree about the focus issue.  I think I'll report it as a separate bug since it seems more like broken behavior than a missing feature.
Comment 3 Charlie Surface CLA 2006-11-02 11:00:39 EST
See bug 163223.
Comment 4 moshe CLA 2007-04-26 12:55:13 EDT
File: org.eclipse.php.internal.ui.wizards.PHPFileCreationWizardPage.java
highlight the newfile word in the file name input
Comment 5 Gadi Goldbarg CLA 2007-05-07 07:29:07 EDT
Wizard exists for a while now