Share My Creation [B4X] [TOOL][SOURCE] lm Snippets Manager

I definitely want to speed up the development of my softwares; I decided to develop a very useful snippets manager.

Although the main purpose is to have all your snippets at your fingertips, saved in a local db, cataloged and easy to find, I have also added the possibility of inserting those that are on b4x.com and also a link to their page.

I am sure that it will also be of use to all the members of our beautiful community.

I'll fill it with my own snippets, as I'm sure you will too, but also the best and most useful ones that are on site.


NEW Version 2.3.0 - 03/29/2022 - Added import-export.


Version 2.2.0 - Added "wildcards" to filter for snippet name. Also added ToolTipTexts. See post #86.

Version 2.1.0 - Added a very useful list of most recent snippets used (window always on top). See post #40.

Ready 2.0.0 version, which implements the feature shown in
post #34, code highlighting (which had a hard to solve bug).

Source code - Min. donation: 16 euros.
Obviously you are not allowed to publish/sell the lmSnippetManager source code.

NOTE: to create the stand-alone (exe) version, use:
Download OpenJDK 14.0.1
EDIT: see this post. You have to add javafx folder to that OpenJDK 14.0.1.




Made with love in B4X... of course!!!
 
Last edited:

aidymp

Well-Known Member
Licensed User
Longtime User
I have v. 8 in Paths (using it in debug mode) and in code, as you can see in Main:
#JavaCompilerPath: 14, C:\jdk-14.0.1\bin\javac.exe

Do I have to install javaFX or something also ??
 

LucaMs

Expert
Licensed User
Longtime User
no, it is part of v. 14.0.1
I've just checked. On my PC that version, 14.0.1 contains javafx, but the download indicated in the first post of this thread does not! :oops:

I don't know how this is possible; I'm searching...
 

LucaMs

Expert
Licensed User
Longtime User
That's right, that download doesn't include javafx. I don't know where I got it! And it is necessary.
 

aidymp

Well-Known Member
Licensed User
Longtime User
I've just checked. On my PC that version, 14.0.1 contains javafx, but the download indicated in the first post of this thread does not! :oops:

I don't know how this is possible; I'm searching...

Yes this is my problem lol, I see images (in the forum) of folders that just dont exist in my Java folder even though I am using the links provided. Im looking more stupid than usual! :rolleyes:
 

LucaMs

Expert
Licensed User
Longtime User
All I can do is put javafx on my GDrive, hoping not to break any laws!

But now I should have dinner and cry in watching Turkey-Italy (football).
 

aidymp

Well-Known Member
Licensed User
Longtime User
So the .zip you sent me i copied it into the C:\jdk-14.0.1\ folder and it compiles & works correctly!

I now have about 10 Java versions installed or unzipped to various locations! lol This is obviously not your fault, It appears many people have just decided to create Java packages and bundles, with no exlaination as to WHY! lol

Solved thank you.
 

aeric

Expert
Licensed User
Longtime User
Hi LucaMS ... I have an error message

B4X:
Waiting for debugger to connect...
Program started.
Fehler in Zeile: 547 (Main)
java.lang.RuntimeException: Method: reorderingProperty not found in: javafx.scene.control.skin.TableHeaderRow
    at anywheresoftware.b4j.object.JavaObject$MethodCache.getMethod(JavaObject.java:363)
    at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:120)
    at com.snippetsmanager.lm.main._disablereordering(main.java:519)
    at com.snippetsmanager.lm.main._appstart(main.java:395)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    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 java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:108)
    at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:95)
    at com.snippetsmanager.lm.main.start(main.java:38)
    at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
    at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
    at java.base/java.lang.Thread.run(Thread.java:834)
I solved this by (works with openJDk11):
B4X:
Private Sub DisableReordering
    Dim Jo As JavaObject = tbvSearch
    Dim Header As JavaObject = Jo.RunMethod("lookup", Array("TableHeaderRow"))
    'Dim Prop As JavaObject = Header.RunMethod("reorderingProperty", Null)
    'Dim o As Object = Prop.CreateEventFromUI("javafx.beans.value.ChangeListener", "HeaderOrder", Null)
    'Prop.RunMethod("addListener",Array(o))
    Header.RunMethod("setMouseTransparent", Array(True))
End Sub
Reference: https://stackoverflow.com/questions...-the-reordering-of-table-columns-in-tableview (second answer)
 

JakeBullet70

Well-Known Member
Licensed User
Longtime User
Thinking a new feature would be to add file attachments to snippets!
I just added some custom Button code snippet - now I really would need to add a zip file of images with it.
 

JakeBullet70

Well-Known Member
Licensed User
Longtime User
And if you do... DO NOT store attachments in the DB! lol... I would do it but neck deep in another project at the moment.
 
Top