diff options
author | Michael Valenta | 2007-09-12 19:40:21 +0000 |
---|---|---|
committer | Michael Valenta | 2007-09-12 19:40:21 +0000 |
commit | 89e4d212d990829cbacec69818599a1084c40950 (patch) | |
tree | 0cf59084b604ef0216e47d164a37925ca5053f72 /bundles | |
parent | 07c0dacadd1ebf8776b1bf194f39f3a19a12fa42 (diff) | |
download | eclipse.platform.team-89e4d212d990829cbacec69818599a1084c40950.tar.gz eclipse.platform.team-89e4d212d990829cbacec69818599a1084c40950.tar.xz eclipse.platform.team-89e4d212d990829cbacec69818599a1084c40950.zip |
Bug 175000 [API] Team and CVS are friends of CompareRoot_branch_20070914_ExtractDocumentDiff
Diffstat (limited to 'bundles')
15 files changed, 105 insertions, 57 deletions
diff --git a/bundles/org.eclipse.compare/META-INF/MANIFEST.MF b/bundles/org.eclipse.compare/META-INF/MANIFEST.MF index f78f1fbcd..85e9d2e88 100644 --- a/bundles/org.eclipse.compare/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.compare/META-INF/MANIFEST.MF @@ -8,9 +8,9 @@ Bundle-Vendor: %providerName Bundle-Localization: plugin Export-Package: org.eclipse.compare, org.eclipse.compare.contentmergeviewer, - org.eclipse.compare.internal;x-friends:="org.eclipse.team.ui,org.eclipse.team.cvs.ui", - org.eclipse.compare.internal.merge;x-friends:="org.eclipse.team.ui,org.eclipse.team.cvs.ui", - org.eclipse.compare.internal.patch;x-friends:="org.eclipse.team.ui,org.eclipse.team.cvs.ui", + org.eclipse.compare.internal;x-internal:=true, + org.eclipse.compare.internal.merge;x-internal:=true, + org.eclipse.compare.internal.patch;x-internal:=true, org.eclipse.compare.patch, org.eclipse.compare.rangedifferencer, org.eclipse.compare.structuremergeviewer diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareUI.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareUI.java index 0825103d8..e6eec9311 100644 --- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareUI.java +++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareUI.java @@ -12,10 +12,9 @@ package org.eclipse.compare; import java.util.ResourceBundle; -import org.eclipse.compare.internal.CompareUIPlugin; -import org.eclipse.compare.internal.DocumentManager; -import org.eclipse.compare.internal.ICompareUIConstants; +import org.eclipse.compare.internal.*; import org.eclipse.compare.structuremergeviewer.ICompareInput; +import org.eclipse.compare.structuremergeviewer.IStructureCreator; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.content.IContentType; import org.eclipse.jface.resource.ImageDescriptor; @@ -361,5 +360,21 @@ public final class CompareUI { DocumentManager.remove(document); } + /** + * Create and return a structure creator for the given typed element. + * Return <code>null</code> if an appropriate structure creator could + * not be obtained. + * @param element the typed element + * @return structure creator for the given typed element or <code>null</code> + * @since 3.4 + */ + public static IStructureCreator createStructureCreator(ITypedElement element) { + StructureCreatorDescriptor scd= CompareUIPlugin.getDefault().getStructureCreator(element.getType()); + if (scd != null) { + return scd.createStructureCreator(); + } + return null; + } + } diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/META-INF/MANIFEST.MF b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/META-INF/MANIFEST.MF index f78f1fbcd..85e9d2e88 100644 --- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/META-INF/MANIFEST.MF @@ -8,9 +8,9 @@ Bundle-Vendor: %providerName Bundle-Localization: plugin Export-Package: org.eclipse.compare, org.eclipse.compare.contentmergeviewer, - org.eclipse.compare.internal;x-friends:="org.eclipse.team.ui,org.eclipse.team.cvs.ui", - org.eclipse.compare.internal.merge;x-friends:="org.eclipse.team.ui,org.eclipse.team.cvs.ui", - org.eclipse.compare.internal.patch;x-friends:="org.eclipse.team.ui,org.eclipse.team.cvs.ui", + org.eclipse.compare.internal;x-internal:=true, + org.eclipse.compare.internal.merge;x-internal:=true, + org.eclipse.compare.internal.patch;x-internal:=true, org.eclipse.compare.patch, org.eclipse.compare.rangedifferencer, org.eclipse.compare.structuremergeviewer diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareUI.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareUI.java index 0825103d8..e6eec9311 100644 --- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareUI.java +++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareUI.java @@ -12,10 +12,9 @@ package org.eclipse.compare; import java.util.ResourceBundle; -import org.eclipse.compare.internal.CompareUIPlugin; -import org.eclipse.compare.internal.DocumentManager; -import org.eclipse.compare.internal.ICompareUIConstants; +import org.eclipse.compare.internal.*; import org.eclipse.compare.structuremergeviewer.ICompareInput; +import org.eclipse.compare.structuremergeviewer.IStructureCreator; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.content.IContentType; import org.eclipse.jface.resource.ImageDescriptor; @@ -361,5 +360,21 @@ public final class CompareUI { DocumentManager.remove(document); } + /** + * Create and return a structure creator for the given typed element. + * Return <code>null</code> if an appropriate structure creator could + * not be obtained. + * @param element the typed element + * @return structure creator for the given typed element or <code>null</code> + * @since 3.4 + */ + public static IStructureCreator createStructureCreator(ITypedElement element) { + StructureCreatorDescriptor scd= CompareUIPlugin.getDefault().getStructureCreator(element.getType()); + if (scd != null) { + return scd.createStructureCreator(); + } + return null; + } + } diff --git a/bundles/org.eclipse.team.cvs.ssh/src/org/eclipse/team/internal/ccvs/ssh/Client.java b/bundles/org.eclipse.team.cvs.ssh/src/org/eclipse/team/internal/ccvs/ssh/Client.java index 0d9f6b484..a46ff34cf 100644 --- a/bundles/org.eclipse.team.cvs.ssh/src/org/eclipse/team/internal/ccvs/ssh/Client.java +++ b/bundles/org.eclipse.team.cvs.ssh/src/org/eclipse/team/internal/ccvs/ssh/Client.java @@ -74,7 +74,7 @@ public class Client { private String command; private Socket socket; - private InputStream socketIn; + /* package */ InputStream socketIn; private PollingOutputStream socketOut; private InputStream is; private OutputStream os; @@ -83,7 +83,7 @@ public class Client { private Cipher cipher = null; - private class StandardInputStream extends InputStream { + class StandardInputStream extends InputStream { private ServerPacket packet = null; private InputStream buffer = null; private boolean atEnd = false; @@ -208,7 +208,7 @@ public class Client { } } - private class StandardOutputStream extends OutputStream { + class StandardOutputStream extends OutputStream { private int MAX_BUFFER_SIZE = MAX_CLIENT_PACKET_SIZE; private byte[] buffer = new byte[MAX_BUFFER_SIZE]; private int bufpos = 0; @@ -564,11 +564,11 @@ private void receive_SSH_SMSG_PUBLIC_KEY(ServerPacket packet) throws IOException send_SSH_CMSG_SESSION_KEY(anti_spoofing_cookie, host_key_bits, server_key_public_modulus, host_key_public_modulus, supported_ciphers_mask, server_key_public_exponent, host_key_public_exponent); } -private void send(int packetType, String s) throws IOException { +void send(int packetType, String s) throws IOException { byte[] data = s == null ? new byte[0] : s.getBytes("UTF-8"); //$NON-NLS-1$ send(packetType, data, 0, data.length); } -private void send(int packetType, byte[] data, int off, int len) throws IOException { +void send(int packetType, byte[] data, int off, int len) throws IOException { data = data == null ? null : Misc.lengthEncode(data, off, len); ClientPacket packet = new ClientPacket(packetType, data, cipher); socketOut.write(packet.getBytes()); @@ -696,7 +696,7 @@ private void send_SSH_CMSG_SESSION_KEY(byte[] anti_spoofing_cookie, byte[] host_ socketOut.flush(); } -private ServerPacket skip_SSH_MSG_DEBUG() throws IOException { +ServerPacket skip_SSH_MSG_DEBUG() throws IOException { ServerPacket packet = new ServerPacket(socketIn, cipher); while (packet.getType() == SSH_MSG_DEBUG) { packet.close(true); diff --git a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2Messages.java b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2Messages.java index fc0128159..7c105620e 100644 --- a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2Messages.java +++ b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2Messages.java @@ -14,6 +14,8 @@ import org.eclipse.osgi.util.NLS; public class CVSSSH2Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.team.internal.ccvs.ssh2.messages";//$NON-NLS-1$ + public static String JSchSession_4; + public static String JSchSession_5; public static String CVSSSH2ServerConnection_open; public static String CVSSSH2PreferencePage_18; diff --git a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/JSchSession.java b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/JSchSession.java index 223615b9a..bfdefb2a7 100644 --- a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/JSchSession.java +++ b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/JSchSession.java @@ -137,7 +137,7 @@ class JSchSession { * headless access to the connection method. */ private static class MyUserInfo implements UserInfo, UIKeyboardInteractive { - private String username; + /* package */ String username; private String password; private String passphrase; private ICVSRepositoryLocation location; @@ -156,6 +156,7 @@ class JSchSession { _location=CVSRepositoryLocation.fromString(dummy); } catch(CVSException e){ + // Ignore } } authenticator = _location.getUserAuthenticator(); @@ -303,11 +304,11 @@ class JSchSession { } static JSchSession getSession(ICVSRepositoryLocation location, String username, String password, String hostname, int port, IProgressMonitor monitor) throws JSchException { - - if (port == ICVSRepositoryLocation.USE_DEFAULT_PORT) - port = getPort(location); + int actualPort = port; + if (actualPort == ICVSRepositoryLocation.USE_DEFAULT_PORT) + actualPort = getPort(location); - String key = getPoolKey(username, hostname, port); + String key = getPoolKey(username, hostname, actualPort); try { JSchSession jschSession = (JSchSession) pool.get(key); @@ -323,17 +324,17 @@ class JSchSession { Session session = null; try { - session = createSession(username, password, hostname, port, wrapperUI, monitor); + session = createSession(username, password, hostname, actualPort, wrapperUI, monitor); } catch (JSchException e) { if (isAuthenticationFailure(e) && wrapperUI.hasPromptExceededTimeout()) { // Try again since the previous prompt may have obtained the proper credentials from the user - session = createSession(username, password, hostname, port, wrapperUI, monitor); + session = createSession(username, password, hostname, actualPort, wrapperUI, monitor); } else { throw e; } } if (session == null) - throw new JSchException("The JSch service is not available"); + throw new JSchException(CVSSSH2Messages.JSchSession_4); ui.connectionMade(); JSchSession schSession = new JSchSession(session, location, wrapperUI); pool.put(key, schSession); @@ -384,6 +385,7 @@ class JSchSession { try { session.getSession().disconnect(); } catch (Exception ee) { + // Ignore } } pool.clear(); diff --git a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/messages.properties b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/messages.properties index 2813953f8..209b13a22 100644 --- a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/messages.properties +++ b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/messages.properties @@ -8,6 +8,7 @@ # Contributors: # IBM Corporation - initial API and implementation ############################################################################### +JSchSession_4=The JSch service is not available JSchSession_5=SSH2 Message CVSSSH2ServerConnection_open=Connecting via SSH to {0}... CVSSSH2PreferencePage_18=Configuration options for SSH2: diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecoratorPreferencesPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecoratorPreferencesPage.java index 9dc738e97..a8942e04b 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecoratorPreferencesPage.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecoratorPreferencesPage.java @@ -13,7 +13,6 @@ package org.eclipse.team.internal.ccvs.ui; import java.util.*; -import org.eclipse.compare.internal.TabFolderLayout; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.*; import org.eclipse.jface.dialogs.Dialog; @@ -568,7 +567,6 @@ public class CVSDecoratorPreferencesPage extends PreferencePage implements IWork // create a tab folder for the page final TabFolder tabFolder = new TabFolder(folderComposite, SWT.NONE); - tabFolder.setLayout(new TabFolderLayout()); tabFolder.setLayoutData(SWTUtils.createHFillGridData()); // text decoration options diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java index 7c295b544..cfeab2a82 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java @@ -55,11 +55,28 @@ import org.eclipse.ui.*; 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; public class Utils { /** + * Constant used to indicate that tests are being run. This field + * should be the same as the corresponding field on + * org.eclipse.compare.internal.Utilities + */ + public static boolean RUNNING_TESTS = false; + + /** + * Constant used while testing the indicate that changes should be flushed + * when the compare input changes and a viewer is dirty. This field + * should be the same as the corresponding field on + * org.eclipse.compare.internal.Utilities + */ + public static boolean TESTING_FLUSH_ON_COMPARE_INPUT_CHANGE = false; + + /** * The SortOperation takes a collection of objects and returns a sorted * collection of these objects. Concrete instances of this class provide * the criteria for the sorting of the objects based on the type of the @@ -963,6 +980,23 @@ public class Utils { return traversal.asTraversals(); } + /** + * 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; + } + return false; + } + public static IEditorPart openEditor(IWorkbenchPage page, IFileRevision revision, IProgressMonitor monitor) throws CoreException { IStorage file = revision.getStorage(monitor); if (file instanceof IFile) { @@ -981,6 +1015,7 @@ public class Utils { String id = getEditorId(editorInput); try { IEditorPart part = page.openEditor(editorInput, id); + // See bug 90582 for the reasons behind this discouraged access if (part instanceof ErrorEditorPart) { page.closeEditor(part, false); part = null; diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/ApplyPatchAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/ApplyPatchAction.java index 0b78a20cc..0a7debb55 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/ApplyPatchAction.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/ApplyPatchAction.java @@ -13,7 +13,6 @@ package org.eclipse.team.internal.ui.actions; import java.lang.reflect.InvocationTargetException; import org.eclipse.compare.CompareConfiguration; -import org.eclipse.compare.internal.CompareUIPlugin; import org.eclipse.compare.patch.ApplyPatchOperation; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; @@ -21,6 +20,7 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.jface.action.IAction; import org.eclipse.swt.custom.BusyIndicator; import org.eclipse.swt.widgets.Display; +import org.eclipse.team.internal.ui.TeamUIPlugin; public class ApplyPatchAction extends TeamAction { @@ -40,7 +40,7 @@ public class ApplyPatchAction extends TeamAction { try { isPatch = ApplyPatchOperation.isPatch((IFile)resource); } catch (CoreException e) { - CompareUIPlugin.log(e); + TeamUIPlugin.log(e); } } diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/PreferencePageContainerDialog.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/PreferencePageContainerDialog.java index ca9e3f846..6c215a396 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/PreferencePageContainerDialog.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/PreferencePageContainerDialog.java @@ -15,7 +15,6 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; -import org.eclipse.compare.internal.TabFolderLayout; import org.eclipse.core.runtime.ListenerList; import org.eclipse.jface.dialogs.*; import org.eclipse.jface.dialogs.Dialog; @@ -141,7 +140,6 @@ public class PreferencePageContainerDialog extends TrayDialog private void createMultiplePageArea(Composite composite) { // create a tab folder for the page tabFolder = new TabFolder(composite, SWT.NONE); - tabFolder.setLayout(new TabFolderLayout()); tabFolder.setLayoutData(new GridData(GridData.FILL_BOTH)); for (int i = 0; i < pages.length; i++) { diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/EditionHistoryPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/EditionHistoryPage.java index 957f93bd5..fc5d0c1a2 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/EditionHistoryPage.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/EditionHistoryPage.java @@ -12,9 +12,8 @@ package org.eclipse.team.internal.ui.history; import java.util.*; +import org.eclipse.compare.CompareUI; import org.eclipse.compare.ITypedElement; -import org.eclipse.compare.internal.CompareUIPlugin; -import org.eclipse.compare.internal.StructureCreatorDescriptor; import org.eclipse.compare.structuremergeviewer.*; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; @@ -130,7 +129,7 @@ public class EditionHistoryPage extends LocalHistoryPage { public static ITypedElement getPreviousState(IFile file, Object element) throws TeamException { LocalResourceTypedElement localFileElement= new LocalResourceTypedElement(file); - IStructureCreator structureCreator = getStructureCreator(localFileElement); + IStructureCreator structureCreator = CompareUI.createStructureCreator(localFileElement); if (structureCreator == null) return null; LocalFileHistory history = new LocalFileHistory(file, false); @@ -155,14 +154,6 @@ public class EditionHistoryPage extends LocalHistoryPage { } return null; } - - private static IStructureCreator getStructureCreator(ITypedElement element) { - StructureCreatorDescriptor scd= CompareUIPlugin.getDefault().getStructureCreator(element.getType()); - if (scd != null) { - return scd.createStructureCreator(); - } - return null; - } public EditionHistoryPage(IFile file, Object element) { super(ON | ALWAYS); @@ -171,7 +162,7 @@ public class EditionHistoryPage extends LocalHistoryPage { this.file = file; this.element = element; this.localFileElement= new LocalResourceTypedElement(getFile()); - structureCreator = getStructureCreator(localFileElement); + structureCreator = CompareUI.createStructureCreator(localFileElement); } public void setSite(IHistoryPageSite site) { diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceSaveableComparison.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceSaveableComparison.java index 8be72e387..5d600c272 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceSaveableComparison.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceSaveableComparison.java @@ -11,7 +11,6 @@ package org.eclipse.team.internal.ui.synchronize; import org.eclipse.compare.*; -import org.eclipse.compare.internal.Utilities; import org.eclipse.compare.structuremergeviewer.ICompareInput; import org.eclipse.core.resources.IFile; import org.eclipse.core.runtime.*; @@ -166,8 +165,8 @@ public abstract class LocalResourceSaveableComparison extends SaveableComparison */ private boolean checkForUpdateConflicts() { if(hasSaveConflict()) { - if (Utilities.RUNNING_TESTS) - return !Utilities.TESTING_FLUSH_ON_COMPARE_INPUT_CHANGE; + if (Utils.RUNNING_TESTS) + return !Utils.TESTING_FLUSH_ON_COMPARE_INPUT_CHANGE; final MessageDialog dialog = new MessageDialog(TeamUIPlugin.getStandardDisplay().getActiveShell(), TeamUIMessages.SyncInfoCompareInput_0, diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/RevisionAnnotationController.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/RevisionAnnotationController.java index fb4d0338e..5d7a12aef 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/RevisionAnnotationController.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/RevisionAnnotationController.java @@ -28,7 +28,6 @@ import org.eclipse.team.internal.ui.history.FileRevisionEditorInput; import org.eclipse.ui.*; import org.eclipse.ui.editors.text.EditorsUI; import org.eclipse.ui.ide.IDE; -import org.eclipse.ui.internal.registry.EditorDescriptor; import org.eclipse.ui.part.FileEditorInput; import org.eclipse.ui.part.MultiPageEditorPart; import org.eclipse.ui.texteditor.AbstractDecoratedTextEditor; @@ -179,7 +178,7 @@ public abstract class RevisionAnnotationController { id = EditorsUI.DEFAULT_TEXT_EDITOR_ID; } else { try { - if (isTextEditor(descriptor)) { + if (Utils.isTextEditor(descriptor)) { id = descriptor.getId(); } else { id = EditorsUI.DEFAULT_TEXT_EDITOR_ID; @@ -191,14 +190,7 @@ public abstract class RevisionAnnotationController { return id; } - private static boolean isTextEditor(IEditorDescriptor descriptor) - throws CoreException { - if (descriptor instanceof EditorDescriptor) { - EditorDescriptor desc = (EditorDescriptor) descriptor; - return desc.createEditor() instanceof AbstractDecoratedTextEditor; - } - return false; - } + private static AbstractDecoratedTextEditor findOpenTextEditorForFile(IWorkbenchPage page, IFile file) { if (file == null) |