예제 #1
0
 @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);
 }
예제 #2
0
파일: postfix.java 프로젝트: JetBrains/MPS
 @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;
 }
 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);
 }
예제 #4
0
 public void handleAction_impl(
     SNode parameterObject,
     SNode node,
     SModel model,
     IOperationContext operationContext,
     EditorContext editorContext) {
   SNode macro =
       SNodeFactoryOperations.createNewNode(NameUtil.nodeFQName(parameterObject), node);
   SNodeOperations.replaceWithAnother(node, macro);
   SelectionUtil.selectLabelCellAnSetCaret(editorContext, macro, SelectionManager.FIRST_CELL, 1);
   editorContext.openInspector();
 }
예제 #5
0
 @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
 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);
 }
예제 #7
0
 @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);
 }
예제 #8
0
 @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);
 }
예제 #9
0
        @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);
        }