package jetbrains.mps.lang.test.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_Vertical; import jetbrains.mps.nodeEditor.cellLayout.CellLayout_Horizontal; import jetbrains.mps.nodeEditor.cells.EditorCell_Constant; import jetbrains.mps.nodeEditor.cells.ModelAccessor; import jetbrains.mps.baseLanguage.unitTest.behavior.ITestCase__BehaviorDescriptor; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; import jetbrains.mps.nodeEditor.cells.EditorCell_Property; import jetbrains.mps.openapi.editor.cells.CellActionType; import jetbrains.mps.editor.runtime.cells.EmptyCellAction; 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.lang.test.behavior.NodesTestCase__BehaviorDescriptor; /*package*/ class NodesTestCase_InspectorBuilder_a extends AbstractEditorBuilder { @NotNull private SNode myNode; public NodesTestCase_InspectorBuilder_a(@NotNull EditorContext context, @NotNull SNode node) { super(context); myNode = node; } @NotNull @Override public SNode getNode() { return myNode; } /*package*/ EditorCell createCell() { return createCollection_58c6e4_a_0(); } private EditorCell createCollection_58c6e4_a_0() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Vertical()); editorCell.setCellId("Collection_58c6e4_a_0"); editorCell.setBig(true); editorCell.setCellContext(getCellFactory().getCellContext()); editorCell.addEditorCell(createCollection_58c6e4_a0_0()); editorCell.addEditorCell(createCollection_58c6e4_b0()); return editorCell; } private EditorCell createCollection_58c6e4_a0_0() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal()); editorCell.setCellId("Collection_58c6e4_a0_0"); editorCell.addEditorCell(createConstant_58c6e4_a0a_0()); editorCell.addEditorCell(createModelAccess_58c6e4_b0a()); return editorCell; } private EditorCell createConstant_58c6e4_a0a_0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "Can execute-in-process:"); editorCell.setCellId("Constant_58c6e4_a0a_0"); editorCell.setDefaultText(""); return editorCell; } private EditorCell createModelAccess_58c6e4_b0a() { ModelAccessor modelAccessor = new ModelAccessor() { public String getText() { return (boolean) ITestCase__BehaviorDescriptor.canRunInProcess_id5_jSk8paieB.invoke(myNode) + ""; } public void setText(String text) { if (text.equals("true")) { SPropertyOperations.set(myNode, MetaAdapterFactory.getProperty(0xf61473f9130f42f6L, 0xb98d6c438812c2f6L, 0x11b2709bd56L, 0x59337dc8dffe0d9dL, "canNotRunInProcess"), "" + (false)); } else if (text.equals("false")) { SPropertyOperations.set(myNode, MetaAdapterFactory.getProperty(0xf61473f9130f42f6L, 0xb98d6c438812c2f6L, 0x11b2709bd56L, 0x59337dc8dffe0d9dL, "canNotRunInProcess"), "" + (true)); } } public boolean isValidText(String text) { return text.equals("true") || text.equals("false"); } }; EditorCell_Property editorCell = EditorCell_Property.create(getEditorContext(), modelAccessor, myNode); editorCell.setAction(CellActionType.DELETE, EmptyCellAction.getInstance()); editorCell.setAction(CellActionType.BACKSPACE, EmptyCellAction.getInstance()); editorCell.setCellId("ModelAccess_58c6e4_b0a"); editorCell.setDefaultText(" "); editorCell.setSubstituteInfo(new CompositeSubstituteInfo(getEditorContext(), new BasicCellContext(myNode), new SubstituteInfoPartExt[]{new NodesTestCase_InspectorBuilder_a.NodesTestCase_generic_cellMenu_58c6e4_a0b0a(), new NodesTestCase_InspectorBuilder_a.NodesTestCase_generic_cellMenu_58c6e4_b0b0a(), new SChildSubstituteInfoPartEx(editorCell)})); return editorCell; } public static class NodesTestCase_generic_cellMenu_58c6e4_a0b0a extends AbstractCellMenuPart_Generic_Item { public NodesTestCase_generic_cellMenu_58c6e4_a0b0a() { } public void handleAction(SNode node, SModel model, IOperationContext operationContext, EditorContext editorContext) { SPropertyOperations.set(node, MetaAdapterFactory.getProperty(0xf61473f9130f42f6L, 0xb98d6c438812c2f6L, 0x11b2709bd56L, 0x59337dc8dffe0d9dL, "canNotRunInProcess"), "" + (true)); } public String getMatchingText() { return "false"; } } public static class NodesTestCase_generic_cellMenu_58c6e4_b0b0a extends AbstractCellMenuPart_Generic_Item { public NodesTestCase_generic_cellMenu_58c6e4_b0b0a() { } public void handleAction(SNode node, SModel model, IOperationContext operationContext, EditorContext editorContext) { SPropertyOperations.set(node, MetaAdapterFactory.getProperty(0xf61473f9130f42f6L, 0xb98d6c438812c2f6L, 0x11b2709bd56L, 0x59337dc8dffe0d9dL, "canNotRunInProcess"), "" + (false)); } public String getMatchingText() { return "true"; } } private EditorCell createCollection_58c6e4_b0() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal()); editorCell.setCellId("Collection_58c6e4_b0"); editorCell.addEditorCell(createConstant_58c6e4_a1a()); editorCell.addEditorCell(createModelAccess_58c6e4_b1a()); return editorCell; } private EditorCell createConstant_58c6e4_a1a() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "Needs write action to run:"); editorCell.setCellId("Constant_58c6e4_a1a"); editorCell.setDefaultText(""); return editorCell; } private EditorCell createModelAccess_58c6e4_b1a() { ModelAccessor modelAccessor = new ModelAccessor() { public String getText() { return (boolean) NodesTestCase__BehaviorDescriptor.needsWriteAction_id5vTxdEzuQjU.invoke(myNode) + ""; } public void setText(String text) { if (text.equals("true")) { SPropertyOperations.set(myNode, MetaAdapterFactory.getProperty(0x8585453e6bfb4d80L, 0x98deb16074f1d86cL, 0x11b55b49e46L, 0x57f984daa37add4aL, "needsNoWriteAction"), "" + (false)); } else if (text.equals("false")) { SPropertyOperations.set(myNode, MetaAdapterFactory.getProperty(0x8585453e6bfb4d80L, 0x98deb16074f1d86cL, 0x11b55b49e46L, 0x57f984daa37add4aL, "needsNoWriteAction"), "" + (true)); } } public boolean isValidText(String text) { return text.equals("true") || text.equals("false"); } }; EditorCell_Property editorCell = EditorCell_Property.create(getEditorContext(), modelAccessor, myNode); editorCell.setAction(CellActionType.DELETE, EmptyCellAction.getInstance()); editorCell.setAction(CellActionType.BACKSPACE, EmptyCellAction.getInstance()); editorCell.setCellId("ModelAccess_58c6e4_b1a"); editorCell.setDefaultText(" "); editorCell.setSubstituteInfo(new CompositeSubstituteInfo(getEditorContext(), new BasicCellContext(myNode), new SubstituteInfoPartExt[]{new NodesTestCase_InspectorBuilder_a.NodesTestCase_generic_cellMenu_58c6e4_a0b1a(), new NodesTestCase_InspectorBuilder_a.NodesTestCase_generic_cellMenu_58c6e4_b0b1a(), new SChildSubstituteInfoPartEx(editorCell)})); return editorCell; } public static class NodesTestCase_generic_cellMenu_58c6e4_a0b1a extends AbstractCellMenuPart_Generic_Item { public NodesTestCase_generic_cellMenu_58c6e4_a0b1a() { } public void handleAction(SNode node, SModel model, IOperationContext operationContext, EditorContext editorContext) { SPropertyOperations.set(node, MetaAdapterFactory.getProperty(0x8585453e6bfb4d80L, 0x98deb16074f1d86cL, 0x11b55b49e46L, 0x57f984daa37add4aL, "needsNoWriteAction"), "" + (true)); } public String getMatchingText() { return "false"; } } public static class NodesTestCase_generic_cellMenu_58c6e4_b0b1a extends AbstractCellMenuPart_Generic_Item { public NodesTestCase_generic_cellMenu_58c6e4_b0b1a() { } public void handleAction(SNode node, SModel model, IOperationContext operationContext, EditorContext editorContext) { SPropertyOperations.set(node, MetaAdapterFactory.getProperty(0x8585453e6bfb4d80L, 0x98deb16074f1d86cL, 0x11b55b49e46L, 0x57f984daa37add4aL, "needsNoWriteAction"), "" + (false)); } public String getMatchingText() { return "true"; } } }