package jetbrains.mps.lang.editor.styleTests.editor;

/*Generated by MPS */

import jetbrains.mps.nodeEditor.EditorAspectDescriptorBase;
import jetbrains.mps.openapi.editor.descriptor.StyleAttributeProvider;
import org.jetbrains.annotations.NotNull;
import java.util.Collection;
import jetbrains.mps.openapi.editor.descriptor.ConceptEditor;
import org.jetbrains.mps.openapi.language.SAbstractConcept;
import java.util.Collections;
import jetbrains.mps.openapi.editor.descriptor.ConceptEditorComponent;
import jetbrains.mps.openapi.editor.style.StyleAttribute;
import jetbrains.mps.editor.runtime.style.InheritableStyleAttribute;
import jetbrains.mps.editor.runtime.style.SimpleStyleAttribute;
import jetbrains.mps.lang.smodel.ConceptSwitchIndex;
import jetbrains.mps.lang.smodel.ConceptSwitchIndexBuilder;
import jetbrains.mps.smodel.adapter.ids.MetaIdFactory;

public class EditorAspectDescriptorImpl extends EditorAspectDescriptorBase implements StyleAttributeProvider {
  @NotNull
  public Collection<ConceptEditor> getDeclaredEditors(SAbstractConcept concept) {
    SAbstractConcept cncpt = ((SAbstractConcept) concept);
    switch (conceptIndex.index(cncpt)) {
      case 0:
        return Collections.<ConceptEditor>singletonList(new CustomFontContainer_Editor());
      case 1:
        return Collections.<ConceptEditor>singletonList(new HugePriorityStyle_Editor());
      case 2:
        return Collections.<ConceptEditor>singletonList(new LeafNode_Editor());
      case 3:
        return Collections.<ConceptEditor>singletonList(new PriorityStyle_Editor());
      case 4:
        return Collections.<ConceptEditor>singletonList(new PriorityStyleCopy_Editor());
      case 5:
        return Collections.<ConceptEditor>singletonList(new SerifFromQueryNode_Editor());
      case 6:
        return Collections.<ConceptEditor>singletonList(new SerifNode_Editor());
      case 7:
        return Collections.<ConceptEditor>singletonList(new TestConceptWithStyleAttributes_Editor());
      case 8:
        return Collections.<ConceptEditor>singletonList(new TestInheritedAttribute_Editor());
      case 9:
        return Collections.<ConceptEditor>singletonList(new TestSimpleAttribute_Editor());
      case 10:
        return Collections.<ConceptEditor>singletonList(new URLCellContainer_Editor());
      case 11:
        return Collections.<ConceptEditor>singletonList(new UnapplyPriorityStyleCopy_Editor());
      default:
    }
    return Collections.<ConceptEditor>emptyList();
  }
  private Collection<ConceptEditorComponent> getDeclaredEC_0(String editorComponentId) {
    if ("jetbrains.mps.lang.editor.styleTests.editor.StyleTestElement_EditorComponent".equals(editorComponentId)) {
      return Collections.singletonList(new CustomFontContainer_EditorComponent());
    }
    return Collections.emptyList();
  }
  private Collection<ConceptEditorComponent> getDeclaredEC_1(String editorComponentId) {
    switch (editorComponentId) {
      case "jetbrains.mps.lang.editor.styleTests.editor.StyleTestElement_EditorComponent":
        return Collections.singletonList(new StyleTestElement_EditorComponent());
      case "jetbrains.mps.lang.editor.styleTests.editor.StyleTest_EditorComponent":
        return Collections.singletonList(new StyleTest_EditorComponent());
    }
    return Collections.emptyList();
  }
  private Collection<ConceptEditorComponent> getDeclaredEC_2(String editorComponentId) {
    if ("jetbrains.mps.lang.editor.styleTests.editor.StyleTestElement_EditorComponent".equals(editorComponentId)) {
      return Collections.singletonList(new TestInheritedAttibute_EditorComponent());
    }
    return Collections.emptyList();
  }
  private Collection<ConceptEditorComponent> getDeclaredEC_3(String editorComponentId) {
    if ("jetbrains.mps.lang.editor.styleTests.editor.StyleTestElement_EditorComponent".equals(editorComponentId)) {
      return Collections.singletonList(new TestISimpleAttribute_EditorComponent());
    }
    return Collections.emptyList();
  }
  @NotNull
  public Collection<ConceptEditorComponent> getDeclaredEditorComponents(SAbstractConcept concept, String editorComponentId) {
    SAbstractConcept cncpt = ((SAbstractConcept) concept);
    switch (conceptIndex1.index(cncpt)) {
      case 0:
        return getDeclaredEC_0(editorComponentId);
      case 1:
        return getDeclaredEC_1(editorComponentId);
      case 2:
        return getDeclaredEC_2(editorComponentId);
      case 3:
        return getDeclaredEC_3(editorComponentId);
      default:
    }
    return Collections.emptyList();
  }


  public StyleAttribute getStyleAttribute(String attributeName) {
    switch (attributeName) {
      case "test-inherited-attribute":
        return new InheritableStyleAttribute<String>("test-inherited-attribute");
      case "test-simple-attribute":
        return new SimpleStyleAttribute<Boolean>("test-simple-attribute", true);
      default:
        return null;
    }
  }

  private static final ConceptSwitchIndex conceptIndex = new ConceptSwitchIndexBuilder().put(MetaIdFactory.conceptId(0xa936c42ccb2c4d64L, 0xa1dc12986579a998L, 0x7697714d0d49e230L), MetaIdFactory.conceptId(0xa936c42ccb2c4d64L, 0xa1dc12986579a998L, 0x7bc02723c1a36a0aL), MetaIdFactory.conceptId(0xa936c42ccb2c4d64L, 0xa1dc12986579a998L, 0x38990895c164873aL), MetaIdFactory.conceptId(0xa936c42ccb2c4d64L, 0xa1dc12986579a998L, 0x7bc02723c1a34c76L), MetaIdFactory.conceptId(0xa936c42ccb2c4d64L, 0xa1dc12986579a998L, 0x7bc02723c1a3689eL), MetaIdFactory.conceptId(0xa936c42ccb2c4d64L, 0xa1dc12986579a998L, 0x6d1be7c4cdf956fL), MetaIdFactory.conceptId(0xa936c42ccb2c4d64L, 0xa1dc12986579a998L, 0x6d1be7c4cdf954fL), MetaIdFactory.conceptId(0xa936c42ccb2c4d64L, 0xa1dc12986579a998L, 0x5bb841570e741168L), MetaIdFactory.conceptId(0xa936c42ccb2c4d64L, 0xa1dc12986579a998L, 0x7bc02723c1a35eddL), MetaIdFactory.conceptId(0xa936c42ccb2c4d64L, 0xa1dc12986579a998L, 0x7bc02723c1a3595dL), MetaIdFactory.conceptId(0xa936c42ccb2c4d64L, 0xa1dc12986579a998L, 0x692a1b3ce85cd977L), MetaIdFactory.conceptId(0xa936c42ccb2c4d64L, 0xa1dc12986579a998L, 0x7bc02723c1a36a0fL)).seal();
  private static final ConceptSwitchIndex conceptIndex1 = new ConceptSwitchIndexBuilder().put(MetaIdFactory.conceptId(0xa936c42ccb2c4d64L, 0xa1dc12986579a998L, 0x7697714d0d49e230L), MetaIdFactory.conceptId(0xa936c42ccb2c4d64L, 0xa1dc12986579a998L, 0x74e28664f056014cL), MetaIdFactory.conceptId(0xa936c42ccb2c4d64L, 0xa1dc12986579a998L, 0x7bc02723c1a35eddL), MetaIdFactory.conceptId(0xa936c42ccb2c4d64L, 0xa1dc12986579a998L, 0x7bc02723c1a3595dL)).seal();
}
