package jetbrains.mps.baseLanguage.regexp.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.cells.EditorCell_Constant;
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.cellProviders.CellProviderWithRole;
import jetbrains.mps.lang.editor.cellProviders.PropertyCellProvider;
import jetbrains.mps.nodeEditor.EditorManager;
import jetbrains.mps.nodeEditor.MPSFonts;
import jetbrains.mps.nodeEditor.cells.EditorCell_Property;
import jetbrains.mps.nodeEditor.cells.ModelAccessor;
import jetbrains.mps.baseLanguage.regexp.behavior.Regexp__BehaviorDescriptor;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import jetbrains.mps.util.EqualUtil;
import jetbrains.mps.openapi.editor.cells.CellActionType;
import jetbrains.mps.editor.runtime.cells.EmptyCellAction;
/*package*/ class InlineRegexpExpression_InspectorBuilder_a extends AbstractEditorBuilder {
@NotNull
private SNode myNode;
public InlineRegexpExpression_InspectorBuilder_a(@NotNull EditorContext context, @NotNull SNode node) {
super(context);
myNode = node;
}
@NotNull
@Override
public SNode getNode() {
return myNode;
}
/*package*/ EditorCell createCell() {
return createCollection_5rturt_a_0();
}
private EditorCell createCollection_5rturt_a_0() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent());
editorCell.setCellId("Collection_5rturt_a_0");
editorCell.setBig(true);
editorCell.setCellContext(getCellFactory().getCellContext());
editorCell.addEditorCell(createConstant_5rturt_a0_0());
editorCell.addEditorCell(createConstant_5rturt_b0());
editorCell.addEditorCell(createProperty_5rturt_c0());
editorCell.addEditorCell(createConstant_5rturt_d0_0());
editorCell.addEditorCell(createConstant_5rturt_e0_0());
editorCell.addEditorCell(createProperty_5rturt_f0());
editorCell.addEditorCell(createConstant_5rturt_g0());
editorCell.addEditorCell(createConstant_5rturt_h0());
editorCell.addEditorCell(createConstant_5rturt_i0());
editorCell.addEditorCell(createConstant_5rturt_j0());
editorCell.addEditorCell(createProperty_5rturt_k0());
editorCell.addEditorCell(createConstant_5rturt_l0());
editorCell.addEditorCell(createConstant_5rturt_m0());
editorCell.addEditorCell(createConstant_5rturt_n0());
editorCell.addEditorCell(createConstant_5rturt_o0());
editorCell.addEditorCell(createConstant_5rturt_p0());
editorCell.addEditorCell(createConstant_5rturt_q0());
editorCell.addEditorCell(createReadOnlyModelAccessor_5rturt_r0());
return editorCell;
}
private EditorCell createConstant_5rturt_a0_0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "Options:");
editorCell.setCellId("Constant_5rturt_a0_0");
Style style = new StyleImpl();
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_5rturt_b0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "Case insensitive (/i) :");
editorCell.setCellId("Constant_5rturt_b0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createProperty_5rturt_c0() {
CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext());
provider.setRole("caseInsensitive");
provider.setNoTargetText("<no caseInsensitive>");
EditorCell editorCell;
editorCell = provider.createEditorCell(getEditorContext());
editorCell.setCellId("property_caseInsensitive");
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_5rturt_d0_0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "");
editorCell.setCellId("Constant_5rturt_d0_0");
Style style = new StyleImpl();
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_5rturt_e0_0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "Dot all (/s) : ");
editorCell.setCellId("Constant_5rturt_e0_0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createProperty_5rturt_f0() {
CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext());
provider.setRole("dotAll");
provider.setNoTargetText("<no dotAll>");
EditorCell editorCell;
editorCell = provider.createEditorCell(getEditorContext());
editorCell.setCellId("property_dotAll");
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_5rturt_g0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, " ");
editorCell.setCellId("Constant_5rturt_g0");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_5rturt_h0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "If dot all mode is enabled, the . symbol class will include new line characters");
editorCell.setCellId("Constant_5rturt_h0");
Style style = new StyleImpl();
style.set(StyleAttributes.FONT_STYLE, MPSFonts.ITALIC);
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_5rturt_i0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "");
editorCell.setCellId("Constant_5rturt_i0");
Style style = new StyleImpl();
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_5rturt_j0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "Multiline mode (/m) : ");
editorCell.setCellId("Constant_5rturt_j0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createProperty_5rturt_k0() {
CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext());
provider.setRole("multiLine");
provider.setNoTargetText("<no multiLine>");
EditorCell editorCell;
editorCell = provider.createEditorCell(getEditorContext());
editorCell.setCellId("property_multiLine");
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_5rturt_l0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, " ");
editorCell.setCellId("Constant_5rturt_l0");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_5rturt_m0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "If multiline mode is enabled, the $ and ^ will work not only in the start and");
editorCell.setCellId("Constant_5rturt_m0");
Style style = new StyleImpl();
style.set(StyleAttributes.FONT_STYLE, MPSFonts.ITALIC);
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_5rturt_n0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, " ");
editorCell.setCellId("Constant_5rturt_n0");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_5rturt_o0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "the end of the text but on starts and ends of lines separated by new line characters");
editorCell.setCellId("Constant_5rturt_o0");
Style style = new StyleImpl();
style.set(StyleAttributes.FONT_STYLE, MPSFonts.ITALIC);
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_5rturt_p0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "");
editorCell.setCellId("Constant_5rturt_p0");
Style style = new StyleImpl();
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_5rturt_q0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "Value:");
editorCell.setCellId("Constant_5rturt_q0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createReadOnlyModelAccessor_5rturt_r0() {
EditorCell_Property editorCell = EditorCell_Property.create(getEditorContext(), new ModelAccessor() {
public String getText() {
return ((boolean) Regexp__BehaviorDescriptor.isValid_id48bMILtL4il.invoke(SLinkOperations.getTarget(myNode, MetaAdapterFactory.getContainmentLink(0xdaafa647f1f74b0bL, 0xb09669cd7c8408c0L, 0x1117648961dL, 0x11176490e08L, "regexp"))) ? "/" + Regexp__BehaviorDescriptor.toString_idhEwIUjb.invoke(SLinkOperations.getTarget(myNode, MetaAdapterFactory.getContainmentLink(0xdaafa647f1f74b0bL, 0xb09669cd7c8408c0L, 0x1117648961dL, 0x11176490e08L, "regexp"))) + "/" : "<invalid>");
}
public void setText(String s) {
}
public boolean isValidText(String s) {
return EqualUtil.equals(s, getText());
}
}, myNode);
editorCell.setAction(CellActionType.DELETE, EmptyCellAction.getInstance());
editorCell.setAction(CellActionType.BACKSPACE, EmptyCellAction.getInstance());
editorCell.setCellId("ReadOnlyModelAccessor_5rturt_r0");
Style style = new StyleImpl();
style.set(StyleAttributes.EDITABLE, false);
editorCell.getStyle().putAll(style);
return editorCell;
}
}