package jetbrains.mps.samples.highlevel.sampleLanguage.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.nodeEditor.cells.EditorCell_Indent;
import jetbrains.mps.nodeEditor.cellProviders.CellProviderWithRole;
import jetbrains.mps.lang.editor.cellProviders.PropertyCellProvider;
import jetbrains.mps.nodeEditor.EditorManager;
/*package*/ class Car_EditorBuilder_a extends AbstractEditorBuilder {
@NotNull
private SNode myNode;
public Car_EditorBuilder_a(@NotNull EditorContext context, @NotNull SNode node) {
super(context);
myNode = node;
}
@NotNull
@Override
public SNode getNode() {
return myNode;
}
/*package*/ EditorCell createCell() {
return createCollection_h8te0s_a();
}
private EditorCell createCollection_h8te0s_a() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Vertical());
editorCell.setCellId("Collection_h8te0s_a");
editorCell.setBig(true);
editorCell.setCellContext(getCellFactory().getCellContext());
editorCell.addEditorCell(createConstant_h8te0s_a0());
editorCell.addEditorCell(createCollection_h8te0s_b0());
return editorCell;
}
private EditorCell createConstant_h8te0s_a0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "car");
editorCell.setCellId("Constant_h8te0s_a0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createCollection_h8te0s_b0() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Vertical());
editorCell.setCellId("Collection_h8te0s_b0");
editorCell.addEditorCell(createCollection_h8te0s_a1a());
editorCell.addEditorCell(createCollection_h8te0s_b1a());
return editorCell;
}
private EditorCell createCollection_h8te0s_a1a() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal());
editorCell.setCellId("Collection_h8te0s_a1a");
editorCell.addEditorCell(createIndentCell_h8te0s_a0b0());
editorCell.addEditorCell(createConstant_h8te0s_b0b0());
editorCell.addEditorCell(createConstant_h8te0s_c0b0());
editorCell.addEditorCell(createProperty_h8te0s_d0b0());
return editorCell;
}
private EditorCell createIndentCell_h8te0s_a0b0() {
EditorCell_Indent editorCell = new EditorCell_Indent(getEditorContext(), myNode);
return editorCell;
}
private EditorCell createConstant_h8te0s_b0b0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "year");
editorCell.setCellId("Constant_h8te0s_b0b0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_h8te0s_c0b0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ":");
editorCell.setCellId("Constant_h8te0s_c0b0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createProperty_h8te0s_d0b0() {
CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext());
provider.setRole("year");
provider.setNoTargetText("<no year>");
EditorCell editorCell;
editorCell = provider.createEditorCell(getEditorContext());
editorCell.setCellId("property_year");
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 EditorCell createCollection_h8te0s_b1a() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal());
editorCell.setCellId("Collection_h8te0s_b1a");
editorCell.addEditorCell(createIndentCell_h8te0s_a1b0());
editorCell.addEditorCell(createConstant_h8te0s_b1b0());
editorCell.addEditorCell(createConstant_h8te0s_c1b0());
editorCell.addEditorCell(createProperty_h8te0s_d1b0());
return editorCell;
}
private EditorCell createIndentCell_h8te0s_a1b0() {
EditorCell_Indent editorCell = new EditorCell_Indent(getEditorContext(), myNode);
return editorCell;
}
private EditorCell createConstant_h8te0s_b1b0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "model");
editorCell.setCellId("Constant_h8te0s_b1b0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_h8te0s_c1b0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ":");
editorCell.setCellId("Constant_h8te0s_c1b0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createProperty_h8te0s_d1b0() {
CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext());
provider.setRole("model");
provider.setNoTargetText("<no model>");
EditorCell editorCell;
editorCell = provider.createEditorCell(getEditorContext());
editorCell.setCellId("property_model");
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;
}
}