package jetbrains.mps.lang.editor.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.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.nodeEditor.MPSFonts;
import jetbrains.mps.lang.editor.editor.Styles_StyleSheet.headerStyleClass;
import jetbrains.mps.nodeEditor.cellLayout.CellLayout_Horizontal;
import jetbrains.mps.lang.editor.editor.Styles_StyleSheet.propertyStyleClass;
import jetbrains.mps.nodeEditor.cellProviders.CellProviderWithRole;
import jetbrains.mps.lang.editor.cellProviders.PropertyCellProvider;
import jetbrains.mps.openapi.editor.style.StyleRegistry;
import jetbrains.mps.nodeEditor.MPSColors;
import jetbrains.mps.nodeEditor.EditorManager;
/*package*/ class CellModel_Constant_InspectorBuilder_a extends AbstractEditorBuilder {
@NotNull
private SNode myNode;
public CellModel_Constant_InspectorBuilder_a(@NotNull EditorContext context, @NotNull SNode node) {
super(context);
myNode = node;
}
@NotNull
@Override
public SNode getNode() {
return myNode;
}
/*package*/ EditorCell createCell() {
return createCollection_8hdu2g_a_0();
}
private EditorCell createCollection_8hdu2g_a_0() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Vertical());
editorCell.setCellId("Collection_8hdu2g_a_0");
editorCell.setBig(true);
editorCell.setCellContext(getCellFactory().getCellContext());
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
editorCell.getStyle().putAll(style);
editorCell.addEditorCell(createComponent_8hdu2g_a0_0());
editorCell.addEditorCell(createConstant_8hdu2g_b0());
editorCell.addEditorCell(createConstant_8hdu2g_c0());
editorCell.addEditorCell(createCollection_8hdu2g_d0());
return editorCell;
}
private EditorCell createComponent_8hdu2g_a0_0() {
EditorCell editorCell = getCellFactory().createEditorComponentCell(myNode, "jetbrains.mps.lang.editor.editor._CellModel_Common");
return editorCell;
}
private EditorCell createConstant_8hdu2g_b0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "");
editorCell.setCellId("Constant_8hdu2g_b0");
Style style = new StyleImpl();
style.set(StyleAttributes.FONT_STYLE, MPSFonts.BOLD);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_8hdu2g_c0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "Constant cell:");
editorCell.setCellId("Constant_8hdu2g_c0");
Style style = new StyleImpl();
new headerStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createCollection_8hdu2g_d0() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Vertical());
editorCell.setCellId("Collection_8hdu2g_d0");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
style.set(StyleAttributes.DRAW_BORDER, true);
editorCell.getStyle().putAll(style);
editorCell.setGridLayout(true);
editorCell.addEditorCell(createCollection_8hdu2g_a3a());
editorCell.addEditorCell(createCollection_8hdu2g_b3a());
return editorCell;
}
private EditorCell createCollection_8hdu2g_a3a() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal());
editorCell.setCellId("Collection_8hdu2g_a3a");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
style.set(StyleAttributes.DRAW_BORDER, true);
editorCell.getStyle().putAll(style);
editorCell.addEditorCell(createConstant_8hdu2g_a0d0());
editorCell.addEditorCell(createProperty_8hdu2g_b0d0());
return editorCell;
}
private EditorCell createConstant_8hdu2g_a0d0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "text");
editorCell.setCellId("Constant_8hdu2g_a0d0");
Style style = new StyleImpl();
new propertyStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createProperty_8hdu2g_b0d0() {
CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext());
provider.setRole("text");
provider.setNoTargetText("<none>");
provider.setAllowsEmptyTarget(true);
EditorCell editorCell;
editorCell = provider.createEditorCell(getEditorContext());
editorCell.setCellId("property_text_1");
Style style = new StyleImpl();
style.set(StyleAttributes.DRAW_BORDER, true);
style.set(StyleAttributes.TEXT_BACKGROUND_COLOR, StyleRegistry.getInstance().getSimpleColor(MPSColors.yellow));
style.set(StyleAttributes.SELECTED_TEXT_BACKGROUND_COLOR, StyleRegistry.getInstance().getSimpleColor(MPSColors.cyan));
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 createCollection_8hdu2g_b3a() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal());
editorCell.setCellId("Collection_8hdu2g_b3a");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
style.set(StyleAttributes.DRAW_BORDER, true);
editorCell.getStyle().putAll(style);
editorCell.addEditorCell(createConstant_8hdu2g_a1d0());
editorCell.addEditorCell(createProperty_8hdu2g_b1d0());
return editorCell;
}
private EditorCell createConstant_8hdu2g_a1d0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "text*");
editorCell.setCellId("Constant_8hdu2g_a1d0");
Style style = new StyleImpl();
new propertyStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createProperty_8hdu2g_b1d0() {
CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext());
provider.setRole("nullText");
provider.setNoTargetText("<none>");
provider.setAllowsEmptyTarget(true);
EditorCell editorCell;
editorCell = provider.createEditorCell(getEditorContext());
editorCell.setCellId("property_nullText");
Style style = new StyleImpl();
style.set(StyleAttributes.DRAW_BORDER, true);
style.set(StyleAttributes.TEXT_BACKGROUND_COLOR, StyleRegistry.getInstance().getSimpleColor(MPSColors.yellow));
style.set(StyleAttributes.SELECTED_TEXT_BACKGROUND_COLOR, StyleRegistry.getInstance().getSimpleColor(MPSColors.cyan));
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;
}
}