package jetbrains.mps.lang.editor.formsTests.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.nodeEditor.cells.EditorCell_Constant;
import jetbrains.mps.nodeEditor.cellLayout.CellLayout_Horizontal;
import jetbrains.mps.openapi.editor.style.Style;
import jetbrains.mps.editor.runtime.style.StyleImpl;
import jetbrains.mps.baseLanguage.editor.BaseLanguageStyle_StyleSheet.UrlStyleClass;
import jetbrains.mps.editor.runtime.style.StyleAttributes;
import jetbrains.mps.nodeEditor.MPSFonts;
import jetbrains.mps.openapi.editor.style.StyleRegistry;
import jetbrains.mps.nodeEditor.MPSColors;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import jetbrains.mps.editor.runtime.EditorCell_Empty;
import jetbrains.mps.openapi.editor.cells.CellActionType;
import jetbrains.mps.nodeEditor.cellActions.CellAction_DeleteNode;
import org.jetbrains.mps.openapi.module.SModule;
import jetbrains.mps.baseLanguage.tuples.runtime.Tuples;
import jetbrains.mps.baseLanguage.closures.runtime._FunctionTypes;
import jetbrains.mps.baseLanguage.tuples.runtime.MultiTuple;
import jetbrains.mps.smodel.ModuleRepositoryFacade;
import org.jetbrains.mps.openapi.persistence.PersistenceFacade;
import jetbrains.mps.nodeEditor.cells.EditorCell_Image;
/*package*/ class VariousCheckboxes_EditorBuilder_a extends AbstractEditorBuilder {
@NotNull
private SNode myNode;
public VariousCheckboxes_EditorBuilder_a(@NotNull EditorContext context, @NotNull SNode node) {
super(context);
myNode = node;
}
@NotNull
@Override
public SNode getNode() {
return myNode;
}
/*package*/ EditorCell createCell() {
return createCollection_3jyf1k_a();
}
private EditorCell createCollection_3jyf1k_a() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Vertical());
editorCell.setCellId("Collection_3jyf1k_a");
editorCell.setBig(true);
editorCell.setCellContext(getCellFactory().getCellContext());
editorCell.addEditorCell(createConstant_3jyf1k_a0());
editorCell.addEditorCell(createCollection_3jyf1k_b0());
editorCell.addEditorCell(createCollection_3jyf1k_c0());
editorCell.addEditorCell(createEmpty_3jyf1k_d0());
editorCell.addEditorCell(createConstant_3jyf1k_e0());
editorCell.addEditorCell(createCollection_3jyf1k_f0());
editorCell.addEditorCell(createCollection_3jyf1k_g0());
return editorCell;
}
private EditorCell createConstant_3jyf1k_a0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "booleanProperty1:");
editorCell.setCellId("Constant_3jyf1k_a0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createCollection_3jyf1k_b0() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal());
editorCell.setCellId("Collection_3jyf1k_b0");
Checkbox_ActionMap_0.setCellActions(editorCell, myNode, getEditorContext());
editorCell.addKeyMap(new Checkbox_KeyMap_0());
editorCell.addEditorCell(createAlternation_3jyf1k_a1a());
editorCell.addEditorCell(createConstant_3jyf1k_b1a());
return editorCell;
}
private EditorCell createAlternation_3jyf1k_a1a() {
boolean alternationCondition = true;
alternationCondition = nodeCondition_3jyf1k_a0b0();
EditorCell editorCell = null;
if (alternationCondition) {
editorCell = createConstant_3jyf1k_a0b0();
} else {
editorCell = createConstant_3jyf1k_a0b0_0();
}
Style style = new StyleImpl();
new UrlStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
style.set(StyleAttributes.FONT_STYLE, MPSFonts.BOLD);
style.set(StyleAttributes.TEXT_COLOR, StyleRegistry.getInstance().getSimpleColor(MPSColors.pink));
editorCell.getStyle().putAll(style);
return editorCell;
}
private boolean nodeCondition_3jyf1k_a0b0() {
return SPropertyOperations.getBoolean(myNode, MetaAdapterFactory.getProperty(0xafb9a5fdbc5d4169L, 0xa22542d8823d623aL, 0x455f8dda63d636dL, 0x455f8dda63d636eL, "booleanProperty1"));
}
private EditorCell createConstant_3jyf1k_a0b0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "true");
editorCell.setCellId("Constant_3jyf1k_a0b0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_3jyf1k_a0b0_0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "false");
editorCell.setCellId("Constant_3jyf1k_a0b0_0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_3jyf1k_b1a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "booleanProperty1");
editorCell.setCellId("Constant_3jyf1k_b1a");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createCollection_3jyf1k_c0() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal());
editorCell.setCellId("Collection_3jyf1k_c0");
Style style = new StyleImpl();
style.set(StyleAttributes.DRAW_BORDER, true);
editorCell.getStyle().putAll(style);
Checkbox_ActionMap_1.setCellActions(editorCell, myNode, getEditorContext());
editorCell.addKeyMap(new Checkbox_KeyMap_1());
editorCell.addEditorCell(createAlternation_3jyf1k_a2a());
editorCell.addEditorCell(createConstant_3jyf1k_b2a());
return editorCell;
}
private EditorCell createAlternation_3jyf1k_a2a() {
boolean alternationCondition = true;
alternationCondition = nodeCondition_3jyf1k_a0c0();
EditorCell editorCell = null;
if (alternationCondition) {
editorCell = createConstant_3jyf1k_a0c0();
} else {
editorCell = createConstant_3jyf1k_a0c0_0();
}
return editorCell;
}
private boolean nodeCondition_3jyf1k_a0c0() {
return SPropertyOperations.getBoolean(myNode, MetaAdapterFactory.getProperty(0xafb9a5fdbc5d4169L, 0xa22542d8823d623aL, 0x455f8dda63d636dL, 0x455f8dda63d636eL, "booleanProperty1"));
}
private EditorCell createConstant_3jyf1k_a0c0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "true");
editorCell.setCellId("Constant_3jyf1k_a0c0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_3jyf1k_a0c0_0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "false");
editorCell.setCellId("Constant_3jyf1k_a0c0_0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_3jyf1k_b2a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "with a style (border)");
editorCell.setCellId("Constant_3jyf1k_b2a");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createEmpty_3jyf1k_d0() {
EditorCell_Empty editorCell = new EditorCell_Empty(getEditorContext(), myNode);
editorCell.setAction(CellActionType.DELETE, new CellAction_DeleteNode(editorCell.getSNode(), CellAction_DeleteNode.DeleteDirection.FORWARD));
editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteNode(editorCell.getSNode(), CellAction_DeleteNode.DeleteDirection.BACKWARD));
editorCell.setCellId("Empty_3jyf1k_d0");
return editorCell;
}
private EditorCell createConstant_3jyf1k_e0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "booleanProperty2:");
editorCell.setCellId("Constant_3jyf1k_e0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createCollection_3jyf1k_f0() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal());
editorCell.setCellId("Collection_3jyf1k_f0");
Checkbox_ActionMap_2.setCellActions(editorCell, myNode, getEditorContext());
editorCell.addKeyMap(new Checkbox_KeyMap_2());
editorCell.addEditorCell(createAlternation_3jyf1k_a5a());
editorCell.addEditorCell(createConstant_3jyf1k_b5a());
return editorCell;
}
private EditorCell createAlternation_3jyf1k_a5a() {
boolean alternationCondition = true;
alternationCondition = nodeCondition_3jyf1k_a0f0();
EditorCell editorCell = null;
if (alternationCondition) {
editorCell = createConstant_3jyf1k_a0f0();
} else {
editorCell = createConstant_3jyf1k_a0f0_0();
}
return editorCell;
}
private boolean nodeCondition_3jyf1k_a0f0() {
return SPropertyOperations.getBoolean(myNode, MetaAdapterFactory.getProperty(0xafb9a5fdbc5d4169L, 0xa22542d8823d623aL, 0x455f8dda63d636dL, 0x3bf28179462bcb27L, "booleanProperty2"));
}
private EditorCell createConstant_3jyf1k_a0f0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "[x]");
editorCell.setCellId("Constant_3jyf1k_a0f0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_3jyf1k_a0f0_0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "[ ]");
editorCell.setCellId("Constant_3jyf1k_a0f0_0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_3jyf1k_b5a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "booleanProperty2");
editorCell.setCellId("Constant_3jyf1k_b5a");
Style style = new StyleImpl();
style.set(StyleAttributes.FONT_STYLE, MPSFonts.PLAIN);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createCollection_3jyf1k_g0() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal());
editorCell.setCellId("Collection_3jyf1k_g0");
Checkbox_ActionMap_3.setCellActions(editorCell, myNode, getEditorContext());
editorCell.addKeyMap(new Checkbox_KeyMap_3());
editorCell.addEditorCell(createAlternation_3jyf1k_a6a());
editorCell.addEditorCell(createConstant_3jyf1k_b6a());
return editorCell;
}
private EditorCell createAlternation_3jyf1k_a6a() {
boolean alternationCondition = true;
alternationCondition = nodeCondition_3jyf1k_a0g0();
EditorCell editorCell = null;
if (alternationCondition) {
editorCell = createImage_3jyf1k_a0g0();
} else {
editorCell = createImage_3jyf1k_a0g0_0();
}
return editorCell;
}
private boolean nodeCondition_3jyf1k_a0g0() {
return SPropertyOperations.getBoolean(myNode, MetaAdapterFactory.getProperty(0xafb9a5fdbc5d4169L, 0xa22542d8823d623aL, 0x455f8dda63d636dL, 0x3bf28179462bcb27L, "booleanProperty2"));
}
private EditorCell createImage_3jyf1k_a0g0() {
SModule imageModule;
String imagePath;
{
Tuples._2<SModule, String> _tmp_483gdi_a0c0hb = (new _FunctionTypes._return_P0_E0<Tuples._2<SModule, String>>() {
public Tuples._2<SModule, String> invoke() {
return MultiTuple.<SModule,String>from(ModuleRepositoryFacade.getInstance().getModule(PersistenceFacade.getInstance().createModuleReference("90966cb5-4f67-429a-b7ba-d0fded4ede71(jetbrains.mps.lang.editor.forms.runtime)")), "${module}/icons/checkBoxSelected.png");
}
}).invoke();
imageModule = _tmp_483gdi_a0c0hb._0();
imagePath = _tmp_483gdi_a0c0hb._1();
}
EditorCell_Image editorCell = EditorCell_Image.createImageCell(getEditorContext(), myNode, imageModule, imagePath);
editorCell.setCellId("Image_3jyf1k_a0g0");
editorCell.setDescent(-1);
return editorCell;
}
private EditorCell createImage_3jyf1k_a0g0_0() {
SModule imageModule;
String imagePath;
{
Tuples._2<SModule, String> _tmp_483gdi_a0c0ib = (new _FunctionTypes._return_P0_E0<Tuples._2<SModule, String>>() {
public Tuples._2<SModule, String> invoke() {
return MultiTuple.<SModule,String>from(ModuleRepositoryFacade.getInstance().getModule(PersistenceFacade.getInstance().createModuleReference("90966cb5-4f67-429a-b7ba-d0fded4ede71(jetbrains.mps.lang.editor.forms.runtime)")), "${module}/icons/checkBox.png");
}
}).invoke();
imageModule = _tmp_483gdi_a0c0ib._0();
imagePath = _tmp_483gdi_a0c0ib._1();
}
EditorCell_Image editorCell = EditorCell_Image.createImageCell(getEditorContext(), myNode, imageModule, imagePath);
editorCell.setCellId("Image_3jyf1k_a0g0_0");
editorCell.setDescent(-1);
return editorCell;
}
private EditorCell createConstant_3jyf1k_b6a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "platform checkbox");
editorCell.setCellId("Constant_3jyf1k_b6a");
editorCell.setDefaultText("");
return editorCell;
}
}