package jetbrains.mps.baseLanguage.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.lang.editor.cellProviders.SingleRoleCellProvider; import org.jetbrains.mps.openapi.language.SContainmentLink; import jetbrains.mps.openapi.editor.cells.CellActionType; import jetbrains.mps.editor.runtime.impl.cellActions.CellAction_DeleteSmart; import jetbrains.mps.openapi.editor.cells.DefaultSubstituteInfo; import jetbrains.mps.nodeEditor.cellMenu.SChildSubstituteInfo; import jetbrains.mps.openapi.editor.menus.transformation.SNodeLocation; 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.baseLanguage.editor.BaseLanguageStyle_StyleSheet.KeyWordStyleClass; import jetbrains.mps.openapi.editor.style.StyleRegistry; import jetbrains.mps.nodeEditor.MPSColors; import jetbrains.mps.editor.runtime.style.FocusPolicy; import jetbrains.mps.lang.editor.menus.transformation.NamedTransformationMenuLookup; import jetbrains.mps.smodel.language.LanguageRegistry; import jetbrains.mps.nodeEditor.cellMenu.CompositeSubstituteInfo; import jetbrains.mps.nodeEditor.cellMenu.BasicCellContext; import jetbrains.mps.nodeEditor.cellMenu.SubstituteInfoPartExt; import jetbrains.mps.nodeEditor.cellMenu.SChildSubstituteInfoPartEx; import jetbrains.mps.lang.editor.generator.internal.AbstractCellMenuPart_ReplaceNode_CustomNodeConcept; import org.jetbrains.mps.openapi.language.SAbstractConcept; /*package*/ class IncompleteMemberDeclaration_EditorBuilder_a extends AbstractEditorBuilder { @NotNull private SNode myNode; public IncompleteMemberDeclaration_EditorBuilder_a(@NotNull EditorContext context, @NotNull SNode node) { super(context); myNode = node; } @NotNull @Override public SNode getNode() { return myNode; } /*package*/ EditorCell createCell() { return createCollection_imlbz9_a(); } private EditorCell createCollection_imlbz9_a() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent()); editorCell.setCellId("Collection_imlbz9_a"); editorCell.setBig(true); editorCell.setCellContext(getCellFactory().getCellContext()); editorCell.addEditorCell(createRefNode_imlbz9_a0()); if (nodeCondition_imlbz9_a1a()) { editorCell.addEditorCell(createConstant_imlbz9_b0()); } if (nodeCondition_imlbz9_a2a()) { editorCell.addEditorCell(createConstant_imlbz9_c0()); } if (nodeCondition_imlbz9_a3a()) { editorCell.addEditorCell(createConstant_imlbz9_d0()); } if (nodeCondition_imlbz9_a4a()) { editorCell.addEditorCell(createConstant_imlbz9_e0()); } if (nodeCondition_imlbz9_a5a()) { editorCell.addEditorCell(createConstant_imlbz9_f0()); } if (nodeCondition_imlbz9_a6a()) { editorCell.addEditorCell(createConstant_imlbz9_g0()); } if (nodeCondition_imlbz9_a7a()) { editorCell.addEditorCell(createConstant_imlbz9_h0()); } editorCell.addEditorCell(createRefNode_imlbz9_i0()); editorCell.addEditorCell(createConstant_imlbz9_j0()); return editorCell; } private boolean nodeCondition_imlbz9_a1a() { return SPropertyOperations.getBoolean(myNode, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x32175ac2e6fcc181L, 0x32175ac2e6fdaf94L, "static")); } private boolean nodeCondition_imlbz9_a2a() { return SPropertyOperations.getBoolean(myNode, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x32175ac2e6fcc181L, 0x32175ac2e6fdaf96L, "final")); } private boolean nodeCondition_imlbz9_a3a() { return SPropertyOperations.getBoolean(myNode, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x32175ac2e6fcc181L, 0x32175ac2e6fdaf99L, "abstract")); } private boolean nodeCondition_imlbz9_a4a() { return SPropertyOperations.getBoolean(myNode, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x32175ac2e6fcc181L, 0x32175ac2e6fdb595L, "synchronized")); } private boolean nodeCondition_imlbz9_a5a() { return SPropertyOperations.getBoolean(myNode, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x32175ac2e6fcc181L, 0x58197aef3e5e4dd7L, "transient")); } private boolean nodeCondition_imlbz9_a6a() { return SPropertyOperations.getBoolean(myNode, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x32175ac2e6fcc181L, 0x32175ac2e6fdbea6L, "volatile")); } private boolean nodeCondition_imlbz9_a7a() { return SPropertyOperations.getBoolean(myNode, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x32175ac2e6fcc181L, 0x73f30e3dfbaac721L, "native")); } private EditorCell createRefNode_imlbz9_a0() { SingleRoleCellProvider provider = new IncompleteMemberDeclaration_EditorBuilder_a.visibilitySingleRoleHandler_imlbz9_a0(myNode, MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x112670d273fL, 0x112670d886aL, "visibility"), getEditorContext()); return provider.createCell(); } private static class visibilitySingleRoleHandler_imlbz9_a0 extends SingleRoleCellProvider { @NotNull private SNode myNode; public visibilitySingleRoleHandler_imlbz9_a0(SNode ownerNode, SContainmentLink containmentLink, EditorContext context) { super(containmentLink, context); myNode = ownerNode; } @Override @NotNull public SNode getNode() { return myNode; } protected EditorCell createChildCell(SNode child) { EditorCell editorCell = getUpdateSession().updateChildNodeCell(child); editorCell.setAction(CellActionType.DELETE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x112670d273fL, 0x112670d886aL, "visibility"), child)); editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x112670d273fL, 0x112670d886aL, "visibility"), child)); installCellInfo(child, editorCell); return editorCell; } private void installCellInfo(SNode child, EditorCell editorCell) { if (editorCell.getSubstituteInfo() == null || editorCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) { editorCell.setSubstituteInfo(new SChildSubstituteInfo(editorCell, myNode, MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x112670d273fL, 0x112670d886aL, "visibility"), child)); } if (editorCell.getRole() == null) { editorCell.setRole("visibility"); } } @Override protected EditorCell createEmptyCell() { getCellFactory().pushCellContext(); getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(getNode(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x112670d273fL, 0x112670d886aL, "visibility"))); try { EditorCell editorCell = createCollection_imlbz9_a0a(); installCellInfo(null, editorCell); setCellContext(editorCell); return editorCell; } finally { getCellFactory().popCellContext(); } } private EditorCell createCollection_imlbz9_a0a() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent()); editorCell.setCellId("Collection_imlbz9_a0a"); Style style = new StyleImpl(); style.set(StyleAttributes.SELECTABLE, false); editorCell.getStyle().putAll(style); return editorCell; } } private EditorCell createConstant_imlbz9_b0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "static"); editorCell.setCellId("Constant_imlbz9_b0"); Style style = new StyleImpl(); new KeyWordStyleClass(getEditorContext(), getNode()).apply(style, editorCell); editorCell.getStyle().putAll(style); DeleteStaticInIncompleteMember.setCellActions(editorCell, myNode, getEditorContext()); editorCell.setDefaultText(""); return editorCell; } private EditorCell createConstant_imlbz9_c0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "final"); editorCell.setCellId("Constant_imlbz9_c0"); Style style = new StyleImpl(); new KeyWordStyleClass(getEditorContext(), getNode()).apply(style, editorCell); editorCell.getStyle().putAll(style); DeleteFinalInIncompleteMember.setCellActions(editorCell, myNode, getEditorContext()); editorCell.setDefaultText(""); return editorCell; } private EditorCell createConstant_imlbz9_d0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "abstract"); editorCell.setCellId("Constant_imlbz9_d0"); Style style = new StyleImpl(); new KeyWordStyleClass(getEditorContext(), getNode()).apply(style, editorCell); editorCell.getStyle().putAll(style); DeleteAbstractInIncompleteMember.setCellActions(editorCell, myNode, getEditorContext()); editorCell.setDefaultText(""); return editorCell; } private EditorCell createConstant_imlbz9_e0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "synchronized"); editorCell.setCellId("Constant_imlbz9_e0"); Style style = new StyleImpl(); new KeyWordStyleClass(getEditorContext(), getNode()).apply(style, editorCell); editorCell.getStyle().putAll(style); DeleteSynchronizedInIncompleteMember.setCellActions(editorCell, myNode, getEditorContext()); editorCell.setDefaultText(""); return editorCell; } private EditorCell createConstant_imlbz9_f0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "transient"); editorCell.setCellId("Constant_imlbz9_f0"); DeleteTransientInIncompleteMember.setCellActions(editorCell, myNode, getEditorContext()); editorCell.setDefaultText(""); return editorCell; } private EditorCell createConstant_imlbz9_g0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "volatile"); editorCell.setCellId("Constant_imlbz9_g0"); Style style = new StyleImpl(); new KeyWordStyleClass(getEditorContext(), getNode()).apply(style, editorCell); editorCell.getStyle().putAll(style); DeleteVolatileInIncompleteMember.setCellActions(editorCell, myNode, getEditorContext()); editorCell.setDefaultText(""); return editorCell; } private EditorCell createConstant_imlbz9_h0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "native"); editorCell.setCellId("Constant_imlbz9_h0"); Style style = new StyleImpl(); new KeyWordStyleClass(getEditorContext(), getNode()).apply(style, editorCell); editorCell.getStyle().putAll(style); editorCell.setDefaultText(""); return editorCell; } private EditorCell createRefNode_imlbz9_i0() { SingleRoleCellProvider provider = new IncompleteMemberDeclaration_EditorBuilder_a.typeSingleRoleHandler_imlbz9_i0(myNode, MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x32175ac2e6fcc181L, 0x32175ac2e8b632a8L, "type"), getEditorContext()); return provider.createCell(); } private static class typeSingleRoleHandler_imlbz9_i0 extends SingleRoleCellProvider { @NotNull private SNode myNode; public typeSingleRoleHandler_imlbz9_i0(SNode ownerNode, SContainmentLink containmentLink, EditorContext context) { super(containmentLink, context); myNode = ownerNode; } @Override @NotNull public SNode getNode() { return myNode; } protected EditorCell createChildCell(SNode child) { EditorCell editorCell = getUpdateSession().updateChildNodeCell(child); editorCell.setAction(CellActionType.DELETE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x32175ac2e6fcc181L, 0x32175ac2e8b632a8L, "type"), child)); editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x32175ac2e6fcc181L, 0x32175ac2e8b632a8L, "type"), child)); installCellInfo(child, editorCell); return editorCell; } private void installCellInfo(SNode child, EditorCell editorCell) { if (editorCell.getSubstituteInfo() == null || editorCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) { editorCell.setSubstituteInfo(new SChildSubstituteInfo(editorCell, myNode, MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x32175ac2e6fcc181L, 0x32175ac2e8b632a8L, "type"), child)); } if (editorCell.getRole() == null) { editorCell.setRole("type"); } } @Override protected EditorCell createEmptyCell() { getCellFactory().pushCellContext(); getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(getNode(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x32175ac2e6fcc181L, 0x32175ac2e8b632a8L, "type"))); try { EditorCell editorCell = createCollection_imlbz9_a8a(); installCellInfo(null, editorCell); setCellContext(editorCell); return editorCell; } finally { getCellFactory().popCellContext(); } } private EditorCell createCollection_imlbz9_a8a() { EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent()); editorCell.setCellId("Collection_imlbz9_a8a"); Style style = new StyleImpl(); style.set(StyleAttributes.SELECTABLE, false); editorCell.getStyle().putAll(style); return editorCell; } } private EditorCell createConstant_imlbz9_j0() { EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ""); editorCell.setCellId("Constant_imlbz9_j0"); Style style = new StyleImpl(); style.set(StyleAttributes.EDITABLE, true); style.set(StyleAttributes.NULL_TEXT_COLOR, StyleRegistry.getInstance().getSimpleColor(MPSColors.red)); editorCell.getStyle().putAll(style); if (true) { editorCell.getStyle().set(StyleAttributes.FOCUS_POLICY, FocusPolicy.ATTRACTS_FOCUS); } IncompleteMemberBackspaceInName.setCellActions(editorCell, myNode, getEditorContext()); editorCell.addKeyMap(new IgnoreRightSquareBrackedInIncompleteMember()); editorCell.setTransformationMenuLookup(new NamedTransformationMenuLookup(LanguageRegistry.getInstance(getEditorContext().getRepository()), MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x32175ac2e6fcc181L, "jetbrains.mps.baseLanguage.structure.IncompleteMemberDeclaration"), "jetbrains.mps.baseLanguage.editor.IncompleteMemberDeclaration_ApplySideTransforms")); editorCell.setDefaultText("<no name>"); editorCell.setSubstituteInfo(new CompositeSubstituteInfo(getEditorContext(), new BasicCellContext(myNode), new SubstituteInfoPartExt[]{new IncompleteMemberDeclaration_EditorBuilder_a.ReplaceWith_ClassifierMember_cellMenu_imlbz9_a0j0(), new SChildSubstituteInfoPartEx(editorCell)})); return editorCell; } public static class ReplaceWith_ClassifierMember_cellMenu_imlbz9_a0j0 extends AbstractCellMenuPart_ReplaceNode_CustomNodeConcept { public ReplaceWith_ClassifierMember_cellMenu_imlbz9_a0j0() { } public SAbstractConcept getReplacementConcept() { return MetaAdapterFactory.getInterfaceConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x112574373bdL, "jetbrains.mps.baseLanguage.structure.ClassifierMember"); } } }