package jetbrains.mps.lang.editor.editorTest.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.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;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import jetbrains.mps.openapi.editor.style.StyleRegistry;
import jetbrains.mps.nodeEditor.MPSColors;
/*package*/ class CollapsedConditionally_EditorBuilder_a extends AbstractEditorBuilder {
@NotNull
private SNode myNode;
public CollapsedConditionally_EditorBuilder_a(@NotNull EditorContext context, @NotNull SNode node) {
super(context);
myNode = node;
}
@NotNull
@Override
public SNode getNode() {
return myNode;
}
/*package*/ EditorCell createCell() {
return createCollection_gbleq0_a();
}
private EditorCell createCollection_gbleq0_a() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent());
editorCell.setCellId("Collection_gbleq0_a");
editorCell.setBig(true);
editorCell.setCellContext(getCellFactory().getCellContext());
editorCell.addEditorCell(createConstant_gbleq0_a0());
editorCell.addEditorCell(createCollection_gbleq0_b0());
return editorCell;
}
private EditorCell createConstant_gbleq0_a0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "foldable node:");
editorCell.setCellId("Constant_gbleq0_a0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createCollection_gbleq0_b0() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent());
editorCell.setCellId("Collection_gbleq0_b0");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
editorCell.getStyle().putAll(style);
editorCell.setFoldable(true);
editorCell.setFoldedCell(createCollection_gbleq0_a1a());
editorCell.addEditorCell(createConstant_gbleq0_a1a());
editorCell.addEditorCell(createCollection_gbleq0_b1a());
editorCell.addEditorCell(createConstant_gbleq0_c1a());
editorCell.setInitiallyCollapsed(nodeCondition_gbleq0_a1a());
return editorCell;
}
private boolean nodeCondition_gbleq0_a1a() {
return SPropertyOperations.getBoolean(SNodeOperations.as(SNodeOperations.getParent(myNode), MetaAdapterFactory.getConcept(0x81f0abb8d71e4d13L, 0xa0c1d2291fbb28b7L, 0x569b712fbc6572f0L, "jetbrains.mps.lang.editor.editorTest.structure.FoldingContainer")), MetaAdapterFactory.getProperty(0x81f0abb8d71e4d13L, 0xa0c1d2291fbb28b7L, 0x569b712fbc6572f0L, 0xc06e5dab971f717L, "collapsed"));
}
private EditorCell createConstant_gbleq0_a1a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "{");
editorCell.setCellId("Constant_gbleq0_a1a");
Style style = new StyleImpl();
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createCollection_gbleq0_b1a() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent());
editorCell.setCellId("Collection_gbleq0_b1a");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
style.set(StyleAttributes.INDENT_LAYOUT_INDENT, true);
editorCell.getStyle().putAll(style);
editorCell.addEditorCell(createConstant_gbleq0_a1b0());
editorCell.addEditorCell(createConstant_gbleq0_b1b0());
editorCell.addEditorCell(createConstant_gbleq0_c1b0());
editorCell.addEditorCell(createConstant_gbleq0_d1b0());
return editorCell;
}
private EditorCell createConstant_gbleq0_a1b0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "1..");
editorCell.setCellId("Constant_gbleq0_a1b0");
Style style = new StyleImpl();
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_gbleq0_b1b0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "2..");
editorCell.setCellId("Constant_gbleq0_b1b0");
Style style = new StyleImpl();
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_gbleq0_c1b0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "3..");
editorCell.setCellId("Constant_gbleq0_c1b0");
Style style = new StyleImpl();
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_gbleq0_d1b0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "4..");
editorCell.setCellId("Constant_gbleq0_d1b0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_gbleq0_c1a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "}");
editorCell.setCellId("Constant_gbleq0_c1a");
Style style = new StyleImpl();
style.set(StyleAttributes.INDENT_LAYOUT_ON_NEW_LINE, true);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createCollection_gbleq0_a1a() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent());
editorCell.setCellId("Collection_gbleq0_a1a");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
editorCell.getStyle().putAll(style);
editorCell.addEditorCell(createConstant_gbleq0_a0b0());
return editorCell;
}
private EditorCell createConstant_gbleq0_a0b0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "<<folded>>");
editorCell.setCellId("Constant_gbleq0_a0b0");
Style style = new StyleImpl();
style.set(StyleAttributes.TEXT_COLOR, StyleRegistry.getInstance().getSimpleColor(MPSColors.gray));
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
}