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.lang.smodel.generator.smodelAdapter.SPropertyOperations; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; 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.RefCellCellProvider; import jetbrains.mps.util.Computable; import jetbrains.mps.editor.runtime.impl.CellUtil; import jetbrains.mps.nodeEditor.EditorManager; import jetbrains.mps.lang.editor.cellProviders.PropertyCellProvider; import jetbrains.mps.openapi.editor.style.StyleRegistry; import jetbrains.mps.nodeEditor.MPSColors; /*package*/ class CellModel_URL_InspectorBuilder_a extends AbstractEditorBuilder { @NotNull private SNode myNode; public CellModel_URL_InspectorBuilder_a(@NotNull EditorContext context, @NotNull SNode node) { super(context); myNode = node; } @NotNull @Override public SNode getNode() { return myNode; } /*package*/ EditorCell createCell() { return createCollection_wgj6gq_a_0(); } private EditorCell createCollection_wgj6gq_a_0() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Vertical()); editorCell.setCellId("Collection_wgj6gq_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_wgj6gq_a0_0()); editorCell.addEditorCell(createConstant_wgj6gq_b0_0()); editorCell.addEditorCell(createConstant_wgj6gq_c0()); editorCell.addEditorCell(createCollection_wgj6gq_d0()); return editorCell; } private EditorCell createComponent_wgj6gq_a0_0() { EditorCell editorCell = getCellFactory().createEditorComponentCell(myNode, "jetbrains.mps.lang.editor.editor._CellModel_Common"); return editorCell; } private EditorCell createConstant_wgj6gq_b0_0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ""); editorCell.setCellId("Constant_wgj6gq_b0_0"); Style style = new StyleImpl(); style.set(StyleAttributes.SELECTABLE, false); style.set(StyleAttributes.FONT_STYLE, MPSFonts.BOLD); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createConstant_wgj6gq_c0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "URL cell:"); editorCell.setCellId("Constant_wgj6gq_c0"); Style style = new StyleImpl(); new headerStyleClass(getEditorContext(), getNode()).apply(style, editorCell); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createCollection_wgj6gq_d0() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Vertical()); editorCell.setCellId("Collection_wgj6gq_d0"); Style style = new StyleImpl(); style.set(StyleAttributes.DRAW_BORDER, true); editorCell.getStyle().putAll(style); editorCell.setGridLayout(true); editorCell.addEditorCell(createCollection_wgj6gq_a3a()); if (nodeCondition_wgj6gq_a1d0()) { editorCell.addEditorCell(createCollection_wgj6gq_b3a()); } if (nodeCondition_wgj6gq_a2d0()) { editorCell.addEditorCell(createCollection_wgj6gq_c3a()); } editorCell.addEditorCell(createCollection_wgj6gq_d3a()); return editorCell; } private boolean nodeCondition_wgj6gq_a1d0() { return !(SPropertyOperations.getBoolean(myNode, MetaAdapterFactory.getProperty(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x10964446123L, 0x11ac9707881L, "emptyNoTargetText"))); } private boolean nodeCondition_wgj6gq_a2d0() { return SPropertyOperations.getString(myNode, MetaAdapterFactory.getProperty(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x10964446123L, 0x109648427f2L, "noTargetText")) == null; } private EditorCell createCollection_wgj6gq_a3a() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal()); editorCell.setCellId("Collection_wgj6gq_a3a"); Style style = new StyleImpl(); style.set(StyleAttributes.SELECTABLE, false); style.set(StyleAttributes.DRAW_BORDER, true); editorCell.getStyle().putAll(style); editorCell.addEditorCell(createConstant_wgj6gq_a0d0()); editorCell.addEditorCell(createRefCell_wgj6gq_b0d0()); return editorCell; } private EditorCell createConstant_wgj6gq_a0d0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "property"); editorCell.setCellId("Constant_wgj6gq_a0d0"); Style style = new StyleImpl(); new propertyStyleClass(getEditorContext(), getNode()).apply(style, editorCell); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createRefCell_wgj6gq_b0d0() { CellProviderWithRole provider = new RefCellCellProvider(myNode, getEditorContext()) { @Override protected EditorCell createRefCell(EditorContext context, final SNode effectiveNode, SNode node) { EditorCell cell = getUpdateSession().updateReferencedNodeCell(new Computable<EditorCell>() { public EditorCell compute() { return new CellModel_URL_InspectorBuilder_a.Inline_Builder_wgj6gq_a1a3a(getEditorContext(), myNode, effectiveNode).createCell(); } }, effectiveNode, "relationDeclaration"); CellUtil.setupIDeprecatableStyles(effectiveNode, cell); setSemanticNodeToCells(cell, myNode); installDeleteActions_atLeastOne(cell); return cell; } }; provider.setRole("propertyDeclaration"); provider.setNoTargetText("<no property>"); EditorCell editorCell; editorCell = provider.createEditorCell(getEditorContext()); if (editorCell.getRole() == null) { editorCell.setReferenceCell(true); editorCell.setRole("relationDeclaration"); } Style style = new StyleImpl(); style.set(StyleAttributes.DRAW_BORDER, 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; } /*package*/ static class Inline_Builder_wgj6gq_a1a3a extends AbstractEditorBuilder { @NotNull private SNode myNode; private SNode myReferencingNode; /*package*/ Inline_Builder_wgj6gq_a1a3a(@NotNull EditorContext context, SNode referencingNode, @NotNull SNode node) { super(context); myReferencingNode = referencingNode; myNode = node; } /*package*/ EditorCell createCell() { return createProperty_wgj6gq_a0b0d0(); } @NotNull @Override public SNode getNode() { return myNode; } private EditorCell createProperty_wgj6gq_a0b0d0() { CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext()); provider.setRole("name"); provider.setNoTargetText("<no name>"); provider.setReadOnly(true); EditorCell editorCell; editorCell = provider.createEditorCell(getEditorContext()); editorCell.setCellId("property_name_1"); Style style = new StyleImpl(); style.set(StyleAttributes.DRAW_BORDER, 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 createCollection_wgj6gq_b3a() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal()); editorCell.setCellId("Collection_wgj6gq_b3a"); Style style = new StyleImpl(); style.set(StyleAttributes.SELECTABLE, false); style.set(StyleAttributes.DRAW_BORDER, true); editorCell.getStyle().putAll(style); editorCell.addEditorCell(createConstant_wgj6gq_a1d0()); editorCell.addEditorCell(createProperty_wgj6gq_b1d0()); return editorCell; } private EditorCell createConstant_wgj6gq_a1d0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "text*"); editorCell.setCellId("Constant_wgj6gq_a1d0"); Style style = new StyleImpl(); new propertyStyleClass(getEditorContext(), getNode()).apply(style, editorCell); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createProperty_wgj6gq_b1d0() { CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext()); provider.setRole("noTargetText"); provider.setNoTargetText("<none>"); provider.setAllowsEmptyTarget(true); EditorCell editorCell; editorCell = provider.createEditorCell(getEditorContext()); editorCell.setCellId("property_noTargetText"); 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_wgj6gq_c3a() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal()); editorCell.setCellId("Collection_wgj6gq_c3a"); Style style = new StyleImpl(); style.set(StyleAttributes.SELECTABLE, false); style.set(StyleAttributes.DRAW_BORDER, true); editorCell.getStyle().putAll(style); editorCell.addEditorCell(createConstant_wgj6gq_a2d0()); editorCell.addEditorCell(createProperty_wgj6gq_b2d0()); return editorCell; } private EditorCell createConstant_wgj6gq_a2d0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "empty text*"); editorCell.setCellId("Constant_wgj6gq_a2d0"); Style style = new StyleImpl(); new propertyStyleClass(getEditorContext(), getNode()).apply(style, editorCell); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createProperty_wgj6gq_b2d0() { CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext()); provider.setRole("emptyNoTargetText"); provider.setNoTargetText("<none>"); provider.setAllowsEmptyTarget(true); EditorCell editorCell; editorCell = provider.createEditorCell(getEditorContext()); editorCell.setCellId("property_emptyNoTargetText"); 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_wgj6gq_d3a() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal()); editorCell.setCellId("Collection_wgj6gq_d3a"); Style style = new StyleImpl(); style.set(StyleAttributes.SELECTABLE, false); style.set(StyleAttributes.DRAW_BORDER, true); editorCell.getStyle().putAll(style); editorCell.addEditorCell(createConstant_wgj6gq_a3d0()); editorCell.addEditorCell(createProperty_wgj6gq_b3d0()); return editorCell; } private EditorCell createConstant_wgj6gq_a3d0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "read only"); editorCell.setCellId("Constant_wgj6gq_a3d0"); Style style = new StyleImpl(); new propertyStyleClass(getEditorContext(), getNode()).apply(style, editorCell); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createProperty_wgj6gq_b3d0() { CellProviderWithRole provider = new PropertyCellProvider(myNode, getEditorContext()); provider.setRole("readOnly"); provider.setNoTargetText("<no readOnly>"); EditorCell editorCell; editorCell = provider.createEditorCell(getEditorContext()); editorCell.setCellId("property_readOnly"); Style style = new StyleImpl(); style.set(StyleAttributes.DRAW_BORDER, 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; } }