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; import jetbrains.mps.baseLanguage.regexp.behavior.ReplaceRegexpOperation__BehaviorDescriptor; /*package*/ class ReplaceRegexpOperation_InspectorBuilder_a extends AbstractEditorBuilder { @NotNull private SNode myNode; public ReplaceRegexpOperation_InspectorBuilder_a(@NotNull EditorContext context, @NotNull SNode node) { super(context); myNode = node; } @NotNull @Override public SNode getNode() { return myNode; } /*package*/ EditorCell createCell() { return createCollection_ldr481_a_0(); } private EditorCell createCollection_ldr481_a_0() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent()); editorCell.setCellId("Collection_ldr481_a_0"); editorCell.setBig(true); editorCell.setCellContext(getCellFactory().getCellContext()); editorCell.addEditorCell(createConstant_ldr481_a0_0()); editorCell.addEditorCell(createConstant_ldr481_b0()); editorCell.addEditorCell(createProperty_ldr481_c0()); editorCell.addEditorCell(createConstant_ldr481_d0()); editorCell.addEditorCell(createConstant_ldr481_e0_0()); editorCell.addEditorCell(createConstant_ldr481_f0_0()); editorCell.addEditorCell(createConstant_ldr481_g0_0()); editorCell.addEditorCell(createProperty_ldr481_h0()); editorCell.addEditorCell(createConstant_ldr481_i0_0()); editorCell.addEditorCell(createConstant_ldr481_j0()); editorCell.addEditorCell(createProperty_ldr481_k0()); editorCell.addEditorCell(createConstant_ldr481_l0()); editorCell.addEditorCell(createConstant_ldr481_m0()); editorCell.addEditorCell(createConstant_ldr481_n0()); editorCell.addEditorCell(createConstant_ldr481_o0()); editorCell.addEditorCell(createProperty_ldr481_p0()); editorCell.addEditorCell(createConstant_ldr481_q0()); editorCell.addEditorCell(createConstant_ldr481_r0()); editorCell.addEditorCell(createConstant_ldr481_s0()); editorCell.addEditorCell(createConstant_ldr481_t0()); editorCell.addEditorCell(createConstant_ldr481_u0()); editorCell.addEditorCell(createConstant_ldr481_v0()); editorCell.addEditorCell(createReadOnlyModelAccessor_ldr481_w0()); editorCell.addEditorCell(createConstant_ldr481_x0()); editorCell.addEditorCell(createReadOnlyModelAccessor_ldr481_y0()); return editorCell; } private EditorCell createConstant_ldr481_a0_0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "Options:"); editorCell.setCellId("Constant_ldr481_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_ldr481_b0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "Global replace (/g) :"); editorCell.setCellId("Constant_ldr481_b0"); editorCell.setDefaultText(""); return editorCell; } private EditorCell createProperty_ldr481_c0() { CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext()); provider.setRole("globalReplace"); provider.setNoTargetText("<no globalReplace>"); EditorCell editorCell; editorCell = provider.createEditorCell(getEditorContext()); editorCell.setCellId("property_globalReplace"); 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_ldr481_d0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, " "); editorCell.setCellId("Constant_ldr481_d0"); editorCell.setDefaultText(""); return editorCell; } private EditorCell createConstant_ldr481_e0_0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "Replaces every subsequence of the input sequence that matches the pattern with the given replacement string."); editorCell.setCellId("Constant_ldr481_e0_0"); Style style = new StyleImpl(); style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true); style.set(StyleAttributes.FONT_STYLE, MPSFonts.ITALIC); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createConstant_ldr481_f0_0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ""); editorCell.setCellId("Constant_ldr481_f0_0"); Style style = new StyleImpl(); style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createConstant_ldr481_g0_0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "Case insensitive (/i) :"); editorCell.setCellId("Constant_ldr481_g0_0"); editorCell.setDefaultText(""); return editorCell; } private EditorCell createProperty_ldr481_h0() { 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_ldr481_i0_0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ""); editorCell.setCellId("Constant_ldr481_i0_0"); Style style = new StyleImpl(); style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createConstant_ldr481_j0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "Dot all (/s) : "); editorCell.setCellId("Constant_ldr481_j0"); editorCell.setDefaultText(""); return editorCell; } private EditorCell createProperty_ldr481_k0() { 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_ldr481_l0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, " "); editorCell.setCellId("Constant_ldr481_l0"); Style style = new StyleImpl(); style.set(StyleAttributes.SELECTABLE, false); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createConstant_ldr481_m0() { 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_ldr481_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_ldr481_n0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ""); editorCell.setCellId("Constant_ldr481_n0"); Style style = new StyleImpl(); style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createConstant_ldr481_o0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "Multiline mode (/m) : "); editorCell.setCellId("Constant_ldr481_o0"); editorCell.setDefaultText(""); return editorCell; } private EditorCell createProperty_ldr481_p0() { 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_ldr481_q0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, " "); editorCell.setCellId("Constant_ldr481_q0"); Style style = new StyleImpl(); style.set(StyleAttributes.SELECTABLE, false); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createConstant_ldr481_r0() { 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_ldr481_r0"); 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_ldr481_s0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, " "); editorCell.setCellId("Constant_ldr481_s0"); Style style = new StyleImpl(); style.set(StyleAttributes.SELECTABLE, false); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createConstant_ldr481_t0() { 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_ldr481_t0"); 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_ldr481_u0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ""); editorCell.setCellId("Constant_ldr481_u0"); Style style = new StyleImpl(); style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createConstant_ldr481_v0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "Value:"); editorCell.setCellId("Constant_ldr481_v0"); editorCell.setDefaultText(""); return editorCell; } private EditorCell createReadOnlyModelAccessor_ldr481_w0() { 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, 0x34ae970c1923d18aL, 0x34ae970c1924ee3bL, "search"))) ? "/" + Regexp__BehaviorDescriptor.toString_idhEwIUjb.invoke(SLinkOperations.getTarget(myNode, MetaAdapterFactory.getContainmentLink(0xdaafa647f1f74b0bL, 0xb09669cd7c8408c0L, 0x34ae970c1923d18aL, 0x34ae970c1924ee3bL, "search"))) + "/" : "<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_ldr481_w0"); Style style = new StyleImpl(); style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true); style.set(StyleAttributes.EDITABLE, false); editorCell.getStyle().putAll(style); return editorCell; } private EditorCell createConstant_ldr481_x0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "Replacement:"); editorCell.setCellId("Constant_ldr481_x0"); editorCell.setDefaultText(""); return editorCell; } private EditorCell createReadOnlyModelAccessor_ldr481_y0() { EditorCell_Property editorCell = EditorCell_Property.create(getEditorContext(), new ModelAccessor() { public String getText() { return "\"" + ReplaceRegexpOperation__BehaviorDescriptor.getReplacementString_id3iI_KKp9qzv.invoke(myNode) + "\""; } 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_ldr481_y0"); Style style = new StyleImpl(); style.set(StyleAttributes.EDITABLE, false); editorCell.getStyle().putAll(style); return editorCell; } }