package jetbrains.mps.lang.test.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.nodeEditor.cells.EditorCell_Constant;
import jetbrains.mps.nodeEditor.cellProviders.CellProviderWithRole;
import jetbrains.mps.lang.editor.cellProviders.PropertyCellProvider;
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.EditorManager;
/*package*/ class AnonymousCellAnnotation_InspectorBuilder_a extends AbstractEditorBuilder {
@NotNull
private SNode myNode;
public AnonymousCellAnnotation_InspectorBuilder_a(@NotNull EditorContext context, @NotNull SNode node) {
super(context);
myNode = node;
}
@NotNull
@Override
public SNode getNode() {
return myNode;
}
/*package*/ EditorCell createCell() {
return createCollection_ql48ef_a_0();
}
private EditorCell createCollection_ql48ef_a_0() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent());
editorCell.setCellId("Collection_ql48ef_a_0");
editorCell.setBig(true);
editorCell.setCellContext(getCellFactory().getCellContext());
editorCell.addEditorCell(createConstant_ql48ef_a0_0());
editorCell.addEditorCell(createProperty_ql48ef_b0());
editorCell.addEditorCell(createConstant_ql48ef_c0());
editorCell.addEditorCell(createProperty_ql48ef_d0());
editorCell.addEditorCell(createConstant_ql48ef_e0());
editorCell.addEditorCell(createAlternation_ql48ef_f0());
if (nodeCondition_ql48ef_a6a()) {
editorCell.addEditorCell(createCollection_ql48ef_g0());
}
return editorCell;
}
private boolean nodeCondition_ql48ef_a6a() {
return SPropertyOperations.getBoolean(myNode, MetaAdapterFactory.getProperty(0x8585453e6bfb4d80L, 0x98deb16074f1d86cL, 0x11e31babe12L, 0x1ad0cd452e251146L, "useLabelSelection"));
}
private EditorCell createConstant_ql48ef_a0_0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "is in inspector");
editorCell.setCellId("Constant_ql48ef_a0_0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createProperty_ql48ef_b0() {
CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext());
provider.setRole("isInInspector");
provider.setNoTargetText("<no isInInspector>");
EditorCell editorCell;
editorCell = provider.createEditorCell(getEditorContext());
editorCell.setCellId("property_isInInspector");
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;
}
private EditorCell createConstant_ql48ef_c0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "cell id:");
editorCell.setCellId("Constant_ql48ef_c0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createProperty_ql48ef_d0() {
CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext());
provider.setRole("cellId");
provider.setNoTargetText("<no cellId>");
EditorCell editorCell;
editorCell = provider.createEditorCell(getEditorContext());
editorCell.setCellId("property_cellId");
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;
}
private EditorCell createConstant_ql48ef_e0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "position:");
editorCell.setCellId("Constant_ql48ef_e0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createAlternation_ql48ef_f0() {
boolean alternationCondition = true;
alternationCondition = nodeCondition_ql48ef_a5a();
EditorCell editorCell = null;
if (alternationCondition) {
editorCell = createConstant_ql48ef_a5a();
} else {
editorCell = createNonEmptyProperty_ql48ef_a5a();
}
Style style = new StyleImpl();
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
return editorCell;
}
private boolean nodeCondition_ql48ef_a5a() {
return SPropertyOperations.getBoolean(myNode, MetaAdapterFactory.getProperty(0x8585453e6bfb4d80L, 0x98deb16074f1d86cL, 0x11e31babe12L, 0x11e3fde6f41L, "isLastPosition"));
}
private EditorCell createConstant_ql48ef_a5a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "last");
editorCell.setCellId("Constant_ql48ef_a5a");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createNonEmptyProperty_ql48ef_a5a() {
CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext());
provider.setRole("caretPosition");
provider.setNoTargetText("<no caretPosition>");
provider.setAllowsEmptyTarget(true);
EditorCell editorCell;
editorCell = provider.createEditorCell(getEditorContext());
editorCell.setCellId("property_caretPosition");
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_ql48ef_g0() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent());
editorCell.setCellId("Collection_ql48ef_g0");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
editorCell.addEditorCell(createConstant_ql48ef_a6a());
editorCell.addEditorCell(createProperty_ql48ef_b6a());
editorCell.addEditorCell(createConstant_ql48ef_c6a());
editorCell.addEditorCell(createProperty_ql48ef_d6a());
return editorCell;
}
private EditorCell createConstant_ql48ef_a6a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "selection start:");
editorCell.setCellId("Constant_ql48ef_a6a");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createProperty_ql48ef_b6a() {
CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext());
provider.setRole("selectionStart");
provider.setNoTargetText("<no selectionStart>");
EditorCell editorCell;
editorCell = provider.createEditorCell(getEditorContext());
editorCell.setCellId("property_selectionStart");
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;
}
private EditorCell createConstant_ql48ef_c6a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "selection end:");
editorCell.setCellId("Constant_ql48ef_c6a");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createProperty_ql48ef_d6a() {
CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext());
provider.setRole("selectionEnd");
provider.setNoTargetText("<no selectionEnd>");
EditorCell editorCell;
editorCell = provider.createEditorCell(getEditorContext());
editorCell.setCellId("property_selectionEnd");
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;
}
}