diff options
Diffstat (limited to 'desktop/test/deployment/options/handler/com/sun/star/comp/extensionoptions/OptionsEventHandler.java')
-rw-r--r-- | desktop/test/deployment/options/handler/com/sun/star/comp/extensionoptions/OptionsEventHandler.java | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/desktop/test/deployment/options/handler/com/sun/star/comp/extensionoptions/OptionsEventHandler.java b/desktop/test/deployment/options/handler/com/sun/star/comp/extensionoptions/OptionsEventHandler.java index bb38108e5eea..bd8e40826cf3 100644 --- a/desktop/test/deployment/options/handler/com/sun/star/comp/extensionoptions/OptionsEventHandler.java +++ b/desktop/test/deployment/options/handler/com/sun/star/comp/extensionoptions/OptionsEventHandler.java @@ -1,7 +1,7 @@ ************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -66,14 +66,14 @@ public class OptionsEventHandler { static private final String __serviceName = "com.sun.star.comp.extensionoptions.OptionsEventHandler"; - + private XComponentContext m_cmpCtx; private XMultiComponentFactory m_xMCF; private XNameAccess m_xAccessLeaves; - /**Names of supported options pages. + /**Names of supported options pages. */ private String[] m_arWindowNames = { "Writer1", "Writer2", "Writer3", "Calc1", "Calc2", "Calc3", @@ -85,10 +85,10 @@ public class OptionsEventHandler { */ private String[] m_arStringControls = { "String0", "String1", "String2", "String3", "String4"}; - + public _OptionsEventHandler(XComponentContext xCompContext) { m_cmpCtx = xCompContext; - m_xMCF = m_cmpCtx.getServiceManager(); + m_xMCF = m_cmpCtx.getServiceManager(); //Create the com.sun.star.configuration.ConfigurationUpdateAccess //for the registry node which contains the data for our option @@ -124,7 +124,7 @@ public class OptionsEventHandler { return; } } - + /** This method returns an array of all supported service names. * @return Array of supported service names. */ @@ -140,7 +140,7 @@ public class OptionsEventHandler { String[] sSupportedServiceNames = { __serviceName }; return sSupportedServiceNames; } - + /** This method returns true, if the given service will be * supported by the component. * @param sServiceName Service name. @@ -149,7 +149,7 @@ public class OptionsEventHandler { public boolean supportsService( String sServiceName ) { return sServiceName.equals( __serviceName ); } - + /** Return the class name of the component. * @return Class name of the component. */ @@ -170,10 +170,10 @@ public class OptionsEventHandler { throw new WrappedTargetException(sMethod, this, e); } } - + return true; } - + //XContainerWindowEventHandler public String[] getSupportedMethodNames() { return new String[] {"external_event"}; @@ -193,13 +193,13 @@ public class OptionsEventHandler { "Method external_event requires a string in the event object argument.", this, (short) -1); } - + return true; } private void saveData(com.sun.star.awt.XWindow aWindow) throws com.sun.star.lang.IllegalArgumentException, - com.sun.star.uno.Exception { + com.sun.star.uno.Exception { //Determine the name of the options page. This serves two purposes. First, if this //options page is supported by this handler and second we use the name two locate @@ -219,7 +219,7 @@ public class OptionsEventHandler { //This is an implementation which will be used for several options pages //which all have the same controls. m_arStringControls is an array which - //contains the names. + //contains the names. for (int i = 0; i < m_arStringControls.length; i++) { //To obtain the data from the controls we need to get their model. @@ -234,7 +234,7 @@ public class OptionsEventHandler { //From the control we get the model, which in turn supports the //XPropertySet interface, which we finally use to get the data from - //the control. + //the control. XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface( XPropertySet.class, xControl.getModel()); @@ -272,7 +272,7 @@ public class OptionsEventHandler { } //Committing the changes will cause or changes to be written to the registry. - XChangesBatch xUpdateCommit = + XChangesBatch xUpdateCommit = (XChangesBatch) UnoRuntime.queryInterface(XChangesBatch.class, m_xAccessLeaves); xUpdateCommit.commitChanges(); } @@ -332,7 +332,7 @@ public class OptionsEventHandler { //control XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface( XPropertySet.class, xControl.getModel()); - + if (xProp == null) throw new com.sun.star.uno.Exception( "Could not get XPropertySet from control.", this); @@ -386,7 +386,7 @@ public class OptionsEventHandler { throw new com.sun.star.uno.Exception( "Name - property of window is not a string.", this); } - + //Eventually we can check if we this handler can "handle" this options page. //The class has a member m_arWindowNames which contains all names of windows //for which it is intended @@ -398,8 +398,8 @@ public class OptionsEventHandler { return null; } } - - + + /** * Gives a factory for creating the service. * This method is called by the <code>JavaLoader</code> @@ -413,11 +413,11 @@ public class OptionsEventHandler { public static XSingleComponentFactory __getComponentFactory(String sImplName) { XSingleComponentFactory xFactory = null; - + if ( sImplName.equals( _OptionsEventHandler.class.getName() ) ) xFactory = Factory.createComponentFactory(_OptionsEventHandler.class, _OptionsEventHandler.getServiceNames()); - + return xFactory; } @@ -445,5 +445,5 @@ public class OptionsEventHandler { public void initialize( Object[] object ) throws com.sun.star.uno.Exception { } - + } |