Share My Creation BOLE - Bruce's Own scriptable mLite Editor

BOLE - Bruce's Own scriptable mLite Editor (https://github.com/axtens/bole)

Requires B4J and Java 8.

Uses a dynamic menu. Path to menu folder stored in BOLE.INI. JavaScript files are interpreted by Nashorn. Most scripts are placeholders except for those marked "(working)".

MENU
├───1-File
│ 1-New.js
│ 2-Open.js (working)
│ 3-Save.js
│ 4-SaveAs.js
│ 5-Close.js (working)
│ 6-Exit.js

├───2-Edit
│ 1-Cut.js
│ 2-Copy.js
│ 3-Paste.js
│ 4-Clear.js
│ 5-SelectAll.js (working)

├───3-Script
└───4-Help
1-About.js (working)

The following objects are exposed to the script engine:

MessageBox
MenuItem
MainForm
MainText
gbDirty
gsVersion
gsPath
FileControl

See https://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/TextArea.html for methods and properties that can be exercised against MainText.

Edit BOLE.INI to point to where you have the menu tree stored. BOLE.INI and example tree stored in bole_bits.zip

Execute jar as

javaw -jar BOLE.jar

If anyone runs it in Mac OS X, please let me know how it performs (if it does at all.)

The menus are strangely reordered under Linux (see Screenshot-BOLE-Filemenu.pngScreenshot-BOLE-menubar.png)
 

Attachments

  • bole.zip
    2.5 KB · Views: 312
  • bole_bits.zip
    5.8 KB · Views: 315
  • BOLEv0.3.zip
    8.4 KB · Views: 340

Bruce Axtens

Active Member
Licensed User
Longtime User
Please note:
1. The menu parsing needs work. I wanted to have menus within menus but haven't got there yet.
2. The Linux reordering of menus is weird. I may have to sort the directories first somehow.
3. Calling the FileControl class requires the name of the class to be the first parameter. I don't know why.
4. When calling a method in the FileControl class, the original casing of the method in B4J is forced to lowercase and an underscore prepended. I had to go digging around in the generated java to find this out. I suppose it must be documented somewhere.
 

Bruce Axtens

Active Member
Licensed User
Longtime User
By the way, mLite is a small ML interpreter. It can be found at http://www.t3x.org/mlite/index.html and it helped me finally get my head around functional programming languages. Kudos to Nils Holm, the developer.
 

Bruce Axtens

Active Member
Licensed User
Longtime User
BOLE v0.3

See the script in 3-Scripts. It actually chooses and inserts a file into the editing buffer. No more attempts to call B4J modules. I will morph that script into FileOpen, FileSave, FileSaveAs and then we might actually have something usable, even to the point of editing its own scripts.
 

Bruce Axtens

Active Member
Licensed User
Longtime User
Minor update can be found on github. Have changed the INI library to the one provided by db2000.
 
Top