summaryrefslogtreecommitdiff
path: root/swext/mediawiki/src/com/sun/star/wiki/MainThreadDialogExecutor.java
diff options
context:
space:
mode:
authorMikhail Voitenko <mav@openoffice.org>2007-12-14 08:40:43 +0000
committerMikhail Voitenko <mav@openoffice.org>2007-12-14 08:40:43 +0000
commit82694b730d5105d9ab7012a04b5517baa5610e15 (patch)
tree7842a33a4f33f6ee6a4c5de1b9880e9ddafb3c4f /swext/mediawiki/src/com/sun/star/wiki/MainThreadDialogExecutor.java
parentfa78bd05b7caadd01789fb4e79832400a9b8486f (diff)
User office error box for MediaWiki errors
Diffstat (limited to 'swext/mediawiki/src/com/sun/star/wiki/MainThreadDialogExecutor.java')
-rw-r--r--swext/mediawiki/src/com/sun/star/wiki/MainThreadDialogExecutor.java19
1 files changed, 17 insertions, 2 deletions
diff --git a/swext/mediawiki/src/com/sun/star/wiki/MainThreadDialogExecutor.java b/swext/mediawiki/src/com/sun/star/wiki/MainThreadDialogExecutor.java
index 7898088e5459..5f4dbf8aaf56 100644
--- a/swext/mediawiki/src/com/sun/star/wiki/MainThreadDialogExecutor.java
+++ b/swext/mediawiki/src/com/sun/star/wiki/MainThreadDialogExecutor.java
@@ -4,9 +4,9 @@
*
* $RCSfile: MainThreadDialogExecutor.java,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: mav $ $Date: 2007-11-28 11:13:59 $
+ * last change: $Author: mav $ $Date: 2007-12-14 09:40:43 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -38,6 +38,7 @@ package com.sun.star.wiki;
import com.sun.star.uno.Any;
import com.sun.star.awt.XDialog;
import com.sun.star.awt.XCallback;
+import com.sun.star.awt.XMessageBox;
import com.sun.star.awt.XRequestCallback;
import com.sun.star.lang.XMultiComponentFactory;
import com.sun.star.uno.UnoRuntime;
@@ -47,6 +48,7 @@ public class MainThreadDialogExecutor implements XCallback
{
private WikiDialog m_aWikiDialog;
private XDialog m_xDialog;
+ private XMessageBox m_xMessageBox;
private boolean m_bResult = false;
private boolean m_bCalled = false;
@@ -62,6 +64,12 @@ public class MainThreadDialogExecutor implements XCallback
return GetCallback( xContext, aExecutor );
}
+ static public boolean Execute( XComponentContext xContext, XMessageBox xMessageBox )
+ {
+ MainThreadDialogExecutor aExecutor = new MainThreadDialogExecutor( xMessageBox );
+ return GetCallback( xContext, aExecutor );
+ }
+
static private boolean GetCallback( XComponentContext xContext, MainThreadDialogExecutor aExecutor )
{
try
@@ -118,6 +126,11 @@ public class MainThreadDialogExecutor implements XCallback
m_xDialog = xDialog;
}
+ private MainThreadDialogExecutor( XMessageBox xMessageBox )
+ {
+ m_xMessageBox = xMessageBox;
+ }
+
private boolean GetResult()
{
return m_bResult;
@@ -129,6 +142,8 @@ public class MainThreadDialogExecutor implements XCallback
m_bResult = m_aWikiDialog.show();
else if ( m_xDialog != null )
m_bResult = ( m_xDialog.execute() == 1 );
+ else if ( m_xMessageBox != null )
+ m_bResult = ( m_xMessageBox.execute() == 1 );
m_bCalled = true;
}