Getting Started with the Lobo Java Web Browser's Sources

Maybe you want to contribute to the Lobo browser's source code. Alternatively, maybe you want to create plugins for Lobo, as outlined in the last few days, such as in the recent article entitled How to Add Syntax Coloring for XML in the Lobo Java Web Browser. Either way, you're going to want to download the sources and work with them. Here's an outline of what that entails.

If you are using Eclipse, the Lobo site provides everything you need, right here. However, if you're using NetBeans IDE, there's currently no document showing you what to do once you've downloaded the browser's sources. These you can get from the site's CVS repository, as explained here. Now, let's assume you've downloaded the sources, what next? Here is an outline:

  1. Import the Lobo Sources. In the New Project wizard (Ctrl-Shift-N), choose Java | Java Project with Existing Sources. Under "Source Package Folder", browse to the location where you downloaded the sources. There, select the following folders (i.e., multiple folders):
    • XAMJ_Project/Primary_Extension
    • XAMJ_Project/HTML_Renderer
    • XAMJ_Project/Platform_Core
    • XAMJ_Project/Platform_Public_API
    • XAMJ_Project/Commons
  2. Set the Required Libraries. After you have completed the above task, right-click the Libraries node and add the following JARs from the Lobo download (i.e., these are not from the sources, but from the end-user's distro), in the ext folder:
    • cobra-no-commons.jar
    • js.jar
    • xpp3-1.1.3.4.M.jar
  3. Set the Required VM Arguments. Right-click the project node and choose Properties. In the Run tab, set these VM Options:

    -Dext.dirs=${lobo.dir}/XAMJ_Build/ext -Dext.files=${lobo.dir}/Primary_Extension


    Switch to the Files window and in the nbproject/project.properties file, define the lobo.dir property and check that the run.jvmargs property is correct. This is how they should be:

    lobo.dir=XAMJ_Project
    run.jvmargs=-Dext.dirs=${lobo.dir}/XAMJ_Build/ext -Dext.files=${lobo.dir}/Primary_Extension


    If you need to play with these settings, you can just do so here in the project.properties file, instead of the u.i, because it is easier to do so, especially if you're changing properties a lot.

  4. Verify the Setup. First, check that the Projects window looks as follows, taking note of the fact that you have 5 source package folders:



    Next, make sure that this is what you see in the Files window:



    Finally, look in the project.properties file and make sure that the VM arguments are as specified above.
  5. Run the Browser. Right-click the project node and choose Build. Once the project is successfully built, choose Run. You should now see the browser, deployed like any other Java application in the IDE:

You might need to troubleshoot before step 5 can be successfully completed. One thing I did was to switch off the security manager (which is set in org.lobobrowser.main.ReuseManager), which is in XAMJ_Project/Platform_Core. In general, if you need to tweak anything, that's probably the module you'll need to be in. Bear in mind that the entry point for the application is there too, in the form of org.lobobrowser.main.EntryPoint. By the way, one thing I found is that I had to tweak the location of the icons that appear in the toolbar buttons.

With this, I hope you have all the info you need for getting started developing Lobo, either by directly extending the source code or by creating plugins. Another possibility is that you want to integrate some of the functionality in your own applications. Having the source code correctly set up is a great place to start.

5
Average: 5 (1 vote)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

The Lobo Project replied on Sat, 2008/02/09 - 11:19pm

I guess that works. It's nice new information for NetBeans users. I set it up a little differently, probably because I use Eclipse. For example, instead of linking the JAR files, I link the corresponding projects. XAMJ_Project/Platform_Core is one project, and that depends on XAMJ_Project/Platform_Public_API, XAMJ_Project/Common, XAMJ_Project/HTML_Renderer, and XAMJ_Project/cssparser. There are some dependencies that are not projects in the workspace, such as js.jar (Rhino). It might take a little time to figure out how all the dependencies should be set up.

For anyone wondering, the Lobo Project started out being called the XAMJ Project. The focus of the project evolved a bit.

Jose

Geertjan Wielenga replied on Sun, 2008/02/10 - 6:29pm in response to: xamjadmin

Hi Jose. In fact, what you describe above is exactly what I did, but in NetBeans terms. It's pretty cool having the whole app available locally and being able to look inside it to see how things work.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.