package jetbrains.mps.baseLanguage.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_Indent; import jetbrains.mps.internal.collections.runtime.ListSequence; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; import jetbrains.mps.nodeEditor.cells.EditorCell_Constant; import jetbrains.mps.openapi.editor.style.Style; import jetbrains.mps.editor.runtime.style.StyleImpl; import jetbrains.mps.editor.runtime.style.StyleAttributes; /*package*/ class _GenericDeclaration_TypeVariables_WithAnchor_Component_ComponentBuilder_a extends AbstractEditorBuilder { @NotNull private SNode myNode; public _GenericDeclaration_TypeVariables_WithAnchor_Component_ComponentBuilder_a(@NotNull EditorContext context, @NotNull SNode node) { super(context); myNode = node; } @NotNull @Override public SNode getNode() { return myNode; } /*package*/ EditorCell createCell() { return createCollection_525l3g_a(); } private EditorCell createCollection_525l3g_a() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent()); editorCell.setCellId("Collection_525l3g_a"); editorCell.addEditorCell(createConstant_525l3g_a0()); if (nodeCondition_525l3g_a1a()) { editorCell.addEditorCell(createComponent_525l3g_b0()); } return editorCell; } private boolean nodeCondition_525l3g_a1a() { return ListSequence.fromList(SLinkOperations.getChildren(myNode, MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x102463b447aL, 0x102463bb98eL, "typeVariableDeclaration"))).isNotEmpty(); } private EditorCell createConstant_525l3g_a0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ""); editorCell.setCellId("TYPE_VARIABLES_ANCHOR"); Style style = new StyleImpl(); style.set(StyleAttributes.PUNCTUATION_LEFT, true); style.set(StyleAttributes.PUNCTUATION_RIGHT, _StyleParameter_QueryFunction_525l3g_a1a0()); style.set(StyleAttributes.FIRST_POSITION_ALLOWED, false); style.set(StyleAttributes.LAST_POSITION_ALLOWED, false); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private boolean _StyleParameter_QueryFunction_525l3g_a1a0() { return ListSequence.fromList(SLinkOperations.getChildren(getNode(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x102463b447aL, 0x102463bb98eL, "typeVariableDeclaration"))).isNotEmpty(); } private EditorCell createComponent_525l3g_b0() { EditorCell editorCell = getCellFactory().createEditorComponentCell(myNode, "jetbrains.mps.baseLanguage.editor._GenericDeclaration_TypeVariables_Component"); return editorCell; } }