diff options
author | Andre Weinand | 2004-11-07 22:08:01 +0000 |
---|---|---|
committer | Andre Weinand | 2004-11-07 22:08:01 +0000 |
commit | 69fb14ec1b90a84205fec49ea06425525e8745ab (patch) | |
tree | edf226fa3bdaed7ca457b14a53437674b6bdfdb3 | |
parent | 7c61db807f1131486e667402713fcd980884036f (diff) | |
download | eclipse.platform.team-69fb14ec1b90a84205fec49ea06425525e8745ab.tar.gz eclipse.platform.team-69fb14ec1b90a84205fec49ea06425525e8745ab.tar.xz eclipse.platform.team-69fb14ec1b90a84205fec49ea06425525e8745ab.zip |
first half of fix for #77599
8 files changed, 88 insertions, 8 deletions
diff --git a/bundles/org.eclipse.compare/buildnotes_compare.html b/bundles/org.eclipse.compare/buildnotes_compare.html index c73ea0eab..dedaa6fb2 100644 --- a/bundles/org.eclipse.compare/buildnotes_compare.html +++ b/bundles/org.eclipse.compare/buildnotes_compare.html @@ -12,6 +12,14 @@ Eclipse Platform Build Notes<br> Compare</h1> +Eclipse Build Input November 9th 2004 + +<h2>Problem reports fixed</h2> +<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=77599">77599</a>: [5.0] Structure comparing of enums does not work<br> + + +<h1><hr WIDTH="100%"></h1> + Eclipse Build Input November 1st 2004 <h2>Problem reports fixed</h2> diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/HistoryItem.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/HistoryItem.java index 9e1b4bddf..3c9dff749 100644 --- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/HistoryItem.java +++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/HistoryItem.java @@ -15,6 +15,7 @@ import java.io.BufferedInputStream; import org.eclipse.swt.graphics.Image; +import org.eclipse.compare.internal.IResourceProvider; import org.eclipse.core.resources.IEncodedStorage; import org.eclipse.core.resources.IFileState; import org.eclipse.core.resources.IResource; @@ -31,7 +32,7 @@ import org.eclipse.core.runtime.IPath; * Clients may instantiate this class; it is not intended to be subclassed. * </p> */ -public class HistoryItem implements IEncodedStreamContentAccessor, ITypedElement, IModificationDate { +public class HistoryItem implements IEncodedStreamContentAccessor, ITypedElement, IModificationDate, IResourceProvider { private ITypedElement fBase; private IFileState fFileState; @@ -90,12 +91,19 @@ public class HistoryItem implements IEncodedStreamContentAccessor, ITypedElement public String getCharset() throws CoreException { String charset= fFileState.getCharset(); if (charset == null) { - IPath fullPath = fFileState.getFullPath(); - IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(fullPath); + IResource resource= getResource(); if (resource instanceof IEncodedStorage) charset= ((IEncodedStorage)resource).getCharset(); } return charset; } + + /* (non-Javadoc) + * @see org.eclipse.compare.internal.IResourceProvider#getResource() + */ + public IResource getResource() { + IPath fullPath= fFileState.getFullPath(); + return ResourcesPlugin.getWorkspace().getRoot().findMember(fullPath); + } } diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/ResourceNode.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/ResourceNode.java index 39a88a93a..ad07219e3 100644 --- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/ResourceNode.java +++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/ResourceNode.java @@ -20,6 +20,7 @@ import org.eclipse.jface.util.Assert; import org.eclipse.core.resources.*; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; +import org.eclipse.compare.internal.IResourceProvider; import org.eclipse.compare.internal.Utilities; import org.eclipse.compare.structuremergeviewer.IStructureComparator; @@ -35,7 +36,7 @@ import org.eclipse.compare.structuremergeviewer.IStructureComparator; */ public class ResourceNode extends BufferedContent implements IEncodedStreamContentAccessor, IStructureComparator, ITypedElement, - IEditableContent, IModificationDate { + IEditableContent, IModificationDate, IResourceProvider { private IResource fResource; private ArrayList fChildren; diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/IResourceProvider.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/IResourceProvider.java new file mode 100644 index 000000000..359d6a293 --- /dev/null +++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/IResourceProvider.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * Copyright (c) 2004 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.compare.internal; + +import org.eclipse.core.resources.IResource; + +public interface IResourceProvider { + + /** + * Returns the corresponding resource for this object or <code>null</code>. + * + * @return the corresponding resource or <code>null</code> + */ + IResource getResource(); +} diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html index c73ea0eab..dedaa6fb2 100644 --- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html +++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html @@ -12,6 +12,14 @@ Eclipse Platform Build Notes<br> Compare</h1> +Eclipse Build Input November 9th 2004 + +<h2>Problem reports fixed</h2> +<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=77599">77599</a>: [5.0] Structure comparing of enums does not work<br> + + +<h1><hr WIDTH="100%"></h1> + Eclipse Build Input November 1st 2004 <h2>Problem reports fixed</h2> diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/HistoryItem.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/HistoryItem.java index 9e1b4bddf..3c9dff749 100644 --- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/HistoryItem.java +++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/HistoryItem.java @@ -15,6 +15,7 @@ import java.io.BufferedInputStream; import org.eclipse.swt.graphics.Image; +import org.eclipse.compare.internal.IResourceProvider; import org.eclipse.core.resources.IEncodedStorage; import org.eclipse.core.resources.IFileState; import org.eclipse.core.resources.IResource; @@ -31,7 +32,7 @@ import org.eclipse.core.runtime.IPath; * Clients may instantiate this class; it is not intended to be subclassed. * </p> */ -public class HistoryItem implements IEncodedStreamContentAccessor, ITypedElement, IModificationDate { +public class HistoryItem implements IEncodedStreamContentAccessor, ITypedElement, IModificationDate, IResourceProvider { private ITypedElement fBase; private IFileState fFileState; @@ -90,12 +91,19 @@ public class HistoryItem implements IEncodedStreamContentAccessor, ITypedElement public String getCharset() throws CoreException { String charset= fFileState.getCharset(); if (charset == null) { - IPath fullPath = fFileState.getFullPath(); - IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(fullPath); + IResource resource= getResource(); if (resource instanceof IEncodedStorage) charset= ((IEncodedStorage)resource).getCharset(); } return charset; } + + /* (non-Javadoc) + * @see org.eclipse.compare.internal.IResourceProvider#getResource() + */ + public IResource getResource() { + IPath fullPath= fFileState.getFullPath(); + return ResourcesPlugin.getWorkspace().getRoot().findMember(fullPath); + } } diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/ResourceNode.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/ResourceNode.java index 39a88a93a..ad07219e3 100644 --- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/ResourceNode.java +++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/ResourceNode.java @@ -20,6 +20,7 @@ import org.eclipse.jface.util.Assert; import org.eclipse.core.resources.*; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; +import org.eclipse.compare.internal.IResourceProvider; import org.eclipse.compare.internal.Utilities; import org.eclipse.compare.structuremergeviewer.IStructureComparator; @@ -35,7 +36,7 @@ import org.eclipse.compare.structuremergeviewer.IStructureComparator; */ public class ResourceNode extends BufferedContent implements IEncodedStreamContentAccessor, IStructureComparator, ITypedElement, - IEditableContent, IModificationDate { + IEditableContent, IModificationDate, IResourceProvider { private IResource fResource; private ArrayList fChildren; diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/IResourceProvider.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/IResourceProvider.java new file mode 100644 index 000000000..359d6a293 --- /dev/null +++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/IResourceProvider.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * Copyright (c) 2004 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.compare.internal; + +import org.eclipse.core.resources.IResource; + +public interface IResourceProvider { + + /** + * Returns the corresponding resource for this object or <code>null</code>. + * + * @return the corresponding resource or <code>null</code> + */ + IResource getResource(); +} |