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())));
     }
   }
 }
 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);
 }
 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());
 }
 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);
   }
 }
Example #5
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, 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));
     }
   }
 }
 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);
   }
 }
 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())));
     }
   }
 }
Example #8
0
  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);
  }
 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));
     }
   }
 }
 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");
   }
 }
Example #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");
   }
 }
 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");
   }
 }
 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");
   }
 }
 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");
   }
 }
 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");
   }
 }
 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");
   }
 }
 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");
   }
 }
 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");
   }
 }