package jetbrains.mps.lang.editor.test.generation.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.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.editor.runtime.style.FocusPolicy; import jetbrains.mps.lang.editor.menus.transformation.NamedTransformationMenuLookup; import jetbrains.mps.smodel.language.LanguageRegistry; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; 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 jetbrains.mps.lang.editor.generator.internal.AbstractCellMenuPart_Generic_Group; import java.util.List; import jetbrains.mps.smodel.IOperationContext; import org.jetbrains.mps.openapi.model.SModel; import jetbrains.mps.lang.editor.generator.internal.AbstractCellMenuPart_ReplaceNode_Group; import jetbrains.mps.lang.editor.generator.internal.AbstractCellMenuPart_ApplySideTransforms; import jetbrains.mps.nodeEditor.CellSide; import jetbrains.mps.openapi.editor.cells.SubstituteAction; import jetbrains.mps.nodeEditor.cellMenu.CellContext; import jetbrains.mps.lang.editor.generator.internal.AbstractCellMenuPart_Generic_Item; import jetbrains.mps.lang.editor.generator.internal.AbstractCellMenuPart_ReplaceNode_CustomNodeConcept; import org.jetbrains.mps.openapi.language.SAbstractConcept; /*package*/ class Constant_EditorCellModel_ComponentBuilder_a extends AbstractEditorBuilder { @NotNull private SNode myNode; public Constant_EditorCellModel_ComponentBuilder_a(@NotNull EditorContext context, @NotNull SNode node) { super(context); myNode = node; } @NotNull @Override public SNode getNode() { return myNode; } /*package*/ EditorCell createCell() { return createCollection_512sof_a(); } private EditorCell createCollection_512sof_a() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal()); editorCell.setCellId("Collection_512sof_a"); Style style = new StyleImpl(); style.set(StyleAttributes.SELECTABLE, false); editorCell.getStyle().putAll(style); if (nodeCondition_512sof_a0a()) { editorCell.addEditorCell(createConstant_512sof_a0()); } return editorCell; } private boolean nodeCondition_512sof_a0a() { return getEditorContext() != null && myNode != null; } private EditorCell createConstant_512sof_a0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "AllOptions"); editorCell.setCellId("custom_cell_id"); if (nodeCondition_512sof_a0a_0()) { editorCell.getStyle().set(StyleAttributes.FOCUS_POLICY, FocusPolicy.ATTRACTS_FOCUS); } TestTargetActionMap.setCellActions(editorCell, myNode, getEditorContext()); editorCell.addKeyMap(new TestTargetKeymap()); editorCell.setTransformationMenuLookup(new NamedTransformationMenuLookup(LanguageRegistry.getInstance(getEditorContext().getRepository()), MetaAdapterFactory.getConcept(0xeaa98d49af584b80L, 0xb585c05e7b5fd335L, 0xbde89531a681a1L, "jetbrains.mps.lang.editor.test.generation.structure.AbstractCellTest"), "jetbrains.mps.lang.editor.test.generation.editor.TestTargetTransformationMenu")); editorCell.setDefaultText(""); editorCell.setSubstituteInfo(new CompositeSubstituteInfo(getEditorContext(), new BasicCellContext(myNode), new SubstituteInfoPartExt[]{new Constant_EditorCellModel_ComponentBuilder_a.Constant_generic_cellMenu_512sof_a0a0(), new Constant_EditorCellModel_ComponentBuilder_a.Constant_generic_cellMenu_512sof_b0a0(), new Constant_EditorCellModel_ComponentBuilder_a.Constant_customReplace_cellMenu_512sof_c0a0(), new Constant_EditorCellModel_ComponentBuilder_a.Constant_customReplace_cellMenu_512sof_d0a0(), new Constant_EditorCellModel_ComponentBuilder_a.ApplySideTransforms_left_cellMenu_512sof_e0a0(), new Constant_EditorCellModel_ComponentBuilder_a.Constant_component_cellMenu_512sof_f0a0(), new Constant_EditorCellModel_ComponentBuilder_a.Constant_generic_cellMenu_512sof_g0a0(), new Constant_EditorCellModel_ComponentBuilder_a.ReplaceWith_Constant_cellMenu_512sof_h0a0(), new SChildSubstituteInfoPartEx(editorCell)})); return editorCell; } private boolean nodeCondition_512sof_a0a_0() { return getEditorContext() != null && myNode != null; } public static class Constant_generic_cellMenu_512sof_a0a0 extends AbstractCellMenuPart_Generic_Group { public Constant_generic_cellMenu_512sof_a0a0() { } public List<?> createParameterObjects(SNode node, IOperationContext operationContext, EditorContext editorContext) { boolean var = operationContext != null || node != null || editorContext != null; return (var ? null : null); } protected void handleAction(Object parameterObject, SNode node, SModel model, IOperationContext operationContext, EditorContext editorContext) { this.handleAction_impl((String) parameterObject, node, model, operationContext, editorContext); } public void handleAction_impl(String parameterObject, SNode node, SModel model, IOperationContext operationContext, EditorContext editorContext) { boolean var = parameterObject != null || node != null || model != null || editorContext != null || operationContext != null; if (var) { // just usage of var } } public boolean isReferentPresentation() { return false; } } public static class Constant_generic_cellMenu_512sof_b0a0 extends AbstractCellMenuPart_Generic_Group { public Constant_generic_cellMenu_512sof_b0a0() { } public List<?> createParameterObjects(SNode node, IOperationContext operationContext, EditorContext editorContext) { return null; } protected void handleAction(Object parameterObject, SNode node, SModel model, IOperationContext operationContext, EditorContext editorContext) { this.handleAction_impl((String) parameterObject, node, model, operationContext, editorContext); } public void handleAction_impl(String parameterObject, SNode node, SModel model, IOperationContext operationContext, EditorContext editorContext) { } public boolean isReferentPresentation() { return false; } public String getMatchingText(Object parameterObject) { return this.getMatchingText_internal((String) parameterObject); } public String getMatchingText_internal(String parameterObject) { return String.valueOf(parameterObject); } public String getDescriptionText(Object parameterObject) { return this.getDescriptionText_internal((String) parameterObject); } public String getDescriptionText_internal(String parameterObject) { return String.valueOf(parameterObject); } } public static class Constant_customReplace_cellMenu_512sof_c0a0 extends AbstractCellMenuPart_ReplaceNode_Group { public Constant_customReplace_cellMenu_512sof_c0a0() { } public List<?> createParameterObjects(SNode node, IOperationContext operationContext, EditorContext editorContext) { boolean var = operationContext != null || node != null || editorContext != null; return (var ? null : null); } public SNode createReplacementNode(Object parameterObject, SNode node, SModel model, IOperationContext operationContext, EditorContext editorContext) { return createReplacementNode_impl((String) parameterObject, node, model, operationContext, editorContext); } public SNode createReplacementNode_impl(String parameterObject, SNode node, SModel model, IOperationContext operationContext, EditorContext editorContext) { boolean var = parameterObject != null || node != null || model != null || editorContext != null || operationContext != null; return (var ? null : null); } public boolean isReferentPresentation() { return false; } } public static class Constant_customReplace_cellMenu_512sof_d0a0 extends AbstractCellMenuPart_ReplaceNode_Group { public Constant_customReplace_cellMenu_512sof_d0a0() { } public List<?> createParameterObjects(SNode node, IOperationContext operationContext, EditorContext editorContext) { return null; } public SNode createReplacementNode(Object parameterObject, SNode node, SModel model, IOperationContext operationContext, EditorContext editorContext) { return createReplacementNode_impl((String) parameterObject, node, model, operationContext, editorContext); } public SNode createReplacementNode_impl(String parameterObject, SNode node, SModel model, IOperationContext operationContext, EditorContext editorContext) { return null; } public boolean isReferentPresentation() { return false; } public String getMatchingText(Object parameterObject) { return this.getMatchingText_internal((String) parameterObject); } public String getMatchingText_internal(String parameterObject) { return String.valueOf(parameterObject); } public String getDescriptionText(Object parameterObject) { return this.getDescriptionText_internal((String) parameterObject); } public String getDescriptionText_internal(String parameterObject) { return String.valueOf(parameterObject); } } public static class ApplySideTransforms_left_cellMenu_512sof_e0a0 extends AbstractCellMenuPart_ApplySideTransforms { public ApplySideTransforms_left_cellMenu_512sof_e0a0() { super(CellSide.LEFT, "ext_1_RTransform"); } } public static class Constant_component_cellMenu_512sof_f0a0 implements SubstituteInfoPartExt { private TestTargetMenuComponent myComponent; public Constant_component_cellMenu_512sof_f0a0() { this.myComponent = new TestTargetMenuComponent(); } public List<SubstituteAction> createActions(CellContext cellContext, EditorContext editorContext) { return this.myComponent.createSubstituteActions(cellContext, editorContext); } } public static class Constant_generic_cellMenu_512sof_g0a0 extends AbstractCellMenuPart_Generic_Item { public Constant_generic_cellMenu_512sof_g0a0() { } public void handleAction(SNode node, SModel model, IOperationContext operationContext, EditorContext editorContext) { boolean var = node != null || model != null || editorContext != null || operationContext != null; if (var) { // just usage of var } } public String getMatchingText() { return "matchingText"; } } public static class ReplaceWith_Constant_cellMenu_512sof_h0a0 extends AbstractCellMenuPart_ReplaceNode_CustomNodeConcept { public ReplaceWith_Constant_cellMenu_512sof_h0a0() { } public SAbstractConcept getReplacementConcept() { return MetaAdapterFactory.getConcept(0xeaa98d49af584b80L, 0xb585c05e7b5fd335L, 0xbde8953186ee02L, "jetbrains.mps.lang.editor.test.generation.structure.Constant"); } } }