public boolean isClusterAssociated(){
    return context.getCluster() != null;
  }
Check if view is associated with cluster

@return isClusterAssociated
contrib/views/utils/src/main/java/org/apache/ambari/view/utils/ambari/AmbariApi.java