package jetbrains.mps.lang.smodel.query.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.editor.runtime.cells.BigCellUtil; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SConceptOperations; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; import jetbrains.mps.nodeEditor.cells.EditorCell_Error; import jetbrains.mps.openapi.editor.style.Style; import jetbrains.mps.editor.runtime.style.StyleImpl; import jetbrains.mps.editor.runtime.style.StyleAttributes; /*package*/ class ScopeParameter_EditorBuilder_a extends AbstractEditorBuilder { @NotNull private SNode myNode; public ScopeParameter_EditorBuilder_a(@NotNull EditorContext context, @NotNull SNode node) { super(context); myNode = node; } @NotNull @Override public SNode getNode() { return myNode; } /*package*/ EditorCell createCell() { return createAlternation_pzkiaj_a(); } private EditorCell createAlternation_pzkiaj_a() { boolean alternationCondition = true; alternationCondition = nodeCondition_pzkiaj_a0(); EditorCell editorCell = null; if (alternationCondition) { editorCell = createError_pzkiaj_a0(); } else { editorCell = createComponent_pzkiaj_a0(); } EditorCell bigCell = BigCellUtil.findBigCell(editorCell, getNode()); if (bigCell != null) { bigCell.setBig(true); bigCell.setCellContext(getCellFactory().getCellContext()); } return editorCell; } private boolean nodeCondition_pzkiaj_a0() { return SConceptOperations.isExactly(SNodeOperations.asSConcept(SNodeOperations.getConcept(myNode)), MetaAdapterFactory.getConcept(0x1a8554c4eb8443baL, 0x8c346f0d90c6e75aL, 0x3bc64421763add4bL, "jetbrains.mps.lang.smodel.query.structure.ScopeParameter")); } private EditorCell createError_pzkiaj_a0() { EditorCell_Error editorCell = new EditorCell_Error(getEditorContext(), myNode, "<no scope>"); editorCell.setCellId("Error_pzkiaj_a0"); return editorCell; } private EditorCell createComponent_pzkiaj_a0() { EditorCell editorCell = getCellFactory().createEditorComponentCell(myNode, "jetbrains.mps.lang.core.editor.alias"); Style style = new StyleImpl(); style.set(StyleAttributes.AUTO_DELETABLE, true); editorCell.getStyle().putAll(style); return editorCell; } }