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 79622 Details for
Bug 204679
Show Annotation on old revision of .java file leaks CompilationUnitEditor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Fix which only creates editor if needed
patch.txt (text/plain), 2.03 KB, created by
Dani Megert
on 2007-10-03 06:27:59 EDT
(
hide
)
Description:
Fix which only creates editor if needed
Filename:
MIME Type:
Creator:
Dani Megert
Created:
2007-10-03 06:27:59 EDT
Size:
2.03 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.team.ui >Index: src/org/eclipse/team/internal/ui/Utils.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java,v >retrieving revision 1.82 >diff -u -r1.82 Utils.java >--- src/org/eclipse/team/internal/ui/Utils.java 28 Sep 2007 14:36:16 -0000 1.82 >+++ src/org/eclipse/team/internal/ui/Utils.java 3 Oct 2007 10:27:28 -0000 >@@ -58,6 +58,7 @@ > import org.eclipse.ui.internal.registry.EditorDescriptor; > import org.eclipse.ui.progress.IWorkbenchSiteProgressService; > import org.eclipse.ui.texteditor.AbstractDecoratedTextEditor; >+import org.osgi.framework.Bundle; > > public class Utils { > >@@ -988,14 +989,34 @@ > * @return whether the editor associated with a descriptor is a text editor > * @throws CoreException > */ >- public static boolean isTextEditor(IEditorDescriptor descriptor) >- throws CoreException { >- if (descriptor instanceof EditorDescriptor) { >- EditorDescriptor desc = (EditorDescriptor) descriptor; >+ public static boolean isTextEditor(IEditorDescriptor descriptor) throws CoreException { >+ if (!(descriptor instanceof EditorDescriptor)) >+ return false; >+ >+ EditorDescriptor desc = (EditorDescriptor) descriptor; >+ String className = desc.getClassName(); >+ String contributor = desc.getPluginId(); >+ >+ if (className == null || contributor == null) >+ return false; >+ >+ Bundle bundle= Platform.getBundle(contributor); >+ Class clazz; >+ try { >+ clazz= bundle.loadClass(className); >+ } catch (ClassNotFoundException e) { >+ return false; // be graceful and continue with default Text Editor >+ } >+ >+ if (AbstractDecoratedTextEditor.class.isAssignableFrom(clazz)) >+ return true; >+ else if (IExecutableExtensionFactory.class.isAssignableFrom(clazz)) { >+ // must create editor > IEditorPart editor= desc.createEditor(); > editor.dispose(); > return editor instanceof AbstractDecoratedTextEditor; > } >+ > return false; > } >
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 204679
:
79201
|
79299
|
79622
|
79629
|
88867