package jetbrains.mps.testbench.suite.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_Horizontal;
import jetbrains.mps.nodeEditor.cells.EditorCell_Constant;
import jetbrains.mps.openapi.editor.style.Style;
import jetbrains.mps.editor.runtime.style.StyleImpl;
import jetbrains.mps.editor.runtime.style.StyleAttributes;
import jetbrains.mps.nodeEditor.cellMenu.CompositeSubstituteInfo;
import jetbrains.mps.nodeEditor.cellMenu.BasicCellContext;
import jetbrains.mps.nodeEditor.cellMenu.SubstituteInfoPartExt;
import jetbrains.mps.nodeEditor.cellMenu.SChildSubstituteInfoPartEx;
import jetbrains.mps.lang.editor.generator.internal.AbstractCellMenuPart_ReplaceNode_CustomNodeConcept;
import org.jetbrains.mps.openapi.language.SAbstractConcept;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import jetbrains.mps.nodeEditor.cells.EditorCell_Property;
import jetbrains.mps.nodeEditor.cells.ModelAccessor;
import jetbrains.mps.testbench.suite.behavior.IModuleRef__BehaviorDescriptor;
import jetbrains.mps.util.EqualUtil;
import jetbrains.mps.openapi.editor.cells.CellActionType;
import jetbrains.mps.editor.runtime.cells.EmptyCellAction;
/*package*/ class SolutionRef_EditorBuilder_a extends AbstractEditorBuilder {
@NotNull
private SNode myNode;
public SolutionRef_EditorBuilder_a(@NotNull EditorContext context, @NotNull SNode node) {
super(context);
myNode = node;
}
@NotNull
@Override
public SNode getNode() {
return myNode;
}
/*package*/ EditorCell createCell() {
return createCollection_ns5ajd_a();
}
private EditorCell createCollection_ns5ajd_a() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal());
editorCell.setCellId("Collection_ns5ajd_a");
editorCell.setBig(true);
editorCell.setCellContext(getCellFactory().getCellContext());
editorCell.addEditorCell(createConstant_ns5ajd_a0());
editorCell.addEditorCell(createReadOnlyModelAccessor_ns5ajd_b0());
return editorCell;
}
private EditorCell createConstant_ns5ajd_a0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "solution");
editorCell.setCellId("Constant_ns5ajd_a0");
Style style = new StyleImpl();
style.set(StyleAttributes.EDITABLE, false);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
editorCell.setSubstituteInfo(new CompositeSubstituteInfo(getEditorContext(), new BasicCellContext(myNode), new SubstituteInfoPartExt[]{new SolutionRef_EditorBuilder_a.ReplaceWith_SolutionRef_cellMenu_ns5ajd_a0a0(), new SChildSubstituteInfoPartEx(editorCell)}));
return editorCell;
}
public static class ReplaceWith_SolutionRef_cellMenu_ns5ajd_a0a0 extends AbstractCellMenuPart_ReplaceNode_CustomNodeConcept {
public ReplaceWith_SolutionRef_cellMenu_ns5ajd_a0a0() {
}
public SAbstractConcept getReplacementConcept() {
return MetaAdapterFactory.getConcept(0xd3c5a46fb8c247dbL, 0xad0a30b8f19c2055L, 0x11c3fc56a6d1cbdcL, "jetbrains.mps.testbench.suite.structure.SolutionRef");
}
}
private EditorCell createReadOnlyModelAccessor_ns5ajd_b0() {
EditorCell_Property editorCell = EditorCell_Property.create(getEditorContext(), new ModelAccessor() {
public String getText() {
return IModuleRef__BehaviorDescriptor.moduleReference_id173Z5qAOun8.invoke(myNode).getModuleName();
}
public void setText(String s) {
}
public boolean isValidText(String s) {
return EqualUtil.equals(s, getText());
}
}, myNode);
editorCell.setAction(CellActionType.DELETE, EmptyCellAction.getInstance());
editorCell.setAction(CellActionType.BACKSPACE, EmptyCellAction.getInstance());
editorCell.setSubstituteInfo(new CompositeSubstituteInfo(getEditorContext(), new BasicCellContext(myNode), new SubstituteInfoPartExt[]{new SolutionRef_EditorBuilder_a.ReplaceWith_SolutionRef_cellMenu_ns5ajd_a0b0(), new SChildSubstituteInfoPartEx(editorCell)}));
editorCell.setCellId("ReadOnlyModelAccessor_ns5ajd_b0");
Style style = new StyleImpl();
style.set(StyleAttributes.EDITABLE, false);
editorCell.getStyle().putAll(style);
return editorCell;
}
public static class ReplaceWith_SolutionRef_cellMenu_ns5ajd_a0b0 extends AbstractCellMenuPart_ReplaceNode_CustomNodeConcept {
public ReplaceWith_SolutionRef_cellMenu_ns5ajd_a0b0() {
}
public SAbstractConcept getReplacementConcept() {
return MetaAdapterFactory.getConcept(0xd3c5a46fb8c247dbL, 0xad0a30b8f19c2055L, 0x11c3fc56a6d1cbdcL, "jetbrains.mps.testbench.suite.structure.SolutionRef");
}
}
}