package jetbrains.mps.lang.editor.imageGen.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.lang.structure.editor.structure_StyleSheet.KeywordStyleClass;
import jetbrains.mps.nodeEditor.cellProviders.CellProviderWithRole;
import jetbrains.mps.lang.editor.cellProviders.RefCellCellProvider;
import jetbrains.mps.util.Computable;
import jetbrains.mps.editor.runtime.impl.CellUtil;
import jetbrains.mps.nodeEditor.EditorManager;
import jetbrains.mps.nodeEditor.cells.EditorCell_Property;
import jetbrains.mps.nodeEditor.cells.EditorCell_RefPresentation;
import jetbrains.mps.smodel.action.IReferentPresentationProvider;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import jetbrains.mps.baseLanguage.editor.BaseLanguageStyle_StyleSheet.LeftBraceStyleClass;
import jetbrains.mps.editor.runtime.style.StyleAttributes;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations;
import jetbrains.mps.lang.editor.cellProviders.PropertyCellProvider;
import jetbrains.mps.baseLanguage.editor.BaseLanguageStyle_StyleSheet.RightBraceStyleClass;
/*package*/ class ImageGenerator_EditorBuilder_a extends AbstractEditorBuilder {
@NotNull
private SNode myNode;
public ImageGenerator_EditorBuilder_a(@NotNull EditorContext context, @NotNull SNode node) {
super(context);
myNode = node;
}
@NotNull
@Override
public SNode getNode() {
return myNode;
}
/*package*/ EditorCell createCell() {
return createCollection_ess7oq_a();
}
private EditorCell createCollection_ess7oq_a() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent());
editorCell.setCellId("Collection_ess7oq_a");
editorCell.setBig(true);
editorCell.setCellContext(getCellFactory().getCellContext());
editorCell.addEditorCell(createConstant_ess7oq_a0());
editorCell.addEditorCell(createConstant_ess7oq_b0());
editorCell.addEditorCell(createConstant_ess7oq_c0());
editorCell.addEditorCell(createConstant_ess7oq_d0());
editorCell.addEditorCell(createRefCell_ess7oq_e0());
editorCell.addEditorCell(createConstant_ess7oq_f0());
editorCell.addEditorCell(createCollection_ess7oq_g0());
editorCell.addEditorCell(createConstant_ess7oq_h0());
return editorCell;
}
private EditorCell createConstant_ess7oq_a0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "generate");
editorCell.setCellId("Constant_ess7oq_a0");
Style style = new StyleImpl();
new KeywordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_ess7oq_b0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "image");
editorCell.setCellId("Constant_ess7oq_b0");
Style style = new StyleImpl();
new KeywordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_ess7oq_c0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "for");
editorCell.setCellId("Constant_ess7oq_c0");
Style style = new StyleImpl();
new KeywordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_ess7oq_d0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "node");
editorCell.setCellId("Constant_ess7oq_d0");
Style style = new StyleImpl();
new KeywordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createRefCell_ess7oq_e0() {
CellProviderWithRole provider = new RefCellCellProvider(myNode, getEditorContext()) {
@Override
protected EditorCell createRefCell(EditorContext context, final SNode effectiveNode, SNode node) {
EditorCell cell = getUpdateSession().updateReferencedNodeCell(new Computable<EditorCell>() {
public EditorCell compute() {
return new ImageGenerator_EditorBuilder_a.Inline_Builder_ess7oq_a4a(getEditorContext(), myNode, effectiveNode).createCell();
}
}, effectiveNode, "node");
CellUtil.setupIDeprecatableStyles(effectiveNode, cell);
setSemanticNodeToCells(cell, myNode);
installDeleteActions_nullable_reference(cell);
return cell;
}
};
provider.setRole("node");
provider.setNoTargetText("<no node>");
EditorCell editorCell;
editorCell = provider.createEditorCell(getEditorContext());
if (editorCell.getRole() == null) {
editorCell.setReferenceCell(true);
editorCell.setRole("node");
}
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;
}
/*package*/ static class Inline_Builder_ess7oq_a4a extends AbstractEditorBuilder {
@NotNull
private SNode myNode;
private SNode myReferencingNode;
/*package*/ Inline_Builder_ess7oq_a4a(@NotNull EditorContext context, SNode referencingNode, @NotNull SNode node) {
super(context);
myReferencingNode = referencingNode;
myNode = node;
}
/*package*/ EditorCell createCell() {
return createReferencePresentation_ess7oq_a0e0();
}
@NotNull
@Override
public SNode getNode() {
return myNode;
}
private EditorCell createReferencePresentation_ess7oq_a0e0() {
EditorCell_Property editorCell = EditorCell_RefPresentation.create(getEditorContext(), myNode, myReferencingNode, IReferentPresentationProvider.getDefaultPresentation(MetaAdapterFactory.getReferenceLink(0x1839bec5cea641dfL, 0xb9e0c405ff35c41eL, 0x20c051df23a9488cL, 0x2d0ad25283902716L, "node")));
editorCell.setCellId("ReferencePresentation_ess7oq_a0e0");
return editorCell;
}
}
private EditorCell createConstant_ess7oq_f0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "{");
editorCell.setCellId("Constant_ess7oq_f0");
Style style = new StyleImpl();
new LeftBraceStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createCollection_ess7oq_g0() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent());
editorCell.setCellId("Collection_ess7oq_g0");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
style.set(StyleAttributes.INDENT_LAYOUT_INDENT, true);
editorCell.getStyle().putAll(style);
editorCell.addEditorCell(createCollection_ess7oq_a6a());
editorCell.addEditorCell(createCollection_ess7oq_b6a());
editorCell.addEditorCell(createCollection_ess7oq_c6a());
if (nodeCondition_ess7oq_a3g0()) {
editorCell.addEditorCell(createCollection_ess7oq_d6a());
}
return editorCell;
}
private boolean nodeCondition_ess7oq_a3g0() {
return SLinkOperations.getTarget(myNode, MetaAdapterFactory.getReferenceLink(0x1839bec5cea641dfL, 0xb9e0c405ff35c41eL, 0x20c051df23a9488cL, 0x2d0ad25283902716L, "node")) == null;
}
private EditorCell createCollection_ess7oq_a6a() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent());
editorCell.setCellId("Collection_ess7oq_a6a");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
editorCell.addEditorCell(createConstant_ess7oq_a0g0());
editorCell.addEditorCell(createConstant_ess7oq_b0g0());
editorCell.addEditorCell(createConstant_ess7oq_c0g0());
editorCell.addEditorCell(createProperty_ess7oq_d0g0());
return editorCell;
}
private EditorCell createConstant_ess7oq_a0g0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "file");
editorCell.setCellId("Constant_ess7oq_a0g0");
Style style = new StyleImpl();
new KeywordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_ess7oq_b0g0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "name");
editorCell.setCellId("Constant_ess7oq_b0g0");
Style style = new StyleImpl();
new KeywordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_ess7oq_c0g0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ":");
editorCell.setCellId("Constant_ess7oq_c0g0");
Style style = new StyleImpl();
new KeywordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createProperty_ess7oq_d0g0() {
CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext());
provider.setRole("fileName");
provider.setNoTargetText("<no fileName>");
EditorCell editorCell;
editorCell = provider.createEditorCell(getEditorContext());
editorCell.setCellId("property_fileName");
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_ess7oq_b6a() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent());
editorCell.setCellId("Collection_ess7oq_b6a");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
editorCell.addEditorCell(createConstant_ess7oq_a1g0());
editorCell.addEditorCell(createConstant_ess7oq_b1g0());
editorCell.addEditorCell(createProperty_ess7oq_c1g0());
return editorCell;
}
private EditorCell createConstant_ess7oq_a1g0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "scale");
editorCell.setCellId("Constant_ess7oq_a1g0");
Style style = new StyleImpl();
new KeywordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_ess7oq_b1g0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ":");
editorCell.setCellId("Constant_ess7oq_b1g0");
Style style = new StyleImpl();
new KeywordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createProperty_ess7oq_c1g0() {
CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext());
provider.setRole("scale");
provider.setNoTargetText("2.0");
provider.setAllowsEmptyTarget(true);
EditorCell editorCell;
editorCell = provider.createEditorCell(getEditorContext());
editorCell.setCellId("property_scale");
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_ess7oq_c6a() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent());
editorCell.setCellId("Collection_ess7oq_c6a");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
editorCell.addEditorCell(createConstant_ess7oq_a2g0());
editorCell.addEditorCell(createConstant_ess7oq_b2g0());
editorCell.addEditorCell(createConstant_ess7oq_c2g0());
editorCell.addEditorCell(createProperty_ess7oq_d2g0());
return editorCell;
}
private EditorCell createConstant_ess7oq_a2g0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "image");
editorCell.setCellId("Constant_ess7oq_a2g0");
Style style = new StyleImpl();
new KeywordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_ess7oq_b2g0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "format");
editorCell.setCellId("Constant_ess7oq_b2g0");
Style style = new StyleImpl();
new KeywordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_ess7oq_c2g0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ":");
editorCell.setCellId("Constant_ess7oq_c2g0");
Style style = new StyleImpl();
new KeywordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createProperty_ess7oq_d2g0() {
CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext());
provider.setRole("imageFormat");
provider.setNoTargetText("png");
provider.setAllowsEmptyTarget(true);
EditorCell editorCell;
editorCell = provider.createEditorCell(getEditorContext());
editorCell.setCellId("property_imageFormat");
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_ess7oq_d6a() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent());
editorCell.setCellId("Collection_ess7oq_d6a");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
editorCell.addEditorCell(createConstant_ess7oq_a3g0());
editorCell.addEditorCell(createConstant_ess7oq_b3g0());
editorCell.addEditorCell(createConstant_ess7oq_c3g0());
editorCell.addEditorCell(createProperty_ess7oq_d3g0());
return editorCell;
}
private EditorCell createConstant_ess7oq_a3g0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "node");
editorCell.setCellId("Constant_ess7oq_a3g0");
Style style = new StyleImpl();
new KeywordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_ess7oq_b3g0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "id");
editorCell.setCellId("Constant_ess7oq_b3g0");
Style style = new StyleImpl();
new KeywordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_ess7oq_c3g0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ":");
editorCell.setCellId("Constant_ess7oq_c3g0");
Style style = new StyleImpl();
new KeywordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createProperty_ess7oq_d3g0() {
CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext());
provider.setRole("id");
provider.setNoTargetText("<no Id>");
provider.setAllowsEmptyTarget(true);
EditorCell editorCell;
editorCell = provider.createEditorCell(getEditorContext());
editorCell.setCellId("property_id");
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_ess7oq_h0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "}");
editorCell.setCellId("Constant_ess7oq_h0");
Style style = new StyleImpl();
new RightBraceStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
}