Get XWindowPeer implementation from the dialog

This commit is contained in:
Mikhail Voitenko 2007-12-14 12:03:54 +00:00
parent eaa5b305ea
commit ec1024217d
3 changed files with 21 additions and 12 deletions

View file

@ -4,9 +4,9 @@
* *
* $RCSfile: Helper.java,v $ * $RCSfile: Helper.java,v $
* *
* $Revision: 1.4 $ * $Revision: 1.5 $
* *
* last change: $Author: mav $ $Date: 2007-12-14 09:40:43 $ * last change: $Author: mav $ $Date: 2007-12-14 13:03:53 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
@ -728,6 +728,15 @@ public class Helper
return bResult; return bResult;
} }
protected static void ShowError( XComponentContext xContext, XDialog xDialog, String sError )
{
XWindowPeer xPeer = null;
XControl xControl = (XControl)UnoRuntime.queryInterface( XControl.class, xDialog );
if ( xControl != null )
xPeer = xControl.getPeer();
ShowError( xContext, xPeer, sError );
}
protected static void ShowError( XComponentContext xContext, XWindowPeer xParentPeer, String sError ) protected static void ShowError( XComponentContext xContext, XWindowPeer xParentPeer, String sError )
{ {
if ( xContext != null && sError != null ) if ( xContext != null && sError != null )

View file

@ -4,9 +4,9 @@
* *
* $RCSfile: WikiEditSettingDialog.java,v $ * $RCSfile: WikiEditSettingDialog.java,v $
* *
* $Revision: 1.5 $ * $Revision: 1.6 $
* *
* last change: $Author: mav $ $Date: 2007-12-14 09:40:43 $ * last change: $Author: mav $ $Date: 2007-12-14 13:03:54 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
@ -163,7 +163,7 @@ public class WikiEditSettingDialog extends WikiDialog
{ {
// show error // show error
Helper.ShowError( m_xContext, Helper.ShowError( m_xContext,
(XWindowPeer)UnoRuntime.queryInterface( XWindowPeer.class, m_xDialog ), m_xDialog,
m_sNoConnectionToURL1 + sURL + m_sNoConnectionToURL2 ); m_sNoConnectionToURL1 + sURL + m_sNoConnectionToURL2 );
} }
} }
@ -175,7 +175,7 @@ public class WikiEditSettingDialog extends WikiDialog
// a wrong login information is provided // a wrong login information is provided
// show error // show error
Helper.ShowError( m_xContext, Helper.ShowError( m_xContext,
(XWindowPeer)UnoRuntime.queryInterface( XWindowPeer.class, m_xDialog ), m_xDialog,
m_sWrongLogin ); m_sWrongLogin );
} }
else else
@ -210,7 +210,7 @@ public class WikiEditSettingDialog extends WikiDialog
// URL invalid // URL invalid
// show error // show error
Helper.ShowError( m_xContext, Helper.ShowError( m_xContext,
(XWindowPeer)UnoRuntime.queryInterface( XWindowPeer.class, m_xDialog ), m_xDialog,
m_sInvalidURL ); m_sInvalidURL );
} }
} }
@ -219,7 +219,7 @@ public class WikiEditSettingDialog extends WikiDialog
// URL field empty // URL field empty
// show error // show error
Helper.ShowError( m_xContext, Helper.ShowError( m_xContext,
(XWindowPeer)UnoRuntime.queryInterface( XWindowPeer.class, m_xDialog ), m_xDialog,
m_sNoURL ); m_sNoURL );
} }
} while ( sRedirectURL.length() > 0 ); } while ( sRedirectURL.length() > 0 );
@ -227,7 +227,7 @@ public class WikiEditSettingDialog extends WikiDialog
catch ( Exception ex ) catch ( Exception ex )
{ {
Helper.ShowError( m_xContext, Helper.ShowError( m_xContext,
(XWindowPeer)UnoRuntime.queryInterface( XWindowPeer.class, m_xDialog ), m_xDialog,
m_sNoConnectionToURL1 + sURL + m_sNoConnectionToURL2 ); m_sNoConnectionToURL1 + sURL + m_sNoConnectionToURL2 );
ex.printStackTrace(); ex.printStackTrace();
} }

View file

@ -4,9 +4,9 @@
* *
* $RCSfile: WikiPropDialog.java,v $ * $RCSfile: WikiPropDialog.java,v $
* *
* $Revision: 1.3 $ * $Revision: 1.4 $
* *
* last change: $Author: mav $ $Date: 2007-12-14 09:40:43 $ * last change: $Author: mav $ $Date: 2007-12-14 13:03:54 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
@ -308,7 +308,7 @@ public class WikiPropDialog extends WikiDialog{
else else
{ {
Helper.ShowError( m_xContext, Helper.ShowError( m_xContext,
(XWindowPeer)UnoRuntime.queryInterface( XWindowPeer.class, m_xDialog ), m_xDialog,
m_sCancelSending ); m_sCancelSending );
} }