Community
Participate
Working Groups
AbstractColorUpdater was extracted to share common code from dialect-specific "color updaters", but the conversion from a generic ColorDescription into concrete RGB values is something which could probably be made available more generaly. Currently one has to do new AbstractColorUpdater().getRGBValuesFromColorDescription(o, c), which: - is rather ugly (instantiating a class (improperly) named Abstract*); - may have some bugs and/or performance issues in corner cases: when the ColorDescription is dynamic and requires evaluating expression, because we do not pass the IInterpreter to use the code ends up calling InterpreterRegistry.getInterpreter(EObject modelElement) which tries to identify the session from the semantic element, and we do this *on each invocation*. In the context of a refresh of a large representation which uses dynamic colors, it might be a performance issue (I have not actually measured so even if present it may be really small). Anyway, we should probably have a proper API to do this, the more logical place to put it would be in org.eclipse.sirius.business.api.query.ColorQuery. It could be something like: RGBValues getRGBValues(EObject context, IInterpreter interpreter) The ColorDescription is implicit, it's the query's target. If the ColorDescription requires expression evaluation, it should use the interpreter specified if non-null, and only if none is given try to find the context's session to locate an interpreter. AbstractColorUpdater could be updated to use the new helper, and reworked (itself and/or its callers) to lookup the interpteter only once per refresh instead of once per color evaluation.