Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 22220 Details for
Bug 97946
[EditorMgmt] old getDefaultEditor API is not backwards compatible (in spirit)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch against org.eclipse.ui.workbench
Bug97946-Workbench.txt (text/plain), 1.72 KB, created by
Kim Horne
on 2005-06-02 08:28:03 EDT
(
hide
)
Description:
Patch against org.eclipse.ui.workbench
Filename:
MIME Type:
Creator:
Kim Horne
Created:
2005-06-02 08:28:03 EDT
Size:
1.72 KB
patch
obsolete
>Index: Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java,v >retrieving revision 1.44 >diff -u -r1.44 EditorRegistry.java >--- Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java 1 Jun 2005 18:40:08 -0000 1.44 >+++ Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java 2 Jun 2005 12:28:16 -0000 >@@ -324,9 +324,20 @@ > * (non-Javadoc) Method declared on IEditorRegistry. > */ > public IEditorDescriptor getDefaultEditor(String filename) { >- return getDefaultEditor(filename, null); >+ return getDefaultEditor(filename, guessAtContentType(filename)); > } > >+ /** >+ * Return the (approximated) content type for a file with the given name. >+ * >+ * @param filename the filename >+ * @return the content type or <code>null</code> if it could not be determined >+ * @since 3.1 >+ */ >+ private IContentType guessAtContentType(String filename) { >+ return Platform.getContentTypeManager().findContentTypeFor(filename); >+ } >+ > /** > * Returns the default file image descriptor. > * >@@ -341,7 +352,7 @@ > * (non-Javadoc) Method declared on IEditorRegistry. > */ > public IEditorDescriptor[] getEditors(String filename) { >- return getEditors(filename, null); >+ return getEditors(filename, guessAtContentType(filename)); > } > > /* >@@ -368,7 +379,7 @@ > * (non-Javadoc) Method declared on IEditorRegistry. > */ > public ImageDescriptor getImageDescriptor(String filename) { >- return getImageDescriptor(filename, null); >+ return getImageDescriptor(filename, guessAtContentType(filename)); > } > > /**
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 97946
: 22220 |
22222