XScrollBar getScrollValue and setScrollValue

Shameera Rathnayaka <[email protected]>
Newsgroups gmane.comp.openoffice.devel.general
Message-ID <[email protected]>
Hi,

 I have being implemented A Visual Navigator for Open Office write as my
induvidual project under CS 3200 course module. I want to set  and get
scroolbar value of the currently viewing writer document. Referring
developer guide i found that i need to get
com.sun.star.awt.UnoControlScrollBarModel of the document but i don't know
hove to get this :( .As my project dead line also coming close please let me
know how to do this. my code sample is mentioned below


i am using Netbeans to implement Open Office add on with Open Office SDK


                                private final XComponentContext m_xContext;
                                private XDesktop xDesktop;
                                private Object desktop;
                                private XMultiComponentFactory xmcf;
                                private XComponent xDoc;
                                private XModel xModel;

                                xmcf = m_xContext.getServiceManager();

                                desktop =
xmcf.createInstanceWithContext("com.sun.star.frame.Desktop", m_xContext);
                               xDesktop = (XDesktop)
UnoRuntime.queryInterface(com.sun.star.frame.XDesktop.class, desktop);
                               xDoc = xDesktop.getCurrentComponent();

                             xModel =
(XModel)UnoRuntime.queryInterface(XModel.class, xDoc);
                             xController = xModel.getCurrentController();

                                      // trying to get ScrollBar
                             xScrollBar = (XScrollBar)
UnoRuntime.queryInterface(XScrollBar.class, xController);

                                      // try to control Scrollbar
                             System.out.println("ScrollValue id
"+xScrollBar.getValue());      // this gives null pointer exception when i
run this code

xScrollBar.setOrientation(xScrollBar.getMaximum());




-- 
Shameera Rathnayaka
Undergraduate
Department of Computer Science and Engineering
University of Moratuwa.
Sri Lanka.
T.P.  0719221454
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.