package jetbrains.mps.baseLanguage.unitTest.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.nodeEditor.cells.EditorCell_Constant; import jetbrains.mps.openapi.editor.style.Style; import jetbrains.mps.editor.runtime.style.StyleImpl; import jetbrains.mps.baseLanguage.editor.BaseLanguageStyle_StyleSheet.KeyWordStyleClass; import jetbrains.mps.nodeEditor.cellProviders.CellProviderWithRole; import jetbrains.mps.lang.editor.cellProviders.PropertyCellProvider; import jetbrains.mps.nodeEditor.EditorManager; 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.editor.runtime.style.StyleAttributes; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations; import jetbrains.mps.baseLanguage.editor.BaseLanguageStyle_StyleSheet.LeftBraceStyleClass; import jetbrains.mps.internal.collections.runtime.Sequence; import jetbrains.mps.lang.smodel.generator.smodelAdapter.AttributeOperations; import jetbrains.mps.nodeEditor.cellProviders.AbstractCellListHandler; import jetbrains.mps.lang.editor.cellProviders.RefNodeListHandler; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SConceptOperations; import jetbrains.mps.nodeEditor.cellActions.CellAction_DeleteNode; import jetbrains.mps.smodel.action.NodeFactoryManager; import jetbrains.mps.openapi.editor.style.StyleRegistry; import jetbrains.mps.nodeEditor.MPSColors; import jetbrains.mps.baseLanguage.editor.BaseLanguageStyle_StyleSheet.RightBraceStyleClass; /*package*/ class BTestCase_EditorBuilder_a extends AbstractEditorBuilder { @NotNull private SNode myNode; public BTestCase_EditorBuilder_a(@NotNull EditorContext context, @NotNull SNode node) { super(context); myNode = node; } @NotNull @Override public SNode getNode() { return myNode; } /*package*/ EditorCell createCell() { return createCollection_lq4ak4_a(); } private EditorCell createCollection_lq4ak4_a() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent()); editorCell.setCellId("Collection_lq4ak4_a"); editorCell.setBig(true); editorCell.setCellContext(getCellFactory().getCellContext()); editorCell.addEditorCell(createComponent_lq4ak4_a0()); if (nodeCondition_lq4ak4_a1a()) { editorCell.addEditorCell(createConstant_lq4ak4_b0()); } editorCell.addEditorCell(createConstant_lq4ak4_c0()); editorCell.addEditorCell(createProperty_lq4ak4_d0()); editorCell.addEditorCell(createConstant_lq4ak4_e0()); editorCell.addEditorCell(createRefNode_lq4ak4_f0()); editorCell.addEditorCell(createCollection_lq4ak4_g0()); return editorCell; } private boolean nodeCondition_lq4ak4_a1a() { return SPropertyOperations.getBoolean(myNode, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c108ca66L, 0xfa5cee6dfaL, "abstractClass")); } private EditorCell createComponent_lq4ak4_a0() { EditorCell editorCell = getCellFactory().createEditorComponentCell(myNode, "jetbrains.mps.baseLanguage.editor.HasAnnotation_AnnotationComponent"); return editorCell; } private EditorCell createConstant_lq4ak4_b0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "abstract"); editorCell.setCellId("Constant_lq4ak4_b0"); Style style = new StyleImpl(); new KeyWordStyleClass(getEditorContext(), getNode()).apply(style, editorCell); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createConstant_lq4ak4_c0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "test case"); editorCell.setCellId("Constant_lq4ak4_c0"); Style style = new StyleImpl(); new KeyWordStyleClass(getEditorContext(), getNode()).apply(style, editorCell); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createProperty_lq4ak4_d0() { CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext()); provider.setRole("testCaseName"); provider.setNoTargetText("<no testCaseName>"); EditorCell editorCell; editorCell = provider.createEditorCell(getEditorContext()); editorCell.setCellId("property_testCaseName"); 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_lq4ak4_e0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "extends"); editorCell.setCellId("Constant_lq4ak4_e0"); Style style = new StyleImpl(); new KeyWordStyleClass(getEditorContext(), getNode()).apply(style, editorCell); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createRefNode_lq4ak4_f0() { SingleRoleCellProvider provider = new BTestCase_EditorBuilder_a.superclassSingleRoleHandler_lq4ak4_f0(myNode, MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c108ca66L, 0x10f6353296dL, "superclass"), getEditorContext()); return provider.createCell(); } private static class superclassSingleRoleHandler_lq4ak4_f0 extends SingleRoleCellProvider { @NotNull private SNode myNode; public superclassSingleRoleHandler_lq4ak4_f0(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(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c108ca66L, 0x10f6353296dL, "superclass"), child)); editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c108ca66L, 0x10f6353296dL, "superclass"), 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(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c108ca66L, 0x10f6353296dL, "superclass"), child)); } if (editorCell.getRole() == null) { editorCell.setRole("superclass"); } } @Override protected EditorCell createEmptyCell() { getCellFactory().pushCellContext(); getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(getNode(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c108ca66L, 0x10f6353296dL, "superclass"))); try { EditorCell editorCell = super.createEmptyCell(); editorCell.setCellId("empty_superclass"); installCellInfo(null, editorCell); setCellContext(editorCell); return editorCell; } finally { getCellFactory().popCellContext(); } } protected String getNoTargetText() { return "<none>"; } } private EditorCell createCollection_lq4ak4_g0() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent()); editorCell.setCellId("Collection_lq4ak4_g0"); Style style = new StyleImpl(); style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true); editorCell.getStyle().putAll(style); editorCell.setFoldable(nodeCondition_lq4ak4_a6a()); editorCell.setFoldedCell(createComponent_lq4ak4_a6a()); editorCell.addEditorCell(createConstant_lq4ak4_a6a()); editorCell.addEditorCell(createCollection_lq4ak4_b6a()); editorCell.addEditorCell(createConstant_lq4ak4_c6a()); return editorCell; } private boolean nodeCondition_lq4ak4_a6a() { return (SNodeOperations.getParent(myNode) != null); } private EditorCell createConstant_lq4ak4_a6a() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "{"); editorCell.setCellId("Constant_lq4ak4_a6a"); Style style = new StyleImpl(); new LeftBraceStyleClass(getEditorContext(), getNode()).apply(style, editorCell); style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createCollection_lq4ak4_b6a() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent()); editorCell.setCellId("Collection_lq4ak4_b6a"); Style style = new StyleImpl(); style.set(StyleAttributes.SELECTABLE, false); style.set(StyleAttributes.INDENT_LAYOUT_INDENT, true); style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true); editorCell.getStyle().putAll(style); editorCell.addEditorCell(createRefNodeList_lq4ak4_a1g0()); editorCell.addEditorCell(createConstant_lq4ak4_b1g0()); editorCell.addEditorCell(createRefNode_lq4ak4_c1g0()); editorCell.addEditorCell(createConstant_lq4ak4_d1g0()); editorCell.addEditorCell(createRefNode_lq4ak4_e1g0()); editorCell.addEditorCell(createConstant_lq4ak4_f1g0()); editorCell.addEditorCell(createRefNode_lq4ak4_g1g0()); if (nodeCondition_lq4ak4_a7b6a()) { editorCell.addEditorCell(createRefNodeList_lq4ak4_h1g0()); } if (nodeCondition_lq4ak4_a8b6a()) { editorCell.addEditorCell(createRefNodeList_lq4ak4_i1g0()); } if (nodeCondition_lq4ak4_a9b6a()) { editorCell.addEditorCell(createRefNodeList_lq4ak4_j1g0()); } return editorCell; } private boolean nodeCondition_lq4ak4_a7b6a() { return Sequence.fromIterable(AttributeOperations.getChildNodesAndAttributes(myNode, MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101d9d3ca30L, 0x106c32c4395L, "staticField"))).isNotEmpty(); } private boolean nodeCondition_lq4ak4_a8b6a() { return Sequence.fromIterable(AttributeOperations.getChildNodesAndAttributes(myNode, MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c108ca66L, 0xf8c108ca67L, "field"))).isNotEmpty(); } private boolean nodeCondition_lq4ak4_a9b6a() { return Sequence.fromIterable(AttributeOperations.getChildNodesAndAttributes(myNode, MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101d9d3ca30L, 0x101f2cc410bL, "method"))).isNotEmpty(); } private EditorCell createRefNodeList_lq4ak4_a1g0() { AbstractCellListHandler handler = new BTestCase_EditorBuilder_a.memberListHandler_lq4ak4_a1g0(myNode, "member", getEditorContext()); EditorCell_Collection editorCell = handler.createCells(new CellLayout_Indent(), false); editorCell.setCellId("refNodeList_member"); Style style = new StyleImpl(); style.set(StyleAttributes.POSITION_CHILDREN, "indented"); style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true); style.set(StyleAttributes.INDENT_LAYOUT_CHILDREN_NEWLINE, true); editorCell.getStyle().putAll(style); editorCell.setRole(handler.getElementRole()); return editorCell; } private static class memberListHandler_lq4ak4_a1g0 extends RefNodeListHandler { @NotNull private SNode myNode; public memberListHandler_lq4ak4_a1g0(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 nodeFactory(); } public SNode nodeFactory() { return SConceptOperations.createNewNode(MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x1458378889e6d166L, "jetbrains.mps.baseLanguage.structure.PlaceholderMember")); } 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(memberListHandler_lq4ak4_a1g0.this.getNode(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101d9d3ca30L, 0x4a9a46de59132803L, "member"))); try { EditorCell emptyCell = null; emptyCell = createConstant_lq4ak4_a0b6a(); 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(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101d9d3ca30L, 0x4a9a46de59132803L, "member"), elementNode)); } } } private EditorCell createConstant_lq4ak4_a0b6a() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ""); editorCell.setCellId("Constant_lq4ak4_a0b6a"); Style style = new StyleImpl(); style.set(StyleAttributes.EDITABLE, true); editorCell.getStyle().putAll(style); editorCell.setDefaultText("<<members>>"); return editorCell; } } private EditorCell createConstant_lq4ak4_b1g0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ""); editorCell.setCellId("Constant_lq4ak4_b1g0"); Style style = new StyleImpl(); style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createRefNode_lq4ak4_c1g0() { SingleRoleCellProvider provider = new BTestCase_EditorBuilder_a.beforeTestSingleRoleHandler_lq4ak4_c1g0(myNode, MetaAdapterFactory.getContainmentLink(0xf61473f9130f42f6L, 0xb98d6c438812c2f6L, 0x110dc94e923L, 0x72682467022fd3e3L, "beforeTest"), getEditorContext()); return provider.createCell(); } private static class beforeTestSingleRoleHandler_lq4ak4_c1g0 extends SingleRoleCellProvider { @NotNull private SNode myNode; public beforeTestSingleRoleHandler_lq4ak4_c1g0(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(0xf61473f9130f42f6L, 0xb98d6c438812c2f6L, 0x110dc94e923L, 0x72682467022fd3e3L, "beforeTest"), child)); editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0xf61473f9130f42f6L, 0xb98d6c438812c2f6L, 0x110dc94e923L, 0x72682467022fd3e3L, "beforeTest"), 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(0xf61473f9130f42f6L, 0xb98d6c438812c2f6L, 0x110dc94e923L, 0x72682467022fd3e3L, "beforeTest"), child)); } if (editorCell.getRole() == null) { editorCell.setRole("beforeTest"); } Style style = new StyleImpl(); style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true); editorCell.getStyle().putAll(style); } @Override protected EditorCell createEmptyCell() { getCellFactory().pushCellContext(); getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(getNode(), MetaAdapterFactory.getContainmentLink(0xf61473f9130f42f6L, 0xb98d6c438812c2f6L, 0x110dc94e923L, 0x72682467022fd3e3L, "beforeTest"))); try { EditorCell editorCell = super.createEmptyCell(); editorCell.setCellId("empty_beforeTest"); installCellInfo(null, editorCell); setCellContext(editorCell); return editorCell; } finally { getCellFactory().popCellContext(); } } protected String getNoTargetText() { return "<<before test>>"; } } private EditorCell createConstant_lq4ak4_d1g0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ""); editorCell.setCellId("Constant_lq4ak4_d1g0"); Style style = new StyleImpl(); style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createRefNode_lq4ak4_e1g0() { SingleRoleCellProvider provider = new BTestCase_EditorBuilder_a.afterTestSingleRoleHandler_lq4ak4_e1g0(myNode, MetaAdapterFactory.getContainmentLink(0xf61473f9130f42f6L, 0xb98d6c438812c2f6L, 0x110dc94e923L, 0x72682467022fd3e4L, "afterTest"), getEditorContext()); return provider.createCell(); } private static class afterTestSingleRoleHandler_lq4ak4_e1g0 extends SingleRoleCellProvider { @NotNull private SNode myNode; public afterTestSingleRoleHandler_lq4ak4_e1g0(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(0xf61473f9130f42f6L, 0xb98d6c438812c2f6L, 0x110dc94e923L, 0x72682467022fd3e4L, "afterTest"), child)); editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0xf61473f9130f42f6L, 0xb98d6c438812c2f6L, 0x110dc94e923L, 0x72682467022fd3e4L, "afterTest"), 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(0xf61473f9130f42f6L, 0xb98d6c438812c2f6L, 0x110dc94e923L, 0x72682467022fd3e4L, "afterTest"), child)); } if (editorCell.getRole() == null) { editorCell.setRole("afterTest"); } Style style = new StyleImpl(); style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true); editorCell.getStyle().putAll(style); } @Override protected EditorCell createEmptyCell() { getCellFactory().pushCellContext(); getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(getNode(), MetaAdapterFactory.getContainmentLink(0xf61473f9130f42f6L, 0xb98d6c438812c2f6L, 0x110dc94e923L, 0x72682467022fd3e4L, "afterTest"))); try { EditorCell editorCell = super.createEmptyCell(); editorCell.setCellId("empty_afterTest"); installCellInfo(null, editorCell); setCellContext(editorCell); return editorCell; } finally { getCellFactory().popCellContext(); } } protected String getNoTargetText() { return "<<after test>>"; } } private EditorCell createConstant_lq4ak4_f1g0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ""); editorCell.setCellId("Constant_lq4ak4_f1g0"); Style style = new StyleImpl(); style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createRefNode_lq4ak4_g1g0() { SingleRoleCellProvider provider = new BTestCase_EditorBuilder_a.testMethodListSingleRoleHandler_lq4ak4_g1g0(myNode, MetaAdapterFactory.getContainmentLink(0xf61473f9130f42f6L, 0xb98d6c438812c2f6L, 0x110dc94e923L, 0x110dc94e924L, "testMethodList"), getEditorContext()); return provider.createCell(); } private static class testMethodListSingleRoleHandler_lq4ak4_g1g0 extends SingleRoleCellProvider { @NotNull private SNode myNode; public testMethodListSingleRoleHandler_lq4ak4_g1g0(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(0xf61473f9130f42f6L, 0xb98d6c438812c2f6L, 0x110dc94e923L, 0x110dc94e924L, "testMethodList"), child)); editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0xf61473f9130f42f6L, 0xb98d6c438812c2f6L, 0x110dc94e923L, 0x110dc94e924L, "testMethodList"), 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(0xf61473f9130f42f6L, 0xb98d6c438812c2f6L, 0x110dc94e923L, 0x110dc94e924L, "testMethodList"), child)); } if (editorCell.getRole() == null) { editorCell.setRole("testMethodList"); } Style style = new StyleImpl(); style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true); editorCell.getStyle().putAll(style); } @Override protected EditorCell createEmptyCell() { getCellFactory().pushCellContext(); getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(getNode(), MetaAdapterFactory.getContainmentLink(0xf61473f9130f42f6L, 0xb98d6c438812c2f6L, 0x110dc94e923L, 0x110dc94e924L, "testMethodList"))); try { EditorCell editorCell = super.createEmptyCell(); editorCell.setCellId("empty_testMethodList"); installCellInfo(null, editorCell); setCellContext(editorCell); return editorCell; } finally { getCellFactory().popCellContext(); } } protected String getNoTargetText() { return "<no testMethodList>"; } } private EditorCell createRefNodeList_lq4ak4_h1g0() { AbstractCellListHandler handler = new BTestCase_EditorBuilder_a.staticFieldListHandler_lq4ak4_h1g0(myNode, "staticField", getEditorContext()); EditorCell_Collection editorCell = handler.createCells(new CellLayout_Indent(), false); editorCell.setCellId("refNodeList_staticField"); Style style = new StyleImpl(); style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true); editorCell.getStyle().putAll(style); editorCell.setRole(handler.getElementRole()); return editorCell; } private static class staticFieldListHandler_lq4ak4_h1g0 extends RefNodeListHandler { @NotNull private SNode myNode; public staticFieldListHandler_lq4ak4_h1g0(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(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93c84351fL, "jetbrains.mps.baseLanguage.structure.StaticFieldDeclaration"), 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(staticFieldListHandler_lq4ak4_h1g0.this.getNode(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101d9d3ca30L, 0x106c32c4395L, "staticField"))); try { EditorCell emptyCell = null; emptyCell = createConstant_lq4ak4_a7b6a(); 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(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101d9d3ca30L, 0x106c32c4395L, "staticField"), elementNode)); } } } private EditorCell createConstant_lq4ak4_a7b6a() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "<<static fields>>"); editorCell.setCellId("Constant_lq4ak4_a7b6a"); Style style = new StyleImpl(); style.set(StyleAttributes.EDITABLE, false); style.set(StyleAttributes.TEXT_COLOR, StyleRegistry.getInstance().getSimpleColor(MPSColors.gray)); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } } private EditorCell createRefNodeList_lq4ak4_i1g0() { AbstractCellListHandler handler = new BTestCase_EditorBuilder_a.fieldListHandler_lq4ak4_i1g0(myNode, "field", getEditorContext()); EditorCell_Collection editorCell = handler.createCells(new CellLayout_Indent(), false); editorCell.setCellId("refNodeList_field"); Style style = new StyleImpl(); style.set(StyleAttributes.SELECTABLE, false); style.set(StyleAttributes.POSITION_CHILDREN, "indented"); style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true); style.set(StyleAttributes.INDENT_LAYOUT_CHILDREN_NEWLINE, true); editorCell.getStyle().putAll(style); editorCell.setRole(handler.getElementRole()); return editorCell; } private static class fieldListHandler_lq4ak4_i1g0 extends RefNodeListHandler { @NotNull private SNode myNode; public fieldListHandler_lq4ak4_i1g0(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(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c108ca68L, "jetbrains.mps.baseLanguage.structure.FieldDeclaration"), 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(fieldListHandler_lq4ak4_i1g0.this.getNode(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c108ca66L, 0xf8c108ca67L, "field"))); try { EditorCell emptyCell = null; emptyCell = createConstant_lq4ak4_a8b6a(); 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(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c108ca66L, 0xf8c108ca67L, "field"), elementNode)); } } } private EditorCell createConstant_lq4ak4_a8b6a() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ""); editorCell.setCellId("Constant_lq4ak4_a8b6a"); Style style = new StyleImpl(); style.set(StyleAttributes.EDITABLE, true); editorCell.getStyle().putAll(style); editorCell.setDefaultText("<<fields>>"); return editorCell; } } private EditorCell createRefNodeList_lq4ak4_j1g0() { AbstractCellListHandler handler = new BTestCase_EditorBuilder_a.methodListHandler_lq4ak4_j1g0(myNode, "method", getEditorContext()); EditorCell_Collection editorCell = handler.createCells(new CellLayout_Indent(), false); editorCell.setCellId("refNodeList_method"); Style style = new StyleImpl(); style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true); editorCell.getStyle().putAll(style); editorCell.setRole(handler.getElementRole()); return editorCell; } private static class methodListHandler_lq4ak4_j1g0 extends RefNodeListHandler { @NotNull private SNode myNode; public methodListHandler_lq4ak4_j1g0(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(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b21dL, "jetbrains.mps.baseLanguage.structure.InstanceMethodDeclaration"), 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(methodListHandler_lq4ak4_j1g0.this.getNode(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101d9d3ca30L, 0x101f2cc410bL, "method"))); try { EditorCell emptyCell = null; emptyCell = createConstant_lq4ak4_a9b6a(); 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(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101d9d3ca30L, 0x101f2cc410bL, "method"), elementNode)); } } } private EditorCell createConstant_lq4ak4_a9b6a() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "<<methods>>"); editorCell.setCellId("Constant_lq4ak4_a9b6a"); Style style = new StyleImpl(); style.set(StyleAttributes.EDITABLE, false); style.set(StyleAttributes.TEXT_COLOR, StyleRegistry.getInstance().getSimpleColor(MPSColors.gray)); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } } private EditorCell createConstant_lq4ak4_c6a() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "}"); editorCell.setCellId("Constant_lq4ak4_c6a"); Style style = new StyleImpl(); new RightBraceStyleClass(getEditorContext(), getNode()).apply(style, editorCell); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createComponent_lq4ak4_a6a() { EditorCell editorCell = getCellFactory().createEditorComponentCell(myNode, "jetbrains.mps.baseLanguage.editor.GenericDeclaration_FoldedCodeBlock_Component"); return editorCell; } }