package jetbrains.mps.lang.textGen.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.lang.smodel.generator.smodelAdapter.SPropertyOperations; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; import jetbrains.mps.nodeEditor.cellLayout.CellLayout_Indent; import org.jetbrains.mps.openapi.model.SNodeAccessUtil; import jetbrains.mps.nodeEditor.cells.EditorCell_Constant; import jetbrains.mps.nodeEditor.cellProviders.CellProviderWithRole; import jetbrains.mps.lang.editor.cellProviders.PropertyCellProvider; import jetbrains.mps.nodeEditor.EditorManager; /*package*/ class CollectionAppendPart_InspectorBuilder_a extends AbstractEditorBuilder { @NotNull private SNode myNode; public CollectionAppendPart_InspectorBuilder_a(@NotNull EditorContext context, @NotNull SNode node) { super(context); myNode = node; } @NotNull @Override public SNode getNode() { return myNode; } /*package*/ EditorCell createCell() { return createCollection_wfu8o0_a_0(); } private EditorCell createCollection_wfu8o0_a_0() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Vertical()); editorCell.setCellId("Collection_wfu8o0_a_0"); editorCell.setBig(true); editorCell.setCellContext(getCellFactory().getCellContext()); if (nodeCondition_wfu8o0_a0a()) { editorCell.addEditorCell(createCollection_wfu8o0_a0()); } return editorCell; } private boolean nodeCondition_wfu8o0_a0a() { return isNotEmptyString(SPropertyOperations.getString(myNode, MetaAdapterFactory.getProperty(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x1201527819cL, 0x120152f5107L, "separator"))); } private EditorCell createCollection_wfu8o0_a0() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent()); editorCell.setCellId("Collection_wfu8o0_a0"); editorCell.addEditorCell(createConstant_wfu8o0_a0a()); editorCell.addEditorCell(createConstant_wfu8o0_b0a()); if (SNodeAccessUtil.hasProperty(myNode, MetaAdapterFactory.getProperty(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x1201527819cL, 0x120152f5107L, "separator"))) { editorCell.addEditorCell(createNonEmptyProperty_wfu8o0_c0a()); } return editorCell; } private EditorCell createConstant_wfu8o0_a0a() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "separator"); editorCell.setCellId("Constant_wfu8o0_a0a"); editorCell.setDefaultText(""); return editorCell; } private EditorCell createConstant_wfu8o0_b0a() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ":"); editorCell.setCellId("Constant_wfu8o0_b0a"); editorCell.setDefaultText(""); return editorCell; } private EditorCell createNonEmptyProperty_wfu8o0_c0a() { CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext()); provider.setRole("separator"); provider.setNoTargetText("<no separator>"); provider.setAllowsEmptyTarget(true); EditorCell editorCell; editorCell = provider.createEditorCell(getEditorContext()); editorCell.setCellId("property_separator_1"); 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 static boolean isNotEmptyString(String str) { return str != null && str.length() > 0; } }