package jetbrains.mps.lang.editor.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.internal.collections.runtime.Sequence; import jetbrains.mps.lang.smodel.generator.smodelAdapter.AttributeOperations; 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.editor.runtime.style.StyleAttributes; import jetbrains.mps.nodeEditor.MPSFonts; 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; /*package*/ class SelectInEditorOperation_EditorBuilder_a extends AbstractEditorBuilder { @NotNull private SNode myNode; public SelectInEditorOperation_EditorBuilder_a(@NotNull EditorContext context, @NotNull SNode node) { super(context); myNode = node; } @NotNull @Override public SNode getNode() { return myNode; } /*package*/ EditorCell createCell() { return createCollection_gmlwwp_a(); } private EditorCell createCollection_gmlwwp_a() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent()); editorCell.setCellId("Collection_gmlwwp_a"); editorCell.setBig(true); editorCell.setCellContext(getCellFactory().getCellContext()); editorCell.addEditorCell(createConstant_gmlwwp_a0()); editorCell.addEditorCell(createConstant_gmlwwp_b0()); editorCell.addEditorCell(createConstant_gmlwwp_c0()); editorCell.addEditorCell(createRefNode_gmlwwp_d0()); if (nodeCondition_gmlwwp_a4a()) { editorCell.addEditorCell(createCollection_gmlwwp_e0()); } editorCell.addEditorCell(createConstant_gmlwwp_f0()); return editorCell; } private boolean nodeCondition_gmlwwp_a4a() { return Sequence.fromIterable(AttributeOperations.getChildNodesAndAttributes(myNode, MetaAdapterFactory.getContainmentLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x329d4406465c63a0L, 0x1b0a9b8c0eb90bdeL, "cellSelector"))).isNotEmpty(); } private EditorCell createConstant_gmlwwp_a0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "select"); editorCell.setCellId("Constant_gmlwwp_a0"); Style style = new StyleImpl(); style.set(StyleAttributes.PUNCTUATION_RIGHT, true); style.set(StyleAttributes.FONT_STYLE, MPSFonts.PLAIN); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createConstant_gmlwwp_b0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "["); editorCell.setCellId("Constant_gmlwwp_b0"); Style style = new StyleImpl(); style.set(StyleAttributes.INDENT_LAYOUT_NO_WRAP, true); style.set(StyleAttributes.MATCHING_LABEL, "bracket"); style.set(StyleAttributes.FONT_STYLE, MPSFonts.PLAIN); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createConstant_gmlwwp_c0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "in:"); editorCell.setCellId("Constant_gmlwwp_c0"); Style style = new StyleImpl(); style.set(StyleAttributes.PUNCTUATION_LEFT, true); style.set(StyleAttributes.FONT_STYLE, MPSFonts.PLAIN); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createRefNode_gmlwwp_d0() { SingleRoleCellProvider provider = new SelectInEditorOperation_EditorBuilder_a.editorContextSingleRoleHandler_gmlwwp_d0(myNode, MetaAdapterFactory.getContainmentLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x329d4406465c63a0L, 0x1b0a9b8c0e947adeL, "editorContext"), getEditorContext()); return provider.createCell(); } private static class editorContextSingleRoleHandler_gmlwwp_d0 extends SingleRoleCellProvider { @NotNull private SNode myNode; public editorContextSingleRoleHandler_gmlwwp_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(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x329d4406465c63a0L, 0x1b0a9b8c0e947adeL, "editorContext"), child)); editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x329d4406465c63a0L, 0x1b0a9b8c0e947adeL, "editorContext"), 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(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x329d4406465c63a0L, 0x1b0a9b8c0e947adeL, "editorContext"), child)); } if (editorCell.getRole() == null) { editorCell.setRole("editorContext"); } Style style = new StyleImpl(); style.set(StyleAttributes.INDENT_LAYOUT_NO_WRAP, true); editorCell.getStyle().putAll(style); SelectInEditorOperation_editorContextActions.setCellActions(editorCell, getNode(), getEditorContext()); } @Override protected EditorCell createEmptyCell() { getCellFactory().pushCellContext(); getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(getNode(), MetaAdapterFactory.getContainmentLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x329d4406465c63a0L, 0x1b0a9b8c0e947adeL, "editorContext"))); try { EditorCell editorCell = super.createEmptyCell(); editorCell.setCellId("empty_editorContext"); installCellInfo(null, editorCell); setCellContext(editorCell); return editorCell; } finally { getCellFactory().popCellContext(); } } protected String getNoTargetText() { return "<no editorContext>"; } } private EditorCell createCollection_gmlwwp_e0() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent()); editorCell.setCellId("Collection_gmlwwp_e0"); Style style = new StyleImpl(); style.set(StyleAttributes.SELECTABLE, false); editorCell.getStyle().putAll(style); editorCell.addEditorCell(createConstant_gmlwwp_a4a()); editorCell.addEditorCell(createConstant_gmlwwp_b4a()); editorCell.addEditorCell(createRefNode_gmlwwp_c4a()); if (nodeCondition_gmlwwp_a3e0()) { editorCell.addEditorCell(createCollection_gmlwwp_d4a()); } return editorCell; } private boolean nodeCondition_gmlwwp_a3e0() { return Sequence.fromIterable(AttributeOperations.getChildNodesAndAttributes(myNode, MetaAdapterFactory.getContainmentLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x329d4406465c63a0L, 0x320558d6ffc96d72L, "selectionStart"))).isNotEmpty(); } private EditorCell createConstant_gmlwwp_a4a() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ","); editorCell.setCellId("Constant_gmlwwp_a4a"); Style style = new StyleImpl(); style.set(StyleAttributes.PUNCTUATION_LEFT, true); style.set(StyleAttributes.INDENT_LAYOUT_NO_WRAP, true); style.set(StyleAttributes.FONT_STYLE, MPSFonts.PLAIN); editorCell.getStyle().putAll(style); CellSelectorLabel_Actions.setCellActions(editorCell, myNode, getEditorContext()); editorCell.setDefaultText(""); return editorCell; } private EditorCell createConstant_gmlwwp_b4a() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "cell:"); editorCell.setCellId("Constant_gmlwwp_b4a"); Style style = new StyleImpl(); style.set(StyleAttributes.FONT_STYLE, MPSFonts.PLAIN); editorCell.getStyle().putAll(style); CellSelectorLabel_Actions.setCellActions(editorCell, myNode, getEditorContext()); editorCell.setDefaultText(""); return editorCell; } private EditorCell createRefNode_gmlwwp_c4a() { SingleRoleCellProvider provider = new SelectInEditorOperation_EditorBuilder_a.cellSelectorSingleRoleHandler_gmlwwp_c4a(myNode, MetaAdapterFactory.getContainmentLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x329d4406465c63a0L, 0x1b0a9b8c0eb90bdeL, "cellSelector"), getEditorContext()); return provider.createCell(); } private static class cellSelectorSingleRoleHandler_gmlwwp_c4a extends SingleRoleCellProvider { @NotNull private SNode myNode; public cellSelectorSingleRoleHandler_gmlwwp_c4a(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(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x329d4406465c63a0L, 0x1b0a9b8c0eb90bdeL, "cellSelector"), child)); editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x329d4406465c63a0L, 0x1b0a9b8c0eb90bdeL, "cellSelector"), 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(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x329d4406465c63a0L, 0x1b0a9b8c0eb90bdeL, "cellSelector"), child)); } if (editorCell.getRole() == null) { editorCell.setRole("cellSelector"); } CellSelectorReference_Actions.setCellActions(editorCell, getNode(), getEditorContext()); } @Override protected EditorCell createEmptyCell() { getCellFactory().pushCellContext(); getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(getNode(), MetaAdapterFactory.getContainmentLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x329d4406465c63a0L, 0x1b0a9b8c0eb90bdeL, "cellSelector"))); try { EditorCell editorCell = super.createEmptyCell(); editorCell.setCellId("empty_cellSelector"); installCellInfo(null, editorCell); setCellContext(editorCell); return editorCell; } finally { getCellFactory().popCellContext(); } } protected String getNoTargetText() { return "<no cellSelector>"; } } private EditorCell createCollection_gmlwwp_d4a() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent()); editorCell.setCellId("Collection_gmlwwp_d4a"); Style style = new StyleImpl(); style.set(StyleAttributes.SELECTABLE, false); editorCell.getStyle().putAll(style); editorCell.addEditorCell(createConstant_gmlwwp_a3e0()); editorCell.addEditorCell(createConstant_gmlwwp_b3e0()); editorCell.addEditorCell(createRefNode_gmlwwp_c3e0()); if (nodeCondition_gmlwwp_a3d4a()) { editorCell.addEditorCell(createCollection_gmlwwp_d3e0()); } return editorCell; } private boolean nodeCondition_gmlwwp_a3d4a() { return Sequence.fromIterable(AttributeOperations.getChildNodesAndAttributes(myNode, MetaAdapterFactory.getContainmentLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x329d4406465c63a0L, 0x257f272033b0db88L, "selectionEnd"))).isNotEmpty(); } private EditorCell createConstant_gmlwwp_a3e0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ","); editorCell.setCellId("Constant_gmlwwp_a3e0"); Style style = new StyleImpl(); style.set(StyleAttributes.PUNCTUATION_LEFT, true); style.set(StyleAttributes.INDENT_LAYOUT_NO_WRAP, true); style.set(StyleAttributes.FONT_STYLE, MPSFonts.PLAIN); editorCell.getStyle().putAll(style); SelectionStartSelectorLabel_Actions.setCellActions(editorCell, myNode, getEditorContext()); editorCell.setDefaultText(""); return editorCell; } private EditorCell createConstant_gmlwwp_b3e0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "selectionStart:"); editorCell.setCellId("Constant_gmlwwp_b3e0"); Style style = new StyleImpl(); style.set(StyleAttributes.FONT_STYLE, MPSFonts.PLAIN); editorCell.getStyle().putAll(style); SelectionStartSelectorLabel_Actions.setCellActions(editorCell, myNode, getEditorContext()); editorCell.setDefaultText(""); return editorCell; } private EditorCell createRefNode_gmlwwp_c3e0() { SingleRoleCellProvider provider = new SelectInEditorOperation_EditorBuilder_a.selectionStartSingleRoleHandler_gmlwwp_c3e0(myNode, MetaAdapterFactory.getContainmentLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x329d4406465c63a0L, 0x320558d6ffc96d72L, "selectionStart"), getEditorContext()); return provider.createCell(); } private static class selectionStartSingleRoleHandler_gmlwwp_c3e0 extends SingleRoleCellProvider { @NotNull private SNode myNode; public selectionStartSingleRoleHandler_gmlwwp_c3e0(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(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x329d4406465c63a0L, 0x320558d6ffc96d72L, "selectionStart"), child)); editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x329d4406465c63a0L, 0x320558d6ffc96d72L, "selectionStart"), 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(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x329d4406465c63a0L, 0x320558d6ffc96d72L, "selectionStart"), child)); } if (editorCell.getRole() == null) { editorCell.setRole("selectionStart"); } Style style = new StyleImpl(); style.set(StyleAttributes.AUTO_DELETABLE, false); editorCell.getStyle().putAll(style); SelectInEditorOperation_selectionStartActions.setCellActions(editorCell, getNode(), getEditorContext()); } @Override protected EditorCell createEmptyCell() { getCellFactory().pushCellContext(); getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(getNode(), MetaAdapterFactory.getContainmentLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x329d4406465c63a0L, 0x320558d6ffc96d72L, "selectionStart"))); try { EditorCell editorCell = super.createEmptyCell(); editorCell.setCellId("empty_selectionStart"); installCellInfo(null, editorCell); setCellContext(editorCell); return editorCell; } finally { getCellFactory().popCellContext(); } } protected String getNoTargetText() { return "<no selectionStart>"; } } private EditorCell createCollection_gmlwwp_d3e0() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent()); editorCell.setCellId("Collection_gmlwwp_d3e0"); Style style = new StyleImpl(); style.set(StyleAttributes.SELECTABLE, false); editorCell.getStyle().putAll(style); editorCell.addEditorCell(createConstant_gmlwwp_a3d4a()); editorCell.addEditorCell(createConstant_gmlwwp_b3d4a()); editorCell.addEditorCell(createRefNode_gmlwwp_c3d4a()); return editorCell; } private EditorCell createConstant_gmlwwp_a3d4a() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ","); editorCell.setCellId("Constant_gmlwwp_a3d4a"); Style style = new StyleImpl(); style.set(StyleAttributes.PUNCTUATION_LEFT, true); style.set(StyleAttributes.INDENT_LAYOUT_NO_WRAP, true); style.set(StyleAttributes.FONT_STYLE, MPSFonts.PLAIN); editorCell.getStyle().putAll(style); SelectionEndSelectorLabel_Actions.setCellActions(editorCell, myNode, getEditorContext()); editorCell.setDefaultText(""); return editorCell; } private EditorCell createConstant_gmlwwp_b3d4a() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "selectionEnd:"); editorCell.setCellId("Constant_gmlwwp_b3d4a"); Style style = new StyleImpl(); style.set(StyleAttributes.FONT_STYLE, MPSFonts.PLAIN); editorCell.getStyle().putAll(style); SelectionEndSelectorLabel_Actions.setCellActions(editorCell, myNode, getEditorContext()); editorCell.setDefaultText(""); return editorCell; } private EditorCell createRefNode_gmlwwp_c3d4a() { SingleRoleCellProvider provider = new SelectInEditorOperation_EditorBuilder_a.selectionEndSingleRoleHandler_gmlwwp_c3d4a(myNode, MetaAdapterFactory.getContainmentLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x329d4406465c63a0L, 0x257f272033b0db88L, "selectionEnd"), getEditorContext()); return provider.createCell(); } private static class selectionEndSingleRoleHandler_gmlwwp_c3d4a extends SingleRoleCellProvider { @NotNull private SNode myNode; public selectionEndSingleRoleHandler_gmlwwp_c3d4a(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(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x329d4406465c63a0L, 0x257f272033b0db88L, "selectionEnd"), child)); editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x329d4406465c63a0L, 0x257f272033b0db88L, "selectionEnd"), 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(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x329d4406465c63a0L, 0x257f272033b0db88L, "selectionEnd"), child)); } if (editorCell.getRole() == null) { editorCell.setRole("selectionEnd"); } Style style = new StyleImpl(); style.set(StyleAttributes.AUTO_DELETABLE, false); editorCell.getStyle().putAll(style); } @Override protected EditorCell createEmptyCell() { getCellFactory().pushCellContext(); getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(getNode(), MetaAdapterFactory.getContainmentLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x329d4406465c63a0L, 0x257f272033b0db88L, "selectionEnd"))); try { EditorCell editorCell = super.createEmptyCell(); editorCell.setCellId("empty_selectionEnd"); installCellInfo(null, editorCell); setCellContext(editorCell); return editorCell; } finally { getCellFactory().popCellContext(); } } protected String getNoTargetText() { return "<no selectionEnd>"; } } private EditorCell createConstant_gmlwwp_f0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "]"); editorCell.setCellId("closingBracket"); Style style = new StyleImpl(); style.set(StyleAttributes.INDENT_LAYOUT_NO_WRAP, true); style.set(StyleAttributes.MATCHING_LABEL, "bracket"); style.set(StyleAttributes.PUNCTUATION_LEFT, true); style.set(StyleAttributes.FONT_STYLE, MPSFonts.PLAIN); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } }