Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Piers2019-02-25 03:25:13 -0500
committerWilliam Piers2019-02-25 03:49:10 -0500
commit43c3ee96775f4effdf91991ffdc1a86803790960 (patch)
tree720aa570d6e6b44dee2aaa213c0952894e9f7730
parent8efb029b92e783cc925db3e41e4e6a68b1e8557c (diff)
downloadorg.eclipse.emf.compare-43c3ee96775f4effdf91991ffdc1a86803790960.tar.gz
org.eclipse.emf.compare-43c3ee96775f4effdf91991ffdc1a86803790960.tar.xz
org.eclipse.emf.compare-43c3ee96775f4effdf91991ffdc1a86803790960.zip
Opened EMF Compare API
Change-Id: I34b9ac1683b48bf9f3bd08cd2ff175fbdf42511f Signed-off-by: William Piers <william.piers@obeo.fr>
-rw-r--r--plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/AttributeChangeItemProviderSpec.java18
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java9
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewerContentProvider.java4
3 files changed, 26 insertions, 5 deletions
diff --git a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/AttributeChangeItemProviderSpec.java b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/AttributeChangeItemProviderSpec.java
index 785272678..00773b3f9 100644
--- a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/AttributeChangeItemProviderSpec.java
+++ b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/AttributeChangeItemProviderSpec.java
@@ -115,9 +115,21 @@ public class AttributeChangeItemProviderSpec extends AttributeChangeItemProvider
* @return a nice text from the the given {@link AttributeChange}.
*/
protected String getValueText(final AttributeChange attChange) {
+ return getValueText(attChange.getValue(), attChange.getAttribute());
+ }
+
+ /**
+ * Converts to text the given {@link Attribute} & value.
+ *
+ * @param attValue
+ * the value
+ * @param attribute
+ * the related attribute
+ * @return a nice text from the the given {@link Attribute} & value.
+ */
+ protected String getValueText(Object attValue, EAttribute attribute) {
String value;
- Object attValue = attChange.getValue();
- if (FeatureMapUtil.isFeatureMap(attChange.getAttribute())) {
+ if (FeatureMapUtil.isFeatureMap(attribute)) {
FeatureMap.Entry entry = (FeatureMap.Entry)attValue;
EStructuralFeature entryFeature = entry.getEStructuralFeature();
if (entryFeature instanceof EAttribute) {
@@ -126,7 +138,7 @@ public class AttributeChangeItemProviderSpec extends AttributeChangeItemProvider
value = itemDelegator.getText(entry.getValue());
}
} else {
- value = EcoreUtil.convertToString(attChange.getAttribute().getEAttributeType(), attValue);
+ value = EcoreUtil.convertToString(attribute.getEAttributeType(), attValue);
}
if (isNullOrEmpty(value)) {
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java
index fe3300ab7..43420c55f 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java
@@ -902,6 +902,15 @@ public class EMFCompareStructureMergeViewer extends AbstractStructuredViewerWrap
}
/**
+ * Returns the tree viewer.
+ *
+ * @return the tree viewer
+ */
+ public TreeViewer getTreeViewer() {
+ return getViewer();
+ }
+
+ /**
* Determines the current used theme.
*
* @return The currently used theme if available, {@code null} otherwise.
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewerContentProvider.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewerContentProvider.java
index 2b797be53..7cecedc19 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewerContentProvider.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewerContentProvider.java
@@ -370,7 +370,7 @@ public class EMFCompareStructureMergeViewerContentProvider extends AdapterFactor
* @see org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider#hasChildren(Object object)
*/
@Override
- public final boolean hasChildren(Object element) {
+ public boolean hasChildren(Object element) {
final boolean ret;
if (element instanceof CompareInputAdapter) {
ret = super.hasChildren(((Adapter)element).getTarget());
@@ -388,7 +388,7 @@ public class EMFCompareStructureMergeViewerContentProvider extends AdapterFactor
* @see org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider#getChildren(java.lang.Object)
*/
@Override
- public final Object[] getChildren(Object element) {
+ public Object[] getChildren(Object element) {
Object[] children;
if (element instanceof CompareInputAdapter) {
children = getCompareInputAdapterChildren((CompareInputAdapter)element);

Back to the top