openoffice-api mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Berkhan Dipso" <berkhan.di...@prmyazilim.com>
Subject Changing Screen Cursor to Wait
Date Fri, 10 Jul 2015 10:00:35 GMT
Hi;

 

I'm trying to develop a Calc Extension in Java, and I'm new at it. I'm not
fully sure that I got the relations between: Desktop, Toolbar, Frame,
Component, Control, WindowPeer etc.

 

So; What I need is to change screen cursor to WAIT when a tool button is
pressed. I'm using the code below:

 

public static XWindowPeer getWindowPeer(XFrame _xFrame) {

        XWindow xWindow = _xFrame.getContainerWindow();

        XWindowPeer xWindowPeer = (XWindowPeer)
UnoRuntime.queryInterface(XWindowPeer.class, xWindow);

        return xWindowPeer;

}

 

public static void changeCursor(XComponentContext m_xContext,
com.sun.star.frame.XFrame m_xFrame, int cursorPointer) {

        XWindowPeer peer = getWindowPeer(m_xFrame);        

        try {

            Object oPointer =
m_xContext.getServiceManager().createInstanceWithContext("com.sun.star.awt.P
ointer", m_xContext);

            XPointer xPointer = (XPointer)
UnoRuntime.queryInterface(XPointer.class, oPointer);

            xPointer.setType(cursorPointer);

 

            if (peer != null) {

                peer.setPointer(xPointer);

            }

 

        } catch (com.sun.star.uno.Exception ex) {

            throw new java.lang.RuntimeException("cannot happen..." +
ex.getMessage());

        }

}

 

USAGE WITHIN THE CODE:

SheetOperations.changeCursor(m_xContext, m_xFrame,
com.sun.star.awt.SystemPointer.WAIT);

 

The problem is that; it is not working stable. So I'm not sure if this is
the right way to change the screen cursor. 

And also I'm not writing any code to change the cursor back to normal, but
somehow it changes back to normal after leaving my code.

 

Regards

 

Berkhan Dipşo

Solutions Architect

Tel          : +90 (216) 469 96 00 (14)

GSM      : +90 (533) 03 03 550

 

PRM YAZILIM

Oracle Gold Partner

Primavera Specialized

 <http://www.prmyazilim.com/> www.prmyazilim.com

 

 <http://www.linkedin/company/prm-yazilim>
http://www.linkedin/company/prm-yazilim

 <http://www.twitter.com/prmyazilim> http://www.twitter.com/prmyazilim

 

6-10 Temmuz - İSTANBUL

Primavera eğitimlerine ön kayıt icin:

 <http://apps.primavera-tr.com/drupal/node/15>
http://apps.primavera-tr.com/drupal/node/15

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message