1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-09-01 12:43:26 +02:00

[363490] PHP files opening in system editor (Dreamweaver)

This commit is contained in:
David McKnight 2011-11-15 23:29:40 +00:00
parent eaa9240362
commit 6915a43ab1

View file

@ -75,6 +75,7 @@
* David McKnight (IBM) - [215814] [performance] Duplicate Queries between Table and Remote Systems View * David McKnight (IBM) - [215814] [performance] Duplicate Queries between Table and Remote Systems View
* David McKnight (IBM) - [249031] Last used editor should be set to SystemEditableRemoteFile * David McKnight (IBM) - [249031] Last used editor should be set to SystemEditableRemoteFile
* David McKnight (IBM) - [341244] folder selection input to unlocked Remote Systems Details view sometimes fails * David McKnight (IBM) - [341244] folder selection input to unlocked Remote Systems Details view sometimes fails
* David McKnight (IBM) - [363490] PHP files opening in system editor (Dreamweaver)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.files.ui.view; package org.eclipse.rse.internal.files.ui.view;
@ -3425,14 +3426,22 @@ public class SystemViewRemoteFileAdapter
if (editable instanceof SystemEditableRemoteFile){ if (editable instanceof SystemEditableRemoteFile){
SystemEditableRemoteFile edit = (SystemEditableRemoteFile)editable; SystemEditableRemoteFile edit = (SystemEditableRemoteFile)editable;
IEditorDescriptor oldDescriptor = edit.getEditorDescriptor(); IEditorDescriptor oldDescriptor = edit.getEditorDescriptor();
IEditorDescriptor curDescriptor; IEditorDescriptor curDescriptor = null;
try { IFile file = editable.getLocalResource();
curDescriptor = IDE.getEditorDescriptor(editable.getLocalResource());
if (oldDescriptor != curDescriptor){ if (file == null || !file.exists()){
edit.setEditorDescriptor(curDescriptor); curDescriptor = registry.getDefaultEditor(remoteFile.getName());
}
if (curDescriptor == null){
try {
curDescriptor = IDE.getEditorDescriptor(file);
} catch (PartInitException e) {
curDescriptor = IDE.getDefaultEditor(file);
} }
} catch (PartInitException e) { }
} if (oldDescriptor != curDescriptor){
edit.setEditorDescriptor(curDescriptor);
}
} }
try try