0.0.28 • Published 2 years ago

ids-editor v0.0.28

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

ids-editor

Npm package version Npm package total downloads

Install

npm install ids-editor

Modify "angular.json" file

{	"assets":[
    ...,
    { "glob": "**/*", "input": "node_modules/ids-editor/node_modules/monaco-editor", "output": "assets/monaco-editor" },
  ],
} 

Modify "app.module.ts" file

import { IdsEditorModule } from 'ids-editor';

@NgModule({
  declarations: [
    ...
  ],
  imports: [
   ..,
    IdsEditorModule
  ],
  providers: [],
  bootstrap: [...]
})

Setting IdsEditor

PropertyTypeExapleDescription
themestring or ThemeProps'vs-dark'theme name
languagestring'java'language used
contentstring'content class'content
glyphMarginbooleantrue
automaticLayoutbooleantrue
wordWrapMinifiedbooleantrue
breakPointsbooleantruebreakpoints view
lineNumbersbooleantrue
minimapbooleantrue
actionsIdsEditorActionProps[][{id: "id", keys: [IdsEditorKeyMod.CtrlCmd, IdsEditorKeyCode.KEY_S], label: "Save", contextMenuGroupId:'navigator'}]actions
commandsIdsEditorCommandProps[][{id: "id1", keys: [IdsEditorKeyMod.CtrlCmd, IdsEditorKeyCode.KEY_7]}]commands
differencebooleantruedifference display
originalVersionstringoriginal contentoriginal content
suggestions.onlyImportedClassesbooleantrueSuggestions only imported class (JAVA)

Example (JAVA)

component.html

<ids-editor #editor [config]="config" 
                    (callCommand)="callCommandEditor($event)" 
                    (callAction)="callAction($event)"
                    (javaClassNotFound)="javaClassNotFound($event)" 
                    [javaMethodsNotFound]="javaMethodsNotFound"
                    (contentChange)="contentChange($event)"></ids-editor>

component.ts

import { IdsEditorComponent, IdsEditorConfig, IdsEditor_Language, IdsEditorKeyMod, IdsEditorKeyCode, IdsEditorMarkerSeverity, IdsEditorCallCommandResponse, IdsEditorAction } from 'ids-editor';
import { JAVA } from 'ids-editor/lib/language/java';


export class ExampleComponent {
  
	@ViewChild('editor', { static: false }) idsEditor  : IdsEditorComponent | undefined;
  config : IdsEditorConfig = {
    content: "HI",
    language: {
      name: IdsEditor_Language.JAVA,
      classes: ["com.networkcontacts.it.TEST"],
      methods: [
        {
          class: "com.networkcontacts.it.TEST",
          fullName: "com.networkcontacts.it.TEST",
          input: [],
          jar: "com.networkcontacts.it.TEST",
          method: "test()",
          output: "",
          throws: "",
          type: ""
        }
      ]
    },
    suggestions:{
      onlyImportedClasses: true
    },
    theme: 'vs-dark',
    actions: [
      {id: "id", keys: [IdsEditorKeyMod.CtrlCmd, IdsEditorKeyCode.KEY_S], label: "Salva", contextMenuGroupId:'navigator'},

      {id: "ida", keys: [IdsEditorKeyMod.CtrlCmd, IdsEditorKeyCode.KEY_D], label: "Elimina", contextMenuGroupId:'navigator'}
    ],
    commands: [
      {id: "id1", keys: [IdsEditorKeyMod.CtrlCmd, IdsEditorKeyCode.KEY_I]}
    ],
    mouseWheelZoom: true,
    glyphMargin: true,
    breakPoints: true,
    
    difference: true,
    originalVersion: "TEST"
  }


  public callAction(event: any){
    if(this.idsEditor){
      this.idsEditor.setListError([
        {line: 1, message: "asdasdasd", severity: IdsEditorMarkerSeverity.Error,  nameclass: "myGlyphMarginClass"}
      ])
    }
  }
  
  async callCommandEditor(callCommandProps : IdsEditorCallCommandResponse){
    if(this.idsEditor){ 
        // await this.idsEditor.callActionEditor(IdsEditorAction.Indent);
        //-----------------------------------------------------------
        //await this.idsEditor.callActionEditor(IdsEditorAction.Comment);
    }
  }
  javaClassNotFound(event: {javaUtility: JAVA, nameClass: string}){
    event.javaUtility.addClass(event.nameClass);
    event.javaUtility.addMetohd({
      class: event.nameClass,
      fullName:event.nameClass,
      input: [],
      jar: event.nameClass,
      method: "newMethod()",
      output: "",
      throws: "",
      type: ""
    });
  }

  javaMethodsNotFound(event: {javaUtility: JAVA, nameClass: string, parent: any}){
    event.javaUtility.addMetohd({
        class: event.nameClass,
        fullName:event.nameClass,
        input: [],
        jar: event.nameClass,
        method: "otherMethod()",
        output: "",
        throws: "",
        type: ""
      });
    // If you want add list
    event.javaUtility.addMetohds([{
        class: event.nameClass,
        fullName:event.nameClass,
        input: [],
        jar: event.nameClass,
        method: "otherMethod()",
        output: "",
        throws: "",
        type: ""
      }]);
      
  }
  
  contentChange(value: string){
    console.log(value);
  }

Created by

npm.io

@Ingegneria dei Sistemi
0.0.25

2 years ago

0.0.26

2 years ago

0.0.27

2 years ago

0.0.28

2 years ago

0.0.20

2 years ago

0.0.21

2 years ago

0.0.22

2 years ago

0.0.23

2 years ago

0.0.24

2 years ago

0.0.12

3 years ago

0.0.13

3 years ago

0.0.14

3 years ago

0.0.15

3 years ago

0.0.16

3 years ago

0.0.17

2 years ago

0.0.18

2 years ago

0.0.19

2 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago