@Override
  public Action createContextAwareInstance(Lookup actionContext) {
    if (!ProfilingPointsManager.getDefault().isProfilingSessionInProgress()) {
      Collection<? extends CodeProfilingPoint.Annotation> anns =
          actionContext.lookupAll(CodeProfilingPoint.Annotation.class);
      if (anns.size() == 1) {
        CodeProfilingPoint pp = anns.iterator().next().profilingPoint();

        action.setProfilingPoint(pp);
        action.setBooleanState(pp.isEnabled());
        return action;
      }
    }
    return this;
  }