示例#1
0
文件: _OpenTag.java 项目: sprig/MPS
  private EditorCell createReadOnlyModelAccessor_mtiojs_a(
      final EditorContext editorContext, final SNode node) {
    EditorCell_Property editorCell =
        EditorCell_Property.create(
            editorContext,
            new ModelAccessor() {
              public String getText() {
                return EditorCellModel_Behavior.call_getOpeningTag_1220340471382(node);
              }

              public void setText(String s) {}

              public boolean isValidText(String s) {
                return EqualUtil.equals(s, getText());
              }
            },
            node);
    editorCell.setAction(CellActionType.DELETE, EmptyCellAction.getInstance());
    editorCell.setCellId("ReadOnlyModelAccessor_mtiojs_a");
    Style style = new StyleImpl();
    Styles_StyleSheet.applyBordered(style, editorCell);
    style.set(
        StyleAttributes.BACKGROUND_COLOR,
        StyleRegistry.getInstance()
            .getSimpleColor(
                _OpenTag._StyleParameter_QueryFunction_mtiojs_a0a(
                    (editorCell == null ? null : editorCell.getContext()),
                    (editorCell == null ? null : editorCell.getSNode()))));
    style.set(StyleAttributes.EDITABLE, false);
    editorCell.getStyle().putAll(style);
    return editorCell;
  }
示例#2
0
 private EditorCell createProperty_35c8z1_a0a0(EditorContext editorContext, SNode node) {
   CellProviderWithRole provider = new PropertyCellProvider(node, editorContext);
   provider.setRole("role");
   provider.setNoTargetText("<no role>");
   provider.setReadOnly(true);
   EditorCell editorCell;
   editorCell = provider.createEditorCell(editorContext);
   editorCell.setCellId("property_role");
   if (editorCell.getRole() == null) {
     editorCell.setReferenceCell(true);
     editorCell.setRole("link");
   }
   Style style = new StyleImpl();
   Styles_StyleSheet.applyRef_link_role(style, editorCell);
   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.createRoleAttributeCell(
         editorContext, attributeConcept, attributeKind, editorCell);
   } else return editorCell;
 }
示例#3
0
 private EditorCell createConstant_zca0xt_a0d0(EditorContext editorContext, SNode node) {
   EditorCell_Constant editorCell = new EditorCell_Constant(editorContext, node, "cell provider");
   editorCell.setCellId("Constant_zca0xt_a0d0");
   Style style = new StyleImpl();
   Styles_StyleSheet.applyProperty(style, editorCell);
   editorCell.getStyle().putAll(style);
   editorCell.setDefaultText("");
   return editorCell;
 }
示例#4
0
 private EditorCell createConstant_7vmkkt_a0(EditorContext editorContext, SNode node) {
   EditorCell_Constant editorCell = new EditorCell_Constant(editorContext, node, "claim/duty");
   editorCell.setCellId("Constant_7vmkkt_a0");
   Style style = new StyleImpl();
   Styles_StyleSheet.apply_Keyword(style, editorCell);
   editorCell.getStyle().putAll(style);
   editorCell.setDefaultText("");
   return editorCell;
 }
 private EditorCell createConstant_yczb8_a2d0(EditorContext editorContext, SNode node) {
   EditorCell_Constant editorCell = new EditorCell_Constant(editorContext, node, "descent :");
   editorCell.setCellId("Constant_yczb8_a2d0");
   Style style = new StyleImpl();
   Styles_StyleSheet.apply_property(style, editorCell);
   editorCell.getStyle().putAll(style);
   editorCell.setDefaultText("");
   return editorCell;
 }
 private EditorCell createConstant_cly5ih_a0(EditorContext editorContext, SNode node) {
   EditorCell_Constant editorCell = new EditorCell_Constant(editorContext, node, "concept in:[");
   editorCell.setCellId("Constant_cly5ih_a0");
   Style style = new StyleImpl();
   Styles_StyleSheet.applyOperationParameter(style, editorCell);
   style.set(StyleAttributes.PADDING_RIGHT, new Padding(0.0, Measure.SPACES));
   editorCell.getStyle().putAll(style);
   editorCell.setDefaultText("");
   return editorCell;
 }
 private EditorCell createConstant_yczb8_a(EditorContext editorContext, SNode node) {
   EditorCell_Constant editorCell = new EditorCell_Constant(editorContext, node, "$image$");
   editorCell.setCellId("Constant_yczb8_a");
   editorCell.setBig(true);
   Style style = new StyleImpl();
   Styles_StyleSheet.apply_rootCellModelStyle(style, editorCell);
   editorCell.getStyle().putAll(style);
   editorCell.setDefaultText("");
   return editorCell;
 }
示例#8
0
 private EditorCell createCollection_zca0xt_a(EditorContext editorContext, SNode node) {
   EditorCell_Collection editorCell = EditorCell_Collection.createHorizontal(editorContext, node);
   editorCell.setCellId("Collection_zca0xt_a");
   editorCell.setBig(true);
   Style style = new StyleImpl();
   Styles_StyleSheet.applyBorderedCollection(style, editorCell);
   editorCell.getStyle().putAll(style);
   editorCell.addEditorCell(this.createComponent_zca0xt_a0(editorContext, node));
   editorCell.addEditorCell(this.createConstant_zca0xt_b0(editorContext, node));
   editorCell.addEditorCell(this.createComponent_zca0xt_c0(editorContext, node));
   return editorCell;
 }
 private EditorCell createConstant_n84rmm_c1a(EditorContext editorContext, SNode node) {
   EditorCell_Constant editorCell = new EditorCell_Constant(editorContext, node, ">");
   editorCell.setCellId("Constant_n84rmm_c1a");
   Style style = new StyleImpl();
   Styles_StyleSheet.applyOperationParameter(style, editorCell);
   style.set(StyleAttributes.MATCHING_LABEL, "AngleBracet");
   style.set(StyleAttributes.FONT_STYLE, MPSFonts.BOLD);
   style.set(StyleAttributes.PUNCTUATION_LEFT, true);
   editorCell.getStyle().putAll(style);
   editorCell.setDefaultText("");
   return editorCell;
 }
示例#10
0
 private EditorCell createConstant_l8ulis_a(EditorContext editorContext, SNode node) {
   EditorCell_Constant editorCell = new EditorCell_Constant(editorContext, node, "--->");
   editorCell.setCellId("Constant_l8ulis_a");
   editorCell.setBig(true);
   Style style = new StyleImpl();
   Styles_StyleSheet.applyRootCellModelStyle(style, editorCell);
   style.set(
       StyleAttributes.TEXT_COLOR,
       StyleRegistry.getInstance().getSimpleColor(MPSColors.lightGray));
   editorCell.getStyle().putAll(style);
   editorCell.setDefaultText("");
   return editorCell;
 }
 private EditorCell createComponent_689p1d_a0(EditorContext editorContext, SNode node) {
   AbstractCellProvider provider = new AliasEditorComponent(node);
   EditorCell editorCell = provider.createEditorCell(editorContext);
   Style style = new StyleImpl();
   Styles_StyleSheet.applyItem(style, editorCell);
   editorCell.getStyle().putAll(style);
   editorCell.setSubstituteInfo(
       new CompositeSubstituteInfo(
           editorContext,
           new BasicCellContext(node),
           new SubstituteInfoPartExt[] {
             new BooleanStyleSheetItem_Editor.ReplaceWith_StyleClassItem_cellMenu_689p1d_a0a0()
           }));
   return editorCell;
 }
 private EditorCell createComponent_4fi5xp_a0(EditorContext editorContext, SNode node) {
   EditorCell editorCell =
       editorContext
           .getCellFactory()
           .createEditorComponentCell(node, "jetbrains.mps.lang.core.editor.alias");
   Style style = new StyleImpl();
   Styles_StyleSheet.apply_item(style, editorCell);
   editorCell.getStyle().putAll(style);
   editorCell.setSubstituteInfo(
       new CompositeSubstituteInfo(
           editorContext,
           new BasicCellContext(node),
           new SubstituteInfoPartExt[] {
             new UnderlinedStyleClassItem_Editor.ReplaceWith_StyleClassItem_cellMenu_4fi5xp_a0a0()
           }));
   return editorCell;
 }
 private EditorCell createConceptProperty_6khmms_a0(EditorContext editorContext, SNode node) {
   CellProviderWithRole provider = new ConceptPropertyCellProvider(node, editorContext);
   provider.setRole("alias");
   provider.setNoTargetText("<no alias>");
   EditorCell editorCell;
   editorCell = provider.createEditorCell(editorContext);
   editorCell.setCellId("conceptProperty_alias");
   Styles_StyleSheet.getItem(editorCell).apply(editorCell);
   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.createRoleAttributeCell(
         editorContext, attributeConcept, attributeKind, editorCell);
   } else return editorCell;
 }
 private EditorCell createConceptProperty_q2tbc1_a0(EditorContext editorContext, SNode node) {
   CellProviderWithRole provider = new ConceptPropertyCellProvider(node, editorContext);
   provider.setRole("alias");
   provider.setNoTargetText("<no alias>");
   EditorCell editorCell;
   editorCell = provider.createEditorCell(editorContext);
   editorCell.setCellId("conceptProperty_alias");
   Styles_StyleSheet.getItem(editorCell).apply(editorCell);
   editorCell.setSubstituteInfo(
       new CompositeSubstituteInfo(
           editorContext,
           provider.getCellContext(),
           new SubstituteInfoPart[] {
             new AbstractPaddingStyleClassItem_Editor.ReplaceWith_StyleClassItem_cellMenu_a0a0_9()
           }));
   SNode attributeConcept = provider.getRoleAttribute();
   Class attributeKind = provider.getRoleAttributeClass();
   if (attributeConcept != null) {
     IOperationContext opContext = editorContext.getOperationContext();
     EditorManager manager = EditorManager.getInstanceFromContext(opContext);
     return manager.createRoleAttributeCell(
         editorContext, attributeConcept, attributeKind, editorCell);
   } else return editorCell;
 }