|
Lines 1-13
Link Here
|
| 1 |
/** |
1 |
/** |
| 2 |
* <copyright> |
2 |
* <copyright> |
| 3 |
* |
3 |
* |
| 4 |
* Copyright (c) 2007 IBM Corporation and others. |
4 |
* Copyright (c) 2007 IBM Corporation and others. |
| 5 |
* All rights reserved. This program and the accompanying materials |
5 |
* All rights reserved. This program and the accompanying materials |
| 6 |
* are made available under the terms of the Eclipse Public License v1.0 |
6 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 7 |
* which accompanies this distribution, and is available at |
7 |
* which accompanies this distribution, and is available at |
| 8 |
* http://www.eclipse.org/legal/epl-v10.html |
8 |
* http://www.eclipse.org/legal/epl-v10.html |
| 9 |
* |
9 |
* |
| 10 |
* Contributors: |
10 |
* Contributors: |
| 11 |
* IBM - Initial API and implementation |
11 |
* IBM - Initial API and implementation |
| 12 |
* |
12 |
* |
| 13 |
* </copyright> |
13 |
* </copyright> |
|
Lines 25-30
Link Here
|
| 25 |
import org.eclipse.emf.common.notify.impl.AdapterImpl; |
25 |
import org.eclipse.emf.common.notify.impl.AdapterImpl; |
| 26 |
import org.eclipse.emf.ecore.EObject; |
26 |
import org.eclipse.emf.ecore.EObject; |
| 27 |
import org.eclipse.emf.ecore.EStructuralFeature; |
27 |
import org.eclipse.emf.ecore.EStructuralFeature; |
|
|
28 |
import org.eclipse.emf.ecore.util.ExtendedMetaData; |
| 28 |
|
29 |
|
| 29 |
/** |
30 |
/** |
| 30 |
* PROVISIONAL |
31 |
* PROVISIONAL |
|
Lines 34-40
Link Here
|
| 34 |
{ |
35 |
{ |
| 35 |
protected EStructuralFeature eStructuralFeature; |
36 |
protected EStructuralFeature eStructuralFeature; |
| 36 |
|
37 |
|
| 37 |
private Adapter elementListener = |
38 |
private Adapter elementListener = |
| 38 |
new AdapterImpl() |
39 |
new AdapterImpl() |
| 39 |
{ |
40 |
{ |
| 40 |
@Override |
41 |
@Override |
|
Lines 80-94
Link Here
|
| 80 |
@Override |
81 |
@Override |
| 81 |
protected Object doGet(Object key) |
82 |
protected Object doGet(Object key) |
| 82 |
{ |
83 |
{ |
| 83 |
return ((EObject)key).eGet(eStructuralFeature); |
84 |
EObject eObject = (EObject)key; |
|
|
85 |
if( eObject.eClass().getEAllStructuralFeatures().contains(eStructuralFeature) ) { |
| 86 |
return ((EObject)key).eGet(eStructuralFeature); |
| 87 |
} else { |
| 88 |
return null; |
| 89 |
} |
| 84 |
} |
90 |
} |
| 85 |
|
91 |
|
| 86 |
@Override |
92 |
@Override |
| 87 |
protected Object doPut(Object key, Object value) |
93 |
protected Object doPut(Object key, Object value) |
| 88 |
{ |
94 |
{ |
| 89 |
EObject eObject = (EObject)key; |
95 |
EObject eObject = (EObject)key; |
| 90 |
Object result = eObject.eGet(eStructuralFeature); |
96 |
if( ((EObject)key).eClass().getEAllStructuralFeatures().contains(eStructuralFeature) ) { |
| 91 |
eObject.eSet(eStructuralFeature, value); |
97 |
Object result = eObject.eGet(eStructuralFeature); |
| 92 |
return result; |
98 |
eObject.eSet(eStructuralFeature, value); |
|
|
99 |
return result; |
| 100 |
} else { |
| 101 |
return null; |
| 102 |
} |
| 93 |
} |
103 |
} |
| 94 |
} |
104 |
} |