private EditorCell createCollection_ed1xw0_a(EditorContext editorContext, SNode node) {
   EditorCell_Collection editorCell = EditorCell_Collection.createIndent2(editorContext, node);
   editorCell.setCellId("Collection_ed1xw0_a");
   editorCell.setBig(true);
   editorCell.addEditorCell(this.createConstant_ed1xw0_a0(editorContext, node));
   if (renderingCondition_ed1xw0_a1a(
       node, editorContext, editorContext.getOperationContext().getScope())) {
     editorCell.addEditorCell(this.createCollection_ed1xw0_b0(editorContext, node));
   }
   if (renderingCondition_ed1xw0_a2a(
       node, editorContext, editorContext.getOperationContext().getScope())) {
     editorCell.addEditorCell(this.createConstant_ed1xw0_c0(editorContext, node));
   }
   editorCell.addEditorCell(this.createRefCell_ed1xw0_d0(editorContext, node));
   if (renderingCondition_ed1xw0_a4a(
       node, editorContext, editorContext.getOperationContext().getScope())) {
     editorCell.addEditorCell(this.createCollection_ed1xw0_e0(editorContext, node));
   }
   if (renderingCondition_ed1xw0_a5a(
       node, editorContext, editorContext.getOperationContext().getScope())) {
     editorCell.addEditorCell(this.createCollection_ed1xw0_f0(editorContext, node));
   }
   editorCell.addEditorCell(this.createConstant_ed1xw0_g0(editorContext, node));
   return editorCell;
 }
 private EditorCell createProperty_j36akn_a(EditorContext editorContext, SNode node) {
   CellProviderWithRole provider = new PropertyCellProvider(node, editorContext);
   provider.setRole("name");
   provider.setNoTargetText("<no name>");
   EditorCell editorCell;
   editorCell = provider.createEditorCell(editorContext);
   editorCell.setCellId("VDNCC_property_name");
   Style style = new StyleImpl();
   BaseLanguageStyle_StyleSheet.applyVariableName(style, editorCell);
   style.set(StyleAttributes.RT_ANCHOR_TAG, "default_RTransform");
   editorCell.getStyle().putAll(style);
   if (renderingCondition_j36akn_a0(node, editorContext, editorContext.getScope())) {
     editorCell.getStyle().set(StyleAttributes.FOCUS_POLICY, FocusPolicy.FIRST_EDITABLE_CELL);
   }
   editorCell.setSubstituteInfo(
       new CompositeSubstituteInfo(
           editorContext,
           provider.getCellContext(),
           new SubstituteInfoPartExt[] {
             new VariableDeclaration_NameCellComponent
                 .VariableDeclaration_name_postfixCellMenu_j36akn_a0a()
           }));
   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;
 }
Ejemplo n.º 3
0
 @Override
 public EditorCell updateRoleAttributeCell(
     final Class attributeKind, final EditorCell cellWithRole, final SNode roleAttribute) {
   if (attributeKind != AttributeKind.Reference.class && myContextStack.peek().hasRoles()) {
     // Suppressing role attribute cell creation upon reference cells.
     return cellWithRole;
   }
   final EditorContext editorContext = getUpdater().getEditorContext();
   editorContext.getCellFactory().pushCellContext();
   editorContext
       .getCellFactory()
       .removeCellContextHints(EditorCellFactoryImpl.BASE_REFLECTIVE_EDITOR_HINT);
   try {
     return runWithExplicitEditorHints(
         editorContext,
         roleAttribute,
         new Computable<EditorCell>() {
           @Override
           public EditorCell compute() {
             return EditorManager.getInstanceFromContext(editorContext)
                 .doCreateRoleAttributeCell(
                     attributeKind, cellWithRole, roleAttribute, myModelModifications);
           }
         });
   } finally {
     editorContext.getCellFactory().popCellContext();
   }
 }
 public void execute_internal(EditorContext editorContext, SNode node) {
   jetbrains.mps.nodeEditor.cells.EditorCell current =
       (jetbrains.mps.nodeEditor.cells.EditorCell) editorContext.getSelectedCell();
   jetbrains.mps.nodeEditor.cells.EditorCell toSelect =
       current.getPrevLeaf(CellConditions.SELECTABLE);
   SPropertyOperations.set(node, "caseInsensitive", "" + (false));
   editorContext.getEditorComponent().changeSelection(toSelect);
 }
Ejemplo n.º 5
0
 @Override
 public boolean canExecute(EditorContext context) {
   jetbrains.mps.openapi.editor.cells.EditorCell cell =
       context.getEditorComponent().findNodeCell(mySemanticNode);
   return cell != null
       && cell.getParent() != null
       && !ReadOnlyUtil.isCellOrSelectionReadOnlyInEditor(context.getEditorComponent(), cell);
 }
Ejemplo n.º 6
0
 public void execute(jetbrains.mps.openapi.editor.EditorContext context) {
   EditorCell selection = (EditorCell) context.getSelectedCell();
   ((EditorComponent) context.getEditorComponent())
       .activateNodeSubstituteChooser(
           selection,
           ((selection instanceof EditorCell_Label)
               && ((EditorCell_Label) selection).isEverythingSelected()),
           true);
 }
 public boolean isApplicable(final SNode node, final EditorContext editorContext) {
   if (!(isApplicableToNode(node, editorContext))) {
     return false;
   }
   if (editorContext.getSelectedNode() != node
       && !(isVisibleInChild(node, editorContext.getSelectedNode(), editorContext))) {
     return false;
   }
   return true;
 }
 @Override
 protected SubstituteMenuLookup getSubstituteMenuLookup(TransformationMenuContext context) {
   final EditorContext editorContext = context.getEditorContext();
   return new DefaultSubstituteMenuLookup(
       LanguageRegistry.getInstance(editorContext.getRepository()),
       MetaAdapterFactory.getConcept(
           0xcb6d57037c8e46a9L,
           0xb993c1373dc0942fL,
           0x7ce1116e3a6fb0beL,
           "jetbrains.mps.lang.editor.menus.substitute.testLanguage.structure.TestSubstituteChild"));
 }
 @Nullable
 @Override
 protected SubstituteMenuLookup getLookup(SubstituteMenuContext _context) {
   final EditorContext editorContext = _context.getEditorContext();
   return new DefaultSubstituteMenuLookup(
       LanguageRegistry.getInstance(editorContext.getRepository()),
       MetaAdapterFactory.getConcept(
           0x798100da4f0a421aL,
           0xb99171f8c50ce5d2L,
           0x3395e884b61c2404L,
           "jetbrains.mps.build.structure.BuildSource_JavaCP"));
 }
Ejemplo n.º 10
0
 private void execute_internal(
     final KeyEvent keyEvent,
     final EditorContext editorContext,
     final SNode node,
     final List<SNode> selectedNodes) {
   SNode propertyMacro = QueriesUtil.addPropertyMacro(node, editorContext.getSelectedCell());
   // set caret
   editorContext.selectAndSetCaret(propertyMacro, 0);
   EditorInspector inspector = editorContext.getInspector();
   assert inspector != null;
   inspector.activate();
 }
 @Nullable
 @Override
 protected SubstituteMenuLookup getSubstituteMenuLookup(TransformationMenuContext _context) {
   final EditorContext editorContext = _context.getEditorContext();
   return new DefaultSubstituteMenuLookup(
       LanguageRegistry.getInstance(editorContext.getRepository()),
       MetaAdapterFactory.getConcept(
           0xf3061a5392264cc5L,
           0xa443f952ceaf5816L,
           0xfbdeb6fecfL,
           "jetbrains.mps.baseLanguage.structure.BinaryOperation"));
 }
Ejemplo n.º 12
0
 public void handleAction_impl(
     SNode parameterObject,
     SNode node,
     SModel model,
     IScope scope,
     IOperationContext operationContext,
     EditorContext editorContext) {
   SNode macro =
       SNodeFactoryOperations.createNewNode(NameUtil.nodeFQName(parameterObject), node);
   SNodeOperations.replaceWithAnother(node, macro);
   editorContext.selectAndSetCaret(macro, 1);
   editorContext.openInspector();
 }
Ejemplo n.º 13
0
 private EditorCell createCollection_yxeg41_a(EditorContext editorContext, SNode node) {
   EditorCell_Collection editorCell = EditorCell_Collection.createIndent2(editorContext, node);
   editorCell.setCellId("Collection_yxeg41_a");
   if (renderingCondition_yxeg41_a0a(
       node, editorContext, editorContext.getOperationContext().getScope())) {
     editorCell.addEditorCell(this.createCollection_yxeg41_a0(editorContext, node));
   }
   if (renderingCondition_yxeg41_a1a(
       node, editorContext, editorContext.getOperationContext().getScope())) {
     editorCell.addEditorCell(this.createCollection_yxeg41_b0(editorContext, node));
   }
   return editorCell;
 }
Ejemplo n.º 14
0
 private void execute_internal(
     final KeyEvent keyEvent,
     final EditorContext editorContext,
     final SNode node,
     final List<SNode> selectedNodes) {
   SNode referenceMacro =
       QueriesUtil.addReferenceMacro(
           node, (jetbrains.mps.nodeEditor.cells.EditorCell) editorContext.getSelectedCell());
   // set caret
   editorContext.selectAndSetCaret(referenceMacro, 2);
   EditorInspector inspector = editorContext.getInspector();
   assert inspector != null;
   inspector.activate();
 }
Ejemplo n.º 15
0
 private <T> T runWithExplicitEditorHints(
     EditorContext editorContext, SNode node, Computable<T> cellCreator) {
   String[] explicitHintsForNode = getExplicitHintsForNode(node);
   if (explicitHintsForNode != null) {
     editorContext.getCellFactory().pushCellContext();
     editorContext.getCellFactory().addCellContextHints(explicitHintsForNode);
   }
   try {
     return cellCreator.compute();
   } finally {
     if (explicitHintsForNode != null) {
       editorContext.getCellFactory().popCellContext();
     }
   }
 }
 private EditorCell createCollection_689p1d_a(EditorContext editorContext, SNode node) {
   EditorCell_Collection editorCell = EditorCell_Collection.createHorizontal(editorContext, node);
   editorCell.setCellId("Collection_689p1d_a");
   editorCell.addEditorCell(this.createComponent_689p1d_a0(editorContext, node));
   editorCell.addEditorCell(this.createConstant_689p1d_b0(editorContext, node));
   if (renderingCondition_689p1d_a2a(
       node, editorContext, editorContext.getOperationContext().getScope())) {
     editorCell.addEditorCell(this.createProperty_689p1d_c0(editorContext, node));
   }
   if (renderingCondition_689p1d_a3a(
       node, editorContext, editorContext.getOperationContext().getScope())) {
     editorCell.addEditorCell(this.createRefNode_689p1d_d0(editorContext, node));
   }
   return editorCell;
 }
 private EditorCell createProperty_7qnrl2_a0a0(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");
   if (editorCell.getRole() == null) {
     editorCell.setReferenceCell(true);
     editorCell.setRole("member");
   }
   Style style = new StyleImpl();
   BaseLanguageStyle_StyleSheet.applyField(style, editorCell);
   style.set(StyleAttributes.PADDING_RIGHT, new Padding(0.0, Measure.SPACES));
   editorCell.getStyle().putAll(style);
   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;
 }
Ejemplo n.º 18
0
 private EditorCell createProperty_poez2y_b0(EditorContext editorContext, SNode node) {
   CellProviderWithRole provider = new PropertyCellProvider(node, editorContext);
   provider.setRole("entityName");
   provider.setNoTargetText("<no entityName>");
   EditorCell editorCell;
   editorCell = provider.createEditorCell(editorContext);
   editorCell.setCellId("property_entityName");
   Style style = new StyleImpl();
   XmlSS_StyleSheet.applyXmlAttrEntityRefValue(style, editorCell);
   editorCell.getStyle().putAll(style);
   delete_XmlEntityRefValueDelete.setCellActions(editorCell, node, editorContext);
   editorCell.setSubstituteInfo(
       new CompositeSubstituteInfo(
           editorContext,
           provider.getCellContext(),
           new SubstituteInfoPartExt[] {
             new XmlEntityRefValue_Editor.XmlEntityRefValue_entityName_cellMenu_poez2y_a0b0()
           }));
   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;
 }
Ejemplo n.º 19
0
 private EditorCell createComponent_zdgerc_a0a0(EditorContext editorContext, SNode node) {
   EditorCell editorCell =
       editorContext
           .getCellFactory()
           .createEditorComponentCell(node, "jetbrains.mps.lang.core.editor.AliasEditorComponent");
   return editorCell;
 }
Ejemplo n.º 20
0
 private EditorCell createComponent_zdgerc_d0a0(EditorContext editorContext, SNode node) {
   EditorCell editorCell =
       editorContext
           .getCellFactory()
           .createEditorComponentCell(node, "jetbrains.mps.ui.editor.common_UIObjectStatement");
   return editorCell;
 }
Ejemplo n.º 21
0
 @Override
 public void execute(final jetbrains.mps.openapi.editor.EditorContext context) {
   EditorComponent editorComponent = ((EditorComponent) context.getEditorComponent());
   SelectionManager selectionManager = editorComponent.getSelectionManager();
   Selection selection = selectionManager.getSelection();
   if (selection instanceof SingularSelection) {
     EditorCell selectedCell = ((SingularSelection) selection).getEditorCell();
     SNode selectedNode = selectedCell.getSNode();
     SNode topMostNodeInSingularContainment =
         findTopMostNodeWithSingularContainment(selectedNode);
     if (topMostNodeInSingularContainment != selectedNode) {
       EditorCell nodeCell = editorComponent.findNodeCell(topMostNodeInSingularContainment);
       if (nodeCell != null) {
         editorComponent.pushSelection(nodeCell);
         editorComponent.scrollToCell(nodeCell);
       }
     } else {
       Selection newSelection =
           selectionManager.createRangeSelection(selectedNode, selectedNode);
       if (newSelection instanceof NodeRangeSelection && selectedCell.isBigCell()) {
         newSelection = ((NodeRangeSelection) newSelection).enlargeSelection(myUp);
       }
       if (newSelection != null) {
         selectionManager.pushSelection(newSelection);
         newSelection.ensureVisible();
       }
     }
   } else if (selection instanceof NodeRangeSelection) {
     Selection newSelection = ((NodeRangeSelection) selection).enlargeSelection(myUp);
     if (newSelection != null) {
       selectionManager.pushSelection(newSelection);
       newSelection.ensureVisible();
     }
   }
 }
Ejemplo n.º 22
0
 private EditorCell createProperty_26flog_a0a0(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");
   if (editorCell.getRole() == null) {
     editorCell.setReferenceCell(true);
     editorCell.setRole("function");
   }
   Style style = new StyleImpl();
   BaseLanguageStyle_StyleSheet.applyMethodName(style, editorCell);
   editorCell.getStyle().putAll(style);
   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;
 }
Ejemplo n.º 23
0
 private EditorCell createComponent_zca0xt_a0_0(EditorContext editorContext, SNode node) {
   EditorCell editorCell =
       editorContext
           .getCellFactory()
           .createEditorComponentCell(node, "jetbrains.mps.lang.editor.editor.Style_Component");
   return editorCell;
 }
 private EditorCell createProperty_cv1jro_b1a0(EditorContext editorContext, SNode node) {
   CellProviderWithRole provider = new PropertyCellProvider(node, editorContext);
   provider.setRole("comment");
   provider.setNoTargetText("<no comment>");
   provider.setAllowsEmptyTarget(true);
   EditorCell editorCell;
   editorCell = provider.createEditorCell(editorContext);
   editorCell.setCellId("property_comment");
   Style style = new StyleImpl();
   style.set(
       StyleAttributes.TEXT_COLOR,
       StyleRegistry.getInstance().getSimpleColor(MPSColors.DARK_GREEN));
   style.set(StyleAttributes.PADDING_LEFT, new Padding(0.0, Measure.SPACES));
   style.set(StyleAttributes.PADDING_RIGHT, new Padding(0.0, Measure.SPACES));
   editorCell.getStyle().putAll(style);
   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;
 }
Ejemplo n.º 25
0
 private EditorCell createProperty_3mrn5h_a0a0(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");
   if (editorCell.getRole() == null) {
     editorCell.setReferenceCell(true);
     editorCell.setRole("target");
   }
   Style style = new StyleImpl();
   style.set(StyleAttributes.AUTO_DELETABLE, false);
   editorCell.getStyle().putAll(style);
   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_689p1d_c0(EditorContext editorContext, SNode node) {
   CellProviderWithRole provider = new PropertyCellProvider(node, editorContext);
   provider.setRole("flag");
   provider.setNoTargetText("<no flag>");
   EditorCell editorCell;
   editorCell = provider.createEditorCell(editorContext);
   editorCell.setCellId("property_flag");
   Style style = new StyleImpl();
   style.set(StyleAttributes.INDENT_LAYOUT_INDENT, true);
   editorCell.getStyle().putAll(style);
   editorCell.setSubstituteInfo(
       new CompositeSubstituteInfo(
           editorContext,
           provider.getCellContext(),
           new SubstituteInfoPartExt[] {
             new BooleanStyleSheetItem_Editor.BooleanStyleSheetItem_flag_cellMenu_689p1d_a0c0(),
             new BooleanStyleSheetItem_Editor.BooleanStyleSheetItem_generic_cellMenu_689p1d_b0c0()
           }));
   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;
 }
Ejemplo n.º 27
0
 private EditorCell createRefCell_uze3jf_c0(EditorContext editorContext, SNode node) {
   CellProviderWithRole provider = new RefCellCellProvider(node, editorContext);
   provider.setRole("concept");
   provider.setNoTargetText("<no concept>");
   EditorCell editorCell;
   provider.setAuxiliaryCellProvider(
       new Model_CreateNewRootNodeOperation_Editor._Inline_uze3jf_a2a());
   editorCell = provider.createEditorCell(editorContext);
   if (editorCell.getRole() == null) {
     editorCell.setReferenceCell(true);
     editorCell.setRole("concept");
   }
   Style style = new StyleImpl();
   style.set(StyleAttributes.PADDING_RIGHT, new Padding(0.0, Measure.SPACES));
   editorCell.getStyle().putAll(style);
   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.createNodeRoleAttributeCell(
         editorContext, attributeConcept, attributeKind, editorCell);
   } else return editorCell;
 }
Ejemplo n.º 28
0
 private EditorCell createProperty_vgxjtu_a1a(EditorContext editorContext, SNode node) {
   CellProviderWithRole provider = new PropertyCellProvider(node, editorContext);
   provider.setRole("label");
   provider.setNoTargetText("<no label>");
   EditorCell editorCell;
   editorCell = provider.createEditorCell(editorContext);
   editorCell.setCellId("property_label");
   Style style = new StyleImpl();
   BaseLanguageStyle_StyleSheet.apply_Label(style, editorCell);
   style.set(StyleAttributes.SELECTABLE, true);
   style.set(StyleAttributes.EDITABLE, true);
   editorCell.getStyle().putAll(style);
   ContinueStatement_Actions.setCellActions(editorCell, node, editorContext);
   editorCell.setSubstituteInfo(
       new CompositeSubstituteInfo(
           editorContext,
           provider.getCellContext(),
           new SubstituteInfoPartExt[] {
             new ContinueStatement_Editor.ContinueStatement_generic_cellMenu_vgxjtu_a0a1a()
           }));
   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 createComponent_jf7bj_c0(EditorContext editorContext, SNode node) {
   EditorCell editorCell =
       editorContext
           .getCellFactory()
           .createEditorComponentCell(node, "jetbrains.mps.lang.editor.editor._CloseTag");
   return editorCell;
 }
Ejemplo n.º 30
0
 @Override
 public void execute(EditorContext context) {
   EditorComponent editorComponent = (EditorComponent) context.getEditorComponent();
   editorComponent.clearSelectionStack();
   editorComponent.changeSelection(
       CellFinderUtil.findLastSelectableLeaf(EditorCell_Collection.this));
 }