package jetbrains.mps.lang.generator.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.nodeEditor.cells.EditorCell_Constant; import jetbrains.mps.openapi.editor.style.Style; import jetbrains.mps.editor.runtime.style.StyleImpl; import jetbrains.mps.lang.generator.editor.Styles_StyleSheet.macroStartStyleClass; import jetbrains.mps.editor.runtime.style.StyleAttributes; import jetbrains.mps.editor.runtime.style.FocusPolicy; import jetbrains.mps.nodeEditor.cellMenu.CompositeSubstituteInfo; import jetbrains.mps.nodeEditor.cellMenu.BasicCellContext; import jetbrains.mps.nodeEditor.cellMenu.SubstituteInfoPartExt; import jetbrains.mps.nodeEditor.cellMenu.SChildSubstituteInfoPartEx; import java.util.List; import jetbrains.mps.openapi.editor.cells.SubstituteAction; import jetbrains.mps.nodeEditor.cellMenu.CellContext; /*package*/ class WeaveMacro_EditorBuilder_a extends AbstractEditorBuilder { @NotNull private SNode myNode; public WeaveMacro_EditorBuilder_a(@NotNull EditorContext context, @NotNull SNode node) { super(context); myNode = node; } @NotNull @Override public SNode getNode() { return myNode; } /*package*/ EditorCell createCell() { return createCollection_1n0h5d_a(); } private EditorCell createCollection_1n0h5d_a() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent()); editorCell.setCellId("Collection_1n0h5d_a"); editorCell.setBig(true); editorCell.setCellContext(getCellFactory().getCellContext()); editorCell.addEditorCell(createConstant_1n0h5d_a0()); editorCell.addEditorCell(createComponent_1n0h5d_b0()); return editorCell; } private EditorCell createConstant_1n0h5d_a0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "$WEAVE$"); editorCell.setCellId("Constant_1n0h5d_a0"); Style style = new StyleImpl(); new macroStartStyleClass(getEditorContext(), getNode()).apply(style, editorCell); editorCell.getStyle().putAll(style); if (true) { editorCell.getStyle().set(StyleAttributes.FOCUS_POLICY, FocusPolicy.ATTRACTS_FOCUS); } MacroSymbol_Actions.setCellActions(editorCell, myNode, getEditorContext()); editorCell.setDefaultText(""); editorCell.setSubstituteInfo(new CompositeSubstituteInfo(getEditorContext(), new BasicCellContext(myNode), new SubstituteInfoPartExt[]{new WeaveMacro_EditorBuilder_a.WeaveMacro_component_cellMenu_1n0h5d_a0a0(), new SChildSubstituteInfoPartEx(editorCell)})); return editorCell; } public static class WeaveMacro_component_cellMenu_1n0h5d_a0a0 implements SubstituteInfoPartExt { private replace_node_macro myComponent; public WeaveMacro_component_cellMenu_1n0h5d_a0a0() { this.myComponent = new replace_node_macro(); } public List<SubstituteAction> createActions(CellContext cellContext, EditorContext editorContext) { return this.myComponent.createSubstituteActions(cellContext, editorContext); } } private EditorCell createComponent_1n0h5d_b0() { EditorCell editorCell = getCellFactory().createEditorComponentCell(myNode, "jetbrains.mps.lang.generator.editor.NodeMacro_postfix"); Style style = new StyleImpl(); style.set(StyleAttributes.INDENT_LAYOUT_NO_WRAP, true); editorCell.getStyle().putAll(style); return editorCell; } }