package jetbrains.mps.lang.editor.test.generation.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.cellProviders.AbstractCellListHandler;
import jetbrains.mps.nodeEditor.cellLayout.CellLayout_Horizontal;
import jetbrains.mps.lang.editor.cellProviders.RefNodeListHandler;
import jetbrains.mps.smodel.action.NodeFactoryManager;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import jetbrains.mps.openapi.editor.menus.transformation.SNodeLocation;
import jetbrains.mps.openapi.editor.cells.CellActionType;
import jetbrains.mps.nodeEditor.cellActions.CellAction_DeleteNode;
import jetbrains.mps.openapi.editor.cells.DefaultSubstituteInfo;
import jetbrains.mps.nodeEditor.cellMenu.SChildSubstituteInfo;
import jetbrains.mps.lang.editor.generator.internal.AbstractCellMenuPart_Generic_Group;
import java.util.List;
import jetbrains.mps.smodel.IOperationContext;
import org.jetbrains.mps.openapi.model.SModel;
import jetbrains.mps.lang.editor.generator.internal.AbstractCellMenuPart_ReplaceChild_Group;
import org.jetbrains.mps.openapi.language.SAbstractConcept;
import jetbrains.mps.lang.editor.generator.internal.AbstractCellMenuPart_ReplaceNode_Group;
import jetbrains.mps.lang.editor.generator.internal.AbstractCellMenuPart_ApplySideTransforms;
import jetbrains.mps.nodeEditor.CellSide;
import jetbrains.mps.nodeEditor.cellMenu.SubstituteInfoPartExt;
import jetbrains.mps.openapi.editor.cells.SubstituteAction;
import jetbrains.mps.nodeEditor.cellMenu.CellContext;
import jetbrains.mps.lang.editor.generator.internal.AbstractCellMenuPart_Generic_Item;
import jetbrains.mps.lang.editor.generator.internal.PrimaryReplaceChildMenuCellMenuPart;
import jetbrains.mps.lang.editor.generator.internal.AbstractCellMenuPart_ReplaceChild_CustomChildConcept;
import jetbrains.mps.lang.editor.generator.internal.AbstractCellMenuPart_ReplaceChild_Item;
import jetbrains.mps.lang.editor.generator.internal.AbstractCellMenuPart_ReplaceNode_CustomNodeConcept;
/*package*/ class RefNodeList_EditorCellModel_ComponentBuilder_a extends AbstractEditorBuilder {
@NotNull
private SNode myNode;
public RefNodeList_EditorCellModel_ComponentBuilder_a(@NotNull EditorContext context, @NotNull SNode node) {
super(context);
myNode = node;
}
@NotNull
@Override
public SNode getNode() {
return myNode;
}
/*package*/ EditorCell createCell() {
return createCollection_ugmp9z_a();
}
private EditorCell createCollection_ugmp9z_a() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent());
editorCell.setCellId("Collection_ugmp9z_a");
editorCell.addEditorCell(createRefNodeList_ugmp9z_a0());
return editorCell;
}
private EditorCell createRefNodeList_ugmp9z_a0() {
AbstractCellListHandler handler = new RefNodeList_EditorCellModel_ComponentBuilder_a.childrenListHandler_ugmp9z_a0(myNode, "children", getEditorContext());
EditorCell_Collection editorCell = handler.createCells(new CellLayout_Horizontal(), false);
editorCell.setCellId("newId");
TestTargetActionMap.setCellActions(editorCell, myNode, getEditorContext());
editorCell.addKeyMap(new TestTargetKeymap());
editorCell.setRole(handler.getElementRole());
return editorCell;
}
private static class childrenListHandler_ugmp9z_a0 extends RefNodeListHandler {
@NotNull
private SNode myNode;
public childrenListHandler_ugmp9z_a0(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(0xeaa98d49af584b80L, 0xb585c05e7b5fd335L, 0xbde89531adc76dL, "jetbrains.mps.lang.editor.test.generation.structure.RefNodeList"), 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(childrenListHandler_ugmp9z_a0.this.getNode(), MetaAdapterFactory.getContainmentLink(0xeaa98d49af584b80L, 0xb585c05e7b5fd335L, 0xbde89531adc76dL, 0xbde89531adcb99L, "children")));
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(0xeaa98d49af584b80L, 0xb585c05e7b5fd335L, 0xbde89531adc76dL, 0xbde89531adcb99L, "children"), elementNode));
}
}
}
}
public static class RefNodeList_generic_cellMenu_ugmp9z_a0a0 extends AbstractCellMenuPart_Generic_Group {
public RefNodeList_generic_cellMenu_ugmp9z_a0a0() {
}
public List<?> createParameterObjects(SNode node, IOperationContext operationContext, EditorContext editorContext) {
boolean var = operationContext != null || node != null || editorContext != null;
return (var ? null : null);
}
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) {
boolean var = parameterObject != null || node != null || model != null || editorContext != null || operationContext != null;
if (var) {
// just usage of var
}
}
public boolean isReferentPresentation() {
return false;
}
}
public static class RefNodeList_generic_cellMenu_ugmp9z_b0a0 extends AbstractCellMenuPart_Generic_Group {
public RefNodeList_generic_cellMenu_ugmp9z_b0a0() {
}
public List<?> createParameterObjects(SNode node, IOperationContext operationContext, EditorContext editorContext) {
return null;
}
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) {
}
public boolean isReferentPresentation() {
return false;
}
public String getMatchingText(Object parameterObject) {
return this.getMatchingText_internal((String) parameterObject);
}
public String getMatchingText_internal(String parameterObject) {
return String.valueOf(parameterObject);
}
public String getDescriptionText(Object parameterObject) {
return this.getDescriptionText_internal((String) parameterObject);
}
public String getDescriptionText_internal(String parameterObject) {
return String.valueOf(parameterObject);
}
}
public static class RefNodeList_children_cellMenu_ugmp9z_c0a0 extends AbstractCellMenuPart_ReplaceChild_Group {
public RefNodeList_children_cellMenu_ugmp9z_c0a0() {
}
public List<?> createParameterObjects(SNode node, SNode currentChild, SAbstractConcept defaultConceptOfChild, IOperationContext operationContext, EditorContext editorContext) {
return createParameterObjects_impl(node, currentChild, defaultConceptOfChild.getDeclarationNode(), defaultConceptOfChild, operationContext, editorContext);
}
private List<?> createParameterObjects_impl(SNode node, SNode currentChild, SNode defaultConceptOfChild, SAbstractConcept defaultChildConcept, IOperationContext operationContext, EditorContext editorContext) {
boolean var = operationContext != null || node != null || currentChild != null || defaultChildConcept.getDeclarationNode() != null;
return (var ? null : null);
}
public boolean isCustomCreateChildNode() {
return true;
}
public SNode customCreateChildNode(Object parameterObject, SNode node, SNode currentChild, SAbstractConcept defaultConceptOfChild, SModel model, IOperationContext operationContext, EditorContext editorContext) {
return this.customCreateChildNode_impl((String) parameterObject, node, currentChild, defaultConceptOfChild.getDeclarationNode(), defaultConceptOfChild, model, operationContext, editorContext);
}
public SNode customCreateChildNode_impl(String parameterObject, SNode node, SNode currentChild, SNode defaultConceptOfChild, SAbstractConcept defaultChildConcept, SModel model, IOperationContext operationContext, EditorContext editorContext) {
boolean var = operationContext != null || defaultChildConcept.getDeclarationNode() != null || model != null || node != null || currentChild != null || parameterObject != null;
return (var ? null : null);
}
public boolean isReferentPresentation() {
return false;
}
}
public static class RefNodeList_children_cellMenu_ugmp9z_d0a0 extends AbstractCellMenuPart_ReplaceChild_Group {
public RefNodeList_children_cellMenu_ugmp9z_d0a0() {
}
public List<?> createParameterObjects(SNode node, SNode currentChild, SAbstractConcept defaultConceptOfChild, IOperationContext operationContext, EditorContext editorContext) {
return createParameterObjects_impl(node, currentChild, defaultConceptOfChild.getDeclarationNode(), defaultConceptOfChild, operationContext, editorContext);
}
private List<?> createParameterObjects_impl(SNode node, SNode currentChild, SNode defaultConceptOfChild, SAbstractConcept defaultChildConcept, IOperationContext operationContext, EditorContext editorContext) {
return null;
}
public boolean isReferentPresentation() {
return false;
}
public String getMatchingText(Object parameterObject) {
return this.getMatchingText_internal((String) parameterObject);
}
public String getMatchingText_internal(String parameterObject) {
return String.valueOf(parameterObject);
}
public String getDescriptionText(Object parameterObject) {
return this.getDescriptionText_internal((String) parameterObject);
}
public String getDescriptionText_internal(String parameterObject) {
return String.valueOf(parameterObject);
}
}
public static class RefNodeList_customReplace_cellMenu_ugmp9z_e0a0 extends AbstractCellMenuPart_ReplaceNode_Group {
public RefNodeList_customReplace_cellMenu_ugmp9z_e0a0() {
}
public List<?> createParameterObjects(SNode node, IOperationContext operationContext, EditorContext editorContext) {
boolean var = operationContext != null || node != null || editorContext != null;
return (var ? null : null);
}
public SNode createReplacementNode(Object parameterObject, SNode node, SModel model, IOperationContext operationContext, EditorContext editorContext) {
return createReplacementNode_impl((String) parameterObject, node, model, operationContext, editorContext);
}
public SNode createReplacementNode_impl(String parameterObject, SNode node, SModel model, IOperationContext operationContext, EditorContext editorContext) {
boolean var = parameterObject != null || node != null || model != null || editorContext != null || operationContext != null;
return (var ? null : null);
}
public boolean isReferentPresentation() {
return false;
}
}
public static class RefNodeList_customReplace_cellMenu_ugmp9z_f0a0 extends AbstractCellMenuPart_ReplaceNode_Group {
public RefNodeList_customReplace_cellMenu_ugmp9z_f0a0() {
}
public List<?> createParameterObjects(SNode node, IOperationContext operationContext, EditorContext editorContext) {
return null;
}
public SNode createReplacementNode(Object parameterObject, SNode node, SModel model, IOperationContext operationContext, EditorContext editorContext) {
return createReplacementNode_impl((String) parameterObject, node, model, operationContext, editorContext);
}
public SNode createReplacementNode_impl(String parameterObject, SNode node, SModel model, IOperationContext operationContext, EditorContext editorContext) {
return null;
}
public boolean isReferentPresentation() {
return false;
}
public String getMatchingText(Object parameterObject) {
return this.getMatchingText_internal((String) parameterObject);
}
public String getMatchingText_internal(String parameterObject) {
return String.valueOf(parameterObject);
}
public String getDescriptionText(Object parameterObject) {
return this.getDescriptionText_internal((String) parameterObject);
}
public String getDescriptionText_internal(String parameterObject) {
return String.valueOf(parameterObject);
}
}
public static class ApplySideTransforms_left_cellMenu_ugmp9z_g0a0 extends AbstractCellMenuPart_ApplySideTransforms {
public ApplySideTransforms_left_cellMenu_ugmp9z_g0a0() {
super(CellSide.LEFT, "ext_1_RTransform");
}
}
public static class RefNodeList_component_cellMenu_ugmp9z_h0a0 implements SubstituteInfoPartExt {
private TestTargetMenuComponent myComponent;
public RefNodeList_component_cellMenu_ugmp9z_h0a0() {
this.myComponent = new TestTargetMenuComponent();
}
public List<SubstituteAction> createActions(CellContext cellContext, EditorContext editorContext) {
return this.myComponent.createSubstituteActions(cellContext, editorContext);
}
}
public static class RefNodeList_generic_cellMenu_ugmp9z_i0a0 extends AbstractCellMenuPart_Generic_Item {
public RefNodeList_generic_cellMenu_ugmp9z_i0a0() {
}
public void handleAction(SNode node, SModel model, IOperationContext operationContext, EditorContext editorContext) {
boolean var = node != null || model != null || editorContext != null || operationContext != null;
if (var) {
// just usage of var
}
}
public String getMatchingText() {
return "matchingText";
}
}
public static class RefNodeList_children_cellMenu_ugmp9z_j0a0 extends PrimaryReplaceChildMenuCellMenuPart {
public RefNodeList_children_cellMenu_ugmp9z_j0a0() {
}
}
public static class RefNodeList_children_cellMenu_ugmp9z_k0a0 extends AbstractCellMenuPart_ReplaceChild_CustomChildConcept {
public RefNodeList_children_cellMenu_ugmp9z_k0a0() {
}
public SNode getConceptOfChild(SNode node, SNode currentChild, SAbstractConcept defaultChildConcept, IOperationContext operationContext, EditorContext editorContext) {
return getConceptOfChild_impl(node, currentChild, defaultChildConcept.getDeclarationNode(), defaultChildConcept, operationContext, editorContext);
}
private SNode getConceptOfChild_impl(SNode node, SNode currentChild, SNode defaultConceptOfChild, SAbstractConcept defaultChildConcept, IOperationContext operationContext, EditorContext editorContext) {
boolean var = currentChild != null || defaultChildConcept.getDeclarationNode() != null || node != null || operationContext != null;
return (var ? null : null);
}
}
public static class RefNodeList_children_cellMenu_ugmp9z_l0a0 extends AbstractCellMenuPart_ReplaceChild_Item {
public RefNodeList_children_cellMenu_ugmp9z_l0a0() {
}
public String getMatchingText() {
return "text";
}
public String getDescriptionText() {
return "text";
}
public boolean isCustomCreateChildNode() {
return true;
}
public SNode customCreateChildNode(SNode node, SNode currentChild, SAbstractConcept defaultChildConcept, SModel model, IOperationContext operationContext, EditorContext editorContext) {
return customCreateChildNode_impl(node, currentChild, defaultChildConcept.getDeclarationNode(), defaultChildConcept, model, operationContext, editorContext);
}
private SNode customCreateChildNode_impl(SNode node, SNode currentChild, SNode defaultConceptOfChild, SAbstractConcept defaultChildConcept, SModel model, IOperationContext operationContext, EditorContext editorContext) {
boolean var = currentChild != null || defaultChildConcept.getDeclarationNode() != null || operationContext != null || model != null || node != null;
return (var ? null : null);
}
}
public static class ReplaceWith_Constant_cellMenu_ugmp9z_m0a0 extends AbstractCellMenuPart_ReplaceNode_CustomNodeConcept {
public ReplaceWith_Constant_cellMenu_ugmp9z_m0a0() {
}
public SAbstractConcept getReplacementConcept() {
return MetaAdapterFactory.getConcept(0xeaa98d49af584b80L, 0xb585c05e7b5fd335L, 0xbde8953186ee02L, "jetbrains.mps.lang.editor.test.generation.structure.Constant");
}
}
}