package jetbrains.mps.lang.generator.plan.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_Vertical;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import jetbrains.mps.nodeEditor.cells.EditorCell_Constant;
import jetbrains.mps.nodeEditor.cellLayout.CellLayout_Horizontal;
import jetbrains.mps.nodeEditor.cellProviders.CellProviderWithRole;
import jetbrains.mps.lang.editor.cellProviders.PropertyCellProvider;
import jetbrains.mps.nodeEditor.EditorManager;
import jetbrains.mps.openapi.editor.style.Style;
import jetbrains.mps.editor.runtime.style.StyleImpl;
import jetbrains.mps.lang.core.editor.BaseStyleSheet_StyleSheet.CommentStyleClass;
/*package*/ class ApplyGenerators_InspectorBuilder_a extends AbstractEditorBuilder {
@NotNull
private SNode myNode;
public ApplyGenerators_InspectorBuilder_a(@NotNull EditorContext context, @NotNull SNode node) {
super(context);
myNode = node;
}
@NotNull
@Override
public SNode getNode() {
return myNode;
}
/*package*/ EditorCell createCell() {
return createCollection_34tr3z_a_0();
}
private EditorCell createCollection_34tr3z_a_0() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Vertical());
editorCell.setCellId("Collection_34tr3z_a_0");
editorCell.setBig(true);
editorCell.setCellContext(getCellFactory().getCellContext());
editorCell.addEditorCell(createConstant_34tr3z_a0());
editorCell.addEditorCell(createConstant_34tr3z_b0());
editorCell.addEditorCell(createCollection_34tr3z_c0());
if (nodeCondition_34tr3z_a3a()) {
editorCell.addEditorCell(createCollection_34tr3z_d0());
}
if (nodeCondition_34tr3z_a4a()) {
editorCell.addEditorCell(createConstant_34tr3z_e0());
}
return editorCell;
}
private boolean nodeCondition_34tr3z_a3a() {
return SPropertyOperations.getBoolean(myNode, MetaAdapterFactory.getProperty(0x7ab1a6fa0a114b95L, 0x9e4875f363d6cb00L, 0x73246de9adeca171L, 0xc11e5088a799353L, "withExtended"));
}
private boolean nodeCondition_34tr3z_a4a() {
return SPropertyOperations.getBoolean(myNode, MetaAdapterFactory.getProperty(0x7ab1a6fa0a114b95L, 0x9e4875f363d6cb00L, 0x73246de9adeca171L, 0xf738996443c35afL, "withPriorityRules"));
}
private EditorCell createConstant_34tr3z_a0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "Apply specified generators directly, regardless of generator's language presence");
editorCell.setCellId("Constant_34tr3z_a0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_34tr3z_b0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "");
editorCell.setCellId("Constant_34tr3z_b0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createCollection_34tr3z_c0() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal());
editorCell.setCellId("Collection_34tr3z_c0");
editorCell.addEditorCell(createConstant_34tr3z_a2a());
editorCell.addEditorCell(createProperty_34tr3z_b2a());
return editorCell;
}
private EditorCell createConstant_34tr3z_a2a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "include extending generators into same step:");
editorCell.setCellId("Constant_34tr3z_a2a");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createProperty_34tr3z_b2a() {
CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext());
provider.setRole("withExtended");
provider.setNoTargetText("<no withExtended>");
EditorCell editorCell;
editorCell = provider.createEditorCell(getEditorContext());
editorCell.setCellId("property_withExtended");
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_34tr3z_d0() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal());
editorCell.setCellId("Collection_34tr3z_d0");
editorCell.addEditorCell(createConstant_34tr3z_a3a());
editorCell.addEditorCell(createProperty_34tr3z_b3a());
return editorCell;
}
private EditorCell createConstant_34tr3z_a3a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "respect priority rules for acivated generators:");
editorCell.setCellId("Constant_34tr3z_a3a");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createProperty_34tr3z_b3a() {
CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext());
provider.setRole("withPriorityRules");
provider.setNoTargetText("<no withPriorityRules>");
EditorCell editorCell;
editorCell = provider.createEditorCell(getEditorContext());
editorCell.setCellId("property_withPriorityRules");
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_34tr3z_e0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "Note, it's not recommended to rely on priority rules, the idea of a Generation Plan is to control order explicitly and from outside, rather than delegate this control to generators");
editorCell.setCellId("Constant_34tr3z_e0");
Style style = new StyleImpl();
new CommentStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
}