package jetbrains.mps.lang.plugin.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.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.editor.runtime.style.CellAlign;
import jetbrains.mps.nodeEditor.cellProviders.CellProviderWithRole;
import jetbrains.mps.lang.editor.cellProviders.PropertyCellProvider;
import jetbrains.mps.nodeEditor.EditorManager;
import jetbrains.mps.baseLanguage.editor.BaseLanguageStyle_StyleSheet.CommentStyleClass;
/*package*/ class ActionDeclaration_InspectorBuilder_a extends AbstractEditorBuilder {
@NotNull
private SNode myNode;
public ActionDeclaration_InspectorBuilder_a(@NotNull EditorContext context, @NotNull SNode node) {
super(context);
myNode = node;
}
@NotNull
@Override
public SNode getNode() {
return myNode;
}
/*package*/ EditorCell createCell() {
return createCollection_6wnsz8_a_0();
}
private EditorCell createCollection_6wnsz8_a_0() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Vertical());
editorCell.setCellId("Collection_6wnsz8_a_0");
editorCell.setBig(true);
editorCell.setCellContext(getCellFactory().getCellContext());
editorCell.setGridLayout(true);
editorCell.addEditorCell(createCollection_6wnsz8_a0_0());
editorCell.addEditorCell(createCollection_6wnsz8_b0());
editorCell.addEditorCell(createCollection_6wnsz8_c0());
return editorCell;
}
private EditorCell createCollection_6wnsz8_a0_0() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal());
editorCell.setCellId("Collection_6wnsz8_a0_0");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
editorCell.getStyle().putAll(style);
editorCell.addEditorCell(createConstant_6wnsz8_a0a());
editorCell.addEditorCell(createConstant_6wnsz8_b0a());
editorCell.addEditorCell(createProperty_6wnsz8_c0a());
return editorCell;
}
private EditorCell createConstant_6wnsz8_a0a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "ID");
editorCell.setCellId("Constant_6wnsz8_a0a");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
style.set(StyleAttributes.HORIZONTAL_ALIGN, CellAlign.RIGHT);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_6wnsz8_b0a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ":");
editorCell.setCellId("Constant_6wnsz8_b0a");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createProperty_6wnsz8_c0a() {
CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext());
provider.setRole("ID");
provider.setNoTargetText("<auto generated from fq name and params>");
provider.setAllowsEmptyTarget(true);
EditorCell editorCell;
editorCell = provider.createEditorCell(getEditorContext());
editorCell.setCellId("property_ID");
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_6wnsz8_b0() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal());
editorCell.setCellId("Collection_6wnsz8_b0");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
editorCell.getStyle().putAll(style);
editorCell.addEditorCell(createConstant_6wnsz8_a1a());
editorCell.addEditorCell(createConstant_6wnsz8_b1a());
editorCell.addEditorCell(createProperty_6wnsz8_c1a());
return editorCell;
}
private EditorCell createConstant_6wnsz8_a1a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "Keep action context");
editorCell.setCellId("Constant_6wnsz8_a1a");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_6wnsz8_b1a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ":");
editorCell.setCellId("Constant_6wnsz8_b1a");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createProperty_6wnsz8_c1a() {
CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext());
provider.setRole("fillActionContext");
provider.setNoTargetText("<no fillActionContext>");
provider.setAllowsEmptyTarget(true);
EditorCell editorCell;
editorCell = provider.createEditorCell(getEditorContext());
editorCell.setCellId("property_fillActionContext");
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_6wnsz8_c0() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal());
editorCell.setCellId("Collection_6wnsz8_c0");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
editorCell.getStyle().putAll(style);
editorCell.addEditorCell(createConstant_6wnsz8_a2a());
editorCell.addEditorCell(createConstant_6wnsz8_b2a());
editorCell.addEditorCell(createConstant_6wnsz8_c2a());
return editorCell;
}
private EditorCell createConstant_6wnsz8_a2a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "");
editorCell.setCellId("Constant_6wnsz8_a2a");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_6wnsz8_b2a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "");
editorCell.setCellId("Constant_6wnsz8_b2a");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_6wnsz8_c2a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "true to use a copy of action context parameters");
editorCell.setCellId("Constant_6wnsz8_c2a");
Style style = new StyleImpl();
new CommentStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
style.set(StyleAttributes.SELECTABLE, false);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
}