public void installElementCellActions(SNode elementNode, EditorCell elementCell) {
   if (elementCell.getUserObject(AbstractCellListHandler.ELEMENT_CELL_ACTIONS_SET) == null) {
     elementCell.putUserObject(
         AbstractCellListHandler.ELEMENT_CELL_ACTIONS_SET,
         AbstractCellListHandler.ELEMENT_CELL_ACTIONS_SET);
     if (elementNode != null) {
       elementCell.setAction(
           CellActionType.DELETE,
           new CellAction_DeleteNode(
               elementNode, CellAction_DeleteNode.DeleteDirection.FORWARD));
       elementCell.setAction(
           CellActionType.BACKSPACE,
           new CellAction_DeleteNode(
               elementNode, CellAction_DeleteNode.DeleteDirection.BACKWARD));
     }
     if (elementCell.getSubstituteInfo() == null
         || elementCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) {
       elementCell.setSubstituteInfo(
           new OldNewCompositeSubstituteInfo(
               getEditorContext(),
               new SChildSubstituteInfo(
                   elementCell,
                   getNode(),
                   MetaAdapterFactory.getContainmentLink(
                       0x798100da4f0a421aL,
                       0xb99171f8c50ce5d2L,
                       0x5f1f0652f6049405L,
                       0x5f1f0652f6049407L,
                       "participant"),
                   elementNode),
               new DefaultChildSubstituteInfo(
                   getNode(), elementNode, super.getLinkDeclaration(), getEditorContext())));
     }
   }
 }
コード例 #2
0
 private void installCellInfo(SNode child, EditorCell editorCell) {
   if (editorCell.getSubstituteInfo() == null
       || editorCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) {
     editorCell.setSubstituteInfo(
         new OldNewCompositeSubstituteInfo(
             getEditorContext(),
             new SChildSubstituteInfo(
                 editorCell,
                 myNode,
                 MetaAdapterFactory.getContainmentLink(
                     0x86ef829012bb4ca7L,
                     0x947f093788f263a9L,
                     0x5869770da61dfe28L,
                     0x19bfb4173fb5241eL,
                     "moduleRef"),
                 child),
             new DefaultChildSubstituteInfo(
                 myNode, myContainmentLink.getDeclarationNode(), getEditorContext())));
   }
   if (editorCell.getRole() == null) {
     editorCell.setRole("moduleRef");
   }
   Style style = new StyleImpl();
   style.set(StyleAttributes.PUNCTUATION_RIGHT, true);
   editorCell.getStyle().putAll(style);
 }
コード例 #3
0
 private void installCellInfo(SNode child, EditorCell editorCell) {
   if (editorCell.getSubstituteInfo() == null
       || editorCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) {
     editorCell.setSubstituteInfo(
         new OldNewCompositeSubstituteInfo(
             getEditorContext(),
             new SChildSubstituteInfo(
                 editorCell,
                 myNode,
                 MetaAdapterFactory.getContainmentLink(
                     0x7866978ea0f04cc7L,
                     0x81bc4d213d9375e1L,
                     0x2143399c0554e687L,
                     0x3636a984eed504f9L,
                     "conceptArgument"),
                 child),
             new DefaultChildSubstituteInfo(
                 myNode, myContainmentLink.getDeclarationNode(), getEditorContext())));
   }
   if (editorCell.getRole() == null) {
     editorCell.setRole("conceptArgument");
   }
   AbstractTypeCastExpression_Concept_Actions.setCellActions(
       editorCell, getNode(), getEditorContext());
 }
コード例 #4
0
 private void installCellInfo(SNode child, EditorCell editorCell) {
   if (editorCell.getSubstituteInfo() == null
       || editorCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) {
     editorCell.setSubstituteInfo(
         new OldNewCompositeSubstituteInfo(
             getEditorContext(),
             new SChildSubstituteInfo(
                 editorCell,
                 myNode,
                 MetaAdapterFactory.getContainmentLink(
                     0x798100da4f0a421aL,
                     0xb99171f8c50ce5d2L,
                     0x63a87b9320d31b36L,
                     0x63a87b9320d31b94L,
                     "fileName"),
                 child),
             new DefaultChildSubstituteInfo(
                 myNode, myContainmentLink.getDeclarationNode(), getEditorContext())));
   }
   if (editorCell.getRole() == null) {
     editorCell.setRole("fileName");
   }
   if (true) {
     editorCell.getStyle().set(StyleAttributes.FOCUS_POLICY, FocusPolicy.ATTRACTS_FOCUS);
   }
 }
コード例 #5
0
ファイル: BwfTaskPart_Editor.java プロジェクト: yan96in/MPS
 public void installElementCellActions(
     SNode listOwner, SNode elementNode, EditorCell elementCell, EditorContext editorContext) {
   if (elementCell.getUserObject(AbstractCellListHandler.ELEMENT_CELL_ACTIONS_SET) == null) {
     elementCell.putUserObject(
         AbstractCellListHandler.ELEMENT_CELL_ACTIONS_SET,
         AbstractCellListHandler.ELEMENT_CELL_ACTIONS_SET);
     if (elementNode != null) {
       elementCell.setAction(
           CellActionType.DELETE,
           new CellAction_DeleteNode(
               elementNode, CellAction_DeleteNode.DeleteDirection.FORWARD));
       elementCell.setAction(
           CellActionType.BACKSPACE,
           new CellAction_DeleteNode(
               elementNode, CellAction_DeleteNode.DeleteDirection.BACKWARD));
       elementCell.addKeyMap(new RefNodeListHandlerElementKeyMap(this, ","));
     }
     if (elementCell.getSubstituteInfo() == null
         || elementCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) {
       elementCell.setSubstituteInfo(
           new DefaultChildSubstituteInfo(
               listOwner, elementNode, super.getLinkDeclaration(), editorContext));
     }
   }
 }
コード例 #6
0
 private void installCellInfo(SNode child, EditorCell editorCell) {
   if (editorCell.getSubstituteInfo() == null
       || editorCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) {
     editorCell.setSubstituteInfo(
         new OldNewCompositeSubstituteInfo(
             getEditorContext(),
             new SChildSubstituteInfo(
                 editorCell,
                 myNode,
                 MetaAdapterFactory.getContainmentLink(
                     0xb401a68083254110L,
                     0x8fd384331ff25befL,
                     0x1231e32ff7a958ceL,
                     0x1231e32ff7a9efcdL,
                     "createNodeQuery"),
                 child),
             new DefaultChildSubstituteInfo(
                 myNode, myContainmentLink.getDeclarationNode(), getEditorContext())));
   }
   if (editorCell.getRole() == null) {
     editorCell.setRole("createNodeQuery");
   }
   if (true) {
     editorCell.getStyle().set(StyleAttributes.FOCUS_POLICY, FocusPolicy.FIRST_EDITABLE_CELL);
   }
 }
コード例 #7
0
 public void installElementCellActions(SNode elementNode, EditorCell elementCell) {
   if (elementCell.getUserObject(AbstractCellListHandler.ELEMENT_CELL_ACTIONS_SET) == null) {
     elementCell.putUserObject(
         AbstractCellListHandler.ELEMENT_CELL_ACTIONS_SET,
         AbstractCellListHandler.ELEMENT_CELL_ACTIONS_SET);
     if (elementNode != null) {
       elementCell.setAction(
           CellActionType.DELETE,
           new CellAction_DeleteNode(
               elementNode, CellAction_DeleteNode.DeleteDirection.FORWARD));
       elementCell.setAction(
           CellActionType.BACKSPACE,
           new CellAction_DeleteNode(
               elementNode, CellAction_DeleteNode.DeleteDirection.BACKWARD));
     }
     if (elementCell.getSubstituteInfo() == null
         || elementCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) {
       elementCell.setSubstituteInfo(
           new OldNewCompositeSubstituteInfo(
               getEditorContext(),
               new SChildSubstituteInfo(
                   elementCell,
                   getNode(),
                   MetaAdapterFactory.getContainmentLink(
                       0xf3061a5392264cc5L,
                       0xa443f952ceaf5816L,
                       0x114a6be947aL,
                       0x114a6beb0bdL,
                       "annotation"),
                   elementNode),
               new DefaultChildSubstituteInfo(
                   getNode(), elementNode, super.getLinkDeclaration(), getEditorContext())));
     }
   }
 }
コード例 #8
0
ファイル: APICellAdapter.java プロジェクト: yan96in/MPS
  public static boolean validate(
      final EditorCell cell, final boolean strict, final boolean canActivatePopup) {
    final SubstituteInfo substituteInfo = cell.getSubstituteInfo();
    if (substituteInfo == null) {
      return false;
    }

    if (cell instanceof EditorCell_Collection) {
      return false;
    }
    final String pattern = cell.renderText().getText();

    if (pattern.equals("")) return false;

    List<SubstituteAction> matchingActions =
        ModelAccess.instance()
            .runReadAction(
                new Computable<List<SubstituteAction>>() {
                  @Override
                  public List<SubstituteAction> compute() {
                    return TypeContextManager.getInstance()
                        .runTypeCheckingComputation(
                            (ITypeContextOwner) cell.getEditorComponent(),
                            cell.getEditorComponent().getEditedNode(),
                            new Computation<List<SubstituteAction>>() {
                              @Override
                              public List<SubstituteAction> compute(TypeCheckingContext context) {
                                return substituteInfo.getMatchingActions(pattern, strict);
                              }
                            });
                  }
                });
    return substituteIfPossible(cell, canActivatePopup, pattern, matchingActions);
  }
コード例 #9
0
 public void installElementCellActions(
     SNode listOwner, SNode elementNode, EditorCell elementCell, EditorContext editorContext) {
   if (elementCell.getUserObject(AbstractCellListHandler.ELEMENT_CELL_ACTIONS_SET) == null) {
     elementCell.putUserObject(
         AbstractCellListHandler.ELEMENT_CELL_ACTIONS_SET,
         AbstractCellListHandler.ELEMENT_CELL_ACTIONS_SET);
     if (elementNode != null) {
       elementCell.setAction(CellActionType.DELETE, new CellAction_DeleteNode(elementNode));
     }
     if (elementCell.getSubstituteInfo() == null
         || elementCell.getSubstituteInfo() instanceof DefaultReferenceSubstituteInfo) {
       elementCell.setSubstituteInfo(
           new DefaultChildSubstituteInfo(
               listOwner, elementNode, super.getLinkDeclaration(), editorContext));
     }
   }
 }
コード例 #10
0
 private void installCellInfo(SNode child, EditorCell editorCell) {
   if (editorCell.getSubstituteInfo() == null
       || editorCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) {
     editorCell.setSubstituteInfo(
         new OldNewCompositeSubstituteInfo(
             getEditorContext(),
             new SChildSubstituteInfo(
                 editorCell,
                 myNode,
                 MetaAdapterFactory.getContainmentLink(
                     0x698a8d22a10447a0L,
                     0xba8d10e3ec237f13L,
                     0x5c3f3e2c1cede077L,
                     0x6e014d63c0847621L,
                     "classpath"),
                 child),
             new DefaultChildSubstituteInfo(
                 myNode, myContainmentLink.getDeclarationNode(), getEditorContext())));
   }
   if (editorCell.getRole() == null) {
     editorCell.setRole("classpath");
   }
 }
コード例 #11
0
 private void installCellInfo(SNode child, EditorCell editorCell) {
   if (editorCell.getSubstituteInfo() == null
       || editorCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) {
     editorCell.setSubstituteInfo(
         new OldNewCompositeSubstituteInfo(
             getEditorContext(),
             new SChildSubstituteInfo(
                 editorCell,
                 myNode,
                 MetaAdapterFactory.getContainmentLink(
                     0xf61473f9130f42f6L,
                     0xb98d6c438812c2f6L,
                     0x110e5250918L,
                     0x110e52557daL,
                     "message"),
                 child),
             new DefaultChildSubstituteInfo(
                 myNode, myContainmentLink.getDeclarationNode(), getEditorContext())));
   }
   if (editorCell.getRole() == null) {
     editorCell.setRole("message");
   }
 }
コード例 #12
0
 private void installCellInfo(SNode child, EditorCell editorCell) {
   if (editorCell.getSubstituteInfo() == null
       || editorCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) {
     editorCell.setSubstituteInfo(
         new OldNewCompositeSubstituteInfo(
             getEditorContext(),
             new SChildSubstituteInfo(
                 editorCell,
                 myNode,
                 MetaAdapterFactory.getContainmentLink(
                     0xf3061a5392264cc5L,
                     0xa443f952ceaf5816L,
                     0x11d00538bdfL,
                     0x11d00538be1L,
                     "classifierType"),
                 child),
             new DefaultChildSubstituteInfo(
                 myNode, myContainmentLink.getDeclarationNode(), getEditorContext())));
   }
   if (editorCell.getRole() == null) {
     editorCell.setRole("classifierType");
   }
 }
コード例 #13
0
 private void installCellInfo(SNode child, EditorCell editorCell) {
   if (editorCell.getSubstituteInfo() == null
       || editorCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) {
     editorCell.setSubstituteInfo(
         new OldNewCompositeSubstituteInfo(
             getEditorContext(),
             new SChildSubstituteInfo(
                 editorCell,
                 myNode,
                 MetaAdapterFactory.getContainmentLink(
                     0x18bc659203a64e29L,
                     0xa83a7ff23bde13baL,
                     0x1b1161f6e648b4b2L,
                     0x1b1161f6e66c1a3cL,
                     "target"),
                 child),
             new DefaultChildSubstituteInfo(
                 myNode, myContainmentLink.getDeclarationNode(), getEditorContext())));
   }
   if (editorCell.getRole() == null) {
     editorCell.setRole("target");
   }
 }
コード例 #14
0
 private void installCellInfo(SNode child, EditorCell editorCell) {
   if (editorCell.getSubstituteInfo() == null
       || editorCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) {
     editorCell.setSubstituteInfo(
         new OldNewCompositeSubstituteInfo(
             getEditorContext(),
             new SChildSubstituteInfo(
                 editorCell,
                 myNode,
                 MetaAdapterFactory.getContainmentLink(
                     0x7866978ea0f04cc7L,
                     0x81bc4d213d9375e1L,
                     0x2143399c0554e687L,
                     0x5d71a86e0b67cd19L,
                     "leftExpression"),
                 child),
             new DefaultChildSubstituteInfo(
                 myNode, myContainmentLink.getDeclarationNode(), getEditorContext())));
   }
   if (editorCell.getRole() == null) {
     editorCell.setRole("leftExpression");
   }
 }
コード例 #15
0
 private void installCellInfo(SNode child, EditorCell editorCell) {
   if (editorCell.getSubstituteInfo() == null
       || editorCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) {
     editorCell.setSubstituteInfo(
         new OldNewCompositeSubstituteInfo(
             getEditorContext(),
             new SChildSubstituteInfo(
                 editorCell,
                 myNode,
                 MetaAdapterFactory.getContainmentLink(
                     0x1a8554c4eb8443baL,
                     0x8c346f0d90c6e75aL,
                     0x307931d0f952484eL,
                     0x307931d0f952484fL,
                     "model"),
                 child),
             new DefaultChildSubstituteInfo(
                 myNode, myContainmentLink.getDeclarationNode(), getEditorContext())));
   }
   if (editorCell.getRole() == null) {
     editorCell.setRole("model");
   }
 }
 private void installCellInfo(SNode child, EditorCell editorCell) {
   if (editorCell.getSubstituteInfo() == null
       || editorCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) {
     editorCell.setSubstituteInfo(
         new OldNewCompositeSubstituteInfo(
             getEditorContext(),
             new SChildSubstituteInfo(
                 editorCell,
                 myNode,
                 MetaAdapterFactory.getContainmentLink(
                     0x7866978ea0f04cc7L,
                     0x81bc4d213d9375e1L,
                     0x10a2e210544L,
                     0x23c00a5f2f61f63L,
                     "nodeId"),
                 child),
             new DefaultChildSubstituteInfo(
                 myNode, myContainmentLink.getDeclarationNode(), getEditorContext())));
   }
   if (editorCell.getRole() == null) {
     editorCell.setRole("nodeId");
   }
 }
コード例 #17
0
 private void installCellInfo(SNode child, EditorCell editorCell) {
   if (editorCell.getSubstituteInfo() == null
       || editorCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) {
     editorCell.setSubstituteInfo(
         new OldNewCompositeSubstituteInfo(
             getEditorContext(),
             new SChildSubstituteInfo(
                 editorCell,
                 myNode,
                 MetaAdapterFactory.getContainmentLink(
                     0xfa8aeae94df94e13L,
                     0xbfb19b04c67ddb77L,
                     0x9a1514044030ceL,
                     0x9a15140440937bL,
                     "value"),
                 child),
             new DefaultChildSubstituteInfo(
                 myNode, myContainmentLink.getDeclarationNode(), getEditorContext())));
   }
   if (editorCell.getRole() == null) {
     editorCell.setRole("value");
   }
 }
コード例 #18
0
 private void installCellInfo(SNode child, EditorCell editorCell) {
   if (editorCell.getSubstituteInfo() == null
       || editorCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) {
     editorCell.setSubstituteInfo(
         new OldNewCompositeSubstituteInfo(
             getEditorContext(),
             new SChildSubstituteInfo(
                 editorCell,
                 myNode,
                 MetaAdapterFactory.getContainmentLink(
                     0x8388864671ce4f1cL,
                     0x9c53c54016f6ad4fL,
                     0x120c4c1050eL,
                     0x120c4c1332bL,
                     "fromElement"),
                 child),
             new DefaultChildSubstituteInfo(
                 myNode, myContainmentLink.getDeclarationNode(), getEditorContext())));
   }
   if (editorCell.getRole() == null) {
     editorCell.setRole("fromElement");
   }
 }
コード例 #19
0
 private void installCellInfo(SNode child, EditorCell editorCell) {
   if (editorCell.getSubstituteInfo() == null
       || editorCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) {
     editorCell.setSubstituteInfo(
         new OldNewCompositeSubstituteInfo(
             getEditorContext(),
             new SChildSubstituteInfo(
                 editorCell,
                 myNode,
                 MetaAdapterFactory.getContainmentLink(
                     0xaee9cad2acd44608L,
                     0xaef20004f6a1cdbdL,
                     0x11c51563250L,
                     0x11c517337d2L,
                     "wrapperFunction"),
                 child),
             new DefaultChildSubstituteInfo(
                 myNode, myContainmentLink.getDeclarationNode(), getEditorContext())));
   }
   if (editorCell.getRole() == null) {
     editorCell.setRole("wrapperFunction");
   }
 }