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 79299 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 without creating any editor
patch.txt (text/plain), 3.99 KB, created by
Dani Megert
on 2007-09-27 13:29:11 EDT
(
hide
)
Description:
Fix without creating any editor
Filename:
MIME Type:
Creator:
Dani Megert
Created:
2007-09-27 13:29:11 EDT
Size:
3.99 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.team.ui >Index: src/org/eclipse/team/ui/history/RevisionAnnotationController.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.ui/src/org/eclipse/team/ui/history/RevisionAnnotationController.java,v >retrieving revision 1.12 >diff -u -r1.12 RevisionAnnotationController.java >--- src/org/eclipse/team/ui/history/RevisionAnnotationController.java 12 Sep 2007 19:40:21 -0000 1.12 >+++ src/org/eclipse/team/ui/history/RevisionAnnotationController.java 27 Sep 2007 17:25:50 -0000 >@@ -15,7 +15,6 @@ > > import org.eclipse.core.resources.IFile; > import org.eclipse.core.resources.IStorage; >-import org.eclipse.core.runtime.CoreException; > import org.eclipse.jface.text.revisions.*; > import org.eclipse.jface.viewers.*; > import org.eclipse.swt.events.DisposeEvent; >@@ -177,13 +176,9 @@ > if (descriptor == null || !descriptor.isInternal()) { > id = EditorsUI.DEFAULT_TEXT_EDITOR_ID; > } else { >- try { >- if (Utils.isTextEditor(descriptor)) { >- id = descriptor.getId(); >- } else { >- id = EditorsUI.DEFAULT_TEXT_EDITOR_ID; >- } >- } catch (CoreException e) { >+ if (Utils.isTextEditor(descriptor)) { >+ id = descriptor.getId(); >+ } else { > id = EditorsUI.DEFAULT_TEXT_EDITOR_ID; > } > } >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.81 >diff -u -r1.81 Utils.java >--- src/org/eclipse/team/internal/ui/Utils.java 12 Sep 2007 19:40:21 -0000 1.81 >+++ src/org/eclipse/team/internal/ui/Utils.java 27 Sep 2007 17:25:50 -0000 >@@ -55,9 +55,9 @@ > import org.eclipse.ui.ide.IContributorResourceAdapter2; > import org.eclipse.ui.ide.IDE; > import org.eclipse.ui.internal.ErrorEditorPart; >-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 { > >@@ -983,20 +983,35 @@ > /** > * Return whether the editor associated with a descriptor is a text editor > * (i.e. an instance of AbstractDecoratedTextEditor). >- * See bug 99568 for a request to move the createEditor method to IEditorDescriptor. >+ * > * @param descriptor > * @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; >- return desc.createEditor() instanceof AbstractDecoratedTextEditor; >+ public static boolean isTextEditor(IEditorDescriptor descriptor) { >+ String editorId= descriptor.getId(); >+ String className= null; >+ String contributor= null; >+ IConfigurationElement[] extensions= Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.ui.editors"); //$NON-NLS-1$ >+ for (int i= 0; i < extensions.length; i++) { >+ if (editorId.equals(extensions[i].getAttribute("id"))) { //$NON-NLS-1$ >+ className= extensions[i].getAttribute("class"); //$NON-NLS-1$ >+ contributor= extensions[i].getContributor().getName(); >+ break; >+ } > } >- return false; >+ 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 >+ } >+ return AbstractDecoratedTextEditor.class.isAssignableFrom(clazz); > } >- >+ > public static IEditorPart openEditor(IWorkbenchPage page, IFileRevision revision, IProgressMonitor monitor) throws CoreException { > IStorage file = revision.getStorage(monitor); > if (file instanceof IFile) {
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