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.nodeEditor.cellLayout.CellLayout_Horizontal;
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.cells.EditorCell_Constant;
import jetbrains.mps.build.workflow.editor.workflowStyles_StyleSheet.keywordStyleClass;
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.build.editor.buildStyles_StyleSheet.hintStyleClass;
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.build.editor.buildStyles_StyleSheet.commentStyleClass;
/*package*/ class BuildMpsLayout_ModuleXml_InspectorBuilder_a extends AbstractEditorBuilder {
@NotNull
private SNode myNode;
public BuildMpsLayout_ModuleXml_InspectorBuilder_a(@NotNull EditorContext context, @NotNull SNode node) {
super(context);
myNode = node;
}
@NotNull
@Override
public SNode getNode() {
return myNode;
}
/*package*/ EditorCell createCell() {
return createCollection_o7xb22_a_0();
}
private EditorCell createCollection_o7xb22_a_0() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent());
editorCell.setCellId("Collection_o7xb22_a_0");
editorCell.setBig(true);
editorCell.setCellContext(getCellFactory().getCellContext());
editorCell.addEditorCell(createCollection_o7xb22_a0());
editorCell.addEditorCell(createCollection_o7xb22_b0());
editorCell.addEditorCell(createRefNodeList_o7xb22_c0());
editorCell.addEditorCell(createCollection_o7xb22_d0());
editorCell.addEditorCell(createRefNodeList_o7xb22_e0());
return editorCell;
}
private EditorCell createCollection_o7xb22_a0() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal());
editorCell.setCellId("Collection_o7xb22_a0");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
editorCell.addEditorCell(createConstant_o7xb22_a0a());
editorCell.addEditorCell(createCollection_o7xb22_b0a());
editorCell.addEditorCell(createRefNode_o7xb22_c0a());
editorCell.addEditorCell(createConstant_o7xb22_d0a());
editorCell.addEditorCell(createConstant_o7xb22_e0a());
editorCell.addEditorCell(createConstant_o7xb22_f0a());
editorCell.addEditorCell(createRefNode_o7xb22_g0a());
return editorCell;
}
private EditorCell createConstant_o7xb22_a0a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "sources jar location:");
editorCell.setCellId("Constant_o7xb22_a0a");
Style style = new StyleImpl();
new keywordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createCollection_o7xb22_b0a() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent());
editorCell.setCellId("Collection_o7xb22_b0a");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
editorCell.getStyle().putAll(style);
editorCell.addEditorCell(createConstant_o7xb22_a1a0());
return editorCell;
}
private EditorCell createConstant_o7xb22_a1a0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "");
editorCell.setCellId("Constant_o7xb22_a1a0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createRefNode_o7xb22_c0a() {
SingleRoleCellProvider provider = new BuildMpsLayout_ModuleXml_InspectorBuilder_a.sourcesJarLocationSingleRoleHandler_o7xb22_c0a(myNode, MetaAdapterFactory.getContainmentLink(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x6a3e160a3efe6274L, 0x707952bffb692f6L, "sourcesJarLocation"), getEditorContext());
return provider.createCell();
}
private static class sourcesJarLocationSingleRoleHandler_o7xb22_c0a extends SingleRoleCellProvider {
@NotNull
private SNode myNode;
public sourcesJarLocationSingleRoleHandler_o7xb22_c0a(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, 0x6a3e160a3efe6274L, 0x707952bffb692f6L, "sourcesJarLocation"), child));
editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x6a3e160a3efe6274L, 0x707952bffb692f6L, "sourcesJarLocation"), 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, 0x6a3e160a3efe6274L, 0x707952bffb692f6L, "sourcesJarLocation"), child));
}
if (editorCell.getRole() == null) {
editorCell.setRole("sourcesJarLocation");
}
}
@Override
protected EditorCell createEmptyCell() {
getCellFactory().pushCellContext();
getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(getNode(), MetaAdapterFactory.getContainmentLink(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x6a3e160a3efe6274L, 0x707952bffb692f6L, "sourcesJarLocation")));
try {
EditorCell editorCell = super.createEmptyCell();
editorCell.setCellId("empty_sourcesJarLocation");
installCellInfo(null, editorCell);
setCellContext(editorCell);
return editorCell;
} finally {
getCellFactory().popCellContext();
}
}
protected String getNoTargetText() {
return "<no sourcesJarLocation>";
}
}
private EditorCell createConstant_o7xb22_d0a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "");
editorCell.setCellId("Constant_o7xb22_d0a");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_o7xb22_e0a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "module descriptor file:");
editorCell.setCellId("Constant_o7xb22_e0a");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_o7xb22_f0a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "");
editorCell.setCellId("Constant_o7xb22_f0a");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createRefNode_o7xb22_g0a() {
SingleRoleCellProvider provider = new BuildMpsLayout_ModuleXml_InspectorBuilder_a.sourceDescriptorFileSingleRoleHandler_o7xb22_g0a(myNode, MetaAdapterFactory.getContainmentLink(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x6a3e160a3efe6274L, 0x67c5a3b7c82af3d6L, "sourceDescriptorFile"), getEditorContext());
return provider.createCell();
}
private static class sourceDescriptorFileSingleRoleHandler_o7xb22_g0a extends SingleRoleCellProvider {
@NotNull
private SNode myNode;
public sourceDescriptorFileSingleRoleHandler_o7xb22_g0a(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, 0x6a3e160a3efe6274L, 0x67c5a3b7c82af3d6L, "sourceDescriptorFile"), child));
editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x6a3e160a3efe6274L, 0x67c5a3b7c82af3d6L, "sourceDescriptorFile"), 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, 0x6a3e160a3efe6274L, 0x67c5a3b7c82af3d6L, "sourceDescriptorFile"), child));
}
if (editorCell.getRole() == null) {
editorCell.setRole("sourceDescriptorFile");
}
}
@Override
protected EditorCell createEmptyCell() {
getCellFactory().pushCellContext();
getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(getNode(), MetaAdapterFactory.getContainmentLink(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x6a3e160a3efe6274L, 0x67c5a3b7c82af3d6L, "sourceDescriptorFile")));
try {
EditorCell editorCell = super.createEmptyCell();
editorCell.setCellId("empty_sourceDescriptorFile");
installCellInfo(null, editorCell);
setCellContext(editorCell);
return editorCell;
} finally {
getCellFactory().popCellContext();
}
}
protected String getNoTargetText() {
return "<no sourceDescriptorFile>";
}
}
private EditorCell createCollection_o7xb22_b0() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal());
editorCell.setCellId("Collection_o7xb22_b0");
Style style = new StyleImpl();
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
editorCell.addEditorCell(createConstant_o7xb22_a1a());
editorCell.addEditorCell(createConstant_o7xb22_b1a());
return editorCell;
}
private EditorCell createConstant_o7xb22_a1a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "jar locations:");
editorCell.setCellId("Constant_o7xb22_a1a");
Style style = new StyleImpl();
new jetbrains.mps.build.editor.buildStyles_StyleSheet.keywordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_o7xb22_b1a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "runtime library jars");
editorCell.setCellId("Constant_o7xb22_b1a");
Style style = new StyleImpl();
new hintStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createRefNodeList_o7xb22_c0() {
AbstractCellListHandler handler = new BuildMpsLayout_ModuleXml_InspectorBuilder_a.jarLocationsListHandler_o7xb22_c0(myNode, "jarLocations", getEditorContext());
EditorCell_Collection editorCell = handler.createCells(new CellLayout_Indent(), false);
editorCell.setCellId("refNodeList_jarLocations");
Style style = new StyleImpl();
style.set(StyleAttributes.INDENT_LAYOUT_CHILDREN_NEWLINE, true);
style.set(StyleAttributes.INDENT_LAYOUT_INDENT, true);
editorCell.getStyle().putAll(style);
editorCell.setRole(handler.getElementRole());
return editorCell;
}
private static class jarLocationsListHandler_o7xb22_c0 extends RefNodeListHandler {
@NotNull
private SNode myNode;
public jarLocationsListHandler_o7xb22_c0(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(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x3c765492deb1a384L, "jetbrains.mps.build.mps.structure.BuildMpsLayout_ModuleXml_CustomJarLocation"), 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(jarLocationsListHandler_o7xb22_c0.this.getNode(), MetaAdapterFactory.getContainmentLink(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x6a3e160a3efe6274L, 0x3c765492deb1ce79L, "jarLocations")));
try {
EditorCell emptyCell = null;
emptyCell = createConstant_o7xb22_a2a();
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(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x6a3e160a3efe6274L, 0x3c765492deb1ce79L, "jarLocations"), elementNode));
}
}
}
private EditorCell createConstant_o7xb22_a2a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "");
editorCell.setCellId("Constant_o7xb22_a2a");
Style style = new StyleImpl();
new commentStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
style.set(StyleAttributes.EDITABLE, true);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("<< default relative locations for all jars >>");
return editorCell;
}
}
private EditorCell createCollection_o7xb22_d0() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal());
editorCell.setCellId("Collection_o7xb22_d0");
Style style = new StyleImpl();
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
editorCell.addEditorCell(createConstant_o7xb22_a3a());
editorCell.addEditorCell(createConstant_o7xb22_b3a());
return editorCell;
}
private EditorCell createConstant_o7xb22_a3a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "module classes:");
editorCell.setCellId("Constant_o7xb22_a3a");
Style style = new StyleImpl();
new jetbrains.mps.build.editor.buildStyles_StyleSheet.keywordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_o7xb22_b3a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "module-relative path to compiled classes");
editorCell.setCellId("Constant_o7xb22_b3a");
Style style = new StyleImpl();
new hintStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createRefNodeList_o7xb22_e0() {
AbstractCellListHandler handler = new BuildMpsLayout_ModuleXml_InspectorBuilder_a.classpathEntriesListHandler_o7xb22_e0(myNode, "classpathEntries", getEditorContext());
EditorCell_Collection editorCell = handler.createCells(new CellLayout_Indent(), false);
editorCell.setCellId("refNodeList_classpathEntries");
Style style = new StyleImpl();
style.set(StyleAttributes.INDENT_LAYOUT_CHILDREN_NEWLINE, true);
style.set(StyleAttributes.INDENT_LAYOUT_INDENT, true);
editorCell.getStyle().putAll(style);
editorCell.setRole(handler.getElementRole());
return editorCell;
}
private static class classpathEntriesListHandler_o7xb22_e0 extends RefNodeListHandler {
@NotNull
private SNode myNode;
public classpathEntriesListHandler_o7xb22_e0(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(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0xd94b027412f0824L, "jetbrains.mps.build.mps.structure.GeneratorInternal_String"), 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(classpathEntriesListHandler_o7xb22_e0.this.getNode(), MetaAdapterFactory.getContainmentLink(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x6a3e160a3efe6274L, 0x75cd89729fd8ef2bL, "classpathEntries")));
try {
EditorCell emptyCell = null;
emptyCell = createConstant_o7xb22_a4a();
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(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x6a3e160a3efe6274L, 0x75cd89729fd8ef2bL, "classpathEntries"), elementNode));
}
}
}
private EditorCell createConstant_o7xb22_a4a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "");
editorCell.setCellId("Constant_o7xb22_a4a");
Style style = new StyleImpl();
new commentStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("<< none >>");
return editorCell;
}
}
}