コード例 #1
0
 public static void applyMappingLabelReference(Style style, EditorCell editorCell) {
   style.set(
       StyleAttributes.TEXT_BACKGROUND_COLOR,
       StyleRegistry.getInstance().getSimpleColor(MPSColors.orange));
   style.set(
       StyleAttributes.TEXT_COLOR,
       StyleRegistry.getInstance()
           .getSimpleColor(
               MPSColors.black, StyleRegistry.getInstance().getSimpleColor(MPSColors.orange)));
 }
コード例 #2
0
 public static void applyMappingRuleDeclaration(Style style, EditorCell editorCell) {
   style.set(
       StyleAttributes.TEXT_BACKGROUND_COLOR,
       StyleRegistry.getInstance().getSimpleColor(MPSColors.orange));
   style.set(
       StyleAttributes.TEXT_COLOR,
       StyleRegistry.getInstance()
           .getSimpleColor(
               MPSColors.darkGray, StyleRegistry.getInstance().getSimpleColor(MPSColors.orange)));
 }
コード例 #3
0
 public static void applyMacroDescriptionText(Style style, EditorCell editorCell) {
   style.set(
       StyleAttributes.TEXT_BACKGROUND_COLOR,
       StyleRegistry.getInstance().getSimpleColor(MPSColors.LIGHT_BLUE));
   style.set(
       StyleAttributes.TEXT_COLOR,
       StyleRegistry.getInstance()
           .getSimpleColor(
               MPSColors.DARK_BLUE,
               StyleRegistry.getInstance().getSimpleColor(MPSColors.LIGHT_BLUE)));
 }
コード例 #4
0
 @Override
 public void apply(Style style, EditorCell editorCell) {
   style.set(
       StyleAttributes.BACKGROUND_COLOR,
       StyleRegistry.getInstance().getSimpleColor(MPSColors.DARK_MAGENTA));
   style.set(
       StyleAttributes.TEXT_COLOR, StyleRegistry.getInstance().getSimpleColor(MPSColors.WHITE));
   style.set(
       StyleAttributes.NULL_TEXT_COLOR,
       StyleRegistry.getInstance().getSimpleColor(MPSColors.lightGray));
 }
コード例 #5
0
 @Deprecated
 public static Style getMappingLabelReference(final EditorCell editorCell) {
   Style style = new StyleImpl(editorCell);
   style.set(
       StyleAttributes.TEXT_BACKGROUND_COLOR,
       StyleRegistry.getInstance().getSimpleColor(MPSColors.orange));
   style.set(
       StyleAttributes.TEXT_COLOR,
       StyleRegistry.getInstance()
           .getSimpleColor(
               MPSColors.black, StyleRegistry.getInstance().getSimpleColor(MPSColors.orange)));
   return style;
 }
コード例 #6
0
 @Deprecated
 public static Style getMappingRuleDeclaration(final EditorCell editorCell) {
   Style style = new StyleImpl(editorCell);
   style.set(
       StyleAttributes.TEXT_BACKGROUND_COLOR,
       StyleRegistry.getInstance().getSimpleColor(MPSColors.orange));
   style.set(
       StyleAttributes.TEXT_COLOR,
       StyleRegistry.getInstance()
           .getSimpleColor(
               MPSColors.darkGray, StyleRegistry.getInstance().getSimpleColor(MPSColors.orange)));
   return style;
 }
コード例 #7
0
 @Deprecated
 public static Style getMacroDescriptionText(final EditorCell editorCell) {
   Style style = new StyleImpl(editorCell);
   style.set(
       StyleAttributes.TEXT_BACKGROUND_COLOR,
       StyleRegistry.getInstance().getSimpleColor(MPSColors.LIGHT_BLUE));
   style.set(
       StyleAttributes.TEXT_COLOR,
       StyleRegistry.getInstance()
           .getSimpleColor(
               MPSColors.DARK_BLUE,
               StyleRegistry.getInstance().getSimpleColor(MPSColors.LIGHT_BLUE)));
   return style;
 }
コード例 #8
0
 private EditorCell createProperty_lbdr4h_b0(EditorContext editorContext, SNode node) {
   CellProviderWithRole provider = new PropertyCellProvider(node, editorContext);
   provider.setRole("label");
   provider.setNoTargetText("");
   provider.setAllowsEmptyTarget(true);
   EditorCell editorCell;
   editorCell = provider.createEditorCell(editorContext);
   editorCell.setCellId("property_label");
   Style style = new StyleImpl();
   style.set(
       StyleAttributes.TEXT_COLOR,
       StyleRegistry.getInstance()
           .getSimpleColor(
               Antiquotation_Editor._StyleParameter_QueryFunction_lbdr4h_a0b0(
                   (editorCell == null ? null : editorCell.getContext()),
                   (editorCell == null ? null : editorCell.getSNode()))));
   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;
 }
コード例 #9
0
ファイル: _OpenTag.java プロジェクト: sprig/MPS
  private EditorCell createReadOnlyModelAccessor_mtiojs_a(
      final EditorContext editorContext, final SNode node) {
    EditorCell_Property editorCell =
        EditorCell_Property.create(
            editorContext,
            new ModelAccessor() {
              public String getText() {
                return EditorCellModel_Behavior.call_getOpeningTag_1220340471382(node);
              }

              public void setText(String s) {}

              public boolean isValidText(String s) {
                return EqualUtil.equals(s, getText());
              }
            },
            node);
    editorCell.setAction(CellActionType.DELETE, EmptyCellAction.getInstance());
    editorCell.setCellId("ReadOnlyModelAccessor_mtiojs_a");
    Style style = new StyleImpl();
    Styles_StyleSheet.applyBordered(style, editorCell);
    style.set(
        StyleAttributes.BACKGROUND_COLOR,
        StyleRegistry.getInstance()
            .getSimpleColor(
                _OpenTag._StyleParameter_QueryFunction_mtiojs_a0a(
                    (editorCell == null ? null : editorCell.getContext()),
                    (editorCell == null ? null : editorCell.getSNode()))));
    style.set(StyleAttributes.EDITABLE, false);
    editorCell.getStyle().putAll(style);
    return editorCell;
  }
コード例 #10
0
 private EditorCell createRefCell_kasd0f_b1a0() {
   CellProviderWithRole provider =
       new RefCellCellProvider(myNode, getEditorContext()) {
         @Override
         protected InlineCellProvider createInlineCellProvider(SNode innerCellNode) {
           return new MigrateManuallyAnnotation_EditorBuilder_a._Inline_kasd0f_a1b0a(
               innerCellNode, myNode);
         }
       };
   provider.setRole("migrateTo");
   provider.setNoTargetText("<no migrateTo>");
   EditorCell editorCell;
   editorCell = provider.createEditorCell(getEditorContext());
   if (editorCell.getRole() == null) {
     editorCell.setReferenceCell(true);
     editorCell.setRole("migrateTo");
   }
   Style style = new StyleImpl();
   style.set(StyleAttributes.NAVIGATABLE_REFERENCE, "migrateTo");
   style.set(
       StyleAttributes.TEXT_COLOR,
       StyleRegistry.getInstance().getSimpleColor(MPSColors.DARK_BLUE));
   style.set(StyleAttributes.FONT_STYLE, MPSFonts.ITALIC);
   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;
 }
コード例 #11
0
 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;
 }
コード例 #12
0
 private EditorCell createRefCell_1x8nz9_a0(EditorContext editorContext, SNode node) {
   CellProviderWithRole provider = new RefCellCellProvider(node, editorContext);
   provider.setRole("declaration");
   provider.setNoTargetText("<no declaration>");
   EditorCell editorCell;
   provider.setAuxiliaryCellProvider(new NodePatternVariableReference_Editor._Inline_1x8nz9_a0a());
   editorCell = provider.createEditorCell(editorContext);
   if (editorCell.getRole() == null) {
     editorCell.setReferenceCell(true);
     editorCell.setRole("declaration");
   }
   Style style = new StyleImpl();
   style.set(StyleAttributes.FONT_STYLE, 0, MPSFonts.BOLD);
   style.set(
       StyleAttributes.TEXT_COLOR,
       0,
       StyleRegistry.getInstance().getSimpleColor(MPSColors.DARK_GREEN));
   editorCell.getStyle().putAll(style);
   editorCell.setSubstituteInfo(provider.createDefaultSubstituteInfo());
   SNode attributeConcept = provider.getRoleAttribute();
   Class attributeKind = provider.getRoleAttributeClass();
   if (attributeConcept != null) {
     EditorManager manager = EditorManager.getInstanceFromContext(editorContext);
     return manager.createNodeRoleAttributeCell(attributeConcept, attributeKind, editorCell);
   } else return editorCell;
 }
コード例 #13
0
  private EditorCell createReadOnlyModelAccessor_clzyhh_a0(
      final EditorContext editorContext, final SNode node) {
    EditorCell_Property editorCell =
        EditorCell_Property.create(
            editorContext,
            new ModelAccessor() {
              public String getText() {
                return BehaviorReflection.invokeVirtual(
                    String.class,
                    node,
                    "virtual_getTextWhenBroken_328850564593858078",
                    new Object[] {});
              }

              public void setText(String s) {}

              public boolean isValidText(String s) {
                return EqualUtil.equals(s, getText());
              }
            },
            node);
    editorCell.setAction(CellActionType.DELETE, EmptyCellAction.getInstance());
    editorCell.setCellId("ReadOnlyModelAccessor_clzyhh_a0");
    Style style = new StyleImpl();
    style.set(
        StyleAttributes.TEXT_COLOR, StyleRegistry.getInstance().getSimpleColor(MPSColors.darkGray));
    editorCell.getStyle().putAll(style);
    return editorCell;
  }
コード例 #14
0
 private EditorCell createProperty_hntvsg_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");
   Style style = new StyleImpl();
   style.set(StyleAttributes.FONT_STYLE, 0, MPSFonts.ITALIC);
   style.set(
       StyleAttributes.TEXT_COLOR,
       0,
       StyleRegistry.getInstance().getSimpleColor(MPSColors.darkGray));
   style.set(StyleAttributes.PADDING_RIGHT, 0, new Padding(0.0, Measure.SPACES));
   style.set(StyleAttributes.AUTO_DELETABLE, 0, true);
   editorCell.getStyle().putAll(style);
   editorCell.setSubstituteInfo(provider.createDefaultSubstituteInfo());
   SNode attributeConcept = provider.getRoleAttribute();
   Class attributeKind = provider.getRoleAttributeClass();
   if (attributeConcept != null) {
     EditorManager manager = EditorManager.getInstanceFromContext(editorContext);
     return manager.createNodeRoleAttributeCell(attributeConcept, attributeKind, editorCell);
   } else return editorCell;
 }
コード例 #15
0
  private EditorCell createReadOnlyModelAccessor_7k9x8q_a0(
      final EditorContext editorContext, final SNode node) {
    EditorCell_Property editorCell =
        EditorCell_Property.create(
            editorContext,
            new ModelAccessor() {
              public String getText() {
                return (String)
                    INodeWithReference__BehaviorDescriptor.getTextWhenBroken_idigjXyuNrou.invoke(
                        node);
              }

              public void setText(String s) {}

              public boolean isValidText(String s) {
                return EqualUtil.equals(s, getText());
              }
            },
            node);
    editorCell.setAction(CellActionType.DELETE, EmptyCellAction.getInstance());
    editorCell.setAction(CellActionType.BACKSPACE, EmptyCellAction.getInstance());
    editorCell.setCellId("ReadOnlyModelAccessor_7k9x8q_a0");
    Style style = new StyleImpl();
    style.set(
        StyleAttributes.TEXT_COLOR, 0, StyleRegistry.getInstance().getSimpleColor(MPSColors.gray));
    editorCell.getStyle().putAll(style);
    return editorCell;
  }
コード例 #16
0
 public static void applyMacroStart(Style style, EditorCell editorCell) {
   style.set(StyleAttributes.FONT_STYLE, MPSFonts.BOLD_ITALIC);
   style.set(
       StyleAttributes.TEXT_COLOR,
       StyleRegistry.getInstance().getSimpleColor(MPSColors.DARK_BLUE));
   style.set(StyleAttributes.EDITABLE, true);
 }
コード例 #17
0
 private EditorCell createProperty_1qbsjw_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");
   Style style = new StyleImpl();
   style.set(StyleAttributes.FONT_STYLE, MPSFonts.BOLD_ITALIC);
   style.set(
       StyleAttributes.TEXT_COLOR,
       StyleRegistry.getInstance().getSimpleColor(MPSColors.DARK_BLUE));
   style.set(StyleAttributes.AUTO_DELETABLE, true);
   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;
 }
コード例 #18
0
ファイル: MqlSS_StyleSheet.java プロジェクト: utkarshx/MPS
 public static void apply_Keyword(Style style, EditorCell editorCell) {
   style.set(StyleAttributes.FONT_STYLE, 0, MPSFonts.BOLD);
   style.set(
       StyleAttributes.TEXT_COLOR,
       0,
       StyleRegistry.getInstance().getSimpleColor(MPSColors.DARK_BLUE));
 }
コード例 #19
0
ファイル: TypeSystemStateTree.java プロジェクト: yan96in/MPS
 public TypeEditorMessage(jetbrains.mps.openapi.editor.cells.EditorCell cell, String message) {
   super(
       cell.getSNode(),
       StyleRegistry.getInstance().getSimpleColor(Color.blue),
       message,
       myMessageOwner);
   this.myCell = cell;
 }
コード例 #20
0
 @Deprecated
 public static Style getGeneratorKeyWord(final EditorCell editorCell) {
   Style style = new StyleImpl(editorCell);
   style.set(
       StyleAttributes.TEXT_COLOR, StyleRegistry.getInstance().getSimpleColor(MPSColors.darkGray));
   style.set(StyleAttributes.FONT_STYLE, MPSFonts.BOLD);
   return style;
 }
コード例 #21
0
 private EditorCell createConstant_pr8n4z_a0_0(EditorContext editorContext, SNode node) {
   EditorCell_Constant editorCell = new EditorCell_Constant(editorContext, node, "map node macro");
   editorCell.setCellId("Constant_pr8n4z_a0_0");
   Style style = new StyleImpl();
   style.set(StyleAttributes.SELECTABLE, false);
   style.set(
       StyleAttributes.TEXT_COLOR,
       StyleRegistry.getInstance()
           .getSimpleColor(
               MPSColors.DARK_BLUE,
               StyleRegistry.getInstance().getSimpleColor(MPSColors.lightGray)));
   style.set(
       StyleAttributes.TEXT_BACKGROUND_COLOR,
       StyleRegistry.getInstance().getSimpleColor(MPSColors.lightGray));
   editorCell.getStyle().putAll(style);
   editorCell.setDefaultText("");
   return editorCell;
 }
コード例 #22
0
 @Deprecated
 public static Style getNodeUnderMacro(final EditorCell editorCell) {
   Style style = new StyleImpl(editorCell);
   style.set(StyleAttributes.DRAW_BRACKETS, true);
   style.set(
       StyleAttributes.BRACKETS_COLOR,
       StyleRegistry.getInstance().getSimpleColor(MPSColors.LIGHT_BLUE));
   return style;
 }
コード例 #23
0
 @Deprecated
 public static Style getLiteral(final EditorCell editorCell) {
   Style style = new StyleImpl(editorCell);
   style.set(
       StyleAttributes.TEXT_COLOR,
       StyleRegistry.getInstance().getSimpleColor(MPSColors.DARK_BLUE));
   style.set(StyleAttributes.FONT_STYLE, MPSFonts.BOLD);
   return style;
 }
コード例 #24
0
 private EditorCell createConstant_vhqdz_a0() {
   EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "fail");
   editorCell.setCellId("Constant_vhqdz_a0");
   Style style = new StyleImpl();
   style.set(
       StyleAttributes.TEXT_COLOR, StyleRegistry.getInstance().getSimpleColor(MPSColors.blue));
   editorCell.getStyle().putAll(style);
   editorCell.setDefaultText("");
   return editorCell;
 }
コード例 #25
0
 private EditorCell createConstant_60liib_a0h1b0(EditorContext editorContext, SNode node) {
   EditorCell_Constant editorCell = new EditorCell_Constant(editorContext, node, "deprecated");
   editorCell.setCellId("Constant_60liib_a0h1b0");
   Style style = new StyleImpl();
   style.set(
       StyleAttributes.TEXT_COLOR, StyleRegistry.getInstance().getSimpleColor(MPSColors.red));
   editorCell.getStyle().putAll(style);
   editorCell.setDefaultText("");
   return editorCell;
 }
コード例 #26
0
 private EditorCell createConstant_iwpawc_a0_0() {
   EditorCell_Constant editorCell =
       new EditorCell_Constant(getEditorContext(), myNode, "insert a node ");
   editorCell.setCellId("Constant_iwpawc_a0_0");
   Style style = new StyleImpl();
   style.set(StyleAttributes.SELECTABLE, false);
   style.set(
       StyleAttributes.TEXT_COLOR,
       StyleRegistry.getInstance()
           .getSimpleColor(
               MPSColors.DARK_BLUE,
               StyleRegistry.getInstance().getSimpleColor(MPSColors.lightGray)));
   style.set(
       StyleAttributes.TEXT_BACKGROUND_COLOR,
       StyleRegistry.getInstance().getSimpleColor(MPSColors.lightGray));
   editorCell.getStyle().putAll(style);
   editorCell.setDefaultText("");
   return editorCell;
 }
コード例 #27
0
 private EditorCell createConstant_60liib_a0b1a(EditorContext editorContext, SNode node) {
   EditorCell_Constant editorCell = new EditorCell_Constant(editorContext, node, "parameter type");
   editorCell.setCellId("Constant_60liib_a0b1a");
   Style style = new StyleImpl();
   style.set(
       StyleAttributes.TEXT_COLOR,
       StyleRegistry.getInstance().getSimpleColor(MPSColors.DARK_BLUE));
   editorCell.getStyle().putAll(style);
   editorCell.setDefaultText("");
   return editorCell;
 }
コード例 #28
0
 private EditorCell createConstant_85j21_e0a(EditorContext editorContext, SNode node) {
   EditorCell_Constant editorCell = new EditorCell_Constant(editorContext, node, ">");
   editorCell.setCellId("Constant_85j21_e0a");
   Style style = new StyleImpl();
   RunConfigurations_StyleSheet.apply_rightOperationBrace(style, editorCell);
   style.set(
       StyleAttributes.TEXT_COLOR, StyleRegistry.getInstance().getSimpleColor(MPSColors.black));
   editorCell.getStyle().putAll(style);
   editorCell.setDefaultText("");
   return editorCell;
 }
コード例 #29
0
 private EditorCell createConstant_rpujt6_a1b0(EditorContext editorContext, SNode node) {
   EditorCell_Constant editorCell = new EditorCell_Constant(editorContext, node, "<no icon>");
   editorCell.setCellId("Constant_rpujt6_a1b0");
   Style style = new StyleImpl();
   style.set(
       StyleAttributes.TEXT_COLOR,
       StyleRegistry.getInstance().getSimpleColor(MPSColors.lightGray));
   editorCell.getStyle().putAll(style);
   editorCell.setDefaultText("");
   return editorCell;
 }
コード例 #30
0
 private EditorCell createConstant_1px6hs_c0(EditorContext editorContext, SNode node) {
   EditorCell_Constant editorCell = new EditorCell_Constant(editorContext, node, "==");
   editorCell.setCellId("Constant_1px6hs_c0");
   Style style = new StyleImpl();
   BaseLanguageStyle_StyleSheet.apply_Operator(style, editorCell);
   style.set(
       StyleAttributes.TEXT_COLOR, StyleRegistry.getInstance().getSimpleColor(MPSColors.blue));
   editorCell.getStyle().putAll(style);
   editorCell.setDefaultText("");
   return editorCell;
 }