package jetbrains.mps.lang.test.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_Vertical; import jetbrains.mps.nodeEditor.cellLayout.CellLayout_Horizontal; import jetbrains.mps.openapi.editor.style.Style; import jetbrains.mps.editor.runtime.style.StyleImpl; import jetbrains.mps.editor.runtime.style.StyleAttributes; import jetbrains.mps.nodeEditor.cells.EditorCell_Constant; import jetbrains.mps.nodeEditor.cellProviders.CellProviderWithRole; import jetbrains.mps.lang.editor.cellProviders.PropertyCellProvider; import jetbrains.mps.nodeEditor.EditorManager; import jetbrains.mps.nodeEditor.cells.EditorCell_Indent; import jetbrains.mps.nodeEditor.cellProviders.AbstractCellListHandler; import jetbrains.mps.lang.editor.cellProviders.RefNodeListHandler; import jetbrains.mps.smodel.action.NodeFactoryManager; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; import jetbrains.mps.openapi.editor.menus.transformation.SNodeLocation; import jetbrains.mps.openapi.editor.cells.CellActionType; import jetbrains.mps.nodeEditor.cellActions.CellAction_DeleteNode; import jetbrains.mps.openapi.editor.cells.DefaultSubstituteInfo; import jetbrains.mps.nodeEditor.cellMenu.SChildSubstituteInfo; import jetbrains.mps.lang.editor.cellProviders.SingleRoleCellProvider; import org.jetbrains.mps.openapi.language.SContainmentLink; import jetbrains.mps.editor.runtime.impl.cellActions.CellAction_DeleteSmart; import jetbrains.mps.lang.editor.cellProviders.RefNodeListHandlerElementKeyMap; /*package*/ class NodesTestCase_EditorBuilder_a extends AbstractEditorBuilder { @NotNull private SNode myNode; public NodesTestCase_EditorBuilder_a(@NotNull EditorContext context, @NotNull SNode node) { super(context); myNode = node; } @NotNull @Override public SNode getNode() { return myNode; } /*package*/ EditorCell createCell() { return createCollection_58c6e4_a(); } private EditorCell createCollection_58c6e4_a() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Vertical()); editorCell.setCellId("Collection_58c6e4_a"); editorCell.setBig(true); editorCell.setCellContext(getCellFactory().getCellContext()); editorCell.addEditorCell(createCollection_58c6e4_a0()); editorCell.addEditorCell(createConstant_58c6e4_b0()); editorCell.addEditorCell(createCollection_58c6e4_c0()); editorCell.addEditorCell(createIndentCell_58c6e4_d0()); editorCell.addEditorCell(createConstant_58c6e4_e0()); editorCell.addEditorCell(createCollection_58c6e4_f0()); editorCell.addEditorCell(createIndentCell_58c6e4_g0()); editorCell.addEditorCell(createCollection_58c6e4_h0()); editorCell.addEditorCell(createIndentCell_58c6e4_i0()); editorCell.addEditorCell(createCollection_58c6e4_j0()); editorCell.addEditorCell(createIndentCell_58c6e4_k0()); editorCell.addEditorCell(createConstant_58c6e4_l0()); editorCell.addEditorCell(createCollection_58c6e4_m0()); return editorCell; } private EditorCell createCollection_58c6e4_a0() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal()); editorCell.setCellId("Collection_58c6e4_a0"); Style style = new StyleImpl(); style.set(StyleAttributes.SELECTABLE, false); style.set(StyleAttributes.PUNCTUATION_LEFT, true); style.set(StyleAttributes.PUNCTUATION_RIGHT, true); style.set(StyleAttributes.SELECTABLE, false); style.set(StyleAttributes.PUNCTUATION_LEFT, true); style.set(StyleAttributes.PUNCTUATION_RIGHT, true); editorCell.getStyle().putAll(style); editorCell.addEditorCell(createConstant_58c6e4_a0a()); editorCell.addEditorCell(createProperty_58c6e4_b0a()); return editorCell; } private EditorCell createConstant_58c6e4_a0a() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "Test case"); editorCell.setCellId("Constant_58c6e4_a0a"); editorCell.setDefaultText(""); return editorCell; } private EditorCell createProperty_58c6e4_b0a() { CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext()); provider.setRole("name"); provider.setNoTargetText("<no name>"); EditorCell editorCell; editorCell = provider.createEditorCell(getEditorContext()); editorCell.setCellId("property_name"); 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_58c6e4_b0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "nodes"); editorCell.setCellId("Constant_58c6e4_b0"); Style style = new StyleImpl(); style.set(StyleAttributes.UNDERLINED, true); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createCollection_58c6e4_c0() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal()); editorCell.setCellId("Collection_58c6e4_c0"); Style style = new StyleImpl(); style.set(StyleAttributes.SELECTABLE, false); style.set(StyleAttributes.PUNCTUATION_LEFT, true); style.set(StyleAttributes.PUNCTUATION_RIGHT, true); style.set(StyleAttributes.SELECTABLE, false); style.set(StyleAttributes.PUNCTUATION_LEFT, true); style.set(StyleAttributes.PUNCTUATION_RIGHT, true); editorCell.getStyle().putAll(style); editorCell.addEditorCell(createIndentCell_58c6e4_a2a()); editorCell.addEditorCell(createRefNodeList_58c6e4_b2a()); return editorCell; } private EditorCell createIndentCell_58c6e4_a2a() { EditorCell_Indent editorCell = new EditorCell_Indent(getEditorContext(), myNode); return editorCell; } private EditorCell createRefNodeList_58c6e4_b2a() { AbstractCellListHandler handler = new NodesTestCase_EditorBuilder_a.nodesToCheckListHandler_58c6e4_b2a(myNode, "nodesToCheck", getEditorContext()); EditorCell_Collection editorCell = handler.createCells(new CellLayout_Vertical(), false); editorCell.setCellId("refNodeList_nodesToCheck"); editorCell.setRole(handler.getElementRole()); return editorCell; } private static class nodesToCheckListHandler_58c6e4_b2a extends RefNodeListHandler { @NotNull private SNode myNode; public nodesToCheckListHandler_58c6e4_b2a(SNode ownerNode, String childRole, EditorContext context) { super(ownerNode, childRole, context, false); myNode = ownerNode; } @Override @NotNull public SNode getNode() { return myNode; } public SNode createNodeToInsert(EditorContext editorContext) { return NodeFactoryManager.createNode(MetaAdapterFactory.getConcept(0x8585453e6bfb4d80L, 0x98deb16074f1d86cL, 0x11b5a38fc01L, "jetbrains.mps.lang.test.structure.TestNode"), null, getNode(), getNode().getModel()); } public EditorCell createNodeCell(SNode elementNode) { EditorCell elementCell = getUpdateSession().updateChildNodeCell(elementNode); installElementCellActions(elementNode, elementCell); return elementCell; } public EditorCell createEmptyCell() { getCellFactory().pushCellContext(); getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(nodesToCheckListHandler_58c6e4_b2a.this.getNode(), MetaAdapterFactory.getContainmentLink(0x8585453e6bfb4d80L, 0x98deb16074f1d86cL, 0x11b55b49e46L, 0x11b78c37cc6L, "nodesToCheck"))); try { EditorCell emptyCell = null; emptyCell = super.createEmptyCell(); installElementCellActions(null, emptyCell); setCellContext(emptyCell); return emptyCell; } finally { getCellFactory().popCellContext(); } } 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 SChildSubstituteInfo(elementCell, getNode(), MetaAdapterFactory.getContainmentLink(0x8585453e6bfb4d80L, 0x98deb16074f1d86cL, 0x11b55b49e46L, 0x11b78c37cc6L, "nodesToCheck"), elementNode)); } } } } private EditorCell createIndentCell_58c6e4_d0() { EditorCell_Indent editorCell = new EditorCell_Indent(getEditorContext(), myNode); return editorCell; } private EditorCell createConstant_58c6e4_e0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "test methods"); editorCell.setCellId("Constant_58c6e4_e0"); Style style = new StyleImpl(); style.set(StyleAttributes.UNDERLINED, true); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createCollection_58c6e4_f0() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal()); editorCell.setCellId("Collection_58c6e4_f0"); Style style = new StyleImpl(); style.set(StyleAttributes.SELECTABLE, false); style.set(StyleAttributes.PUNCTUATION_LEFT, true); style.set(StyleAttributes.PUNCTUATION_RIGHT, true); style.set(StyleAttributes.SELECTABLE, false); style.set(StyleAttributes.PUNCTUATION_LEFT, true); style.set(StyleAttributes.PUNCTUATION_RIGHT, true); editorCell.getStyle().putAll(style); editorCell.addEditorCell(createIndentCell_58c6e4_a5a()); editorCell.addEditorCell(createRefNodeList_58c6e4_b5a()); return editorCell; } private EditorCell createIndentCell_58c6e4_a5a() { EditorCell_Indent editorCell = new EditorCell_Indent(getEditorContext(), myNode); return editorCell; } private EditorCell createRefNodeList_58c6e4_b5a() { AbstractCellListHandler handler = new NodesTestCase_EditorBuilder_a.testMethodsListHandler_58c6e4_b5a(myNode, "testMethods", getEditorContext()); EditorCell_Collection editorCell = handler.createCells(new CellLayout_Vertical(), false); editorCell.setCellId("refNodeList_testMethods"); editorCell.setRole(handler.getElementRole()); return editorCell; } private static class testMethodsListHandler_58c6e4_b5a extends RefNodeListHandler { @NotNull private SNode myNode; public testMethodsListHandler_58c6e4_b5a(SNode ownerNode, String childRole, EditorContext context) { super(ownerNode, childRole, context, false); myNode = ownerNode; } @Override @NotNull public SNode getNode() { return myNode; } public SNode createNodeToInsert(EditorContext editorContext) { return NodeFactoryManager.createNode(MetaAdapterFactory.getConcept(0x8585453e6bfb4d80L, 0x98deb16074f1d86cL, 0x11b55b54d88L, "jetbrains.mps.lang.test.structure.NodesTestMethod"), null, getNode(), getNode().getModel()); } private String getSeparatorText() { return ""; } public EditorCell createNodeCell(SNode elementNode) { EditorCell elementCell = getUpdateSession().updateChildNodeCell(elementNode); installElementCellActions(elementNode, elementCell); return elementCell; } public EditorCell createEmptyCell() { getCellFactory().pushCellContext(); getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(testMethodsListHandler_58c6e4_b5a.this.getNode(), MetaAdapterFactory.getContainmentLink(0x8585453e6bfb4d80L, 0x98deb16074f1d86cL, 0x11b55b49e46L, 0x11b78c499b5L, "testMethods"))); try { EditorCell emptyCell = null; emptyCell = super.createEmptyCell(); installElementCellActions(null, emptyCell); setCellContext(emptyCell); return emptyCell; } finally { getCellFactory().popCellContext(); } } 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 SChildSubstituteInfo(elementCell, getNode(), MetaAdapterFactory.getContainmentLink(0x8585453e6bfb4d80L, 0x98deb16074f1d86cL, 0x11b55b49e46L, 0x11b78c499b5L, "testMethods"), elementNode)); } } } @Override public EditorCell createSeparatorCell(SNode prevNode, SNode nextNode) { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), getNode(), testMethodsListHandler_58c6e4_b5a.this.getSeparatorText()); editorCell.setSelectable(false); Style style = new StyleImpl(); style.set(StyleAttributes.LAYOUT_CONSTRAINT, ""); style.set(StyleAttributes.PUNCTUATION_LEFT, true); editorCell.getStyle().putAll(style); editorCell.setAction(CellActionType.DELETE, new CellAction_DeleteNode(prevNode, CellAction_DeleteNode.DeleteDirection.FORWARD)); editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteNode(prevNode, CellAction_DeleteNode.DeleteDirection.BACKWARD)); return editorCell; } } private EditorCell createIndentCell_58c6e4_g0() { EditorCell_Indent editorCell = new EditorCell_Indent(getEditorContext(), myNode); return editorCell; } private EditorCell createCollection_58c6e4_h0() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal()); editorCell.setCellId("Collection_58c6e4_h0"); Style style = new StyleImpl(); style.set(StyleAttributes.SELECTABLE, false); style.set(StyleAttributes.PUNCTUATION_LEFT, true); style.set(StyleAttributes.PUNCTUATION_RIGHT, true); style.set(StyleAttributes.SELECTABLE, false); style.set(StyleAttributes.PUNCTUATION_LEFT, true); style.set(StyleAttributes.PUNCTUATION_RIGHT, true); editorCell.getStyle().putAll(style); editorCell.addEditorCell(createIndentCell_58c6e4_a7a()); editorCell.addEditorCell(createRefNode_58c6e4_b7a()); return editorCell; } private EditorCell createIndentCell_58c6e4_a7a() { EditorCell_Indent editorCell = new EditorCell_Indent(getEditorContext(), myNode); return editorCell; } private EditorCell createRefNode_58c6e4_b7a() { SingleRoleCellProvider provider = new NodesTestCase_EditorBuilder_a.beforeTestsSingleRoleHandler_58c6e4_b7a(myNode, MetaAdapterFactory.getContainmentLink(0x8585453e6bfb4d80L, 0x98deb16074f1d86cL, 0x11b55b49e46L, 0x2045125020efb661L, "beforeTests"), getEditorContext()); return provider.createCell(); } private static class beforeTestsSingleRoleHandler_58c6e4_b7a extends SingleRoleCellProvider { @NotNull private SNode myNode; public beforeTestsSingleRoleHandler_58c6e4_b7a(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(0x8585453e6bfb4d80L, 0x98deb16074f1d86cL, 0x11b55b49e46L, 0x2045125020efb661L, "beforeTests"), child)); editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0x8585453e6bfb4d80L, 0x98deb16074f1d86cL, 0x11b55b49e46L, 0x2045125020efb661L, "beforeTests"), 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(0x8585453e6bfb4d80L, 0x98deb16074f1d86cL, 0x11b55b49e46L, 0x2045125020efb661L, "beforeTests"), child)); } if (editorCell.getRole() == null) { editorCell.setRole("beforeTests"); } Style style = new StyleImpl(); style.set(StyleAttributes.UNDERLINED, true); editorCell.getStyle().putAll(style); } @Override protected EditorCell createEmptyCell() { getCellFactory().pushCellContext(); getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(getNode(), MetaAdapterFactory.getContainmentLink(0x8585453e6bfb4d80L, 0x98deb16074f1d86cL, 0x11b55b49e46L, 0x2045125020efb661L, "beforeTests"))); try { EditorCell editorCell = super.createEmptyCell(); editorCell.setCellId("empty_beforeTests"); installCellInfo(null, editorCell); setCellContext(editorCell); return editorCell; } finally { getCellFactory().popCellContext(); } } protected String getNoTargetText() { return "<no beforeTests>"; } } private EditorCell createIndentCell_58c6e4_i0() { EditorCell_Indent editorCell = new EditorCell_Indent(getEditorContext(), myNode); return editorCell; } private EditorCell createCollection_58c6e4_j0() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal()); editorCell.setCellId("Collection_58c6e4_j0"); Style style = new StyleImpl(); style.set(StyleAttributes.SELECTABLE, false); style.set(StyleAttributes.PUNCTUATION_LEFT, true); style.set(StyleAttributes.PUNCTUATION_RIGHT, true); style.set(StyleAttributes.SELECTABLE, false); style.set(StyleAttributes.PUNCTUATION_LEFT, true); style.set(StyleAttributes.PUNCTUATION_RIGHT, true); editorCell.getStyle().putAll(style); editorCell.addEditorCell(createIndentCell_58c6e4_a9a()); editorCell.addEditorCell(createRefNode_58c6e4_b9a()); return editorCell; } private EditorCell createIndentCell_58c6e4_a9a() { EditorCell_Indent editorCell = new EditorCell_Indent(getEditorContext(), myNode); return editorCell; } private EditorCell createRefNode_58c6e4_b9a() { SingleRoleCellProvider provider = new NodesTestCase_EditorBuilder_a.afterTestsSingleRoleHandler_58c6e4_b9a(myNode, MetaAdapterFactory.getContainmentLink(0x8585453e6bfb4d80L, 0x98deb16074f1d86cL, 0x11b55b49e46L, 0x2045125020efb66cL, "afterTests"), getEditorContext()); return provider.createCell(); } private static class afterTestsSingleRoleHandler_58c6e4_b9a extends SingleRoleCellProvider { @NotNull private SNode myNode; public afterTestsSingleRoleHandler_58c6e4_b9a(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(0x8585453e6bfb4d80L, 0x98deb16074f1d86cL, 0x11b55b49e46L, 0x2045125020efb66cL, "afterTests"), child)); editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0x8585453e6bfb4d80L, 0x98deb16074f1d86cL, 0x11b55b49e46L, 0x2045125020efb66cL, "afterTests"), 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(0x8585453e6bfb4d80L, 0x98deb16074f1d86cL, 0x11b55b49e46L, 0x2045125020efb66cL, "afterTests"), child)); } if (editorCell.getRole() == null) { editorCell.setRole("afterTests"); } Style style = new StyleImpl(); style.set(StyleAttributes.UNDERLINED, true); editorCell.getStyle().putAll(style); } @Override protected EditorCell createEmptyCell() { getCellFactory().pushCellContext(); getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(getNode(), MetaAdapterFactory.getContainmentLink(0x8585453e6bfb4d80L, 0x98deb16074f1d86cL, 0x11b55b49e46L, 0x2045125020efb66cL, "afterTests"))); try { EditorCell editorCell = super.createEmptyCell(); editorCell.setCellId("empty_afterTests"); installCellInfo(null, editorCell); setCellContext(editorCell); return editorCell; } finally { getCellFactory().popCellContext(); } } protected String getNoTargetText() { return "<no afterTests>"; } } private EditorCell createIndentCell_58c6e4_k0() { EditorCell_Indent editorCell = new EditorCell_Indent(getEditorContext(), myNode); return editorCell; } private EditorCell createConstant_58c6e4_l0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "utility methods"); editorCell.setCellId("Constant_58c6e4_l0"); Style style = new StyleImpl(); style.set(StyleAttributes.UNDERLINED, true); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createCollection_58c6e4_m0() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal()); editorCell.setCellId("Collection_58c6e4_m0"); Style style = new StyleImpl(); style.set(StyleAttributes.SELECTABLE, false); style.set(StyleAttributes.PUNCTUATION_LEFT, true); style.set(StyleAttributes.PUNCTUATION_RIGHT, true); style.set(StyleAttributes.SELECTABLE, false); style.set(StyleAttributes.PUNCTUATION_LEFT, true); style.set(StyleAttributes.PUNCTUATION_RIGHT, true); editorCell.getStyle().putAll(style); editorCell.addEditorCell(createIndentCell_58c6e4_a21a()); editorCell.addEditorCell(createRefNodeList_58c6e4_b21a()); return editorCell; } private EditorCell createIndentCell_58c6e4_a21a() { EditorCell_Indent editorCell = new EditorCell_Indent(getEditorContext(), myNode); return editorCell; } private EditorCell createRefNodeList_58c6e4_b21a() { AbstractCellListHandler handler = new NodesTestCase_EditorBuilder_a.methodsListHandler_58c6e4_b21a(myNode, "methods", getEditorContext()); EditorCell_Collection editorCell = handler.createCells(new CellLayout_Vertical(), false); editorCell.setCellId("refNodeList_methods"); editorCell.setRole(handler.getElementRole()); return editorCell; } private static class methodsListHandler_58c6e4_b21a extends RefNodeListHandler { @NotNull private SNode myNode; public methodsListHandler_58c6e4_b21a(SNode ownerNode, String childRole, EditorContext context) { super(ownerNode, childRole, context, false); myNode = ownerNode; } @Override @NotNull public SNode getNode() { return myNode; } public SNode createNodeToInsert(EditorContext editorContext) { return NodeFactoryManager.createNode(MetaAdapterFactory.getConcept(0x443f4c36fcf54eb6L, 0x95008d06ed259e3eL, 0x118bd6ee3c3L, "jetbrains.mps.baseLanguage.classifiers.structure.DefaultClassifierMethodDeclaration"), null, getNode(), getNode().getModel()); } public EditorCell createNodeCell(SNode elementNode) { EditorCell elementCell = getUpdateSession().updateChildNodeCell(elementNode); installElementCellActions(elementNode, elementCell); return elementCell; } public EditorCell createEmptyCell() { getCellFactory().pushCellContext(); getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(methodsListHandler_58c6e4_b21a.this.getNode(), MetaAdapterFactory.getContainmentLink(0x8585453e6bfb4d80L, 0x98deb16074f1d86cL, 0x11b55b49e46L, 0x11b5a762e97L, "methods"))); try { EditorCell emptyCell = null; emptyCell = super.createEmptyCell(); installElementCellActions(null, emptyCell); setCellContext(emptyCell); return emptyCell; } finally { getCellFactory().popCellContext(); } } 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)); elementCell.addKeyMap(new RefNodeListHandlerElementKeyMap(this, " ")); } if (elementCell.getSubstituteInfo() == null || elementCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) { elementCell.setSubstituteInfo(new SChildSubstituteInfo(elementCell, getNode(), MetaAdapterFactory.getContainmentLink(0x8585453e6bfb4d80L, 0x98deb16074f1d86cL, 0x11b55b49e46L, 0x11b5a762e97L, "methods"), elementNode)); } } } @Override public EditorCell createSeparatorCell(SNode prevNode, SNode nextNode) { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), getNode(), " "); editorCell.setSelectable(false); Style style = new StyleImpl(); style.set(StyleAttributes.LAYOUT_CONSTRAINT, ""); style.set(StyleAttributes.PUNCTUATION_LEFT, true); editorCell.getStyle().putAll(style); editorCell.setAction(CellActionType.DELETE, new CellAction_DeleteNode(prevNode, CellAction_DeleteNode.DeleteDirection.FORWARD)); editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteNode(prevNode, CellAction_DeleteNode.DeleteDirection.BACKWARD)); return editorCell; } } }