B4J Question [SOLVED] How to add custom class templates in B4J library?

Discussion in 'B4J Questions' started by Mashiane, Oct 12, 2018.

  1. Mashiane

    Mashiane Expert Licensed User

    Hi

    Please find question as per subject matter?

    Thanks
     
  2. DonManfred

    DonManfred Expert Licensed User

    Erel and Mashiane like this.
  3. Mashiane

    Mashiane Expert Licensed User

    Thanks @DonManfred , let me play around and see what I can come up with.
     
  4. Mashiane

    Mashiane Expert Licensed User

    I see why I dismissed this, its not prefixed with B4X and I assumed it only applies to B4A. It works, wow, great stuff.

    https://www.b4x.com/android/forum/threads/custom-class-templates-in-b4a.90552/

    Anyway

    1. Create your B4J library as you would normally create it.
    2. Create your skeleton class modules that you want to include it in your library that will be a templates
    3. Rename the extension from .bas to .b4x_excluded and ensure the header content is removed on your class, this would be...

    Code:
    B4J=true
    Group=Default Group
    ModulesStructureVersion=
    1
    Type=Class
    Version=
    6.51
    @EndOfDesignText@
    This should be for all the templates.
    4. Open your library .jar file with 7 zip / any compressor and drag and drop the .b4x_excluded files there.
    5. Open the xml file that came with your compiled library and for each template add a line just before the closing </root> element

    Code:
    <customClass>filenamewithoutextension:MashyClass, name:Mashy Nice Class</customClass>
    Where MashyClass is the exact name of your file name without .b4x_excluded.

    Ta!
     
    Erel, DonManfred, BPak and 1 other person like this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice