package jetbrains.mps.lang.editor.diagram.testLanguage.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.nodeEditor.cellProviders.CellProviderWithRole;
import jetbrains.mps.lang.editor.cellProviders.PropertyCellProvider;
import jetbrains.mps.nodeEditor.EditorManager;
import jetbrains.mps.openapi.editor.style.Style;
import jetbrains.mps.editor.runtime.style.StyleImpl;
import jetbrains.mps.editor.runtime.style.StyleAttributes;
/*package*/ class NodeWithName_DiagramTestTextual_EditorBuilder_a extends AbstractEditorBuilder {
@NotNull
private SNode myNode;
public NodeWithName_DiagramTestTextual_EditorBuilder_a(@NotNull EditorContext context, @NotNull SNode node) {
super(context);
myNode = node;
}
@NotNull
@Override
public SNode getNode() {
return myNode;
}
/*package*/ EditorCell createCell() {
return createCollection_il7sl5_a();
}
private EditorCell createCollection_il7sl5_a() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent());
editorCell.setCellId("Collection_il7sl5_a");
editorCell.setBig(true);
editorCell.setCellContext(getCellFactory().getCellContext());
editorCell.addEditorCell(createConstant_il7sl5_a0());
editorCell.addEditorCell(createProperty_il7sl5_b0());
editorCell.addEditorCell(createConstant_il7sl5_c0());
editorCell.addEditorCell(createCollection_il7sl5_d0());
editorCell.addEditorCell(createConstant_il7sl5_e0());
return editorCell;
}
private EditorCell createConstant_il7sl5_a0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "node with name");
editorCell.setCellId("Constant_il7sl5_a0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createProperty_il7sl5_b0() {
CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext());
provider.setRole("name");
provider.setNoTargetText("<no name>");
EditorCell editorCell;
editorCell = provider.createEditorCell(getEditorContext());
editorCell.setCellId("property_name");
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 createConstant_il7sl5_c0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "{");
editorCell.setCellId("Constant_il7sl5_c0");
Style style = new StyleImpl();
style.set(StyleAttributes.MATCHING_LABEL, "body-brace");
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createCollection_il7sl5_d0() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent());
editorCell.setCellId("Collection_il7sl5_d0");
Style style = new StyleImpl();
style.set(StyleAttributes.INDENT_LAYOUT_INDENT, true);
editorCell.getStyle().putAll(style);
editorCell.addEditorCell(createConstant_il7sl5_a3a());
editorCell.addEditorCell(createConstant_il7sl5_b3a());
editorCell.addEditorCell(createProperty_il7sl5_c3a());
editorCell.addEditorCell(createConstant_il7sl5_d3a());
editorCell.addEditorCell(createConstant_il7sl5_e3a());
editorCell.addEditorCell(createProperty_il7sl5_f3a());
editorCell.addEditorCell(createConstant_il7sl5_g3a());
editorCell.addEditorCell(createConstant_il7sl5_h3a());
editorCell.addEditorCell(createProperty_il7sl5_i3a());
editorCell.addEditorCell(createConstant_il7sl5_j3a());
editorCell.addEditorCell(createConstant_il7sl5_k3a());
editorCell.addEditorCell(createProperty_il7sl5_l3a());
editorCell.addEditorCell(createConstant_il7sl5_m3a());
editorCell.addEditorCell(createConstant_il7sl5_n3a());
editorCell.addEditorCell(createProperty_il7sl5_o3a());
return editorCell;
}
private EditorCell createConstant_il7sl5_a3a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "x");
editorCell.setCellId("Constant_il7sl5_a3a");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_il7sl5_b3a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ":");
editorCell.setCellId("Constant_il7sl5_b3a");
Style style = new StyleImpl();
style.set(StyleAttributes.PUNCTUATION_LEFT, true);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createProperty_il7sl5_c3a() {
CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext());
provider.setRole("x");
provider.setNoTargetText("<no x>");
EditorCell editorCell;
editorCell = provider.createEditorCell(getEditorContext());
editorCell.setCellId("property_x");
Style style = new StyleImpl();
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
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 createConstant_il7sl5_d3a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "y");
editorCell.setCellId("Constant_il7sl5_d3a");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_il7sl5_e3a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ":");
editorCell.setCellId("Constant_il7sl5_e3a");
Style style = new StyleImpl();
style.set(StyleAttributes.PUNCTUATION_LEFT, true);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createProperty_il7sl5_f3a() {
CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext());
provider.setRole("y");
provider.setNoTargetText("<no y>");
EditorCell editorCell;
editorCell = provider.createEditorCell(getEditorContext());
editorCell.setCellId("property_y");
Style style = new StyleImpl();
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
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 createConstant_il7sl5_g3a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "width");
editorCell.setCellId("Constant_il7sl5_g3a");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_il7sl5_h3a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ":");
editorCell.setCellId("Constant_il7sl5_h3a");
Style style = new StyleImpl();
style.set(StyleAttributes.PUNCTUATION_LEFT, true);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createProperty_il7sl5_i3a() {
CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext());
provider.setRole("width");
provider.setNoTargetText("<no width>");
EditorCell editorCell;
editorCell = provider.createEditorCell(getEditorContext());
editorCell.setCellId("property_width");
Style style = new StyleImpl();
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
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 createConstant_il7sl5_j3a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "height");
editorCell.setCellId("Constant_il7sl5_j3a");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_il7sl5_k3a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ":");
editorCell.setCellId("Constant_il7sl5_k3a");
Style style = new StyleImpl();
style.set(StyleAttributes.PUNCTUATION_LEFT, true);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createProperty_il7sl5_l3a() {
CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext());
provider.setRole("height");
provider.setNoTargetText("<no height>");
EditorCell editorCell;
editorCell = provider.createEditorCell(getEditorContext());
editorCell.setCellId("property_height");
Style style = new StyleImpl();
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
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 createConstant_il7sl5_m3a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "line width");
editorCell.setCellId("Constant_il7sl5_m3a");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_il7sl5_n3a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ":");
editorCell.setCellId("Constant_il7sl5_n3a");
Style style = new StyleImpl();
style.set(StyleAttributes.PUNCTUATION_LEFT, true);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createProperty_il7sl5_o3a() {
CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext());
provider.setRole("lineWidth");
provider.setNoTargetText("<no lineWidth>");
EditorCell editorCell;
editorCell = provider.createEditorCell(getEditorContext());
editorCell.setCellId("property_lineWidth");
Style style = new StyleImpl();
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
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 createConstant_il7sl5_e0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "}");
editorCell.setCellId("Constant_il7sl5_e0");
Style style = new StyleImpl();
style.set(StyleAttributes.MATCHING_LABEL, "body-brace");
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
}