@Override public void execute(@NotNull String pattern) { ListSequence.fromList( SLinkOperations.getChildren( _context.getNode(), MetaAdapterFactory.getContainmentLink( 0x698a8d22a10447a0L, 0xba8d10e3ec237f13L, 0x2670d5989d5a6275L, 0x2670d5989d5b4a01L, "after"))) .addElement( SModelOperations.createNewNode( _context.getModel(), null, MetaAdapterFactory.getConcept( 0x698a8d22a10447a0L, 0xba8d10e3ec237f13L, 0x2670d5989d5b49b8L, "jetbrains.mps.build.workflow.structure.BwfSubTaskDependency"))); SelectionUtil.selectLabelCellAnSetCaret( _context.getEditorContext(), _context.getNode(), SelectionManager.FIRST_ERROR_CELL + "|" + SelectionManager.FOCUS_POLICY_CELL + "|" + SelectionManager.FIRST_EDITABLE_CELL + "|" + SelectionManager.FIRST_CELL, -1); }
@Override @NotNull protected List<MenuPart<TransformationMenuItem, TransformationMenuContext>> getParts( TransformationMenuContext _context) { List<MenuPart<TransformationMenuItem, TransformationMenuContext>> result = new ArrayList<MenuPart<TransformationMenuItem, TransformationMenuContext>>(); if (ListSequence.fromListAndArray( new ArrayList<String>(), MenuLocations.LEFT_SIDE_TRANSFORM, MenuLocations.RIGHT_SIDE_TRANSFORM) .contains(_context.getMenuLocation())) { result.add( new DefaultConceptMenusTransformationMenuPart( SModelUtil.getDirectSuperConcepts( MetaAdapterFactory.getConcept( 0xf3347d8a0e794f35L, 0x8ac91574f25c986fL, 0xbe3a0d5ba1a2c12L, "jetbrains.mps.execution.commands.structure.ProcessType")))); } if (ListSequence.fromListAndArray(new ArrayList<String>(), MenuLocations.RIGHT_SIDE_TRANSFORM) .contains(_context.getMenuLocation())) { result.add( new ConstraintsFilteringTransformationMenuPartDecorator( new ProcessType_TransformationMenu.TransformationMenuPart_Action_fvqin_a1(), MetaAdapterFactory.getConcept( 0xf3347d8a0e794f35L, 0x8ac91574f25c986fL, 0x87f99370d7e1ea3L, "jetbrains.mps.execution.commands.structure.CommandProcessType"))); } return result; }
@Override @NotNull protected List<MenuPart<TransformationMenuItem, TransformationMenuContext>> getParts( TransformationMenuContext _context) { List<MenuPart<TransformationMenuItem, TransformationMenuContext>> result = new ArrayList<MenuPart<TransformationMenuItem, TransformationMenuContext>>(); if (ListSequence.fromListAndArray( new ArrayList<String>(), MenuLocations.LEFT_SIDE_TRANSFORM, MenuLocations.RIGHT_SIDE_TRANSFORM) .contains(_context.getMenuLocation())) { result.add( new DefaultConceptMenusTransformationMenuPart( SModelUtil.getDirectSuperConcepts( MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfbdeb6fecfL, "jetbrains.mps.baseLanguage.structure.BinaryOperation")))); } if (ListSequence.fromListAndArray(new ArrayList<String>(), MenuLocations.LEFT_SIDE_TRANSFORM) .contains(_context.getMenuLocation())) { result.add( new BinaryOperation_TransformationMenu .TransformationMenuPart_WrapSubstituteMenu_kltahs_a1()); } if (ListSequence.fromListAndArray(new ArrayList<String>(), MenuLocations.RIGHT_SIDE_TRANSFORM) .contains(_context.getMenuLocation())) { result.add( new BinaryOperation_TransformationMenu .TransformationMenuPart_WrapSubstituteMenu_kltahs_a2()); } return result; }
@Override public void execute(@NotNull String pattern) { final SNode result = SNodeFactoryOperations.createNewNode( SNodeFactoryOperations.asInstanceConcept( MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x11adecdb4f0L, "jetbrains.mps.baseLanguage.structure.PostfixIncrementExpression")), null); SLinkOperations.setTarget( result, MetaAdapterFactory.getContainmentLink( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x120a4c1f269L, 0x120a4c433a6L, "expression"), SNodeOperations.copyNode(_context.getNode())); SNodeOperations.replaceWithAnother(_context.getNode(), result); SelectionUtil.selectLabelCellAnSetCaret( _context.getEditorContext(), result, SelectionManager.LAST_CELL, -1); return; }
@Override @NotNull protected List<MenuPart<TransformationMenuItem, TransformationMenuContext>> getParts( TransformationMenuContext _context) { List<MenuPart<TransformationMenuItem, TransformationMenuContext>> result = new ArrayList<MenuPart<TransformationMenuItem, TransformationMenuContext>>(); if (ListSequence.fromListAndArray( new ArrayList<String>(), MenuLocations.LEFT_SIDE_TRANSFORM, MenuLocations.RIGHT_SIDE_TRANSFORM) .contains(_context.getMenuLocation())) { result.add( new DefaultConceptMenusTransformationMenuPart( SModelUtil.getDirectSuperConcepts( MetaAdapterFactory.getConcept( 0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x58ea5217b045b9abL, "jetbrains.mps.lang.smodel.structure.AttributeQualifier")))); } if (ListSequence.fromListAndArray(new ArrayList<String>(), MenuLocations.RIGHT_SIDE_TRANSFORM) .contains(_context.getMenuLocation())) { result.add( new AttributeQualifier_TransformationMenu.TransformationMenuPart_IncludeMenu_5hmkak_a1()); } return result; }
@Override public void execute(@NotNull String pattern) { SNodeFactoryOperations.addNewChild( SNodeOperations.cast( SNodeOperations.getParent(_context.getNode()), MetaAdapterFactory.getConcept( 0xfd3920347849419dL, 0x907112563d152375L, 0x1174a4d19ffL, "jetbrains.mps.baseLanguage.closures.structure.FunctionType")), MetaAdapterFactory.getContainmentLink( 0xfd3920347849419dL, 0x907112563d152375L, 0x1174a4d19ffL, 0x11ad99d9c36L, "throwsType"), SNodeFactoryOperations.asInstanceConcept( MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c37f506dL, "jetbrains.mps.baseLanguage.structure.Type"))); SelectionUtil.selectLabelCellAnSetCaret( _context.getEditorContext(), ListSequence.fromList( SLinkOperations.getChildren( SNodeOperations.cast( SNodeOperations.getParent(_context.getNode()), MetaAdapterFactory.getConcept( 0xfd3920347849419dL, 0x907112563d152375L, 0x1174a4d19ffL, "jetbrains.mps.baseLanguage.closures.structure.FunctionType")), MetaAdapterFactory.getContainmentLink( 0xfd3920347849419dL, 0x907112563d152375L, 0x1174a4d19ffL, 0x11ad99d9c36L, "throwsType"))) .first(), SelectionManager.FIRST_ERROR_CELL + "|" + SelectionManager.FOCUS_POLICY_CELL + "|" + SelectionManager.FIRST_EDITABLE_CELL + "|" + SelectionManager.FIRST_CELL, -1); }
@Override protected boolean isApplicable(TransformationMenuContext _context) { return eq_uewb7w_a0a0a7( SNodeOperations.getParent( SNodeOperations.getNodeAncestor( _context.getNode(), MetaAdapterFactory.getConcept( 0x49a08c51fe543ccL, 0xbd998b46d641d7f5L, 0x2de971c785f06a3fL, "jetbrains.mps.samples.Kaja.structure.CommandList"), false, false)), SNodeOperations.getContainingRoot(_context.getNode())); }
@Override public void execute(@NotNull String pattern) { SNode inserted = SNodeOperations.insertPrevSiblingChild( _context.getNode(), SNodeFactoryOperations.createNewNode( SNodeFactoryOperations.asInstanceConcept( MetaAdapterFactory.getConcept( 0x49a08c51fe543ccL, 0xbd998b46d641d7f5L, 0x3cfcda239f1a1049L, "jetbrains.mps.samples.Kaja.structure.Require")), null)); _context.getEditorContext().selectWRTFocusPolicy(inserted); }
protected void execute( SNode targetNode, SubstituteMenuItem item, TransformationMenuContext _context, String pattern) { SNode createdNode = item.createNode(pattern); SelectionUtil.selectLabelCellAnSetCaret( _context.getEditorContext(), PrecedenceUtil.processLeftTransform( SNodeOperations.cast( targetNode, MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c37f506fL, "jetbrains.mps.baseLanguage.structure.Expression")), createdNode), SelectionManager.FIRST_ERROR_CELL + "|" + SelectionManager.FOCUS_POLICY_CELL + "|" + SelectionManager.FIRST_EDITABLE_CELL + "|" + SelectionManager.FIRST_CELL, -1); }
@Override @NotNull protected List<MenuPart<TransformationMenuItem, TransformationMenuContext>> getParts( TransformationMenuContext _context) { List<MenuPart<TransformationMenuItem, TransformationMenuContext>> result = new ArrayList<MenuPart<TransformationMenuItem, TransformationMenuContext>>(); if (ListSequence.fromListAndArray(new ArrayList<String>(), MenuLocations.RIGHT_SIDE_TRANSFORM) .contains(_context.getMenuLocation())) { result.add( new ConstraintsFilteringTransformationMenuPartDecorator( new postfix.TransformationMenuPart_Action_wa3l4q_a0(), MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x11adecdb4f0L, "jetbrains.mps.baseLanguage.structure.PostfixIncrementExpression"))); result.add( new ConstraintsFilteringTransformationMenuPartDecorator( new postfix.TransformationMenuPart_Action_wa3l4q_b0(), MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x11aded05fe6L, "jetbrains.mps.baseLanguage.structure.PostfixDecrementExpression"))); } return result; }
@Override protected boolean isApplicable(TransformationMenuContext _context) { return SNodeOperations.isInstanceOf( SNodeOperations.getParent(_context.getNode()), MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x6c6b6a1e379f9408L, "jetbrains.mps.baseLanguage.structure.MethodDeclaration")) && !(SNodeOperations.isInstanceOf( SNodeOperations.getParent(SNodeOperations.getParent(_context.getNode())), MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101edd46144L, "jetbrains.mps.baseLanguage.structure.Interface"))); }
@Override protected SNode getTargetNode(TransformationMenuContext _context) { return SLinkOperations.getTarget( _context.getNode(), MetaAdapterFactory.getContainmentLink( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfbdeb6fecfL, 0xfbdeb7a11cL, "leftExpression")); }
@Override protected SubstituteMenuLookup getSubstituteMenuLookup(TransformationMenuContext context) { final EditorContext editorContext = context.getEditorContext(); return new DefaultSubstituteMenuLookup( LanguageRegistry.getInstance(editorContext.getRepository()), MetaAdapterFactory.getConcept( 0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7ce1116e3a6fb0beL, "jetbrains.mps.lang.editor.menus.substitute.testLanguage.structure.TestSubstituteChild")); }
@Override @NotNull protected List<MenuPart<TransformationMenuItem, TransformationMenuContext>> getParts( TransformationMenuContext _context) { List<MenuPart<TransformationMenuItem, TransformationMenuContext>> result = new ArrayList<MenuPart<TransformationMenuItem, TransformationMenuContext>>(); if (ListSequence.fromListAndArray(new ArrayList<String>(), MenuLocations.RIGHT_SIDE_TRANSFORM) .contains(_context.getMenuLocation())) { result.add(new add_throw_to_FunctionType.TransformationMenuPart_Group_eifi1b_a0()); } return result; }
@Nullable @Override protected SubstituteMenuLookup getSubstituteMenuLookup(TransformationMenuContext _context) { final EditorContext editorContext = _context.getEditorContext(); return new DefaultSubstituteMenuLookup( LanguageRegistry.getInstance(editorContext.getRepository()), MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfbdeb6fecfL, "jetbrains.mps.baseLanguage.structure.BinaryOperation")); }
@Override public void execute(@NotNull String pattern) { SelectionUtil.selectLabelCellAnSetCaret( _context.getEditorContext(), SNodeFactoryOperations.replaceWithNewChild( _context.getNode(), SNodeFactoryOperations.asInstanceConcept( MetaAdapterFactory.getConcept( 0xf3347d8a0e794f35L, 0x8ac91574f25c986fL, 0x87f99370d7e1ea3L, "jetbrains.mps.execution.commands.structure.CommandProcessType"))), SelectionManager.FIRST_ERROR_CELL + "|" + SelectionManager.FOCUS_POLICY_CELL + "|" + SelectionManager.FIRST_EDITABLE_CELL + "|" + SelectionManager.FIRST_CELL, -1); }
@Override public void execute(@NotNull String pattern) { SNodeOperations.insertPrevSiblingChild( _context.getNode(), SNodeFactoryOperations.createNewNode( SNodeFactoryOperations.asInstanceConcept( MetaAdapterFactory.getConcept( 0x49a08c51fe543ccL, 0xbd998b46d641d7f5L, 0x58e59ea713f79f27L, "jetbrains.mps.samples.Kaja.structure.Drop")), null)); }
@Override protected boolean isApplicable(TransformationMenuContext _context) { return ListSequence.fromList( SLinkOperations.getChildren( _context.getNode(), MetaAdapterFactory.getContainmentLink( 0x698a8d22a10447a0L, 0xba8d10e3ec237f13L, 0x2670d5989d5a6275L, 0x2670d5989d5b4a01L, "after"))) .isEmpty(); }
@Override public void execute(@NotNull String pattern) { SNode method = SNodeOperations.cast( SNodeOperations.getParent(_context.getNode()), MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x6c6b6a1e379f9408L, "jetbrains.mps.baseLanguage.structure.MethodDeclaration")); SPropertyOperations.set( method, MetaAdapterFactory.getProperty( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x6c6b6a1e379f9408L, 0x73f30e3df95c0b73L, "isNative"), "" + (true)); SelectionUtil.selectLabelCellAnSetCaret( _context.getEditorContext(), method, "nativeModifier", -1); }
@Override public void execute(@NotNull String pattern) { SNode method = SNodeOperations.cast( SNodeOperations.getParent(_context.getNode()), MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b21dL, "jetbrains.mps.baseLanguage.structure.InstanceMethodDeclaration")); SPropertyOperations.set( method, MetaAdapterFactory.getProperty( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b21dL, 0x1126a8d157dL, "isAbstract"), "" + (true)); SelectionUtil.selectLabelCellAnSetCaret( _context.getEditorContext(), method, "abstractModifier", -1); }
@Override @NotNull protected List<MenuPart<TransformationMenuItem, TransformationMenuContext>> getParts( TransformationMenuContext _context) { List<MenuPart<TransformationMenuItem, TransformationMenuContext>> result = new ArrayList<MenuPart<TransformationMenuItem, TransformationMenuContext>>(); if (ListSequence.fromListAndArray(new ArrayList<String>(), MenuLocations.LEFT_SIDE_TRANSFORM) .contains(_context.getMenuLocation())) { result.add(new AddMethodModifiersOnTypes.TransformationMenuPart_Group_svkn68_a0()); result.add(new AddMethodModifiersOnTypes.TransformationMenuPart_Group_svkn68_b0()); } return result; }
@Override @NotNull protected List<MenuPart<TransformationMenuItem, TransformationMenuContext>> getParts( TransformationMenuContext _context) { List<MenuPart<TransformationMenuItem, TransformationMenuContext>> result = new ArrayList<MenuPart<TransformationMenuItem, TransformationMenuContext>>(); if (ListSequence.fromListAndArray(new ArrayList<String>(), MenuLocations.CONTEXT_ASSISTANT) .contains(_context.getMenuLocation())) { result.add(new OtherCommands.TransformationMenuPart_Action_uewb7w_a0()); result.add(new OtherCommands.TransformationMenuPart_Action_uewb7w_b0()); result.add(new OtherCommands.TransformationMenuPart_Group_uewb7w_c0()); } return result; }
@Override @NotNull protected List<MenuPart<TransformationMenuItem, TransformationMenuContext>> getParts( TransformationMenuContext _context) { List<MenuPart<TransformationMenuItem, TransformationMenuContext>> result = new ArrayList<MenuPart<TransformationMenuItem, TransformationMenuContext>>(); if (ListSequence.fromListAndArray(new ArrayList<String>(), MenuLocations.SUBSTITUTE) .contains(_context.getMenuLocation())) { result.add( new TestSubstituteChild_TransformationMenu .TransformationMenuPart_IncludeSubstituteMenu_ny17dn_a0()); } return result; }
@Override public void execute(@NotNull String pattern) { SNode method = SNodeOperations.cast( SNodeOperations.getParent(_context.getNode()), MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b21dL, "jetbrains.mps.baseLanguage.structure.InstanceMethodDeclaration")); SNode staticMethod = SNodeFactoryOperations.replaceWithNewChild( method, SNodeFactoryOperations.asInstanceConcept( MetaAdapterFactory.getConcept( 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfbbebabf0aL, "jetbrains.mps.baseLanguage.structure.StaticMethodDeclaration"))); MemberDeclarationRefactoringUtil.rewireMethodReferences(method, staticMethod); SelectionUtil.selectLabelCellAnSetCaret( _context.getEditorContext(), staticMethod, "staticModifier", -1); }
@Override protected boolean isApplicable(TransformationMenuContext _context) { SNode parent = SNodeOperations.getParent(_context.getNode()); if (SNodeOperations.isInstanceOf( parent, MetaAdapterFactory.getConcept( 0xfd3920347849419dL, 0x907112563d152375L, 0x11e505b9d83L, "jetbrains.mps.baseLanguage.closures.structure.UnrestrictedFunctionType"))) { return SLinkOperations.getTarget( SNodeOperations.cast( parent, MetaAdapterFactory.getConcept( 0xfd3920347849419dL, 0x907112563d152375L, 0x11e505b9d83L, "jetbrains.mps.baseLanguage.closures.structure.UnrestrictedFunctionType")), MetaAdapterFactory.getContainmentLink( 0xfd3920347849419dL, 0x907112563d152375L, 0x11e505b9d83L, 0x11eda2b270fL, "terminateType")) == _context.getNode() && (ListSequence.fromList( SLinkOperations.getChildren( SNodeOperations.cast( parent, MetaAdapterFactory.getConcept( 0xfd3920347849419dL, 0x907112563d152375L, 0x11e505b9d83L, "jetbrains.mps.baseLanguage.closures.structure.UnrestrictedFunctionType")), MetaAdapterFactory.getContainmentLink( 0xfd3920347849419dL, 0x907112563d152375L, 0x1174a4d19ffL, 0x11ad99d9c36L, "throwsType"))) .isEmpty()); } if (SNodeOperations.isInstanceOf( parent, MetaAdapterFactory.getConcept( 0xfd3920347849419dL, 0x907112563d152375L, 0x1174a4d19ffL, "jetbrains.mps.baseLanguage.closures.structure.FunctionType"))) { return SLinkOperations.getTarget( SNodeOperations.cast( parent, MetaAdapterFactory.getConcept( 0xfd3920347849419dL, 0x907112563d152375L, 0x1174a4d19ffL, "jetbrains.mps.baseLanguage.closures.structure.FunctionType")), MetaAdapterFactory.getContainmentLink( 0xfd3920347849419dL, 0x907112563d152375L, 0x1174a4d19ffL, 0x1174a4d5371L, "resultType")) == _context.getNode() && (ListSequence.fromList( SLinkOperations.getChildren( SNodeOperations.cast( parent, MetaAdapterFactory.getConcept( 0xfd3920347849419dL, 0x907112563d152375L, 0x1174a4d19ffL, "jetbrains.mps.baseLanguage.closures.structure.FunctionType")), MetaAdapterFactory.getContainmentLink( 0xfd3920347849419dL, 0x907112563d152375L, 0x1174a4d19ffL, 0x11ad99d9c36L, "throwsType"))) .isEmpty()); } return false; }
@Nullable @Override protected SNode getNode(TransformationMenuContext _context) { return SNodeOperations.getParent(_context.getNode()); }