diff options
author | Noel Grandin <noel@peralex.com> | 2013-04-17 12:57:16 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-04-17 13:06:32 +0200 |
commit | bea18dd581ac9341a19e757a72662ab7a2e34b0a (patch) | |
tree | 4f78bb9a616c6c6a8393401505d6b1277965f290 /odk/examples/java | |
parent | f4b7fa5cdb670359ee967f38bd71fa9a8e5eb8d4 (diff) |
fix compile error in unused Java file.
"exception not thrown in catch block"
Change-Id: I13f8be9913f655ab1633b29e9fe686a41c2c0fcb
Diffstat (limited to 'odk/examples/java')
-rw-r--r-- | odk/examples/java/Inspector/ProtocolHandlerAddon.java | 50 |
1 files changed, 23 insertions, 27 deletions
diff --git a/odk/examples/java/Inspector/ProtocolHandlerAddon.java b/odk/examples/java/Inspector/ProtocolHandlerAddon.java index 86d03ade53d0..e20d3a2b1bcf 100644 --- a/odk/examples/java/Inspector/ProtocolHandlerAddon.java +++ b/odk/examples/java/Inspector/ProtocolHandlerAddon.java @@ -204,35 +204,31 @@ public class ProtocolHandlerAddon { } public void showMessageBox(String sTitle, String sMessage) { - try { - if ( null != m_xFrame && null != m_xToolkit ) { - - // describe window properties. - WindowDescriptor aDescriptor = new WindowDescriptor(); - aDescriptor.Type = WindowClass.MODALTOP; - aDescriptor.WindowServiceName = new String( "infobox" ); - aDescriptor.ParentIndex = -1; - aDescriptor.Parent = (XWindowPeer)UnoRuntime.queryInterface( - XWindowPeer.class, m_xFrame.getContainerWindow()); - aDescriptor.Bounds = new Rectangle(0,0,300,200); - aDescriptor.WindowAttributes = WindowAttribute.BORDER | - WindowAttribute.MOVEABLE | - WindowAttribute.CLOSEABLE; - - XWindowPeer xPeer = m_xToolkit.createWindow( aDescriptor ); - if ( null != xPeer ) { - XMessageBox xMsgBox = (XMessageBox)UnoRuntime.queryInterface( - XMessageBox.class, xPeer); - if ( null != xMsgBox ) - { - xMsgBox.setCaptionText( sTitle ); - xMsgBox.setMessageText( sMessage ); - xMsgBox.execute(); - } + if ( null != m_xFrame && null != m_xToolkit ) { + + // describe window properties. + WindowDescriptor aDescriptor = new WindowDescriptor(); + aDescriptor.Type = WindowClass.MODALTOP; + aDescriptor.WindowServiceName = new String( "infobox" ); + aDescriptor.ParentIndex = -1; + aDescriptor.Parent = (XWindowPeer)UnoRuntime.queryInterface( + XWindowPeer.class, m_xFrame.getContainerWindow()); + aDescriptor.Bounds = new Rectangle(0,0,300,200); + aDescriptor.WindowAttributes = WindowAttribute.BORDER | + WindowAttribute.MOVEABLE | + WindowAttribute.CLOSEABLE; + + XWindowPeer xPeer = m_xToolkit.createWindow( aDescriptor ); + if ( null != xPeer ) { + XMessageBox xMsgBox = (XMessageBox)UnoRuntime.queryInterface( + XMessageBox.class, xPeer); + if ( null != xMsgBox ) + { + xMsgBox.setCaptionText( sTitle ); + xMsgBox.setMessageText( sMessage ); + xMsgBox.execute(); } } - } catch ( com.sun.star.uno.Exception e) { - // do your error handling } } } |