package jetbrains.mps.lang.feedback.problem.structural.structure;

/*Generated by MPS */

import jetbrains.mps.smodel.runtime.ConceptPresentationAspectBase;
import jetbrains.mps.smodel.runtime.ConceptPresentation;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.mps.openapi.language.SAbstractConcept;
import jetbrains.mps.smodel.runtime.ConceptPresentationBuilder;

public class ConceptPresentationAspectImpl extends ConceptPresentationAspectBase {
  private ConceptPresentation props_InConceptProblem;
  private ConceptPresentation props_MissingChildInConceptProblem;
  private ConceptPresentation props_MissingPropertyInConceptProblem;
  private ConceptPresentation props_MissingRefInConceptProblem;
  private ConceptPresentation props_MultipleChildrenInSingleRoleProblem;
  private ConceptPresentation props_NoChildInObligatoryRoleProblem;
  private ConceptPresentation props_NoRefInObligatoryRoleProblem;
  private ConceptPresentation props_TargetConceptIncorrectChild;
  private ConceptPresentation props_TargetConceptIncorrectRef;

  @Override
  @Nullable
  public ConceptPresentation getDescriptor(SAbstractConcept c) {
    StructureAspectDescriptor structureDescriptor = (StructureAspectDescriptor) myLanguageRuntime.getAspect(jetbrains.mps.smodel.runtime.StructureAspectDescriptor.class);
    switch (structureDescriptor.internalIndex(c)) {
      case LanguageConceptSwitch.InConceptProblem:
        if (props_InConceptProblem == null) {
          ConceptPresentationBuilder cpb = new ConceptPresentationBuilder();
          props_InConceptProblem = cpb.create();
        }
        return props_InConceptProblem;
      case LanguageConceptSwitch.MissingChildInConceptProblem:
        if (props_MissingChildInConceptProblem == null) {
          ConceptPresentationBuilder cpb = new ConceptPresentationBuilder();
          cpb.rawPresentation("when child is not defined in concept");
          props_MissingChildInConceptProblem = cpb.create();
        }
        return props_MissingChildInConceptProblem;
      case LanguageConceptSwitch.MissingPropertyInConceptProblem:
        if (props_MissingPropertyInConceptProblem == null) {
          ConceptPresentationBuilder cpb = new ConceptPresentationBuilder();
          cpb.rawPresentation("when property is not defined in concept");
          props_MissingPropertyInConceptProblem = cpb.create();
        }
        return props_MissingPropertyInConceptProblem;
      case LanguageConceptSwitch.MissingRefInConceptProblem:
        if (props_MissingRefInConceptProblem == null) {
          ConceptPresentationBuilder cpb = new ConceptPresentationBuilder();
          cpb.rawPresentation("when reference is not defined in concept");
          props_MissingRefInConceptProblem = cpb.create();
        }
        return props_MissingRefInConceptProblem;
      case LanguageConceptSwitch.MultipleChildrenInSingleRoleProblem:
        if (props_MultipleChildrenInSingleRoleProblem == null) {
          ConceptPresentationBuilder cpb = new ConceptPresentationBuilder();
          cpb.rawPresentation("when there are multiple children in role with single cardinality");
          props_MultipleChildrenInSingleRoleProblem = cpb.create();
        }
        return props_MultipleChildrenInSingleRoleProblem;
      case LanguageConceptSwitch.NoChildInObligatoryRoleProblem:
        if (props_NoChildInObligatoryRoleProblem == null) {
          ConceptPresentationBuilder cpb = new ConceptPresentationBuilder();
          cpb.rawPresentation("when there is no child in role with nonzero cardinality");
          props_NoChildInObligatoryRoleProblem = cpb.create();
        }
        return props_NoChildInObligatoryRoleProblem;
      case LanguageConceptSwitch.NoRefInObligatoryRoleProblem:
        if (props_NoRefInObligatoryRoleProblem == null) {
          ConceptPresentationBuilder cpb = new ConceptPresentationBuilder();
          cpb.rawPresentation("when there is no ref in role with nonzero cardinality");
          props_NoRefInObligatoryRoleProblem = cpb.create();
        }
        return props_NoRefInObligatoryRoleProblem;
      case LanguageConceptSwitch.TargetConceptIncorrectChild:
        if (props_TargetConceptIncorrectChild == null) {
          ConceptPresentationBuilder cpb = new ConceptPresentationBuilder();
          cpb.rawPresentation("when child role has incompatible target concept");
          props_TargetConceptIncorrectChild = cpb.create();
        }
        return props_TargetConceptIncorrectChild;
      case LanguageConceptSwitch.TargetConceptIncorrectRef:
        if (props_TargetConceptIncorrectRef == null) {
          ConceptPresentationBuilder cpb = new ConceptPresentationBuilder();
          cpb.rawPresentation("when reference role has incompatible target concept");
          props_TargetConceptIncorrectRef = cpb.create();
        }
        return props_TargetConceptIncorrectRef;
    }
    return null;
  }
}
