Property Browser com.sun.star.awt.Toolkit com.sun.star.frame.Frame com.sun.star.form.PropertyBrowserController introspectedObject Paolo Mantovani Is it possible to use the service {@link com.sun.star.form.PropertyBrowserController} from a OOBasic macro ?

The IDL documentation contains a java example for this service but it's not easy to translate it in OOBasic

Here you'll find an OOBasic "translation" of the example in the IDL documentation for the service com.sun.star.form.PropertyBrowserController.

The code does the following operations:

To see it working:

Open the OOBasic IDE, add a new empty dialog (this will be the introspected Object) and run the following code:

REM ***** BASIC ***** Sub ShowPropertyBrowser() ' Create a rectangle struct Dim aRect As New {@see com.sun.star.awt.Rectangle} aRect.Y = 0 aRect.X = 0 aRect.width = 350 aRect.height = 550 ' Create a window descriptor and set up its properties Dim aDescriptor As New {@see com.sun.star.awt.WindowDescriptor} aDescriptor.Type = {@see com.sun.star.awt.WindowClass:TOP} ' aDescriptor.WindowServiceName = "window" ' aDescriptor.ParentIndex = -1 ' aDescriptor.Parent = Null 'not available in OOBasic aDescriptor.Bounds = aRect aDescriptor.WindowAttributes = _ {@see com.sun.star.awt.WindowAttribute:BORDER} + _ {@see com.sun.star.awt.WindowAttribute:MOVEABLE} + _ {@see com.sun.star.awt.WindowAttribute:SIZEABLE} + _ {@see com.sun.star.awt.WindowAttribute:CLOSEABLE} ' Use a Toolkit to create a Window oToolkit = createUnoService("{@see com.sun.star.awt.Toolkit}") oContainerWindow = oToolkit.createWindow(aDescriptor) ' Create a new empty target frame. oFrame = createUnoService("{@see com.sun.star.frame.Frame}") ' Set the container window on it. oFrame.initialize(oContainerWindow) ' Insert the new frame in desktop hierarchy. oFrameContainer = StarDesktop.getFrames() oFrameContainer.append(oFrame) ' Make some other initializations. oFrame.Name = "newly created 1" oFrame.Title = "newly created 1" oContainerWindow.setVisible(True) ' Create the Property Browser Controller oPropBrowser = CreateUnoService("{@see com.sun.star.form.PropertyBrowserController}") oPropBrowser.attachFrame(oFrame) ' Now we have a component window ! ' Make it visible oFrame.ComponentWindow.setVisible(True) ' Retrieve an UNO Control Model oDlg = CreateUnoDialog(DialogLibraries.Standard.Dialog1) oCtrlModel = oDlg.getModel 'also Form Controls works well(obvious) ' oCtrlModel = ThisComponent.DrawPage.Forms.Standard.PushButton ' Show Control properties in the browser oPropBrowser.introspectedObject = oCtrlModel End Sub
Initial version fixed linking to IDL-Fields