diff options
author | Stefan Dirix | 2016-08-10 07:57:57 +0000 |
---|---|---|
committer | Stefan Dirix | 2017-01-13 11:40:44 +0000 |
commit | 5aeefe6e825a9d7b529202b48fd3dc64501c0021 (patch) | |
tree | d1c08b8f91052a44e7006f9b01e0c3f22b3f6ddc /plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/mergeviewer/item/provider/IMergeViewerItemProvider.java | |
parent | a6cb5f1bd528d972fc41cc14907375aeb5ea13dc (diff) | |
download | org.eclipse.emf.compare-5aeefe6e825a9d7b529202b48fd3dc64501c0021.tar.gz org.eclipse.emf.compare-5aeefe6e825a9d7b529202b48fd3dc64501c0021.tar.xz org.eclipse.emf.compare-5aeefe6e825a9d7b529202b48fd3dc64501c0021.zip |
Introduce ContentProviders for TreeContentMergeViewer
This refactoring has two distinct goals: Clear separation of concerns in
the code and allowing the user to customize the TreeContentMergeViewer.
Currently the MergeViewerItem serves the dual use of wrapping the
displayed model but is also responsible to determine its parents,
children and stub elements. The later tasks are now separated to
different ContentProviders.
The content of the TreeContentMergeViewer is now determined by
'IMergeViewerItemContentProvider's which can be registered at the new
extension point 'contentMergeViewerCustomization'. The default
implementation uses the existing EMFCompare adapterFactory mechanism to
determine the 'real' and 'stub' content of the TreeContentMergeViewer.
Additionally the new 'ImergeViewerItemProvider's are used to determine
the root elements of the tree, currently provided by the
'ICompareAccessors'.
The new customizations are extensively used within the Papyrus
customizations for EMFCompare.
Change-Id: I5f3cc5143b71ed3f517e427868395a5e14638fea
Signed-off-by: Alexandra Buzila <abuzila@eclipsesource.com>
Signed-off-by: Stefan Dirix <sdirix@eclipsesource.com>
Diffstat (limited to 'plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/mergeviewer/item/provider/IMergeViewerItemProvider.java')
-rw-r--r-- | plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/mergeviewer/item/provider/IMergeViewerItemProvider.java | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/mergeviewer/item/provider/IMergeViewerItemProvider.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/mergeviewer/item/provider/IMergeViewerItemProvider.java new file mode 100644 index 000000000..694b136fd --- /dev/null +++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/mergeviewer/item/provider/IMergeViewerItemProvider.java @@ -0,0 +1,48 @@ +/******************************************************************************* + * Copyright (c) 2016 EclipseSource Muenchen GmbH and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Stefan Dirix - initial API and implementation + *******************************************************************************/ +package org.eclipse.emf.compare.rcp.ui.mergeviewer.item.provider; + +import java.util.List; + +import org.eclipse.emf.compare.rcp.ui.mergeviewer.item.IMergeViewerItem; + +/** + * The contract for providers responsible for determining root elements in merge viewers. Typically these are + * {@link IMergeViewerItem}s but they not necessarily have to be. + * + * @author Stefan Dirix <sdirix@eclipsesource.com> + * @since 4.4 + */ +public interface IMergeViewerItemProvider extends IOptionalProvider { + + /** + * Determine the root merge viewer items for the given {@code object}. + * + * @param object + * the {@link Object} for which the root merge viewer items are to be determined. + * @param configuration + * the {@link IMergeViewerItemProviderConfiguration}. + * @return a list of the root elements. + */ + public List<Object> getMergeViewerItems(Object object, + IMergeViewerItemProviderConfiguration configuration); + + /** + * Determine the merge viewer item which shall be selected. + * + * @param object + * the {@link Object} for which the selected merge viewer item is to be determined. + * @param configuration + * the {@link IMergeViewerItemProviderConfiguration}. + * @return the merge viewer item to select. + */ + public Object getItemToSelect(Object object, IMergeViewerItemProviderConfiguration configuration); +} |