package jetbrains.mps.samples.notesOrganizer.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.cellProviders.CellProviderWithRole; import jetbrains.mps.lang.editor.cellProviders.PropertyCellProvider; import jetbrains.mps.nodeEditor.EditorManager; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; import jetbrains.mps.nodeEditor.cells.EditorCell_Constant; /*package*/ class Status_EditorBuilder_a extends AbstractEditorBuilder { @NotNull private SNode myNode; public Status_EditorBuilder_a(@NotNull EditorContext context, @NotNull SNode node) { super(context); myNode = node; } @NotNull @Override public SNode getNode() { return myNode; } /*package*/ EditorCell createCell() { return createCollection_gjf57x_a(); } private EditorCell createCollection_gjf57x_a() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal()); editorCell.setCellId("Collection_gjf57x_a"); editorCell.setBig(true); editorCell.setCellContext(getCellFactory().getCellContext()); editorCell.addEditorCell(createProperty_gjf57x_a0()); editorCell.addEditorCell(createCollection_gjf57x_b0()); editorCell.addEditorCell(createComponent_gjf57x_c0()); return editorCell; } private EditorCell createProperty_gjf57x_a0() { CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext()); provider.setRole("name"); provider.setNoTargetText("<no name>"); EditorCell editorCell; editorCell = provider.createEditorCell(getEditorContext()); editorCell.setCellId("property_name"); editorCell.setSubstituteInfo(provider.createDefaultSubstituteInfo()); SNode attributeConcept = provider.getRoleAttribute(); if (attributeConcept != null) { EditorManager manager = EditorManager.getInstanceFromContext(getEditorContext()); return manager.createNodeRoleAttributeCell(attributeConcept, provider.getRoleAttributeKind(), editorCell); } else return editorCell; } private EditorCell createCollection_gjf57x_b0() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal()); editorCell.setCellId("Collection_gjf57x_b0"); Checkbox_ActionMap_0.setCellActions(editorCell, myNode, getEditorContext()); editorCell.addKeyMap(new Checkbox_KeyMap_0()); editorCell.addEditorCell(createAlternation_gjf57x_a1a()); editorCell.addEditorCell(createConstant_gjf57x_b1a()); return editorCell; } private EditorCell createAlternation_gjf57x_a1a() { boolean alternationCondition = true; alternationCondition = nodeCondition_gjf57x_a0b0(); EditorCell editorCell = null; if (alternationCondition) { editorCell = createConstant_gjf57x_a0b0(); } else { editorCell = createConstant_gjf57x_a0b0_0(); } return editorCell; } private boolean nodeCondition_gjf57x_a0b0() { return SPropertyOperations.getBoolean(myNode, MetaAdapterFactory.getProperty(0x4b0f115a88684d72L, 0x8d6197071eaaa5f1L, 0x7ba12f0b163df360L, 0x36042ea3549551c8L, "active")); } private EditorCell createConstant_gjf57x_a0b0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "[x]"); editorCell.setCellId("Constant_gjf57x_a0b0"); editorCell.setDefaultText(""); return editorCell; } private EditorCell createConstant_gjf57x_a0b0_0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "[ ]"); editorCell.setCellId("Constant_gjf57x_a0b0_0"); editorCell.setDefaultText(""); return editorCell; } private EditorCell createConstant_gjf57x_b1a() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "active"); editorCell.setCellId("Constant_gjf57x_b1a"); editorCell.setDefaultText(""); return editorCell; } private EditorCell createComponent_gjf57x_c0() { EditorCell editorCell = getCellFactory().createEditorComponentCell(myNode, "jetbrains.mps.samples.notesOrganizer.editor.MetaInfo"); return editorCell; } }