package jetbrains.mps.lang.smodel.editor; /*Generated by MPS */ import jetbrains.mps.editor.runtime.descriptor.AbstractEditorBuilder; import org.jetbrains.annotations.NotNull; import org.jetbrains.mps.openapi.model.SNode; import jetbrains.mps.openapi.editor.EditorContext; import jetbrains.mps.openapi.editor.cells.EditorCell; import jetbrains.mps.nodeEditor.cells.EditorCell_Collection; import jetbrains.mps.nodeEditor.cellLayout.CellLayout_Indent; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations; import jetbrains.mps.lang.editor.cellProviders.SingleRoleCellProvider; import org.jetbrains.mps.openapi.language.SContainmentLink; import jetbrains.mps.openapi.editor.cells.CellActionType; import jetbrains.mps.editor.runtime.impl.cellActions.CellAction_DeleteSmart; import jetbrains.mps.openapi.editor.cells.DefaultSubstituteInfo; import jetbrains.mps.nodeEditor.cellMenu.SChildSubstituteInfo; import jetbrains.mps.openapi.editor.menus.transformation.SNodeLocation; import jetbrains.mps.nodeEditor.cells.EditorCell_Constant; import jetbrains.mps.openapi.editor.style.Style; import jetbrains.mps.editor.runtime.style.StyleImpl; import jetbrains.mps.editor.runtime.style.StyleAttributes; import jetbrains.mps.openapi.editor.style.StyleRegistry; import jetbrains.mps.nodeEditor.MPSColors; import jetbrains.mps.baseLanguage.editor.BaseLanguageStyle_StyleSheet.CommentStyleClass; import jetbrains.mps.editor.runtime.style.Padding; import jetbrains.mps.editor.runtime.style.Measure; import jetbrains.mps.nodeEditor.cellProviders.CellProviderWithRole; import jetbrains.mps.lang.editor.cellProviders.RefCellCellProvider; import jetbrains.mps.util.Computable; import jetbrains.mps.editor.runtime.impl.CellUtil; import jetbrains.mps.nodeEditor.EditorManager; import jetbrains.mps.lang.editor.cellProviders.PropertyCellProvider; /*package*/ class SNodeTypeCastExpression_EditorBuilder_a extends AbstractEditorBuilder { @NotNull private SNode myNode; public SNodeTypeCastExpression_EditorBuilder_a(@NotNull EditorContext context, @NotNull SNode node) { super(context); myNode = node; } @NotNull @Override public SNode getNode() { return myNode; } /*package*/ EditorCell createCell() { return createCollection_x0l1fn_a(); } private EditorCell createCollection_x0l1fn_a() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent()); editorCell.setCellId("Collection_x0l1fn_a"); editorCell.setBig(true); editorCell.setCellContext(getCellFactory().getCellContext()); editorCell.addEditorCell(createRefNode_x0l1fn_a0()); if (nodeCondition_x0l1fn_a1a()) { editorCell.addEditorCell(createConstant_x0l1fn_b0()); } if (nodeCondition_x0l1fn_a2a()) { editorCell.addEditorCell(createConstant_x0l1fn_c0()); } editorCell.addEditorCell(createRefNode_x0l1fn_d0()); if (nodeCondition_x0l1fn_a4a()) { editorCell.addEditorCell(createCollection_x0l1fn_e0()); } return editorCell; } private boolean nodeCondition_x0l1fn_a1a() { return !(SPropertyOperations.getBoolean(myNode, MetaAdapterFactory.getProperty(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x10975850da7L, 0x12067573bc7L, "asCast"))); } private boolean nodeCondition_x0l1fn_a2a() { return SPropertyOperations.getBoolean(myNode, MetaAdapterFactory.getProperty(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x10975850da7L, 0x12067573bc7L, "asCast")); } private boolean nodeCondition_x0l1fn_a4a() { return (SLinkOperations.getTarget(myNode, MetaAdapterFactory.getReferenceLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x2143399c0554e687L, 0x5d71a86e0b67ce04L, "concept")) != null) || (SLinkOperations.getTarget(myNode, MetaAdapterFactory.getReferenceLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x10975850da7L, 0x10975873562L, "concept_old")) != null) || (SLinkOperations.getTarget(myNode, MetaAdapterFactory.getContainmentLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x10975850da7L, 0x109758722b4L, "leftExpression_old")) != null); } private EditorCell createRefNode_x0l1fn_a0() { SingleRoleCellProvider provider = new SNodeTypeCastExpression_EditorBuilder_a.leftExpressionSingleRoleHandler_x0l1fn_a0(myNode, MetaAdapterFactory.getContainmentLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x2143399c0554e687L, 0x5d71a86e0b67cd19L, "leftExpression"), getEditorContext()); return provider.createCell(); } private static class leftExpressionSingleRoleHandler_x0l1fn_a0 extends SingleRoleCellProvider { @NotNull private SNode myNode; public leftExpressionSingleRoleHandler_x0l1fn_a0(SNode ownerNode, SContainmentLink containmentLink, EditorContext context) { super(containmentLink, context); myNode = ownerNode; } @Override @NotNull public SNode getNode() { return myNode; } protected EditorCell createChildCell(SNode child) { EditorCell editorCell = getUpdateSession().updateChildNodeCell(child); editorCell.setAction(CellActionType.DELETE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x2143399c0554e687L, 0x5d71a86e0b67cd19L, "leftExpression"), child)); editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x2143399c0554e687L, 0x5d71a86e0b67cd19L, "leftExpression"), child)); installCellInfo(child, editorCell); return editorCell; } private void installCellInfo(SNode child, EditorCell editorCell) { if (editorCell.getSubstituteInfo() == null || editorCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) { editorCell.setSubstituteInfo(new SChildSubstituteInfo(editorCell, myNode, MetaAdapterFactory.getContainmentLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x2143399c0554e687L, 0x5d71a86e0b67cd19L, "leftExpression"), child)); } if (editorCell.getRole() == null) { editorCell.setRole("leftExpression"); } } @Override protected EditorCell createEmptyCell() { getCellFactory().pushCellContext(); getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(getNode(), MetaAdapterFactory.getContainmentLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x2143399c0554e687L, 0x5d71a86e0b67cd19L, "leftExpression"))); try { EditorCell editorCell = super.createEmptyCell(); editorCell.setCellId("empty_leftExpression"); installCellInfo(null, editorCell); setCellContext(editorCell); return editorCell; } finally { getCellFactory().popCellContext(); } } protected String getNoTargetText() { return "<no leftExpression>"; } } private EditorCell createConstant_x0l1fn_b0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ":"); editorCell.setCellId("Constant_x0l1fn_b0"); Style style = new StyleImpl(); style.set(StyleAttributes.SELECTABLE, false); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createConstant_x0l1fn_c0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "as"); editorCell.setCellId("Constant_x0l1fn_c0"); Style style = new StyleImpl(); style.set(StyleAttributes.TEXT_COLOR, StyleRegistry.getInstance().getSimpleColor(MPSColors.DARK_MAGENTA)); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createRefNode_x0l1fn_d0() { SingleRoleCellProvider provider = new SNodeTypeCastExpression_EditorBuilder_a.conceptArgumentSingleRoleHandler_x0l1fn_d0(myNode, MetaAdapterFactory.getContainmentLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x2143399c0554e687L, 0x3636a984eed504f9L, "conceptArgument"), getEditorContext()); return provider.createCell(); } private static class conceptArgumentSingleRoleHandler_x0l1fn_d0 extends SingleRoleCellProvider { @NotNull private SNode myNode; public conceptArgumentSingleRoleHandler_x0l1fn_d0(SNode ownerNode, SContainmentLink containmentLink, EditorContext context) { super(containmentLink, context); myNode = ownerNode; } @Override @NotNull public SNode getNode() { return myNode; } protected EditorCell createChildCell(SNode child) { EditorCell editorCell = getUpdateSession().updateChildNodeCell(child); editorCell.setAction(CellActionType.DELETE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x2143399c0554e687L, 0x3636a984eed504f9L, "conceptArgument"), child)); editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x2143399c0554e687L, 0x3636a984eed504f9L, "conceptArgument"), child)); installCellInfo(child, editorCell); return editorCell; } private void installCellInfo(SNode child, EditorCell editorCell) { if (editorCell.getSubstituteInfo() == null || editorCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) { editorCell.setSubstituteInfo(new SChildSubstituteInfo(editorCell, myNode, MetaAdapterFactory.getContainmentLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x2143399c0554e687L, 0x3636a984eed504f9L, "conceptArgument"), child)); } if (editorCell.getRole() == null) { editorCell.setRole("conceptArgument"); } AbstractTypeCastExpression_Concept_Actions.setCellActions(editorCell, getNode(), getEditorContext()); } @Override protected EditorCell createEmptyCell() { getCellFactory().pushCellContext(); getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(getNode(), MetaAdapterFactory.getContainmentLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x2143399c0554e687L, 0x3636a984eed504f9L, "conceptArgument"))); try { EditorCell editorCell = super.createEmptyCell(); editorCell.setCellId("empty_conceptArgument"); installCellInfo(null, editorCell); setCellContext(editorCell); return editorCell; } finally { getCellFactory().popCellContext(); } } protected String getNoTargetText() { return "<no conceptArgument>"; } } private EditorCell createCollection_x0l1fn_e0() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent()); editorCell.setCellId("Collection_x0l1fn_e0"); Style style = new StyleImpl(); new CommentStyleClass(getEditorContext(), getNode()).apply(style, editorCell); style.set(StyleAttributes.SELECTABLE, false); editorCell.getStyle().putAll(style); editorCell.addEditorCell(createConstant_x0l1fn_a4a()); editorCell.addEditorCell(createConstant_x0l1fn_b4a()); editorCell.addEditorCell(createConstant_x0l1fn_c4a()); editorCell.addEditorCell(createConstant_x0l1fn_d4a()); if (nodeCondition_x0l1fn_a4e0()) { editorCell.addEditorCell(createCollection_x0l1fn_e4a()); } if (nodeCondition_x0l1fn_a5e0()) { editorCell.addEditorCell(createRefCell_x0l1fn_f4a()); } if (nodeCondition_x0l1fn_a6e0()) { editorCell.addEditorCell(createConstant_x0l1fn_g4a()); } if (nodeCondition_x0l1fn_a7e0()) { editorCell.addEditorCell(createRefCell_x0l1fn_h4a()); } editorCell.addEditorCell(createConstant_x0l1fn_i4a()); return editorCell; } private boolean nodeCondition_x0l1fn_a4e0() { return (SLinkOperations.getTarget(myNode, MetaAdapterFactory.getContainmentLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x10975850da7L, 0x109758722b4L, "leftExpression_old")) != null); } private boolean nodeCondition_x0l1fn_a5e0() { return (SLinkOperations.getTarget(myNode, MetaAdapterFactory.getReferenceLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x10975850da7L, 0x10975873562L, "concept_old")) != null); } private boolean nodeCondition_x0l1fn_a6e0() { return (SLinkOperations.getTarget(myNode, MetaAdapterFactory.getReferenceLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x10975850da7L, 0x10975873562L, "concept_old")) != null) && (SLinkOperations.getTarget(myNode, MetaAdapterFactory.getReferenceLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x2143399c0554e687L, 0x5d71a86e0b67ce04L, "concept")) != null); } private boolean nodeCondition_x0l1fn_a7e0() { return (SLinkOperations.getTarget(myNode, MetaAdapterFactory.getReferenceLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x2143399c0554e687L, 0x5d71a86e0b67ce04L, "concept")) != null); } private EditorCell createConstant_x0l1fn_a4a() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "("); editorCell.setCellId("Constant_x0l1fn_a4a"); editorCell.setDefaultText(""); return editorCell; } private EditorCell createConstant_x0l1fn_b4a() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "deprecated"); editorCell.setCellId("Constant_x0l1fn_b4a"); Style style = new StyleImpl(); style.set(StyleAttributes.PADDING_LEFT, new Padding(0.5, Measure.SPACES)); style.set(StyleAttributes.PADDING_RIGHT, new Padding(0.5, Measure.SPACES)); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createConstant_x0l1fn_c4a() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "parts"); editorCell.setCellId("Constant_x0l1fn_c4a"); Style style = new StyleImpl(); style.set(StyleAttributes.PADDING_LEFT, new Padding(0.5, Measure.SPACES)); style.set(StyleAttributes.PADDING_RIGHT, new Padding(0.5, Measure.SPACES)); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createConstant_x0l1fn_d4a() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ":"); editorCell.setCellId("Constant_x0l1fn_d4a"); editorCell.setDefaultText(""); return editorCell; } private EditorCell createCollection_x0l1fn_e4a() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent()); editorCell.setCellId("Collection_x0l1fn_e4a"); Style style = new StyleImpl(); style.set(StyleAttributes.SELECTABLE, false); editorCell.getStyle().putAll(style); editorCell.addEditorCell(createRefNode_x0l1fn_a4e0()); if (nodeCondition_x0l1fn_a1e4a()) { editorCell.addEditorCell(createConstant_x0l1fn_b4e0()); } if (nodeCondition_x0l1fn_a2e4a()) { editorCell.addEditorCell(createConstant_x0l1fn_c4e0()); } return editorCell; } private boolean nodeCondition_x0l1fn_a1e4a() { return !(SPropertyOperations.getBoolean(myNode, MetaAdapterFactory.getProperty(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x10975850da7L, 0x12067573bc7L, "asCast"))); } private boolean nodeCondition_x0l1fn_a2e4a() { return SPropertyOperations.getBoolean(myNode, MetaAdapterFactory.getProperty(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x10975850da7L, 0x12067573bc7L, "asCast")); } private EditorCell createRefNode_x0l1fn_a4e0() { SingleRoleCellProvider provider = new SNodeTypeCastExpression_EditorBuilder_a.leftExpression_oldSingleRoleHandler_x0l1fn_a4e0(myNode, MetaAdapterFactory.getContainmentLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x10975850da7L, 0x109758722b4L, "leftExpression_old"), getEditorContext()); return provider.createCell(); } private static class leftExpression_oldSingleRoleHandler_x0l1fn_a4e0 extends SingleRoleCellProvider { @NotNull private SNode myNode; public leftExpression_oldSingleRoleHandler_x0l1fn_a4e0(SNode ownerNode, SContainmentLink containmentLink, EditorContext context) { super(containmentLink, context); myNode = ownerNode; } @Override @NotNull public SNode getNode() { return myNode; } protected EditorCell createChildCell(SNode child) { EditorCell editorCell = getUpdateSession().updateChildNodeCell(child); editorCell.setAction(CellActionType.DELETE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x10975850da7L, 0x109758722b4L, "leftExpression_old"), child)); editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x10975850da7L, 0x109758722b4L, "leftExpression_old"), child)); installCellInfo(child, editorCell); return editorCell; } private void installCellInfo(SNode child, EditorCell editorCell) { if (editorCell.getSubstituteInfo() == null || editorCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) { editorCell.setSubstituteInfo(new SChildSubstituteInfo(editorCell, myNode, MetaAdapterFactory.getContainmentLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x10975850da7L, 0x109758722b4L, "leftExpression_old"), child)); } if (editorCell.getRole() == null) { editorCell.setRole("leftExpression_old"); } } @Override protected EditorCell createEmptyCell() { getCellFactory().pushCellContext(); getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(getNode(), MetaAdapterFactory.getContainmentLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x10975850da7L, 0x109758722b4L, "leftExpression_old"))); try { EditorCell editorCell = super.createEmptyCell(); editorCell.setCellId("empty_leftExpression_old"); installCellInfo(null, editorCell); setCellContext(editorCell); return editorCell; } finally { getCellFactory().popCellContext(); } } protected String getNoTargetText() { return "<no leftExpression_old>"; } } private EditorCell createConstant_x0l1fn_b4e0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ":"); editorCell.setCellId("Constant_x0l1fn_b4e0"); Style style = new StyleImpl(); style.set(StyleAttributes.SELECTABLE, false); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createConstant_x0l1fn_c4e0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "as"); editorCell.setCellId("Constant_x0l1fn_c4e0"); Style style = new StyleImpl(); style.set(StyleAttributes.TEXT_COLOR, StyleRegistry.getInstance().getSimpleColor(MPSColors.DARK_MAGENTA)); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createRefCell_x0l1fn_f4a() { CellProviderWithRole provider = new RefCellCellProvider(myNode, getEditorContext()) { @Override protected EditorCell createRefCell(EditorContext context, final SNode effectiveNode, SNode node) { EditorCell cell = getUpdateSession().updateReferencedNodeCell(new Computable<EditorCell>() { public EditorCell compute() { return new SNodeTypeCastExpression_EditorBuilder_a.Inline_Builder_x0l1fn_a5e0(getEditorContext(), myNode, effectiveNode).createCell(); } }, effectiveNode, "concept_old"); CellUtil.setupIDeprecatableStyles(effectiveNode, cell); setSemanticNodeToCells(cell, myNode); installDeleteActions_nullable_reference(cell); return cell; } }; provider.setRole("concept_old"); provider.setNoTargetText("<no concept>"); EditorCell editorCell; editorCell = provider.createEditorCell(getEditorContext()); if (editorCell.getRole() == null) { editorCell.setReferenceCell(true); editorCell.setRole("concept_old"); } editorCell.setSubstituteInfo(provider.createDefaultSubstituteInfo()); SNode attributeConcept = provider.getRoleAttribute(); if (attributeConcept != null) { EditorManager manager = EditorManager.getInstanceFromContext(getEditorContext()); return manager.createNodeRoleAttributeCell(attributeConcept, provider.getRoleAttributeKind(), editorCell); } else return editorCell; } /*package*/ static class Inline_Builder_x0l1fn_a5e0 extends AbstractEditorBuilder { @NotNull private SNode myNode; private SNode myReferencingNode; /*package*/ Inline_Builder_x0l1fn_a5e0(@NotNull EditorContext context, SNode referencingNode, @NotNull SNode node) { super(context); myReferencingNode = referencingNode; myNode = node; } /*package*/ EditorCell createCell() { return createProperty_x0l1fn_a0f4a(); } @NotNull @Override public SNode getNode() { return myNode; } private EditorCell createProperty_x0l1fn_a0f4a() { CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext()); provider.setRole("name"); provider.setNoTargetText("<no name>"); provider.setReadOnly(true); EditorCell editorCell; editorCell = provider.createEditorCell(getEditorContext()); editorCell.setCellId("property_name"); Style style = new StyleImpl(); style.set(StyleAttributes.TEXT_COLOR, StyleRegistry.getInstance().getSimpleColor(MPSColors.DARK_MAGENTA)); style.set(StyleAttributes.PADDING_RIGHT, new Padding(0.0, Measure.SPACES)); editorCell.getStyle().putAll(style); editorCell.setSubstituteInfo(provider.createDefaultSubstituteInfo()); SNode attributeConcept = provider.getRoleAttribute(); if (attributeConcept != null) { EditorManager manager = EditorManager.getInstanceFromContext(getEditorContext()); return manager.createNodeRoleAttributeCell(attributeConcept, provider.getRoleAttributeKind(), editorCell); } else return editorCell; } } private EditorCell createConstant_x0l1fn_g4a() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ","); editorCell.setCellId("Constant_x0l1fn_g4a"); Style style = new StyleImpl(); style.set(StyleAttributes.PUNCTUATION_LEFT, true); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createRefCell_x0l1fn_h4a() { CellProviderWithRole provider = new RefCellCellProvider(myNode, getEditorContext()) { @Override protected EditorCell createRefCell(EditorContext context, final SNode effectiveNode, SNode node) { EditorCell cell = getUpdateSession().updateReferencedNodeCell(new Computable<EditorCell>() { public EditorCell compute() { return new SNodeTypeCastExpression_EditorBuilder_a.Inline_Builder_x0l1fn_a7e0(getEditorContext(), myNode, effectiveNode).createCell(); } }, effectiveNode, "concept"); CellUtil.setupIDeprecatableStyles(effectiveNode, cell); setSemanticNodeToCells(cell, myNode); installDeleteActions_nullable_reference(cell); return cell; } }; provider.setRole("concept"); provider.setNoTargetText("<no concept>"); EditorCell editorCell; editorCell = provider.createEditorCell(getEditorContext()); if (editorCell.getRole() == null) { editorCell.setReferenceCell(true); editorCell.setRole("concept"); } editorCell.setSubstituteInfo(provider.createDefaultSubstituteInfo()); SNode attributeConcept = provider.getRoleAttribute(); if (attributeConcept != null) { EditorManager manager = EditorManager.getInstanceFromContext(getEditorContext()); return manager.createNodeRoleAttributeCell(attributeConcept, provider.getRoleAttributeKind(), editorCell); } else return editorCell; } /*package*/ static class Inline_Builder_x0l1fn_a7e0 extends AbstractEditorBuilder { @NotNull private SNode myNode; private SNode myReferencingNode; /*package*/ Inline_Builder_x0l1fn_a7e0(@NotNull EditorContext context, SNode referencingNode, @NotNull SNode node) { super(context); myReferencingNode = referencingNode; myNode = node; } /*package*/ EditorCell createCell() { return createProperty_x0l1fn_a0h4a(); } @NotNull @Override public SNode getNode() { return myNode; } private EditorCell createProperty_x0l1fn_a0h4a() { CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext()); provider.setRole("name"); provider.setNoTargetText("<no name>"); provider.setReadOnly(true); EditorCell editorCell; editorCell = provider.createEditorCell(getEditorContext()); editorCell.setCellId("property_name_1"); Style style = new StyleImpl(); style.set(StyleAttributes.TEXT_COLOR, StyleRegistry.getInstance().getSimpleColor(MPSColors.DARK_MAGENTA)); style.set(StyleAttributes.PADDING_RIGHT, new Padding(0.0, Measure.SPACES)); editorCell.getStyle().putAll(style); editorCell.setSubstituteInfo(provider.createDefaultSubstituteInfo()); SNode attributeConcept = provider.getRoleAttribute(); if (attributeConcept != null) { EditorManager manager = EditorManager.getInstanceFromContext(getEditorContext()); return manager.createNodeRoleAttributeCell(attributeConcept, provider.getRoleAttributeKind(), editorCell); } else return editorCell; } } private EditorCell createConstant_x0l1fn_i4a() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ")"); editorCell.setCellId("Constant_x0l1fn_i4a"); editorCell.setDefaultText(""); return editorCell; } }