- ModelingResources MOD = ModelingResources.getInstance(graph);
- if (resource != null) {
- Resource component = graph.getPossibleObject(resource, MOD.ElementToComponent);
- String id = component != null ? graph.getPossibleRelatedValue2(component, MOD.contextualHelpId, Bindings.STRING) : null;
- if (id != null)
- return id;
- id = graph.getPossibleRelatedValue2(resource, MOD.contextualHelpId, Bindings.STRING);
- if (id != null)
- return id;
- }
-
- if (variable != null) {
- String id = variable.getPossiblePropertyValue(graph, MOD.contextualHelpId, Bindings.STRING);
- if (id != null)
- return id;
- }
-
- // TODO: consider removing this block
- if (sel != null) {
- PropertyVariables vars = AdaptionUtils.adaptToSingle(sel, PropertyVariables.class);
- Variable var = vars != null ? vars.getConfiguration() : null;
- String id = var != null ? var.getPossiblePropertyValue(graph, MOD.contextualHelpId, Bindings.STRING) : null;
- if (id != null)
- return id;
- }
-
- return null;
+ return HelpContexts.getPossibleId(graph, resource, variable, sel);