private EditorCell createCollection_1x071y_a(EditorContext editorContext, SNode node) { EditorCell_Collection editorCell = EditorCell_Collection.createIndent2(editorContext, node); editorCell.setCellId("Collection_1x071y_a"); { Style style = editorCell.getStyle(); style.set(StyleAttributes.SELECTABLE, true); } editorCell.addEditorCell(this.createComponent_1x071y_a0(editorContext, node)); editorCell.addEditorCell(this.createComponent_1x071y_b0(editorContext, node)); editorCell.addEditorCell(this.createComponent_1x071y_c0(editorContext, node)); if (renderingCondition_1x071y_a3a( node, editorContext, editorContext.getOperationContext().getScope())) { editorCell.addEditorCell(this.createComponent_1x071y_d0(editorContext, node)); } editorCell.addEditorCell(this.createProperty_1x071y_e0(editorContext, node)); editorCell.addEditorCell(this.createConstant_1x071y_f0(editorContext, node)); editorCell.addEditorCell(this.createRefNodeList_1x071y_g0(editorContext, node)); editorCell.addEditorCell(this.createConstant_1x071y_h0(editorContext, node)); if (renderingCondition_1x071y_a8a( node, editorContext, editorContext.getOperationContext().getScope())) { editorCell.addEditorCell(this.createCollection_1x071y_i0(editorContext, node)); } editorCell.addEditorCell(this.createComponent_1x071y_j0(editorContext, node)); if (renderingCondition_1x071y_a01a( node, editorContext, editorContext.getOperationContext().getScope())) { editorCell.addEditorCell(this.createConstant_1x071y_k0(editorContext, node)); } return editorCell; }
@Override public EditorCell findCell(final EditorComponent editorComponent) { if (myCellId != null) { final EditorContext editorContext = editorComponent.getEditorContext(); if (myNodeReference == null) return null; final EditorCell[] cell = new EditorCell[] {null}; editorContext .getRepository() .getModelAccess() .runReadAction( new Runnable() { @Override public void run() { cell[0] = editorComponent.findCellWithId( myNodeReference.resolve(editorContext.getRepository()), myCellId); } }); return cell[0]; } else if (myParentInfo != null) { EditorCell parentCell = myParentInfo.findCell(editorComponent); if (!(parentCell instanceof EditorCell_Collection)) { return null; } EditorCell_Collection parentCollection = (EditorCell_Collection) parentCell; if (myCellNumber >= parentCollection.getCellsCount()) { return null; } EditorCell editorCell = parentCollection.getChildAt(myCellNumber); // This editorCell should not have any cellId due to corresponding conditions in constructor return editorCell.getCellId() == null ? editorCell : null; } return null; }
public boolean isApplicable(final SNode node, final EditorContext editorContext) { if (!(this.isApplicableToNode(node, editorContext))) { return false; } if (editorContext.getSelectedNode() != node && !(this.isVisibleInChild(node, editorContext.getSelectedNode(), editorContext))) { return false; } return true; }
public static void addVariablePattern(EditorContext context) { EditorCell contextCell = context.getSelectedCell(); SNode node = contextCell.getSNode(); SNode linkDeclaration = SNodeOperations.cast( contextCell.getLinkDeclaration(), "jetbrains.mps.lang.structure.structure.LinkDeclaration"); SNode genuineLinkDeclaration = SModelUtil.getGenuineLinkDeclaration(linkDeclaration); if (linkDeclaration != null && SPropertyOperations.hasValue( genuineLinkDeclaration, "metaClass", "reference", "reference")) { String role = SPropertyOperations.getString(genuineLinkDeclaration, "role"); AttributeOperations.createAndSetAttrbiute( node, new IAttributeDescriptor.LinkAttribute( SConceptOperations.findConceptDeclaration( "jetbrains.mps.lang.pattern.structure.LinkPatternVariableDeclaration"), role), "jetbrains.mps.lang.pattern.structure.LinkPatternVariableDeclaration"); } else { AttributeOperations.createAndSetAttrbiute( node, new IAttributeDescriptor.NodeAttribute( SConceptOperations.findConceptDeclaration( "jetbrains.mps.lang.pattern.structure.Pattern")), "jetbrains.mps.lang.pattern.structure.PatternVariableDeclaration"); } }
private EditorCell createProperty_uugm4e_a0a0(EditorContext editorContext, SNode node) { CellProviderWithRole provider = new PropertyCellProvider(node, editorContext); provider.setRole("elementName"); provider.setNoTargetText("<no elementName>"); provider.setReadOnly(true); EditorCell editorCell; editorCell = provider.createEditorCell(editorContext); editorCell.setCellId("property_elementName"); { Style style = editorCell.getStyle(); style.set(StyleAttributes.FONT_STYLE, MPSFonts.BOLD); style.set( StyleAttributes.TEXT_COLOR, new AttributeCalculator<Color>() { public Color calculate(EditorCell cell) { return ElementReference_Editor._Inline_uugm4e_a0a ._StyleParameter_QueryFunction_uugm4e_a1a0a0( (cell == null ? null : cell.getSNode()), (cell == null ? null : cell.getEditorContext())); } }); } editorCell.setSubstituteInfo(provider.createDefaultSubstituteInfo()); SNode attributeConcept = provider.getRoleAttribute(); Class attributeKind = provider.getRoleAttributeClass(); if (attributeConcept != null) { IOperationContext opContext = editorContext.getOperationContext(); EditorManager manager = EditorManager.getInstanceFromContext(opContext); return manager.createRoleAttributeCell( editorContext, attributeConcept, attributeKind, editorCell); } else return editorCell; }
private EditorCell createCollection_1xd1xh_a(EditorContext editorContext, SNode node) { EditorCell_Collection editorCell = EditorCell_Collection.createHorizontal(editorContext, node); editorCell.setCellId("Collection_1xd1xh_a"); if (renderingCondition_1xd1xh_a0a( node, editorContext, editorContext.getOperationContext().getScope())) { editorCell.addEditorCell(this.createCollection_1xd1xh_a0(editorContext, node)); } return editorCell; }
private void execute_internal( final KeyEvent keyEvent, final EditorContext editorContext, final SNode node, final List<SNode> selectedNodes) { IOperationContext operationContext = editorContext.getOperationContext(); Project project = operationContext.getProject(); ProjectPane.getInstance(ProjectHelper.toIdeaProject(project)) .selectModule(Module_Behavior.call_getModule_1213877515148(node), false); }
private EditorCell createCollection_f5bzsg_a(EditorContext editorContext, SNode node) { EditorCell_Collection editorCell = EditorCell_Collection.createHorizontal(editorContext, node); editorCell.setCellId("Collection_f5bzsg_a"); editorCell.addEditorCell(this.createRefNode_f5bzsg_a0(editorContext, node)); editorCell.addEditorCell(this.createProperty_f5bzsg_b0(editorContext, node)); if (renderingCondition_f5bzsg_a2a( node, editorContext, editorContext.getOperationContext().getScope())) { editorCell.addEditorCell(this.createConstant_f5bzsg_c0(editorContext, node)); } return editorCell; }
public static boolean isPatternApplicable(EditorContext context) { EditorCell contextCell = context.getSelectedCell(); if (contextCell == null) { return false; } INodeAdapter node = BaseAdapter.fromNode(contextCell.getSNode()); if (node == null) { return false; } return node.findParent(PatternExpression.class) != null; }
private EditorCell createCollection_dvtb4y_a(EditorContext editorContext, SNode node) { EditorCell_Collection editorCell = EditorCell_Collection.createIndent2(editorContext, node); editorCell.setCellId("Collection_dvtb4y_a"); editorCell.addEditorCell(this.createConceptProperty_dvtb4y_a0(editorContext, node)); editorCell.addEditorCell(this.createProperty_dvtb4y_b0(editorContext, node)); if (renderingCondition_dvtb4y_a2a( node, editorContext, editorContext.getOperationContext().getScope())) { editorCell.addEditorCell(this.createCollection_dvtb4y_c0(editorContext, node)); } editorCell.addEditorCell(this.createCollection_dvtb4y_d0(editorContext, node)); editorCell.addEditorCell(this.createConstant_dvtb4y_e0(editorContext, node)); return editorCell; }
private EditorCell createCollection_uc5iyq_a(EditorContext editorContext, SNode node) { EditorCell_Collection editorCell = EditorCell_Collection.createIndent2(editorContext, node); editorCell.setCellId("Collection_uc5iyq_a"); { Style style = editorCell.getStyle(); style.set(StyleAttributes.SELECTABLE, false); } if (renderingCondition_uc5iyq_a0a( node, editorContext, editorContext.getOperationContext().getScope())) { editorCell.addEditorCell(this.createCollection_uc5iyq_a0(editorContext, node)); } return editorCell; }
private EditorCell createAlternation_ayjduv_c0(EditorContext editorContext, SNode node) { boolean alternationCondition = true; alternationCondition = BuildVarRefStringPart_Editor.renderingCondition_ayjduv_a2a( node, editorContext, editorContext.getOperationContext().getScope()); EditorCell editorCell = null; if (alternationCondition) { editorCell = this.createConstant_ayjduv_a2a(editorContext, node); } else { editorCell = this.createConstant_ayjduv_a2a_0(editorContext, node); } return editorCell; }
private EditorCell createAlternation_4kucyt_d0(EditorContext editorContext, SNode node) { boolean alternationCondition = true; alternationCondition = PngIcon_Editor.renderingCondition_4kucyt_a3a( node, editorContext, editorContext.getOperationContext().getScope()); EditorCell editorCell = null; if (alternationCondition) { editorCell = this.createJComponent_4kucyt_a3a(editorContext, node); } else { editorCell = this.createConstant_4kucyt_a3a(editorContext, node); } return editorCell; }
private EditorCell createAlternation_sjqidp_a0(EditorContext editorContext, SNode node) { boolean alternationCondition = true; alternationCondition = State_Editor.renderingCondition_sjqidp_a0a( node, editorContext, editorContext.getOperationContext().getScope()); EditorCell editorCell = null; if (alternationCondition) { editorCell = this.createConstant_sjqidp_a0a(editorContext, node); } else { editorCell = this.createEmpty_sjqidp_a0a(editorContext, node); } return editorCell; }
private EditorCell createCollection_du6pr9_a0(EditorContext editorContext, SNode node) { EditorCell_Collection editorCell = EditorCell_Collection.createHorizontal(editorContext, node); editorCell.setCellId("Collection_du6pr9_a0"); { Style style = editorCell.getStyle(); style.set(StyleAttributes.SELECTABLE, false); } editorCell.addEditorCell(this.createCollection_du6pr9_a0a(editorContext, node)); if (renderingCondition_du6pr9_a1a0( node, editorContext, editorContext.getOperationContext().getScope())) { editorCell.addEditorCell(this.createConstant_du6pr9_b0a(editorContext, node)); } return editorCell; }
public boolean canExecute(final KeyEvent keyEvent, final EditorContext editorContext) { EditorCell contextCell = editorContext.getContextCell(); if ((contextCell == null)) { return false; } SNode contextNode = contextCell.getSNode(); if (contextNode == null) { return false; } if (contextNode.isInstanceOfConcept("jetbrains.mps.build.packaging.structure.Module")) { return true; } return false; }
public boolean canExecute(final KeyEvent keyEvent, final EditorContext editorContext) { EditorCell contextCell = editorContext.getContextCell(); if ((contextCell == null)) { return false; } SNode contextNode = contextCell.getSNode(); if (contextNode == null) { return false; } if (contextNode.isInstanceOfConcept( "jetbrains.mps.baseLanguage.structure.ParenthesizedExpression")) { return true; } return false; }
private EditorCell createRefNode_o0q9qg_e0(EditorContext editorContext, SNode node) { CellProviderWithRole provider = new RefNodeCellProvider(node, editorContext); provider.setRole("message"); provider.setNoTargetText("<no message>"); EditorCell editorCell; editorCell = provider.createEditorCell(editorContext); editorCell.setSubstituteInfo(provider.createDefaultSubstituteInfo()); SNode attributeConcept = provider.getRoleAttribute(); Class attributeKind = provider.getRoleAttributeClass(); if (attributeConcept != null) { IOperationContext opContext = editorContext.getOperationContext(); EditorManager manager = EditorManager.getInstanceFromContext(opContext); return manager.createRoleAttributeCell( editorContext, attributeConcept, attributeKind, editorCell); } else return editorCell; }
public EditorCell createProperty_4406_1(EditorContext context, SNode node) { CellProviderWithRole provider = new PropertyCellProvider(node, context); provider.setRole("identifier"); provider.setNoTargetText("<no identifier>"); provider.setReadOnly(true); provider.setAllowsEmptyTarget(false); EditorCell cellWithRole = this.createProperty_4406_0_internal(context, node, provider); SNode attributeConcept = provider.getRoleAttribute(); Class attributeKind = provider.getRoleAttributeClass(); if (attributeConcept != null) { IOperationContext opContext = context.getOperationContext(); EditorManager manager = EditorManager.getInstanceFromContext(opContext); return manager.createRoleAttributeCell( context, attributeConcept, attributeKind, cellWithRole); } else return cellWithRole; }
public boolean isApplicableToNode(final SNode node, final EditorContext editorContext) { final EditorCell editorCell = editorContext.getSelectedCell(); if (editorCell == null) { return false; } if (editorCell.getLinkDeclaration() != SLinkOperations.findLinkDeclaration( "jetbrains.mps.lang.generator.structure.Weaving_MappingRule", "ruleConsequence")) { return false; } return SLinkOperations.getTarget(node, "ruleConsequence", true) == null || SConceptOperations.isExactly( SNodeOperations.getConceptDeclaration( SLinkOperations.getTarget(node, "ruleConsequence", true)), "jetbrains.mps.lang.generator.structure.RuleConsequence"); }
private EditorCell createConstant_1xd1xh_c0a(EditorContext editorContext, SNode node) { EditorCell_Constant editorCell = new EditorCell_Constant(editorContext, node, ")"); editorCell.setCellId("Constant_1xd1xh_c0a"); BaseLanguageStyle_StyleSheet.getRightParen(editorCell).apply(editorCell); { Style style = editorCell.getStyle(); style.set(StyleAttributes.SELECTABLE, true); style.set(StyleAttributes.FONT_STYLE, MPSFonts.PLAIN); style.set(StyleAttributes.EDITABLE, false); } if (renderingCondition_1xd1xh_a2a0(node, editorContext, editorContext.getScope())) { editorCell.setFocusPolicy(FocusPolicy.ATTRACTS_FOCUS); } editorCell.setDefaultText(""); return editorCell; }
private EditorCell createConceptProperty_hsieeg_a(EditorContext editorContext, SNode node) { CellProviderWithRole provider = new ConceptPropertyCellProvider(node, editorContext); provider.setRole("alias"); provider.setNoTargetText("<no alias>"); EditorCell editorCell; editorCell = provider.createEditorCell(editorContext); editorCell.setCellId("conceptProperty_alias"); editorCell.setSubstituteInfo(provider.createDefaultSubstituteInfo()); SNode attributeConcept = provider.getRoleAttribute(); Class attributeKind = provider.getRoleAttributeClass(); if (attributeConcept != null) { IOperationContext opContext = editorContext.getOperationContext(); EditorManager manager = EditorManager.getInstanceFromContext(opContext); return manager.createRoleAttributeCell( editorContext, attributeConcept, attributeKind, editorCell); } else return editorCell; }
private EditorCell createRefCell_uugm4e_a0(EditorContext editorContext, SNode node) { CellProviderWithRole provider = new RefCellCellProvider(node, editorContext); provider.setRole("elementDeclaration"); provider.setNoTargetText("<no elementDeclaration>"); EditorCell editorCell; provider.setAuxiliaryCellProvider(new ElementReference_Editor._Inline_uugm4e_a0a()); editorCell = provider.createEditorCell(editorContext); editorCell.setSubstituteInfo(provider.createDefaultSubstituteInfo()); SNode attributeConcept = provider.getRoleAttribute(); Class attributeKind = provider.getRoleAttributeClass(); if (attributeConcept != null) { IOperationContext opContext = editorContext.getOperationContext(); EditorManager manager = EditorManager.getInstanceFromContext(opContext); return manager.createRoleAttributeCell( editorContext, attributeConcept, attributeKind, editorCell); } else return editorCell; }
private EditorCell createRefCell_v26ttb_b0(EditorContext editorContext, SNode node) { CellProviderWithRole provider = new RefCellCellProvider(node, editorContext); provider.setRole("plugin"); provider.setNoTargetText("<no plugin>"); EditorCell editorCell; provider.setAuxiliaryCellProvider(new MPSPluginDependency_Editor._Inline_v26ttb_a1a()); editorCell = provider.createEditorCell(editorContext); editorCell.setSubstituteInfo(provider.createDefaultSubstituteInfo()); SNode attributeConcept = provider.getRoleAttribute(); Class attributeKind = provider.getRoleAttributeClass(); if (attributeConcept != null) { IOperationContext opContext = editorContext.getOperationContext(); EditorManager manager = EditorManager.getInstanceFromContext(opContext); return manager.createRoleAttributeCell( editorContext, attributeConcept, attributeKind, editorCell); } else return editorCell; }
private EditorCell createRefCell_ayjduv_b0(EditorContext editorContext, SNode node) { CellProviderWithRole provider = new RefCellCellProvider(node, editorContext); provider.setRole("macro"); provider.setNoTargetText("<no macro>"); EditorCell editorCell; provider.setAuxiliaryCellProvider(new BuildVarRefStringPart_Editor._Inline_ayjduv_a1a()); editorCell = provider.createEditorCell(editorContext); editorCell.setSubstituteInfo(provider.createDefaultSubstituteInfo()); SNode attributeConcept = provider.getRoleAttribute(); Class attributeKind = provider.getRoleAttributeClass(); if (attributeConcept != null) { IOperationContext opContext = editorContext.getOperationContext(); EditorManager manager = EditorManager.getInstanceFromContext(opContext); return manager.createRoleAttributeCell( editorContext, attributeConcept, attributeKind, editorCell); } else return editorCell; }
private EditorCell createProperty_zdgerc_a0b0a0(EditorContext editorContext, SNode node) { CellProviderWithRole provider = new PropertyCellProvider(node, editorContext); provider.setRole("name"); provider.setNoTargetText("<no name>"); provider.setReadOnly(true); EditorCell editorCell; editorCell = provider.createEditorCell(editorContext); editorCell.setCellId("property_name"); editorCell.setSubstituteInfo(provider.createDefaultSubstituteInfo()); SNode attributeConcept = provider.getRoleAttribute(); Class attributeKind = provider.getRoleAttributeClass(); if (attributeConcept != null) { IOperationContext opContext = editorContext.getOperationContext(); EditorManager manager = EditorManager.getInstanceFromContext(opContext); return manager.createRoleAttributeCell( editorContext, attributeConcept, attributeKind, editorCell); } else return editorCell; }
private EditorCell createRefCell_zdgerc_b0a0(EditorContext editorContext, SNode node) { CellProviderWithRole provider = new RefCellCellProvider(node, editorContext); provider.setRole("uiObject"); provider.setNoTargetText("<no uiObject>"); EditorCell editorCell; provider.setAuxiliaryCellProvider(new UIObjectStatement_Editor._Inline_zdgerc_a1a0a()); editorCell = provider.createEditorCell(editorContext); UI_StyleSheet.getUIObject(editorCell).apply(editorCell); editorCell.setSubstituteInfo(provider.createDefaultSubstituteInfo()); SNode attributeConcept = provider.getRoleAttribute(); Class attributeKind = provider.getRoleAttributeClass(); if (attributeConcept != null) { IOperationContext opContext = editorContext.getOperationContext(); EditorManager manager = EditorManager.getInstanceFromContext(opContext); return manager.createRoleAttributeCell( editorContext, attributeConcept, attributeKind, editorCell); } else return editorCell; }
private EditorCell createProperty_17volu_a0(EditorContext editorContext, SNode node) { CellProviderWithRole provider = new PropertyCellProvider(node, editorContext); provider.setRole("value"); provider.setNoTargetText("<no value>"); EditorCell editorCell; editorCell = provider.createEditorCell(editorContext); editorCell.setCellId("property_value"); MqlSS_StyleSheet.getIntLiteral(editorCell).apply(editorCell); editorCell.setSubstituteInfo(provider.createDefaultSubstituteInfo()); SNode attributeConcept = provider.getRoleAttribute(); Class attributeKind = provider.getRoleAttributeClass(); if (attributeConcept != null) { IOperationContext opContext = editorContext.getOperationContext(); EditorManager manager = EditorManager.getInstanceFromContext(opContext); return manager.createRoleAttributeCell( editorContext, attributeConcept, attributeKind, editorCell); } else return editorCell; }
public static void extractComponent(final SNode node, EditorContext editorContext) { final SNode container = SNodeOperations.getAncestor( node, "jetbrains.mps.lang.editor.structure.BaseEditorComponent", false, false); final String componentName = JOptionPane.showInputDialog( editorContext.getNodeEditorComponent(), "Enter a component name:", ""); if (componentName == null) { return; } ModelAccess.instance() .runWriteActionInCommand( new Runnable() { public void run() { SModel model = SNodeOperations.getModel(node); SNode component = SModelOperations.createNewRootNode( model, "jetbrains.mps.lang.editor.structure.EditorComponentDeclaration", null); SPropertyOperations.set(component, "name", componentName); SLinkOperations.setTarget( component, "conceptDeclaration", ((SNode) BehaviorManager.getInstance() .invoke( Object.class, SNodeOperations.cast( container, "jetbrains.mps.lang.editor.structure.AbstractComponent"), "virtual_getConceptDeclaration_7055725856388417603", new Class[] {SNode.class})), false); SLinkOperations.setTarget( component, "cellModel", SNodeOperations.copyNode(node), true); SNode toReplace = SConceptOperations.createNewNode( "jetbrains.mps.lang.editor.structure.CellModel_Component", null); SLinkOperations.setTarget(toReplace, "editorComponent", component, false); SNodeOperations.replaceWithAnother(node, toReplace); } }); }
private EditorCell createRefNode_dq5n1t_b0(EditorContext editorContext, SNode node) { CellProviderWithRole provider = new RefNodeCellProvider(node, editorContext); provider.setRole("type"); provider.setNoTargetText("<no type>"); EditorCell editorCell; editorCell = provider.createEditorCell(editorContext); if (true) { editorCell.setFocusPolicy(FocusPolicy.FIRST_EDITABLE_CELL); } editorCell.setSubstituteInfo(provider.createDefaultSubstituteInfo()); SNode attributeConcept = provider.getRoleAttribute(); Class attributeKind = provider.getRoleAttributeClass(); if (attributeConcept != null) { IOperationContext opContext = editorContext.getOperationContext(); EditorManager manager = EditorManager.getInstanceFromContext(opContext); return manager.createRoleAttributeCell( editorContext, attributeConcept, attributeKind, editorCell); } else return editorCell; }