package jetbrains.mps.build.mps.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.smodel.generator.smodelAdapter.SPropertyOperations;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import jetbrains.mps.openapi.editor.style.Style;
import jetbrains.mps.editor.runtime.style.StyleImpl;
import jetbrains.mps.build.editor.buildStyles_StyleSheet.outputLayoutStyleClass;
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.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.nodeEditor.cells.EditorCell_Constant;
import jetbrains.mps.build.workflow.editor.workflowStyles_StyleSheet.keywordStyleClass;
import jetbrains.mps.lang.editor.cellProviders.SingleRoleCellProvider;
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.build.editor.buildStyles_StyleSheet.commentStyleClass;
/*package*/ class BuildMpsLayout_ModuleJars_EditorBuilder_a extends AbstractEditorBuilder {
@NotNull
private SNode myNode;
public BuildMpsLayout_ModuleJars_EditorBuilder_a(@NotNull EditorContext context, @NotNull SNode node) {
super(context);
myNode = node;
}
@NotNull
@Override
public SNode getNode() {
return myNode;
}
/*package*/ EditorCell createCell() {
return createCollection_aqxvre_a();
}
private EditorCell createCollection_aqxvre_a() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent());
editorCell.setCellId("Collection_aqxvre_a");
editorCell.setBig(true);
editorCell.setCellContext(getCellFactory().getCellContext());
editorCell.addEditorCell(createComponent_aqxvre_a0());
editorCell.addEditorCell(createRefCell_aqxvre_b0());
if (nodeCondition_aqxvre_a2a()) {
editorCell.addEditorCell(createCollection_aqxvre_c0());
}
return editorCell;
}
private boolean nodeCondition_aqxvre_a2a() {
return SPropertyOperations.getBoolean(myNode, MetaAdapterFactory.getProperty(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x11918e0f209b83e7L, 0x2e490987db3dd40dL, "customContent"));
}
private EditorCell createComponent_aqxvre_a0() {
EditorCell editorCell = getCellFactory().createEditorComponentCell(myNode, "jetbrains.mps.lang.core.editor.alias");
Style style = new StyleImpl();
new outputLayoutStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
style.set(StyleAttributes.EDITABLE, true);
editorCell.getStyle().putAll(style);
editorCell.setSubstituteInfo(new CompositeSubstituteInfo(getEditorContext(), new BasicCellContext(myNode), new SubstituteInfoPartExt[]{new BuildMpsLayout_ModuleJars_EditorBuilder_a.ReplaceWith_BuildLayout_Node_cellMenu_aqxvre_a0a0(), new SChildSubstituteInfoPartEx(editorCell)}));
return editorCell;
}
public static class ReplaceWith_BuildLayout_Node_cellMenu_aqxvre_a0a0 extends AbstractCellMenuPart_ReplaceNode_CustomNodeConcept {
public ReplaceWith_BuildLayout_Node_cellMenu_aqxvre_a0a0() {
}
public SAbstractConcept getReplacementConcept() {
return MetaAdapterFactory.getConcept(0x798100da4f0a421aL, 0xb99171f8c50ce5d2L, 0x668c6cfbafac4c85L, "jetbrains.mps.build.structure.BuildLayout_Node");
}
}
private EditorCell createRefCell_aqxvre_b0() {
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 BuildMpsLayout_ModuleJars_EditorBuilder_a.Inline_Builder_aqxvre_a1a(getEditorContext(), myNode, effectiveNode).createCell();
}
}, effectiveNode, "module");
CellUtil.setupIDeprecatableStyles(effectiveNode, cell);
setSemanticNodeToCells(cell, myNode);
installDeleteActions_atLeastOne(cell);
return cell;
}
};
provider.setRole("module");
provider.setNoTargetText("<no module>");
EditorCell editorCell;
editorCell = provider.createEditorCell(getEditorContext());
if (editorCell.getRole() == null) {
editorCell.setReferenceCell(true);
editorCell.setRole("module");
}
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;
}
/*package*/ static class Inline_Builder_aqxvre_a1a extends AbstractEditorBuilder {
@NotNull
private SNode myNode;
private SNode myReferencingNode;
/*package*/ Inline_Builder_aqxvre_a1a(@NotNull EditorContext context, SNode referencingNode, @NotNull SNode node) {
super(context);
myReferencingNode = referencingNode;
myNode = node;
}
/*package*/ EditorCell createCell() {
return createProperty_aqxvre_a0b0();
}
@NotNull
@Override
public SNode getNode() {
return myNode;
}
private EditorCell createProperty_aqxvre_a0b0() {
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");
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_aqxvre_c0() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent());
editorCell.setCellId("Collection_aqxvre_c0");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
editorCell.getStyle().putAll(style);
editorCell.setFoldable(true);
editorCell.setFoldedCell(createConstant_aqxvre_a2a_0());
editorCell.addEditorCell(createConstant_aqxvre_a2a());
editorCell.addEditorCell(createCollection_aqxvre_b2a());
editorCell.addEditorCell(createConstant_aqxvre_c2a());
editorCell.addEditorCell(createCollection_aqxvre_d2a());
return editorCell;
}
private EditorCell createConstant_aqxvre_a2a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "Extras for deployment jar:");
editorCell.setCellId("Constant_aqxvre_a2a");
Style style = new StyleImpl();
new keywordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
style.set(StyleAttributes.INDENT_LAYOUT_INDENT, true);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createCollection_aqxvre_b2a() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent());
editorCell.setCellId("Collection_aqxvre_b2a");
Style style = new StyleImpl();
style.set(StyleAttributes.INDENT_LAYOUT_INDENT, true);
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
editorCell.addEditorCell(createRefNode_aqxvre_a1c0());
return editorCell;
}
private EditorCell createRefNode_aqxvre_a1c0() {
SingleRoleCellProvider provider = new BuildMpsLayout_ModuleJars_EditorBuilder_a.deployedJarSingleRoleHandler_aqxvre_a1c0(myNode, MetaAdapterFactory.getContainmentLink(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x11918e0f209b83e7L, 0x2e490987db3dc749L, "deployedJar"), getEditorContext());
return provider.createCell();
}
private static class deployedJarSingleRoleHandler_aqxvre_a1c0 extends SingleRoleCellProvider {
@NotNull
private SNode myNode;
public deployedJarSingleRoleHandler_aqxvre_a1c0(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(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x11918e0f209b83e7L, 0x2e490987db3dc749L, "deployedJar"), child));
editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x11918e0f209b83e7L, 0x2e490987db3dc749L, "deployedJar"), 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(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x11918e0f209b83e7L, 0x2e490987db3dc749L, "deployedJar"), child));
}
if (editorCell.getRole() == null) {
editorCell.setRole("deployedJar");
}
Style style = new StyleImpl();
style.set(StyleAttributes.INDENT_LAYOUT_INDENT, true);
editorCell.getStyle().putAll(style);
}
@Override
protected EditorCell createEmptyCell() {
getCellFactory().pushCellContext();
getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(getNode(), MetaAdapterFactory.getContainmentLink(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x11918e0f209b83e7L, 0x2e490987db3dc749L, "deployedJar")));
try {
EditorCell editorCell = super.createEmptyCell();
editorCell.setCellId("empty_deployedJar");
installCellInfo(null, editorCell);
setCellContext(editorCell);
return editorCell;
} finally {
getCellFactory().popCellContext();
}
}
protected String getNoTargetText() {
return "no extra stuff";
}
}
private EditorCell createConstant_aqxvre_c2a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "Extras for jar with sources:");
editorCell.setCellId("Constant_aqxvre_c2a");
Style style = new StyleImpl();
new keywordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
style.set(StyleAttributes.INDENT_LAYOUT_INDENT, true);
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createCollection_aqxvre_d2a() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent());
editorCell.setCellId("Collection_aqxvre_d2a");
Style style = new StyleImpl();
style.set(StyleAttributes.INDENT_LAYOUT_INDENT, true);
editorCell.getStyle().putAll(style);
editorCell.addEditorCell(createRefNode_aqxvre_a3c0());
return editorCell;
}
private EditorCell createRefNode_aqxvre_a3c0() {
SingleRoleCellProvider provider = new BuildMpsLayout_ModuleJars_EditorBuilder_a.sourceJarSingleRoleHandler_aqxvre_a3c0(myNode, MetaAdapterFactory.getContainmentLink(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x11918e0f209b83e7L, 0x2e490987db3dd410L, "sourceJar"), getEditorContext());
return provider.createCell();
}
private static class sourceJarSingleRoleHandler_aqxvre_a3c0 extends SingleRoleCellProvider {
@NotNull
private SNode myNode;
public sourceJarSingleRoleHandler_aqxvre_a3c0(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(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x11918e0f209b83e7L, 0x2e490987db3dd410L, "sourceJar"), child));
editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x11918e0f209b83e7L, 0x2e490987db3dd410L, "sourceJar"), 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(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x11918e0f209b83e7L, 0x2e490987db3dd410L, "sourceJar"), child));
}
if (editorCell.getRole() == null) {
editorCell.setRole("sourceJar");
}
Style style = new StyleImpl();
style.set(StyleAttributes.INDENT_LAYOUT_INDENT, true);
editorCell.getStyle().putAll(style);
}
@Override
protected EditorCell createEmptyCell() {
getCellFactory().pushCellContext();
getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(getNode(), MetaAdapterFactory.getContainmentLink(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x11918e0f209b83e7L, 0x2e490987db3dd410L, "sourceJar")));
try {
EditorCell editorCell = super.createEmptyCell();
editorCell.setCellId("empty_sourceJar");
installCellInfo(null, editorCell);
setCellContext(editorCell);
return editorCell;
} finally {
getCellFactory().popCellContext();
}
}
protected String getNoTargetText() {
return "no extra stuff";
}
}
private EditorCell createConstant_aqxvre_a2a_0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "extra content...");
editorCell.setCellId("Constant_aqxvre_a2a_0");
Style style = new StyleImpl();
new commentStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
style.set(StyleAttributes.INDENT_LAYOUT_INDENT, true);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
}