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_Horizontal; 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 CopySrcNodeMacro_EditorBuilder_a extends AbstractEditorBuilder { @NotNull private SNode myNode; public CopySrcNodeMacro_EditorBuilder_a(@NotNull EditorContext context, @NotNull SNode node) { super(context); myNode = node; } @NotNull @Override public SNode getNode() { return myNode; } /*package*/ EditorCell createCell() { return createCollection_jiideg_a(); } private EditorCell createCollection_jiideg_a() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal()); editorCell.setCellId("Collection_jiideg_a"); editorCell.setBig(true); editorCell.setCellContext(getCellFactory().getCellContext()); editorCell.addEditorCell(createConstant_jiideg_a0()); editorCell.addEditorCell(createComponent_jiideg_b0()); return editorCell; } private EditorCell createConstant_jiideg_a0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "$COPY_SRC$"); editorCell.setCellId("Constant_jiideg_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 CopySrcNodeMacro_EditorBuilder_a.CopySrcNodeMacro_component_cellMenu_jiideg_a0a0(), new SChildSubstituteInfoPartEx(editorCell)})); return editorCell; } public static class CopySrcNodeMacro_component_cellMenu_jiideg_a0a0 implements SubstituteInfoPartExt { private replace_node_macro myComponent; public CopySrcNodeMacro_component_cellMenu_jiideg_a0a0() { this.myComponent = new replace_node_macro(); } public List<SubstituteAction> createActions(CellContext cellContext, EditorContext editorContext) { return this.myComponent.createSubstituteActions(cellContext, editorContext); } } private EditorCell createComponent_jiideg_b0() { EditorCell editorCell = getCellFactory().createEditorComponentCell(myNode, "jetbrains.mps.lang.generator.editor.NodeMacro_postfix"); return editorCell; } }