|
Lines 21-26
Link Here
|
| 21 |
import org.eclipse.emf.ecore.EObject; |
21 |
import org.eclipse.emf.ecore.EObject; |
| 22 |
import org.eclipse.emf.ecore.EValidator; |
22 |
import org.eclipse.emf.ecore.EValidator; |
| 23 |
import org.eclipse.emf.ecore.util.Diagnostician; |
23 |
import org.eclipse.emf.ecore.util.Diagnostician; |
|
|
24 |
import org.eclipse.emf.ecore.util.EObjectValidator; |
| 24 |
import org.eclipse.emf.ecp.ui.common.AbstractCachedTree; |
25 |
import org.eclipse.emf.ecp.ui.common.AbstractCachedTree; |
| 25 |
import org.eclipse.emf.ecp.ui.common.CachedTreeNode; |
26 |
import org.eclipse.emf.ecp.ui.common.CachedTreeNode; |
| 26 |
import org.eclipse.emf.ecp.ui.common.IExcludedObjectsCallback; |
27 |
import org.eclipse.emf.ecp.ui.common.IExcludedObjectsCallback; |
|
Lines 136-154
Link Here
|
| 136 |
} |
137 |
} |
| 137 |
|
138 |
|
| 138 |
private Diagnostic getSeverity(EObject object) { |
139 |
private Diagnostic getSeverity(EObject object) { |
| 139 |
EValidator validator = EValidator.Registry.INSTANCE.getEValidator(object.eClass().getEPackage()); |
140 |
EValidator validator = EValidator.Registry.INSTANCE.getEValidator(object.eClass().getEPackage()); |
| 140 |
BasicDiagnostic diagnostics = Diagnostician.INSTANCE.createDefaultDiagnostic(object); |
141 |
BasicDiagnostic diagnostics = Diagnostician.INSTANCE.createDefaultDiagnostic(object); |
| 141 |
|
142 |
|
| 142 |
if (validator != null) { |
143 |
if (validator == null) { |
| 143 |
Map<Object, Object> context = new HashMap<Object, Object>(); |
144 |
validator = new EObjectValidator(); |
| 144 |
context.put(EValidator.SubstitutionLabelProvider.class, Diagnostician.INSTANCE); |
145 |
} |
| 145 |
context.put(EValidator.class, validator); |
146 |
Map<Object, Object> context = new HashMap<Object, Object>(); |
| 146 |
|
147 |
context.put(EValidator.SubstitutionLabelProvider.class, Diagnostician.INSTANCE); |
| 147 |
validator.validate(object, diagnostics, context); |
148 |
context.put(EValidator.class, validator); |
| 148 |
return diagnostics; |
149 |
|
| 149 |
} |
150 |
validator.validate(object, diagnostics, context); |
| 150 |
return diagnostics; |
151 |
return diagnostics; |
| 151 |
} |
152 |
|
|
|
153 |
} |
| 152 |
|
154 |
|
| 153 |
} |
155 |
} |
| 154 |
|
156 |
|