Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 327679 - Can not override default editor on PHP content-type associated files
Summary: Can not override default editor on PHP content-type associated files
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: PHP UI CLA
QA Contact: Ilina Stefanova CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-13 11:17 EDT by Alexandre Nion CLA
Modified: 2020-05-14 11:27 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandre Nion CLA 2010-10-13 11:17:24 EDT
Build Identifier: 2.2.1

When using new PDT 2.2 with Helios, it becomes impossible to set up a new default editor for files whose content-type is associated with PHP.

As PHP Content type now includes ".tpl" extension, it's for an example not possible any more to embed a different default editor, which was a common practice on tools driving their own template system. All "locked by content-type PHP" extensions seem to be concerned (*.inc, *.php, ..., *.tpl).

Reproducible: Always

Steps to Reproduce:
1.Open "File Association" tab from "Window/Preferences/General/Editors/"
2.Add a file type association by clicking "Add", defining "*.tpl" or "*.php".
3.On the "Associated editors" panel, click "Add" and choose your own internal editor, for an example HTML editor or any other editor that should look different.
4.Mark the added editor as default one, by clicking "Default". A string "Default" will be added to signify that the change has been made.
5.Now validate preferences and try to open a file that matches the extension pattern (*.tpl or *.php) using the default editor (automatically used by double cliking from the PHP Explorer view). As you would expect that the default defined editor will be used to open the file, it will happen that the internal defined "PHP Editor" will be used to render the file.
 The "Default" setting is not honored, you will need to right-click and choose your own editor to render as expected, which is from day to day quite a calamity to use..
Comment 1 Alexandre Nion CLA 2010-10-13 11:22:14 EDT
Seems indeed linked to behavior of PHP explorer as "Open with default editor" and click opening from standard navigator tab will work fine.
Comment 2 Ryan Mising name CLA 2011-02-28 15:37:39 EST
I also came here to report this bug.  I encountered it on Windows, and would love to see it fixed.  I am guessing it is a similar issue to the one I reported a while back (which was fixed), found here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=270137 .

From my debugging, I can tell that the call to EditorUtility.openInEditor in org.eclipse.php.internal.ui.actions.OpenActionUtil returns an EditorPart of type PHPStructuredEditor no matter what you have set as the default editor for the *.php extension.  I suspect this is the problem.
Comment 3 Zhongwei Zhao CLA 2011-05-12 04:12:05 EDT
yes,I notice org.eclipse.php.internal.ui.actions.OpenActionUtil will get PHPStructuredEditor if the the file's content type is "org.eclipse.php.core.phpsource"
after discussing with Roy,we decide to remove tpl from "org.eclipse.php.core.phpsource".
Comment 4 Kalin CLA 2011-07-28 04:18:25 EDT
Verified.
Closing...