Author: scabanovich
Date: 2009-11-13 06:10:41 -0500 (Fri, 13 Nov 2009)
New Revision: 18678
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/OpenEditorWizard.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5191
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/OpenEditorWizard.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/OpenEditorWizard.java 2009-11-13
01:47:10 UTC (rev 18677)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/OpenEditorWizard.java 2009-11-13
11:10:41 UTC (rev 18678)
@@ -40,6 +40,9 @@
IWorkbenchPage workbenchPage = getWorkbenchPage();
if(workbenchPage == null) return 0;
String id = object.getModelEntity().getEditorClassName();
+ if("FileXML".equals(object.getModelEntity().getName())) {
+ id = null;
+ }
if(id != null && (id.length() == 0 || id.equals("DefaultEditor"))) {
//$NON-NLS-1$
id = null;
} else {
@@ -73,7 +76,15 @@
if(editor != null) workbenchPage.bringToTop(editor);
} else if(id == null) {
if(input instanceof IFileEditorInput) {
- editor = IDE.openEditor(workbenchPage, ((IFileEditorInput)input).getFile(), true);
+ IFile f = ((IFileEditorInput)input).getFile();
+ IDE.setDefaultEditor(f, null);
+ IEditorDescriptor d = IDE.getEditorDescriptor(f);
+ if(d != null) id = d.getId();
+ if(id != null) {
+ editor = IDE.openEditor(workbenchPage, f, id, true);
+ } else {
+ editor = IDE.openEditor(workbenchPage, f, true);
+ }
} else {
editor = workbenchPage.openEditor(input, id);
}