diff options
author | Michael Valenta | 2005-11-23 04:04:20 +0000 |
---|---|---|
committer | Michael Valenta | 2005-11-23 04:04:20 +0000 |
commit | cc30e6dfedd36db3113b46cf03bc279287cddad1 (patch) | |
tree | fd099bf29d3b9070befbd9abf1998e7e33b623d9 | |
parent | 005b91034b0ec2fa07705c77fe2def0070146264 (diff) | |
download | eclipse.platform.team-cc30e6dfedd36db3113b46cf03bc279287cddad1.tar.gz eclipse.platform.team-cc30e6dfedd36db3113b46cf03bc279287cddad1.tar.xz eclipse.platform.team-cc30e6dfedd36db3113b46cf03bc279287cddad1.zip |
Got book merge editor save working
4 files changed, 35 insertions, 16 deletions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/IModelProviderCompareAdapter.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/IModelProviderCompareAdapter.java index f3798a583..a842d2dfc 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/IModelProviderCompareAdapter.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/IModelProviderCompareAdapter.java @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.team.internal.ui.mapping; +import org.eclipse.compare.CompareConfiguration; import org.eclipse.compare.structuremergeviewer.ICompareInput; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; @@ -63,17 +64,19 @@ public interface IModelProviderCompareAdapter { * @param parent the parent composite of the viewer * @param oldViewer the current viewer which canbe returned if it is appropriate for use with the given input * @param input the compare input to be viewed + * @param configuration the compare configuration information * @return a viewer for viewing the structure of the given compare input */ - Viewer findStructureViewer(Composite parent, Viewer oldViewer, ICompareInput input); + Viewer findStructureViewer(Composite parent, Viewer oldViewer, ICompareInput input, CompareConfiguration configuration); /** * Return a viewer for comparing the content of the given compare input. * @param parent the parent composite of the viewer * @param oldViewer the current viewer which can be returned if it is appropriate for use with the given input * @param input the compare input to be viewed + * @param configuration the compare configuration information * @return a viewer for comparing the content of the given compare input */ - Viewer findContentViewer(Composite parent, Viewer oldViewer, ICompareInput input); + Viewer findContentViewer(Composite parent, Viewer oldViewer, ICompareInput input, CompareConfiguration configuration); } diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelParticipantPageSavablePart.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelParticipantPageSavablePart.java index 77ec632a7..72529be4e 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelParticipantPageSavablePart.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelParticipantPageSavablePart.java @@ -55,7 +55,7 @@ public class ModelParticipantPageSavablePart extends * @see org.eclipse.team.ui.synchronize.ParticipantPageSaveablePart#findStructureViewer(org.eclipse.swt.widgets.Composite, org.eclipse.jface.viewers.Viewer, org.eclipse.compare.structuremergeviewer.ICompareInput) */ protected Viewer findStructureViewer(Composite parent, Viewer oldViewer, ICompareInput input) { - Viewer viewer = ((ModelSynchronizePage)getPageConfiguration().getPage()).findStructureViewer(parent, oldViewer, input); + Viewer viewer = ((ModelSynchronizePage)getPageConfiguration().getPage()).findStructureViewer(parent, oldViewer, input, getCompareConfiguration()); if (viewer != null) return viewer; return super.findStructureViewer(parent, oldViewer, input); @@ -65,7 +65,7 @@ public class ModelParticipantPageSavablePart extends * @see org.eclipse.team.ui.synchronize.ParticipantPageSaveablePart#findContentViewer(org.eclipse.swt.widgets.Composite, org.eclipse.jface.viewers.Viewer, org.eclipse.compare.structuremergeviewer.ICompareInput) */ protected Viewer findContentViewer(Composite parent, Viewer oldViewer, ICompareInput input) { - Viewer viewer = ((ModelSynchronizePage)getPageConfiguration().getPage()).findContentViewer(parent, oldViewer, input); + Viewer viewer = ((ModelSynchronizePage)getPageConfiguration().getPage()).findContentViewer(parent, oldViewer, input, getCompareConfiguration()); if (viewer != null) return viewer; return super.findContentViewer(parent, oldViewer, input); diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelSynchronizePage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelSynchronizePage.java index 7bc133136..18d05bf34 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelSynchronizePage.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelSynchronizePage.java @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.team.internal.ui.mapping; +import org.eclipse.compare.CompareConfiguration; import org.eclipse.compare.structuremergeviewer.ICompareInput; import org.eclipse.core.resources.mapping.ModelProvider; import org.eclipse.core.resources.mapping.ResourceMapping; @@ -138,13 +139,14 @@ public class ModelSynchronizePage extends AbstractSynchronizePage { * @param parent the parent composite of the viewer * @param oldViewer the current viewer which canbe returned if it is appropriate for use with the given input * @param input the compare input to be viewed + * @param configuration the compare sonfiguration information * @return a viewer for viewing the structure of the given compare input */ - public Viewer findStructureViewer(Composite parent, Viewer oldViewer, ICompareInput input) { + public Viewer findStructureViewer(Composite parent, Viewer oldViewer, ICompareInput input, CompareConfiguration configuration) { // Get a structure viewer from the model provider's compare adapter IModelProviderCompareAdapter adapter = getModelProviderCompareAdapter(input); if (adapter != null) - return adapter.findStructureViewer(parent, oldViewer, input); + return adapter.findStructureViewer(parent, oldViewer, input, configuration); return null; } @@ -153,13 +155,14 @@ public class ModelSynchronizePage extends AbstractSynchronizePage { * @param parent the parent composite of the viewer * @param oldViewer the current viewer which can be returned if it is appropriate for use with the given input * @param input the compare input to be viewed + * @param configuration the compare configuration information * @return a viewer for comparing the content of the given compare input */ - public Viewer findContentViewer(Composite parent, Viewer oldViewer, ICompareInput input) { + public Viewer findContentViewer(Composite parent, Viewer oldViewer, ICompareInput input, CompareConfiguration configuration) { // Get a content viewer from the model provider's compare adapter IModelProviderCompareAdapter adapter = getModelProviderCompareAdapter(input); if (adapter != null) - return adapter.findContentViewer(parent, oldViewer, input); + return adapter.findContentViewer(parent, oldViewer, input, configuration); return null; } diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ParticipantPageSaveablePart.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ParticipantPageSaveablePart.java index 93f83883e..072bf1bfc 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ParticipantPageSaveablePart.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ParticipantPageSaveablePart.java @@ -221,14 +221,17 @@ public class ParticipantPageSaveablePart extends SaveablePartAdapter implements */ public void doSave(IProgressMonitor pm) { //super.saveChanges(pm); - ISynchronizeModelElement root = (ISynchronizeModelElement)viewer.getInput(); - if (root != null && root instanceof DiffNode) { - try { - commit(pm, (DiffNode)root); - } catch (CoreException e) { - Utils.handle(e); - } finally { - setDirty(false); + Object input = viewer.getInput(); + if (input instanceof ISynchronizeModelElement) { + ISynchronizeModelElement root = (ISynchronizeModelElement)input; + if (root != null && root instanceof DiffNode) { + try { + commit(pm, (DiffNode)root); + } catch (CoreException e) { + Utils.handle(e); + } finally { + setDirty(false); + } } } } @@ -584,4 +587,14 @@ public class ParticipantPageSaveablePart extends SaveablePartAdapter implements protected Viewer findContentViewer(Composite parent, Viewer oldViewer, ICompareInput input) { return CompareUI.findContentViewer(oldViewer, input, parent, cc); } + + /** + * Return the compare configuration for this part. + * @return the compare configuration for this part + * + * @since 3.2 + */ + protected CompareConfiguration getCompareConfiguration() { + return cc; + } } |