GithubHelp home page GithubHelp logo

monacoeditorfx2's Introduction

项目说明

本项目旨在将开源的代码编辑器Monaco Editor(js)包装为一个JavaFx控件,最终达到在JavaFx项目中如同使用原生控件一样使用Monaco Editor的目标。 本项目实质上是一个JS/Kotlin的混合项目,底层使用webview来加载和渲染Monaco Editor实例,并通过一个使用JS/TS编写的中间层来封装Monaco Editor的API,并暴露给(或者说映射到)Kotlin层,使我们在Kotlin中能够如同调用原生函数一样调用这些API。

core-library模块

核心功能的实现,对外提供各功能模块的API。

主要API

主要API定义在MonacoEditorFx.ktMonacoEditor.ktTextModel.kt等文件中。 可以参考其中公开的接口。

src/main/resources/dist

该目录下储存了Monaco Editor(web层面)所需的全部静态资源,包括js、html、css、字体文件等等资源。 使用JS/TS编写的的中间层代码被打包到此目录下的monacofx.bundle.js文件中。 Web层面的实现(特别是使用TS/JS编写的中间层的原始代码)可以在这个仓库 找到。

api-demo模块

作为对core-library中的API的演示。同时也演示了在JavaFx中使用MonacoEditorFx控件的基本方式。

jsobject-processor

使用KSP技术编写的注解处理器,用于在编译时生成一些必要的代码。

目前状态:WIP

目前已经完成

  1. 对monaco.editor.IStandaloneEditor中大多数接口的映射
  2. 对monaco.editor.ITextModel中大多数接口的映射
  3. 对monaco.editor.IStandaloneEditor中大多数事件的桥接
  4. 对monaco.editor.ITextModel中大多数事件的桥接
  5. 对Editor和TextModel部分功能的演示

尚待完成(完善)的地方

  1. 完善API测试与Demo
  2. 代码整理、清理和统一化
  3. 优化项目构架,减少重复代码,合理拆分代码、组织功能模块,使单个文件长度保存在合适尺度,便于后期维护
  4. 完善文档
  5. 其他

特别说明

  1. 本项目依赖monaco editor、tornadofx、fastjson、ksp等第三方项目
  2. 由于处在早期开发阶段,本项目中各个功能模块的API尚未完全定型,还处在一个随时可能发生变得的阶段,因此目前还无法保证向前、向后的兼容性

一些截图

avatar avatar avatar avatar avatar avatar avatar

monacoeditorfx2's People

Contributors

zyzz19951230 avatar

Stargazers

Yang Lin avatar zimolab avatar

Watchers

zimolab avatar

Forkers

todoubaba sdmq

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.