package jetbrains.mps.lang.textGen.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.lang.textGen.behavior.ConceptTextGenDeclaration__BehaviorDescriptor;
import jetbrains.mps.nodeEditor.cells.EditorCell_Constant;
import jetbrains.mps.openapi.editor.style.Style;
import jetbrains.mps.editor.runtime.style.StyleImpl;
import jetbrains.mps.baseLanguage.editor.BaseLanguageStyle_StyleSheet.KeyWordStyleClass;
import jetbrains.mps.editor.runtime.style.StyleAttributes;
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.lang.editor.cellProviders.PropertyCellProvider;
import jetbrains.mps.lang.sharedConcepts.editor.SharedStyles_StyleSheet.ReferenceOnConceptStyleClass;
import jetbrains.mps.baseLanguage.editor.BaseLanguageStyle_StyleSheet.LeftBraceStyleClass;
import jetbrains.mps.nodeEditor.cellLayout.CellLayout_Vertical;
import jetbrains.mps.lang.editor.cellProviders.SingleRoleCellProvider;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import org.jetbrains.mps.openapi.language.SContainmentLink;
import jetbrains.mps.openapi.editor.cells.CellActionType;
import jetbrains.mps.editor.runtime.impl.cellActions.CellAction_DeleteSmart;
import jetbrains.mps.openapi.editor.cells.DefaultSubstituteInfo;
import jetbrains.mps.nodeEditor.cellMenu.SChildSubstituteInfo;
import jetbrains.mps.openapi.editor.menus.transformation.SNodeLocation;
import jetbrains.mps.nodeEditor.cellMenu.CompositeSubstituteInfo;
import jetbrains.mps.lang.editor.cellProviders.AggregationCellContext;
import jetbrains.mps.nodeEditor.cellMenu.SubstituteInfoPartExt;
import jetbrains.mps.nodeEditor.cellMenu.SChildSubstituteInfoPartEx;
import jetbrains.mps.lang.editor.generator.internal.AbstractCellMenuPart_Generic_Item;
import org.jetbrains.mps.openapi.model.SModel;
import jetbrains.mps.smodel.IOperationContext;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations;
import jetbrains.mps.lang.editor.generator.internal.AbstractCellMenuPart_Generic_Group;
import java.util.List;
import jetbrains.mps.internal.collections.runtime.Sequence;
import java.nio.charset.Charset;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations;
import jetbrains.mps.nodeEditor.cellProviders.AbstractCellListHandler;
import jetbrains.mps.lang.editor.cellProviders.RefNodeListHandler;
import jetbrains.mps.smodel.action.NodeFactoryManager;
import jetbrains.mps.nodeEditor.cellActions.CellAction_DeleteNode;
import jetbrains.mps.baseLanguage.editor.BaseLanguageStyle_StyleSheet.RightBraceStyleClass;
/*package*/ class ConceptTextGenDeclaration_EditorBuilder_a extends AbstractEditorBuilder {
@NotNull
private SNode myNode;
public ConceptTextGenDeclaration_EditorBuilder_a(@NotNull EditorContext context, @NotNull SNode node) {
super(context);
myNode = node;
}
@NotNull
@Override
public SNode getNode() {
return myNode;
}
/*package*/ EditorCell createCell() {
return createCollection_9mcqjq_a();
}
private EditorCell createCollection_9mcqjq_a() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent());
editorCell.setCellId("Collection_9mcqjq_a");
editorCell.setBig(true);
editorCell.setCellContext(getCellFactory().getCellContext());
editorCell.addEditorCell(createConstant_9mcqjq_a0());
editorCell.addEditorCell(createConstant_9mcqjq_b0());
editorCell.addEditorCell(createConstant_9mcqjq_c0());
editorCell.addEditorCell(createConstant_9mcqjq_d0());
editorCell.addEditorCell(createConstant_9mcqjq_e0());
editorCell.addEditorCell(createRefCell_9mcqjq_f0());
editorCell.addEditorCell(createConstant_9mcqjq_g0());
if (nodeCondition_9mcqjq_a7a()) {
editorCell.addEditorCell(createCollection_9mcqjq_h0());
}
editorCell.addEditorCell(createCollection_9mcqjq_i0());
editorCell.addEditorCell(createConstant_9mcqjq_j0());
return editorCell;
}
private boolean nodeCondition_9mcqjq_a7a() {
return (boolean) ConceptTextGenDeclaration__BehaviorDescriptor.shallProduceOutputUnit_id3fG6dkhfrk3.invoke(myNode);
}
private EditorCell createConstant_9mcqjq_a0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "text");
editorCell.setCellId("Constant_9mcqjq_a0");
Style style = new StyleImpl();
new KeyWordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
style.set(StyleAttributes.EDITABLE, false);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_9mcqjq_b0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "gen");
editorCell.setCellId("Constant_9mcqjq_b0");
Style style = new StyleImpl();
new KeyWordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_9mcqjq_c0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "component");
editorCell.setCellId("Constant_9mcqjq_c0");
Style style = new StyleImpl();
new KeyWordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_9mcqjq_d0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "for");
editorCell.setCellId("Constant_9mcqjq_d0");
Style style = new StyleImpl();
new KeyWordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_9mcqjq_e0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "concept");
editorCell.setCellId("Constant_9mcqjq_e0");
Style style = new StyleImpl();
new KeyWordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createRefCell_9mcqjq_f0() {
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 ConceptTextGenDeclaration_EditorBuilder_a.Inline_Builder_9mcqjq_a5a(getEditorContext(), myNode, effectiveNode).createCell();
}
}, effectiveNode, "conceptDeclaration");
CellUtil.setupIDeprecatableStyles(effectiveNode, cell);
setSemanticNodeToCells(cell, myNode);
installDeleteActions_atLeastOne(cell);
return cell;
}
};
provider.setRole("conceptDeclaration");
provider.setNoTargetText("<no conceptDeclaration>");
EditorCell editorCell;
editorCell = provider.createEditorCell(getEditorContext());
if (editorCell.getRole() == null) {
editorCell.setReferenceCell(true);
editorCell.setRole("conceptDeclaration");
}
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_9mcqjq_a5a extends AbstractEditorBuilder {
@NotNull
private SNode myNode;
private SNode myReferencingNode;
/*package*/ Inline_Builder_9mcqjq_a5a(@NotNull EditorContext context, SNode referencingNode, @NotNull SNode node) {
super(context);
myReferencingNode = referencingNode;
myNode = node;
}
/*package*/ EditorCell createCell() {
return createProperty_9mcqjq_a0f0();
}
@NotNull
@Override
public SNode getNode() {
return myNode;
}
private EditorCell createProperty_9mcqjq_a0f0() {
CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext());
provider.setRole("name");
provider.setNoTargetText("<no name>");
provider.setReadOnly(true);
EditorCell editorCell;
editorCell = provider.createEditorCell(getEditorContext());
editorCell.setCellId("property_name");
Style style = new StyleImpl();
new ReferenceOnConceptStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
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_9mcqjq_g0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "{");
editorCell.setCellId("Constant_9mcqjq_g0");
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_9mcqjq_h0() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Vertical());
editorCell.setCellId("Collection_9mcqjq_h0");
Style style = new StyleImpl();
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
editorCell.addEditorCell(createCollection_9mcqjq_a7a());
editorCell.addEditorCell(createCollection_9mcqjq_b7a());
editorCell.addEditorCell(createCollection_9mcqjq_c7a());
editorCell.addEditorCell(createCollection_9mcqjq_d7a());
editorCell.addEditorCell(createCollection_9mcqjq_e7a());
editorCell.addEditorCell(createConstant_9mcqjq_f7a());
return editorCell;
}
private EditorCell createCollection_9mcqjq_a7a() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent());
editorCell.setCellId("Collection_9mcqjq_a7a");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
style.set(StyleAttributes.INDENT_LAYOUT_INDENT, true);
editorCell.getStyle().putAll(style);
editorCell.addEditorCell(createConstant_9mcqjq_a0h0());
editorCell.addEditorCell(createConstant_9mcqjq_b0h0());
editorCell.addEditorCell(createRefNode_9mcqjq_c0h0());
return editorCell;
}
private EditorCell createConstant_9mcqjq_a0h0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "file name");
editorCell.setCellId("Constant_9mcqjq_a0h0");
Style style = new StyleImpl();
new KeyWordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
style.set(StyleAttributes.EDITABLE, false);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_9mcqjq_b0h0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ":");
editorCell.setCellId("Constant_9mcqjq_b0h0");
Style style = new StyleImpl();
new KeyWordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createRefNode_9mcqjq_c0h0() {
SingleRoleCellProvider provider = new ConceptTextGenDeclaration_EditorBuilder_a.filenameSingleRoleHandler_9mcqjq_c0h0(myNode, MetaAdapterFactory.getContainmentLink(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x11f3c776369L, 0xa0f73089d631ccL, "filename"), getEditorContext());
return provider.createCell();
}
private static class filenameSingleRoleHandler_9mcqjq_c0h0 extends SingleRoleCellProvider {
@NotNull
private SNode myNode;
public filenameSingleRoleHandler_9mcqjq_c0h0(SNode ownerNode, SContainmentLink containmentLink, EditorContext context) {
super(containmentLink, context);
myNode = ownerNode;
}
@Override
@NotNull
public SNode getNode() {
return myNode;
}
protected EditorCell createChildCell(SNode child) {
EditorCell editorCell = getUpdateSession().updateChildNodeCell(child);
editorCell.setAction(CellActionType.DELETE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x11f3c776369L, 0xa0f73089d631ccL, "filename"), child));
editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x11f3c776369L, 0xa0f73089d631ccL, "filename"), child));
installCellInfo(child, editorCell);
return editorCell;
}
private void installCellInfo(SNode child, EditorCell editorCell) {
if (editorCell.getSubstituteInfo() == null || editorCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) {
editorCell.setSubstituteInfo(new SChildSubstituteInfo(editorCell, myNode, MetaAdapterFactory.getContainmentLink(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x11f3c776369L, 0xa0f73089d631ccL, "filename"), child));
}
if (editorCell.getRole() == null) {
editorCell.setRole("filename");
}
}
@Override
protected EditorCell createEmptyCell() {
getCellFactory().pushCellContext();
getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(getNode(), MetaAdapterFactory.getContainmentLink(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x11f3c776369L, 0xa0f73089d631ccL, "filename")));
try {
EditorCell editorCell = super.createEmptyCell();
editorCell.setCellId("empty_filename");
installCellInfo(null, editorCell);
setCellContext(editorCell);
return editorCell;
} finally {
getCellFactory().popCellContext();
}
}
protected String getNoTargetText() {
return "<Node.name>";
}
}
private EditorCell createCollection_9mcqjq_b7a() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent());
editorCell.setCellId("Collection_9mcqjq_b7a");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
style.set(StyleAttributes.INDENT_LAYOUT_INDENT, true);
editorCell.getStyle().putAll(style);
editorCell.addEditorCell(createConstant_9mcqjq_a1h0());
editorCell.addEditorCell(createConstant_9mcqjq_b1h0());
editorCell.addEditorCell(createRefNode_9mcqjq_c1h0());
return editorCell;
}
private EditorCell createConstant_9mcqjq_a1h0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "extension");
editorCell.setCellId("Constant_9mcqjq_a1h0");
Style style = new StyleImpl();
new KeyWordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
style.set(StyleAttributes.EDITABLE, false);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_9mcqjq_b1h0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ":");
editorCell.setCellId("Constant_9mcqjq_b1h0");
Style style = new StyleImpl();
new KeyWordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createRefNode_9mcqjq_c1h0() {
SingleRoleCellProvider provider = new ConceptTextGenDeclaration_EditorBuilder_a.extensionSingleRoleHandler_9mcqjq_c1h0(myNode, MetaAdapterFactory.getContainmentLink(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x11f3c776369L, 0x6ee6b5c5ad5f7279L, "extension"), getEditorContext());
return provider.createCell();
}
private static class extensionSingleRoleHandler_9mcqjq_c1h0 extends SingleRoleCellProvider {
@NotNull
private SNode myNode;
public extensionSingleRoleHandler_9mcqjq_c1h0(SNode ownerNode, SContainmentLink containmentLink, EditorContext context) {
super(containmentLink, context);
myNode = ownerNode;
}
@Override
@NotNull
public SNode getNode() {
return myNode;
}
protected EditorCell createChildCell(SNode child) {
EditorCell editorCell = getUpdateSession().updateChildNodeCell(child);
editorCell.setAction(CellActionType.DELETE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x11f3c776369L, 0x6ee6b5c5ad5f7279L, "extension"), child));
editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x11f3c776369L, 0x6ee6b5c5ad5f7279L, "extension"), child));
installCellInfo(child, editorCell);
return editorCell;
}
private void installCellInfo(SNode child, EditorCell editorCell) {
if (editorCell.getSubstituteInfo() == null || editorCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) {
editorCell.setSubstituteInfo(new SChildSubstituteInfo(editorCell, myNode, MetaAdapterFactory.getContainmentLink(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x11f3c776369L, 0x6ee6b5c5ad5f7279L, "extension"), child));
}
if (editorCell.getRole() == null) {
editorCell.setRole("extension");
}
}
@Override
protected EditorCell createEmptyCell() {
getCellFactory().pushCellContext();
getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(getNode(), MetaAdapterFactory.getContainmentLink(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x11f3c776369L, 0x6ee6b5c5ad5f7279L, "extension")));
try {
EditorCell editorCell = super.createEmptyCell();
editorCell.setCellId("empty_extension");
installCellInfo(null, editorCell);
setCellContext(editorCell);
return editorCell;
} finally {
getCellFactory().popCellContext();
}
}
protected String getNoTargetText() {
return "<no extension>";
}
}
private EditorCell createCollection_9mcqjq_c7a() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent());
editorCell.setCellId("Collection_9mcqjq_c7a");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
style.set(StyleAttributes.INDENT_LAYOUT_INDENT, true);
editorCell.getStyle().putAll(style);
editorCell.addEditorCell(createConstant_9mcqjq_a2h0());
editorCell.addEditorCell(createConstant_9mcqjq_b2h0());
editorCell.addEditorCell(createRefNode_9mcqjq_c2h0());
return editorCell;
}
private EditorCell createConstant_9mcqjq_a2h0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "encoding");
editorCell.setCellId("Constant_9mcqjq_a2h0");
Style style = new StyleImpl();
new KeyWordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_9mcqjq_b2h0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ":");
editorCell.setCellId("Constant_9mcqjq_b2h0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createRefNode_9mcqjq_c2h0() {
SingleRoleCellProvider provider = new ConceptTextGenDeclaration_EditorBuilder_a.encodingSingleRoleHandler_9mcqjq_c2h0(myNode, MetaAdapterFactory.getContainmentLink(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x11f3c776369L, 0x10fd02ec599e8fbeL, "encoding"), getEditorContext());
return provider.createCell();
}
private static class encodingSingleRoleHandler_9mcqjq_c2h0 extends SingleRoleCellProvider {
@NotNull
private SNode myNode;
public encodingSingleRoleHandler_9mcqjq_c2h0(SNode ownerNode, SContainmentLink containmentLink, EditorContext context) {
super(containmentLink, context);
myNode = ownerNode;
}
@Override
@NotNull
public SNode getNode() {
return myNode;
}
protected EditorCell createChildCell(SNode child) {
EditorCell editorCell = getUpdateSession().updateChildNodeCell(child);
editorCell.setAction(CellActionType.DELETE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x11f3c776369L, 0x10fd02ec599e8fbeL, "encoding"), child));
editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x11f3c776369L, 0x10fd02ec599e8fbeL, "encoding"), child));
installCellInfo(child, editorCell);
return editorCell;
}
private void installCellInfo(SNode child, EditorCell editorCell) {
if (editorCell.getSubstituteInfo() == null || editorCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) {
editorCell.setSubstituteInfo(new CompositeSubstituteInfo(getEditorContext(), new AggregationCellContext(myNode, child, MetaAdapterFactory.getContainmentLink(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x11f3c776369L, 0x10fd02ec599e8fbeL, "encoding"), MetaAdapterFactory.getInterfaceConcept(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x10fd02ec599e8fbbL, "jetbrains.mps.lang.textGen.structure.EncodingDeclarationBase")), new SubstituteInfoPartExt[]{new ConceptTextGenDeclaration_EditorBuilder_a.encodingSingleRoleHandler_9mcqjq_c2h0.ConceptTextGenDeclaration_generic_cellMenu_9mcqjq_a0c2h0(), new ConceptTextGenDeclaration_EditorBuilder_a.encodingSingleRoleHandler_9mcqjq_c2h0.ConceptTextGenDeclaration_generic_cellMenu_9mcqjq_b0c2h0(), new SChildSubstituteInfoPartEx(editorCell)}));
}
if (editorCell.getRole() == null) {
editorCell.setRole("encoding");
}
}
@Override
protected EditorCell createEmptyCell() {
getCellFactory().pushCellContext();
getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(getNode(), MetaAdapterFactory.getContainmentLink(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x11f3c776369L, 0x10fd02ec599e8fbeL, "encoding")));
try {
EditorCell editorCell = super.createEmptyCell();
editorCell.setCellId("empty_encoding");
installCellInfo(null, editorCell);
setCellContext(editorCell);
return editorCell;
} finally {
getCellFactory().popCellContext();
}
}
protected String getNoTargetText() {
return "utf-8";
}
public static class ConceptTextGenDeclaration_generic_cellMenu_9mcqjq_a0c2h0 extends AbstractCellMenuPart_Generic_Item {
public ConceptTextGenDeclaration_generic_cellMenu_9mcqjq_a0c2h0() {
}
public void handleAction(SNode node, SModel model, IOperationContext operationContext, EditorContext editorContext) {
SLinkOperations.setNewChild(node, MetaAdapterFactory.getContainmentLink(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x11f3c776369L, 0x10fd02ec599e8fbeL, "encoding"), MetaAdapterFactory.getConcept(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x10fd02ec599e8f93L, "jetbrains.mps.lang.textGen.structure.EncodingDeclaration"));
}
public String getMatchingText() {
return "<query>";
}
}
public static class ConceptTextGenDeclaration_generic_cellMenu_9mcqjq_b0c2h0 extends AbstractCellMenuPart_Generic_Group {
public ConceptTextGenDeclaration_generic_cellMenu_9mcqjq_b0c2h0() {
}
public List<?> createParameterObjects(SNode node, IOperationContext operationContext, EditorContext editorContext) {
return Sequence.fromIterable(((Iterable<String>) Charset.availableCharsets().keySet())).toListSequence();
}
protected void handleAction(Object parameterObject, SNode node, SModel model, IOperationContext operationContext, EditorContext editorContext) {
this.handleAction_impl((String) parameterObject, node, model, operationContext, editorContext);
}
public void handleAction_impl(String parameterObject, SNode node, SModel model, IOperationContext operationContext, EditorContext editorContext) {
SLinkOperations.setNewChild(node, MetaAdapterFactory.getContainmentLink(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x11f3c776369L, 0x10fd02ec599e8fbeL, "encoding"), MetaAdapterFactory.getConcept(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x63754d97e1c86b8cL, "jetbrains.mps.lang.textGen.structure.EncodingLiteral"));
SPropertyOperations.set(SNodeOperations.cast(SLinkOperations.getTarget(node, MetaAdapterFactory.getContainmentLink(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x11f3c776369L, 0x10fd02ec599e8fbeL, "encoding")), MetaAdapterFactory.getConcept(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x63754d97e1c86b8cL, "jetbrains.mps.lang.textGen.structure.EncodingLiteral")), MetaAdapterFactory.getProperty(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x63754d97e1c86b8cL, 0x63754d97e1c86b8dL, "encoding"), parameterObject);
}
public boolean isReferentPresentation() {
return false;
}
}
}
private EditorCell createCollection_9mcqjq_d7a() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent());
editorCell.setCellId("Collection_9mcqjq_d7a");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
style.set(StyleAttributes.INDENT_LAYOUT_INDENT, true);
editorCell.getStyle().putAll(style);
editorCell.addEditorCell(createConstant_9mcqjq_a3h0());
editorCell.addEditorCell(createConstant_9mcqjq_b3h0());
editorCell.addEditorCell(createRefNode_9mcqjq_c3h0());
return editorCell;
}
private EditorCell createConstant_9mcqjq_a3h0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "text layout");
editorCell.setCellId("Constant_9mcqjq_a3h0");
Style style = new StyleImpl();
new KeyWordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_9mcqjq_b3h0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ":");
editorCell.setCellId("Constant_9mcqjq_b3h0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createRefNode_9mcqjq_c3h0() {
SingleRoleCellProvider provider = new ConceptTextGenDeclaration_EditorBuilder_a.layoutSingleRoleHandler_9mcqjq_c3h0(myNode, MetaAdapterFactory.getContainmentLink(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x11f3c776369L, 0x2bad879ac8f27decL, "layout"), getEditorContext());
return provider.createCell();
}
private static class layoutSingleRoleHandler_9mcqjq_c3h0 extends SingleRoleCellProvider {
@NotNull
private SNode myNode;
public layoutSingleRoleHandler_9mcqjq_c3h0(SNode ownerNode, SContainmentLink containmentLink, EditorContext context) {
super(containmentLink, context);
myNode = ownerNode;
}
@Override
@NotNull
public SNode getNode() {
return myNode;
}
protected EditorCell createChildCell(SNode child) {
EditorCell editorCell = getUpdateSession().updateChildNodeCell(child);
editorCell.setAction(CellActionType.DELETE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x11f3c776369L, 0x2bad879ac8f27decL, "layout"), child));
editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x11f3c776369L, 0x2bad879ac8f27decL, "layout"), child));
installCellInfo(child, editorCell);
return editorCell;
}
private void installCellInfo(SNode child, EditorCell editorCell) {
if (editorCell.getSubstituteInfo() == null || editorCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) {
editorCell.setSubstituteInfo(new SChildSubstituteInfo(editorCell, myNode, MetaAdapterFactory.getContainmentLink(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x11f3c776369L, 0x2bad879ac8f27decL, "layout"), child));
}
if (editorCell.getRole() == null) {
editorCell.setRole("layout");
}
}
@Override
protected EditorCell createEmptyCell() {
getCellFactory().pushCellContext();
getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(getNode(), MetaAdapterFactory.getContainmentLink(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x11f3c776369L, 0x2bad879ac8f27decL, "layout")));
try {
EditorCell editorCell = super.createEmptyCell();
editorCell.setCellId("empty_layout");
installCellInfo(null, editorCell);
setCellContext(editorCell);
return editorCell;
} finally {
getCellFactory().popCellContext();
}
}
protected String getNoTargetText() {
return "<no layout>";
}
}
private EditorCell createCollection_9mcqjq_e7a() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent());
editorCell.setCellId("Collection_9mcqjq_e7a");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
style.set(StyleAttributes.INDENT_LAYOUT_INDENT, true);
editorCell.getStyle().putAll(style);
editorCell.addEditorCell(createConstant_9mcqjq_a4h0());
editorCell.addEditorCell(createConstant_9mcqjq_b4h0());
editorCell.addEditorCell(createRefNodeList_9mcqjq_c4h0());
return editorCell;
}
private EditorCell createConstant_9mcqjq_a4h0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "context objects");
editorCell.setCellId("Constant_9mcqjq_a4h0");
Style style = new StyleImpl();
new KeyWordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_9mcqjq_b4h0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ":");
editorCell.setCellId("Constant_9mcqjq_b4h0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createRefNodeList_9mcqjq_c4h0() {
AbstractCellListHandler handler = new ConceptTextGenDeclaration_EditorBuilder_a.contextObjectsListHandler_9mcqjq_c4h0(myNode, "contextObjects", getEditorContext());
EditorCell_Collection editorCell = handler.createCells(new CellLayout_Vertical(), false);
editorCell.setCellId("refNodeList_contextObjects");
editorCell.setRole(handler.getElementRole());
return editorCell;
}
private static class contextObjectsListHandler_9mcqjq_c4h0 extends RefNodeListHandler {
@NotNull
private SNode myNode;
public contextObjectsListHandler_9mcqjq_c4h0(SNode ownerNode, String childRole, EditorContext context) {
super(ownerNode, childRole, context, false);
myNode = ownerNode;
}
@Override
@NotNull
public SNode getNode() {
return myNode;
}
public SNode createNodeToInsert(EditorContext editorContext) {
return NodeFactoryManager.createNode(MetaAdapterFactory.getConcept(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x1dfcc3c672ea762cL, "jetbrains.mps.lang.textGen.structure.UnitContextObject"), null, getNode(), getNode().getModel());
}
public EditorCell createNodeCell(SNode elementNode) {
EditorCell elementCell = getUpdateSession().updateChildNodeCell(elementNode);
installElementCellActions(elementNode, elementCell);
return elementCell;
}
public EditorCell createEmptyCell() {
getCellFactory().pushCellContext();
getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(contextObjectsListHandler_9mcqjq_c4h0.this.getNode(), MetaAdapterFactory.getContainmentLink(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x11f3c776369L, 0x1dfcc3c672ea7620L, "contextObjects")));
try {
EditorCell emptyCell = null;
emptyCell = super.createEmptyCell();
installElementCellActions(null, emptyCell);
setCellContext(emptyCell);
return emptyCell;
} finally {
getCellFactory().popCellContext();
}
}
public void installElementCellActions(SNode elementNode, EditorCell elementCell) {
if (elementCell.getUserObject(AbstractCellListHandler.ELEMENT_CELL_ACTIONS_SET) == null) {
elementCell.putUserObject(AbstractCellListHandler.ELEMENT_CELL_ACTIONS_SET, AbstractCellListHandler.ELEMENT_CELL_ACTIONS_SET);
if (elementNode != null) {
elementCell.setAction(CellActionType.DELETE, new CellAction_DeleteNode(elementNode, CellAction_DeleteNode.DeleteDirection.FORWARD));
elementCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteNode(elementNode, CellAction_DeleteNode.DeleteDirection.BACKWARD));
}
if (elementCell.getSubstituteInfo() == null || elementCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) {
elementCell.setSubstituteInfo(new SChildSubstituteInfo(elementCell, getNode(), MetaAdapterFactory.getContainmentLink(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x11f3c776369L, 0x1dfcc3c672ea7620L, "contextObjects"), elementNode));
}
}
}
}
private EditorCell createConstant_9mcqjq_f7a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "");
editorCell.setCellId("Constant_9mcqjq_f7a");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createCollection_9mcqjq_i0() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent());
editorCell.setCellId("Collection_9mcqjq_i0");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
style.set(StyleAttributes.INDENT_LAYOUT_INDENT, true);
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
editorCell.addEditorCell(createRefNode_9mcqjq_a8a());
return editorCell;
}
private EditorCell createRefNode_9mcqjq_a8a() {
SingleRoleCellProvider provider = new ConceptTextGenDeclaration_EditorBuilder_a.textGenBlockSingleRoleHandler_9mcqjq_a8a(myNode, MetaAdapterFactory.getContainmentLink(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x11f3c776369L, 0x11f41304578L, "textGenBlock"), getEditorContext());
return provider.createCell();
}
private static class textGenBlockSingleRoleHandler_9mcqjq_a8a extends SingleRoleCellProvider {
@NotNull
private SNode myNode;
public textGenBlockSingleRoleHandler_9mcqjq_a8a(SNode ownerNode, SContainmentLink containmentLink, EditorContext context) {
super(containmentLink, context);
myNode = ownerNode;
}
@Override
@NotNull
public SNode getNode() {
return myNode;
}
protected EditorCell createChildCell(SNode child) {
EditorCell editorCell = getUpdateSession().updateChildNodeCell(child);
editorCell.setAction(CellActionType.DELETE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x11f3c776369L, 0x11f41304578L, "textGenBlock"), child));
editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x11f3c776369L, 0x11f41304578L, "textGenBlock"), child));
installCellInfo(child, editorCell);
return editorCell;
}
private void installCellInfo(SNode child, EditorCell editorCell) {
if (editorCell.getSubstituteInfo() == null || editorCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) {
editorCell.setSubstituteInfo(new SChildSubstituteInfo(editorCell, myNode, MetaAdapterFactory.getContainmentLink(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x11f3c776369L, 0x11f41304578L, "textGenBlock"), child));
}
if (editorCell.getRole() == null) {
editorCell.setRole("textGenBlock");
}
Style style = new StyleImpl();
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
}
@Override
protected EditorCell createEmptyCell() {
getCellFactory().pushCellContext();
getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(getNode(), MetaAdapterFactory.getContainmentLink(0xb83431fe5c8f40bcL, 0x8a3665e25f4dd253L, 0x11f3c776369L, 0x11f41304578L, "textGenBlock")));
try {
EditorCell editorCell = super.createEmptyCell();
editorCell.setCellId("empty_textGenBlock");
installCellInfo(null, editorCell);
setCellContext(editorCell);
return editorCell;
} finally {
getCellFactory().popCellContext();
}
}
protected String getNoTargetText() {
return "use textgen of ancestor";
}
}
private EditorCell createConstant_9mcqjq_j0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "}");
editorCell.setCellId("Constant_9mcqjq_j0");
Style style = new StyleImpl();
new RightBraceStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
}