package jetbrains.mps.lang.editor.menus.extras.generator.template.main; /*Generated by MPS */ import jetbrains.mps.generator.runtime.Generated; import jetbrains.mps.generator.impl.query.QueryProviderBase; import jetbrains.mps.generator.template.PropertyMacroContext; import jetbrains.mps.lang.intentions.behavior.BaseIntentionDeclaration__BehaviorDescriptor; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; import jetbrains.mps.lang.core.behavior.INamedConcept__BehaviorDescriptor; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations; import jetbrains.mps.lang.plugin.behavior.ActionDeclaration__BehaviorDescriptor; import org.jetbrains.mps.openapi.model.SNode; import jetbrains.mps.generator.template.SourceSubstituteMacroNodesContext; import java.util.List; import jetbrains.mps.lang.editor.behavior.IExtensibleTransformationMenuPart__BehaviorDescriptor; import java.util.Map; import jetbrains.mps.generator.impl.query.SourceNodesQuery; import java.util.HashMap; import org.jetbrains.annotations.NotNull; import jetbrains.mps.generator.impl.query.QueryKey; import jetbrains.mps.generator.impl.query.QueryKeyImpl; import java.util.Collection; import jetbrains.mps.generator.impl.GenerationFailureException; import jetbrains.mps.util.IterableUtil; import jetbrains.mps.generator.impl.query.PropertyValueQuery; import org.jetbrains.mps.openapi.language.SProperty; import org.jetbrains.annotations.Nullable; @Generated public class QueriesGenerated extends QueryProviderBase { public QueriesGenerated() { super(1); } public static Object propertyMacro_GetPropertyValue_7291101478621741016(final PropertyMacroContext _context) { return (String) BaseIntentionDeclaration__BehaviorDescriptor.getGeneratedId_id2ytFvC$HDcE.invoke(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0xcffe907ed3de433fL, 0x89d657d9c449c0e2L, 0x289dadfa24b57a51L, 0x289dadfa24b57a52L, "intention"))); } public static Object propertyMacro_GetPropertyValue_7291101478621741111(final PropertyMacroContext _context) { return _context.createUniqueName("TMP_Intention", _context.getNode()); } public static Object propertyMacro_GetPropertyValue_4736696158595700433(final PropertyMacroContext _context) { return (String) INamedConcept__BehaviorDescriptor.getFqName_idhEwIO9y.invoke(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0xcffe907ed3de433fL, 0x89d657d9c449c0e2L, 0x41bc200f660dc377L, 0x41bc200f660dc37aL, "refactoring"))); } public static Object propertyMacro_GetPropertyValue_4736696158595700557(final PropertyMacroContext _context) { return _context.createUniqueName("TMP_Refactoring", _context.getNode()); } public static Object propertyMacro_GetPropertyValue_2319156231054489313(final PropertyMacroContext _context) { return (isNotEmptyString(SPropertyOperations.getString(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0xcffe907ed3de433fL, 0x89d657d9c449c0e2L, 0x202f4c4e02a0918cL, 0x202f4c4e02a09194L, "action")), MetaAdapterFactory.getProperty(0x28f9e4973b424291L, 0xaeba0a1039153ab1L, 0x1181ca87c38L, 0x374ac263e13f4abeL, "ID"))) ? SPropertyOperations.getString(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0xcffe907ed3de433fL, 0x89d657d9c449c0e2L, 0x202f4c4e02a0918cL, 0x202f4c4e02a09194L, "action")), MetaAdapterFactory.getProperty(0x28f9e4973b424291L, 0xaeba0a1039153ab1L, 0x1181ca87c38L, 0x374ac263e13f4abeL, "ID")) : ActionDeclaration__BehaviorDescriptor.getGeneratedClassFQName_idhEwIGgK.invoke(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0xcffe907ed3de433fL, 0x89d657d9c449c0e2L, 0x202f4c4e02a0918cL, 0x202f4c4e02a09194L, "action")))); } public static Object propertyMacro_GetPropertyValue_2319156231054489386(final PropertyMacroContext _context) { return _context.createUniqueName("TMP_PluginAction", _context.getNode()); } public static Iterable<SNode> sourceNodesQuery_4233361609414462017(final SourceSubstituteMacroNodesContext _context) { return SLinkOperations.getChildren(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x652f322a364c9a28L, 0x7c45559defbb3517L, "features")); } public static Iterable<SNode> sourceNodesQuery_7985135009828791482(final SourceSubstituteMacroNodesContext _context) { return (List<SNode>) IExtensibleTransformationMenuPart__BehaviorDescriptor.getLocations_id6V0bp$oM1WF.invoke(_context.getNode()); } public static Iterable<SNode> sourceNodesQuery_4736696158595700525(final SourceSubstituteMacroNodesContext _context) { return SLinkOperations.getChildren(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x652f322a364c9a28L, 0x7c45559defbb3517L, "features")); } public static Iterable<SNode> sourceNodesQuery_7985135009828854649(final SourceSubstituteMacroNodesContext _context) { return (List<SNode>) IExtensibleTransformationMenuPart__BehaviorDescriptor.getLocations_id6V0bp$oM1WF.invoke(_context.getNode()); } public static Iterable<SNode> sourceNodesQuery_2319156231054489354(final SourceSubstituteMacroNodesContext _context) { return SLinkOperations.getChildren(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x652f322a364c9a28L, 0x7c45559defbb3517L, "features")); } public static Iterable<SNode> sourceNodesQuery_7985135009828838072(final SourceSubstituteMacroNodesContext _context) { return (List<SNode>) IExtensibleTransformationMenuPart__BehaviorDescriptor.getLocations_id6V0bp$oM1WF.invoke(_context.getNode()); } private final Map<String, SourceNodesQuery> snsqMethods = new HashMap<String, SourceNodesQuery>(); { int i = 0; snsqMethods.put("4233361609414462017", new QueriesGenerated.SNsQ(i++)); snsqMethods.put("7985135009828791482", new QueriesGenerated.SNsQ(i++)); snsqMethods.put("4736696158595700525", new QueriesGenerated.SNsQ(i++)); snsqMethods.put("7985135009828854649", new QueriesGenerated.SNsQ(i++)); snsqMethods.put("2319156231054489354", new QueriesGenerated.SNsQ(i++)); snsqMethods.put("7985135009828838072", new QueriesGenerated.SNsQ(i++)); } @NotNull @Override public SourceNodesQuery getSourceNodesQuery(@NotNull QueryKey identity) { final String id = ((QueryKeyImpl) identity).getQueryNodeId().toString(); if (!(snsqMethods.containsKey(id))) { return super.getSourceNodesQuery(identity); } return snsqMethods.get(id); } private static class SNsQ implements SourceNodesQuery { private final int methodKey; public SNsQ(int methodKey) { this.methodKey = methodKey; } @NotNull public Collection<SNode> evaluate(@NotNull SourceSubstituteMacroNodesContext ctx) throws GenerationFailureException { switch (methodKey) { case 0: return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_4233361609414462017(ctx)); case 1: return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_7985135009828791482(ctx)); case 2: return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_4736696158595700525(ctx)); case 3: return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_7985135009828854649(ctx)); case 4: return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_2319156231054489354(ctx)); case 5: return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_7985135009828838072(ctx)); default: throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no method for query %s (key: #%d)", ctx.getTemplateReference(), methodKey)); } } } private final Map<String, PropertyValueQuery> pvqMethods = new HashMap<String, PropertyValueQuery>(); { int i = 0; pvqMethods.put("7291101478621741015", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "intentionId")); pvqMethods.put("7291101478621741110", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "IntentionMenuPart")); pvqMethods.put("4736696158595700432", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "refactoringClassName")); pvqMethods.put("4736696158595700556", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "RefactoringMenuPart")); pvqMethods.put("2319156231054489312", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "actionId")); pvqMethods.put("2319156231054489385", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "PluginActionMenuPart")); } @NotNull @Override public PropertyValueQuery getPropertyValueQuery(@NotNull QueryKey identity) { final String id = identity.getTemplateNode().getNodeId().toString(); if (!(pvqMethods.containsKey(id))) { return super.getPropertyValueQuery(identity); } return pvqMethods.get(id); } private static class PVQ extends PropertyValueQuery.Base { private final int methodKey; /*package*/ PVQ(int methodKey, SProperty property, String templateValue) { super(property, templateValue); this.methodKey = methodKey; } @Nullable public Object evaluate(@NotNull PropertyMacroContext ctx) throws GenerationFailureException { switch (methodKey) { case 0: return QueriesGenerated.propertyMacro_GetPropertyValue_7291101478621741016(ctx); case 1: return QueriesGenerated.propertyMacro_GetPropertyValue_7291101478621741111(ctx); case 2: return QueriesGenerated.propertyMacro_GetPropertyValue_4736696158595700433(ctx); case 3: return QueriesGenerated.propertyMacro_GetPropertyValue_4736696158595700557(ctx); case 4: return QueriesGenerated.propertyMacro_GetPropertyValue_2319156231054489313(ctx); case 5: return QueriesGenerated.propertyMacro_GetPropertyValue_2319156231054489386(ctx); default: throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no method for query %s (key: #%d)", ctx.getTemplateReference(), methodKey)); } } } private static boolean isNotEmptyString(String str) { return str != null && str.length() > 0; } }