Share My Creation Menu Designer

The task of creating menu for b4j is not simple because you have to create a jason string.
I made a tool for creating the string based on this thread https://www.b4x.com/android/forum/threads/designer-menu-items.56602/
While doing that I exercised the new designer :)

For first level menu items only name, tag and event are relevant (I tried to disable but it does not work)
Make sure that an item is selected before doing update or remove.
After "create" you have the string in the clipboard, just paste it to the menu field in the application designer, or copy from the textarea or the log.
Please check and report any problems, it has not been tested too much.

Edit: Ver. 1.1 , logic of update and remove is changed completely.
Edit: Ver 2.0 includes save and load functions. A bug is corrected in submenu operation, now when you click it you can add a sub menu for the selected treeitem.
Edit: ver 2.1 correct a bug.
Edit: ver 2.2 corrected a bug in update.
Edit: ver 2.3 added menu with shortcuts (created by itself ! ) for load(open) and save files.
Edit: ver 2.4 corrects bugs in move and remove.
MenuDesigner_kvs uses KeyValueStore to keep the current "menu in work" ready even while exiting.
Edit: ver 2.5 and kvs_2.5 replace the previous after correction of bug.
Edit: ver 2.6 corrected the same problem in moving nodes.

Note: From version 2.0 the item's details are kept in a map by the item's name as the key. This means that an update cannot include change of the name. To do such update remove the item and add a new item instead.
 

Attachments

  • img.png
    img.png
    51.1 KB · Views: 6,432
  • MenuDesigner2.6.zip
    18.5 KB · Views: 926
  • MenuDesigner_kvs_2.6.zip
    20.7 KB · Views: 828
Last edited:

dtrieb

New Member
Thank you for this handy tool.

But it crashed, if I cancle the Save Dialog ...

Fehler in Zeile: 556 (Main)
java.io.FileNotFoundException: (Result too large)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at anywheresoftware.b4a.objects.streams.File.OpenOutput(File.java:439)
at b4j.example.main._save(main.java:1161)
at b4j.example.main._saveas_action(main.java:1228)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:632)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:237)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
at anywheresoftware.b4a.BA$1.run(BA.java:216)
at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$4(WinApplication.java:186)
at java.lang.Thread.run(Thread.java:748)
 
Top