BASIC/UNO Object Browser

From Apache OpenOffice Wiki
Jump to: navigation, search

The intention of this project is to provide a browser that shows the interfaces, methods and properties of a living object. It will be a component of the BASIC ide debugger, and probably will be invoked from the watch window. It is implemented as a UNO object.

First step: text mode browser

First a "text mode browser" was built, that accept an object as a parameter and displays the interfaces, methods and properties. The purpose of this step was to learn the Reflection APIs. As a result of this work, some issues with Corereflection and Introspection were filed (bugs 66631 and 66635). The first of these was closed by the mentor as invalid, because I had a wrong view about the role of the Introspection interface. Within my time limits, I may try to fix 66635.

Unfortunately, plenty of time was lost trying to build OpenOffice. After switching to OpenOffice SDK, work became more pleasant.

Graphical user interface

Then, a basic graphical user interface was built. It just shows who to use the VCL for showing a tree, applied for displaying the methods and interfaces of this object. Here is a screenshot:

ObjectBrowserUNO.png ObjectBrowserBASIC.png

Task list

This task is roughly in order of priority.

  • Implement interface XNameContainer instead of its own interface (done).
  • Improve the GUI. Insert proper +/- (done).
  • Information about services (done).
  • Do a portable Makefile and integrate into OpenOffice. According to the mentor, create a directory similar to the propctlr (done).
  • Link methods to interfaces supporting them. (done).

Right click in a method in the flat list of methods, and choose "View interface". You will be directed to the interface implementing that method.

  • Make the output in Basic language. Better even, make this an option.(done).

Choice of language supported both in the user interface and programmatically, using the XObjectBrowser interface.

  • Link interfaces to OpenOffice documentation.(done) .

Right click in any interface, attribute or service and choose "IDL reference" (see first screenshot).

  • Implement interface XController for integration into BASIC IDE.
 Actually, you'd need the Controller service instead of only the interface.
 Also, I suggest moving this down the list. There's additional work involved to finally
 integrate this as pluggable component into the Basic IDE, and given the timeline, I'd
 let's say concentrate on the core features of the Object Browser. (fs)


(Earliear post had old code. Apologies)

Download the code and idl files. Both archives are intended to be extracted in the OpenOffice source tree, and a corresponding solver tree in the solver/ directory. To compile it, go to extensions/source/objectbrowser and run dmake. In addition, you will find files with extension .diff. These files are patches, that are intended to be used with the command patch in the same directory where they are. Their purpose is to modify makefiles and project files to include the new components.

Steps to compile the code:

Go to udkapi/prj; build; deliver

Go to offapi/prj; build; deliver

Go to offuh/prj; build; deliver

(These steps create the header files from the IDL files).

Finally go to extensions/source/objectbrowser Type dmake.

This will compile the component, but will not register it. The complete build procedure should generate a registered component. But you can register it by hand, by customizing running the included script register_by_hand in this directory.

A test swriter document is included. Open it, and run the macro "Main". It should display something similar to the screenshot.


A full featured object browser was delivered. The only missing desirable feature is an implementation of a Controller service for full integration into the BASIC IDE. After 9th of september (exams) this will be completed.

I want to thank the mentor for his support. He is very busy, and I tried to bug him as seldom as possible.

I wish that this is the start of a long term collaboration with the OpenOffice project.

Personal tools