1 11 package org.eclipse.help.internal.base; 12 13 import org.eclipse.core.expressions.EvaluationContext; 14 import org.eclipse.core.runtime.Platform; 15 16 20 public final class HelpEvaluationContext { 21 22 private static final String VARIABLE_PLATFORM = "platform"; 24 private static EvaluationContext context; 25 26 29 public static EvaluationContext getContext() { 30 if (context == null) { 31 context = new EvaluationContext(null, Platform.class) { 32 public Object getVariable(String name) { 33 if (VARIABLE_PLATFORM.equals(name)) { 34 return Platform.class; 35 } 36 return null; 37 } 38 }; 39 } 40 return context; 41 } 42 43 48 public static void setContext(EvaluationContext context) { 49 HelpEvaluationContext.context = context; 50 } 51 52 55 private HelpEvaluationContext() { 56 } 57 } 58 | Popular Tags |