package jetbrains.mps.execution.configurations.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.baseLanguage.editor.BaseLanguageStyle_StyleSheet.KeyWordStyleClass; import jetbrains.mps.editor.runtime.style.StyleAttributes; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; import jetbrains.mps.nodeEditor.cells.EditorCell_Indent; 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_Item; import org.jetbrains.mps.openapi.model.SModel; import jetbrains.mps.smodel.IOperationContext; import jetbrains.mps.openapi.editor.style.StyleRegistry; import jetbrains.mps.nodeEditor.MPSColors; /*package*/ class SimpleCanRunAndDebug_ComponentBuilder_a extends AbstractEditorBuilder { @NotNull private SNode myNode; public SimpleCanRunAndDebug_ComponentBuilder_a(@NotNull EditorContext context, @NotNull SNode node) { super(context); myNode = node; } @NotNull @Override public SNode getNode() { return myNode; } /*package*/ EditorCell createCell() { return createCollection_o92gz8_a(); } private EditorCell createCollection_o92gz8_a() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal()); editorCell.setCellId("Collection_o92gz8_a"); editorCell.addEditorCell(createConstant_o92gz8_a0()); editorCell.addEditorCell(createCollection_o92gz8_b0()); editorCell.addEditorCell(createConstant_o92gz8_c0()); editorCell.addEditorCell(createCollection_o92gz8_d0()); return editorCell; } private EditorCell createConstant_o92gz8_a0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "can:"); editorCell.setCellId("Constant_o92gz8_a0"); Style style = new StyleImpl(); new KeyWordStyleClass(getEditorContext(), getNode()).apply(style, editorCell); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createCollection_o92gz8_b0() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal()); editorCell.setCellId("Collection_o92gz8_b0"); Style style = new StyleImpl(); style.set(StyleAttributes.SELECTABLE, false); editorCell.getStyle().putAll(style); editorCell.addEditorCell(createIndentCell_o92gz8_a1a()); if (nodeCondition_o92gz8_a1b0()) { editorCell.addEditorCell(createConstant_o92gz8_b1a()); } if (nodeCondition_o92gz8_a2b0()) { editorCell.addEditorCell(createConstant_o92gz8_c1a()); } return editorCell; } private boolean nodeCondition_o92gz8_a1b0() { return SPropertyOperations.getBoolean(myNode, MetaAdapterFactory.getProperty(0x22e72e4c0f6946ceL, 0x84036750153aa615L, 0x2153d8f1c1f52479L, 0x523a1a6c9706408bL, "canRun")); } private boolean nodeCondition_o92gz8_a2b0() { return !(SPropertyOperations.getBoolean(myNode, MetaAdapterFactory.getProperty(0x22e72e4c0f6946ceL, 0x84036750153aa615L, 0x2153d8f1c1f52479L, 0x523a1a6c9706408bL, "canRun"))); } private EditorCell createIndentCell_o92gz8_a1a() { EditorCell_Indent editorCell = new EditorCell_Indent(getEditorContext(), myNode); return editorCell; } private EditorCell createConstant_o92gz8_b1a() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "run"); editorCell.setCellId("Constant_o92gz8_b1a"); Style style = new StyleImpl(); new KeyWordStyleClass(getEditorContext(), getNode()).apply(style, editorCell); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); editorCell.setSubstituteInfo(new CompositeSubstituteInfo(getEditorContext(), new BasicCellContext(myNode), new SubstituteInfoPartExt[]{new SimpleCanRunAndDebug_ComponentBuilder_a.RunConfigurationExecutor_generic_cellMenu_o92gz8_a0b1a(), new SChildSubstituteInfoPartEx(editorCell)})); return editorCell; } public static class RunConfigurationExecutor_generic_cellMenu_o92gz8_a0b1a extends AbstractCellMenuPart_Generic_Item { public RunConfigurationExecutor_generic_cellMenu_o92gz8_a0b1a() { } public void handleAction(SNode node, SModel model, IOperationContext operationContext, EditorContext editorContext) { SPropertyOperations.set(node, MetaAdapterFactory.getProperty(0x22e72e4c0f6946ceL, 0x84036750153aa615L, 0x2153d8f1c1f52479L, 0x523a1a6c9706408bL, "canRun"), "" + (false)); } public String getMatchingText() { return "can't run"; } } private EditorCell createConstant_o92gz8_c1a() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "can't run"); editorCell.setCellId("Constant_o92gz8_c1a"); Style style = new StyleImpl(); style.set(StyleAttributes.TEXT_COLOR, StyleRegistry.getInstance().getSimpleColor(MPSColors.lightGray)); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); editorCell.setSubstituteInfo(new CompositeSubstituteInfo(getEditorContext(), new BasicCellContext(myNode), new SubstituteInfoPartExt[]{new SimpleCanRunAndDebug_ComponentBuilder_a.RunConfigurationExecutor_generic_cellMenu_o92gz8_a0c1a(), new SChildSubstituteInfoPartEx(editorCell)})); return editorCell; } public static class RunConfigurationExecutor_generic_cellMenu_o92gz8_a0c1a extends AbstractCellMenuPart_Generic_Item { public RunConfigurationExecutor_generic_cellMenu_o92gz8_a0c1a() { } public void handleAction(SNode node, SModel model, IOperationContext operationContext, EditorContext editorContext) { SPropertyOperations.set(node, MetaAdapterFactory.getProperty(0x22e72e4c0f6946ceL, 0x84036750153aa615L, 0x2153d8f1c1f52479L, 0x523a1a6c9706408bL, "canRun"), "" + (true)); } public String getMatchingText() { return "run"; } } private EditorCell createConstant_o92gz8_c0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ","); editorCell.setCellId("Constant_o92gz8_c0"); editorCell.setDefaultText(""); return editorCell; } private EditorCell createCollection_o92gz8_d0() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal()); editorCell.setCellId("Collection_o92gz8_d0"); Style style = new StyleImpl(); style.set(StyleAttributes.SELECTABLE, false); editorCell.getStyle().putAll(style); if (nodeCondition_o92gz8_a0d0()) { editorCell.addEditorCell(createConstant_o92gz8_a3a()); } if (nodeCondition_o92gz8_a1d0()) { editorCell.addEditorCell(createConstant_o92gz8_b3a()); } return editorCell; } private boolean nodeCondition_o92gz8_a0d0() { return SPropertyOperations.getBoolean(myNode, MetaAdapterFactory.getProperty(0x22e72e4c0f6946ceL, 0x84036750153aa615L, 0x6c55c13f5bc8e1ecL, 0x566a06529af9d7ddL, "canDebug")); } private boolean nodeCondition_o92gz8_a1d0() { return !(SPropertyOperations.getBoolean(myNode, MetaAdapterFactory.getProperty(0x22e72e4c0f6946ceL, 0x84036750153aa615L, 0x6c55c13f5bc8e1ecL, 0x566a06529af9d7ddL, "canDebug"))); } private EditorCell createConstant_o92gz8_a3a() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "debug"); editorCell.setCellId("Constant_o92gz8_a3a"); Style style = new StyleImpl(); new KeyWordStyleClass(getEditorContext(), getNode()).apply(style, editorCell); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); editorCell.setSubstituteInfo(new CompositeSubstituteInfo(getEditorContext(), new BasicCellContext(myNode), new SubstituteInfoPartExt[]{new SimpleCanRunAndDebug_ComponentBuilder_a.RunConfigurationExecutor_generic_cellMenu_o92gz8_a0a3a(), new SChildSubstituteInfoPartEx(editorCell)})); return editorCell; } public static class RunConfigurationExecutor_generic_cellMenu_o92gz8_a0a3a extends AbstractCellMenuPart_Generic_Item { public RunConfigurationExecutor_generic_cellMenu_o92gz8_a0a3a() { } public void handleAction(SNode node, SModel model, IOperationContext operationContext, EditorContext editorContext) { SPropertyOperations.set(node, MetaAdapterFactory.getProperty(0x22e72e4c0f6946ceL, 0x84036750153aa615L, 0x6c55c13f5bc8e1ecL, 0x566a06529af9d7ddL, "canDebug"), "" + (false)); } public String getMatchingText() { return "can't debug"; } } private EditorCell createConstant_o92gz8_b3a() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "can't debug"); editorCell.setCellId("Constant_o92gz8_b3a"); Style style = new StyleImpl(); style.set(StyleAttributes.TEXT_COLOR, StyleRegistry.getInstance().getSimpleColor(MPSColors.lightGray)); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); editorCell.setSubstituteInfo(new CompositeSubstituteInfo(getEditorContext(), new BasicCellContext(myNode), new SubstituteInfoPartExt[]{new SimpleCanRunAndDebug_ComponentBuilder_a.RunConfigurationExecutor_generic_cellMenu_o92gz8_a0b3a(), new SChildSubstituteInfoPartEx(editorCell)})); return editorCell; } public static class RunConfigurationExecutor_generic_cellMenu_o92gz8_a0b3a extends AbstractCellMenuPart_Generic_Item { public RunConfigurationExecutor_generic_cellMenu_o92gz8_a0b3a() { } public void handleAction(SNode node, SModel model, IOperationContext operationContext, EditorContext editorContext) { SPropertyOperations.set(node, MetaAdapterFactory.getProperty(0x22e72e4c0f6946ceL, 0x84036750153aa615L, 0x6c55c13f5bc8e1ecL, 0x566a06529af9d7ddL, "canDebug"), "" + (true)); } public String getMatchingText() { return "debug"; } } }