/** @deprecated Since MPS 3.5 use generated StyleClass */
 @Deprecated
 public static void apply_InequationsGroupsLabel(Style style, EditorCell editorCell) {
   SNode node = (editorCell == null ? null : editorCell.getSNode());
   EditorContext editorContext = (editorCell == null ? null : editorCell.getContext());
   new TypesystemStyles_StyleSheet.InequationsGroupsLabelStyleClass(editorContext, node)
       .apply(style, editorCell);
 }
 private EditorCell createProperty_lbdr4h_b0(EditorContext editorContext, SNode node) {
   CellProviderWithRole provider = new PropertyCellProvider(node, editorContext);
   provider.setRole("label");
   provider.setNoTargetText("");
   provider.setAllowsEmptyTarget(true);
   EditorCell editorCell;
   editorCell = provider.createEditorCell(editorContext);
   editorCell.setCellId("property_label");
   Style style = new StyleImpl();
   style.set(
       StyleAttributes.TEXT_COLOR,
       StyleRegistry.getInstance()
           .getSimpleColor(
               Antiquotation_Editor._StyleParameter_QueryFunction_lbdr4h_a0b0(
                   (editorCell == null ? null : editorCell.getContext()),
                   (editorCell == null ? null : editorCell.getSNode()))));
   editorCell.getStyle().putAll(style);
   editorCell.setSubstituteInfo(provider.createDefaultSubstituteInfo());
   SNode attributeConcept = provider.getRoleAttribute();
   Class attributeKind = provider.getRoleAttributeClass();
   if (attributeConcept != null) {
     IOperationContext opContext = editorContext.getOperationContext();
     EditorManager manager = EditorManager.getInstanceFromContext(opContext);
     return manager.createNodeRoleAttributeCell(
         editorContext, attributeConcept, attributeKind, editorCell);
   } else return editorCell;
 }
 private EditorCell createProperty_3uf681_a0(EditorContext editorContext, SNode node) {
   CellProviderWithRole provider = new PropertyCellProvider(node, editorContext);
   provider.setRole("name");
   provider.setNoTargetText("<no name>");
   EditorCell editorCell;
   editorCell = provider.createEditorCell(editorContext);
   editorCell.setCellId("property_name");
   Style style = new StyleImpl();
   style.set(
       StyleAttributes.NAVIGATABLE_NODE,
       0,
       FigureParameterMapping_Editor._StyleParameter_QueryFunction_3uf681_a0a0(
           (editorCell == null ? null : editorCell.getContext()),
           (editorCell == null ? null : editorCell.getSNode())));
   style.set(StyleAttributes.AUTO_DELETABLE, 0, true);
   editorCell.getStyle().putAll(style);
   FigureParameterMappingName_Actions.setCellActions(editorCell, node, editorContext);
   editorCell.setSubstituteInfo(
       new CompositeSubstituteInfo(
           editorContext,
           provider.getCellContext(),
           new SubstituteInfoPartExt[] {
             new FigureParameterMapping_Editor
                 .FigureParameterMapping_generic_cellMenu_3uf681_a0a0()
           }));
   SNode attributeConcept = provider.getRoleAttribute();
   Class attributeKind = provider.getRoleAttributeClass();
   if (attributeConcept != null) {
     EditorManager manager = EditorManager.getInstanceFromContext(editorContext);
     return manager.createNodeRoleAttributeCell(attributeConcept, attributeKind, editorCell);
   } else return editorCell;
 }
Example #4
0
 static boolean substituteIfPossible(
     EditorCell cell,
     boolean canActivatePopup,
     final String pattern,
     List<SubstituteAction> matchingActions) {
   if (matchingActions.size() == 0 && canActivatePopup) {
     return false;
   }
   if (matchingActions.size() != 1) {
     if (canActivatePopup) {
       ((EditorComponent) cell.getEditorComponent()).activateNodeSubstituteChooser(cell, false);
     } else {
       return false;
     }
     return true;
   }
   final SubstituteAction action = matchingActions.get(0);
   Boolean canSubstitute =
       ModelAccess.instance()
           .runReadAction(
               new Computable<Boolean>() {
                 @Override
                 public Boolean compute() {
                   return action.canSubstitute(pattern);
                 }
               });
   if (canSubstitute) {
     action.substitute(cell.getContext(), pattern);
     return true;
   } else {
     return false;
   }
 }
 public void installCellInfo(SNode child, EditorCell editorCell) {
   editorCell.setSubstituteInfo(
       new DefaultChildSubstituteInfo(
           myOwnerNode, myContainmentLink.getDeclarationNode(), myEditorContext));
   if (editorCell.getRole() == null) {
     editorCell.setRole("body");
   }
   Style style = new StyleImpl();
   style.set(
       StyleAttributes.INDENT_LAYOUT_NEW_LINE,
       0,
       BaseMethodDeclaration_BodyComponent._StyleParameter_QueryFunction_fao2ea_a0b0(
           (editorCell == null ? null : editorCell.getContext()),
           (editorCell == null ? null : editorCell.getSNode())));
   style.set(StyleAttributes.INDENT_LAYOUT_INDENT, 0, true);
   editorCell.getStyle().putAll(style);
 }