diff options
author | Mikhail Voitenko <mav@openoffice.org> | 2008-02-05 16:22:59 +0000 |
---|---|---|
committer | Mikhail Voitenko <mav@openoffice.org> | 2008-02-05 16:22:59 +0000 |
commit | e13029b3e6569a852d7a37df1283f74e04310384 (patch) | |
tree | b7576eae2a08d9b43e35798d408610ddd7cc4fb9 /swext | |
parent | 18f05c538971907325d02eb0946e4faab41418d8 (diff) |
set the focus to cancel before disabling of controls
Diffstat (limited to 'swext')
3 files changed, 34 insertions, 8 deletions
diff --git a/swext/mediawiki/src/com/sun/star/wiki/WikiDialog.java b/swext/mediawiki/src/com/sun/star/wiki/WikiDialog.java index 533314e6f87f..93b49faa66cf 100644 --- a/swext/mediawiki/src/com/sun/star/wiki/WikiDialog.java +++ b/swext/mediawiki/src/com/sun/star/wiki/WikiDialog.java @@ -4,9 +4,9 @@ * * $RCSfile: WikiDialog.java,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: mav $ $Date: 2008-02-05 16:35:54 $ + * last change: $Author: mav $ $Date: 2008-02-05 17:22:59 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -261,6 +261,23 @@ public class WikiDialog implements XDialogEventHandler, XTopWindowListener } } + public void SetFocusTo( String aControl ) + { + if ( m_xControlContainer != null ) + { + try + { + XWindow xWindow = (XWindow)UnoRuntime.queryInterface( XWindow.class, m_xControlContainer.getControl( aControl ) ); + if ( xWindow != null ) + xWindow.setFocus(); + } + catch ( Exception e ) + { + e.printStackTrace(); + } + } + } + public void DisposeDialog() { Helper.Dispose( m_xDialog ); diff --git a/swext/mediawiki/src/com/sun/star/wiki/WikiEditSettingDialog.java b/swext/mediawiki/src/com/sun/star/wiki/WikiEditSettingDialog.java index edb5c633b45b..5e77ec70f349 100644 --- a/swext/mediawiki/src/com/sun/star/wiki/WikiEditSettingDialog.java +++ b/swext/mediawiki/src/com/sun/star/wiki/WikiEditSettingDialog.java @@ -4,9 +4,9 @@ * * $RCSfile: WikiEditSettingDialog.java,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: mav $ $Date: 2008-02-05 16:35:54 $ + * last change: $Author: mav $ $Date: 2008-02-05 17:22:59 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -110,19 +110,26 @@ public class WikiEditSettingDialog extends WikiDialog private void EnableControls( boolean bEnable ) { + if ( !bEnable ) + SetFocusTo( "CancelButton" ); + try { - GetPropSet( "UrlField" ).setPropertyValue( "Enabled", new Boolean( m_bAllowURLChange ) ); GetPropSet( "UsernameField" ).setPropertyValue( "Enabled", new Boolean( bEnable ) ); GetPropSet( "PasswordField" ).setPropertyValue( "Enabled", new Boolean( bEnable ) ); GetPropSet( "OkButton" ).setPropertyValue( "Enabled", new Boolean( bEnable ) ); GetPropSet( "HelpButton" ).setPropertyValue( "Enabled", new Boolean( bEnable ) ); if ( bEnable ) + { + GetPropSet( "UrlField" ).setPropertyValue( "Enabled", new Boolean( m_bAllowURLChange ) ); GetPropSet( "SaveBox" ).setPropertyValue( "Enabled", new Boolean( Helper.PasswordStoringIsAllowed( m_xContext ) ) ); + } else + { + GetPropSet( "UrlField" ).setPropertyValue( "Enabled", Boolean.FALSE ); GetPropSet( "SaveBox" ).setPropertyValue( "Enabled", Boolean.FALSE ); - + } } catch ( Exception ex ) { diff --git a/swext/mediawiki/src/com/sun/star/wiki/WikiPropDialog.java b/swext/mediawiki/src/com/sun/star/wiki/WikiPropDialog.java index 358faef4ac23..05a8b96fec19 100644 --- a/swext/mediawiki/src/com/sun/star/wiki/WikiPropDialog.java +++ b/swext/mediawiki/src/com/sun/star/wiki/WikiPropDialog.java @@ -4,9 +4,9 @@ * * $RCSfile: WikiPropDialog.java,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: mav $ $Date: 2008-02-05 16:35:54 $ + * last change: $Author: mav $ $Date: 2008-02-05 17:22:59 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -229,6 +229,8 @@ public class WikiPropDialog extends WikiDialog{ short nBrowserState = ((Short) aBrowserCheckProps.getPropertyValue("State")).shortValue(); Helper.SetShowInBrowserByDefault( m_xContext, nBrowserState != 0 ); + // allow to disable other buttons + SetFocusTo( "CancelButton" ); XPropertySet[] aToDisable = { aWikiListProps, aArticleTextProps, aCommentTextProps, aMinorCheckProps, aBrowserCheckProps, aHelpButtonProps, aSendButtonProps, aAddButtonProps }; for ( int nInd = 0; nInd < aToDisable.length; nInd++ ) aToDisable[nInd].setPropertyValue( "Enabled", Boolean.FALSE ); |