package jetbrains.mps.samples.highlevel.simpleStructure.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_SimpleConceptDeclaration;
  private ConceptPresentation props_SimplePropertyDeclaration;
  private ConceptPresentation props_StructureAspectDeclaration;

  @Override
  @Nullable
  public ConceptPresentation getDescriptor(SAbstractConcept c) {
    StructureAspectDescriptor structureDescriptor = (StructureAspectDescriptor) myLanguageRuntime.getAspect(jetbrains.mps.smodel.runtime.StructureAspectDescriptor.class);
    switch (structureDescriptor.internalIndex(c)) {
      case LanguageConceptSwitch.SimpleConceptDeclaration:
        if (props_SimpleConceptDeclaration == null) {
          ConceptPresentationBuilder cpb = new ConceptPresentationBuilder();
          cpb.presentationByName();
          props_SimpleConceptDeclaration = cpb.create();
        }
        return props_SimpleConceptDeclaration;
      case LanguageConceptSwitch.SimplePropertyDeclaration:
        if (props_SimplePropertyDeclaration == null) {
          ConceptPresentationBuilder cpb = new ConceptPresentationBuilder();
          cpb.presentationByName();
          props_SimplePropertyDeclaration = cpb.create();
        }
        return props_SimplePropertyDeclaration;
      case LanguageConceptSwitch.StructureAspectDeclaration:
        if (props_StructureAspectDeclaration == null) {
          ConceptPresentationBuilder cpb = new ConceptPresentationBuilder();
          cpb.rawPresentation("StructureAspectDeclaration");
          props_StructureAspectDeclaration = cpb.create();
        }
        return props_StructureAspectDeclaration;
    }
    return null;
  }
}
