jsc340: i114609: support passive component registration

This commit is contained in:
Juergen Schmidt
2011-02-22 16:13:49 +01:00
parent 134b85e8f8
commit 928af9414d
28 changed files with 421 additions and 326 deletions

View File

@@ -765,7 +765,7 @@ public class ExampleDataPilotSource
com.sun.star.lang.XServiceInfo
{
static private final String aServiceName = "com.sun.star.sheet.DataPilotSource";
static private final String aImplName = "ExampleDataPilotSource";
static private final String aImplName = _ExampleDataPilotSource.class.getName();
private ExampleSettings aSettings = new ExampleSettings();
private ExampleDimensions aDimensions;
@@ -780,27 +780,34 @@ public class ExampleDataPilotSource
{
// If the first argument (Source) is a number between 2 and 10,
// use it as member count, otherwise keep the default value.
if ( aArguments.length >= 1 )
try
{
String aSource = (String) aArguments[0];
if ( aSource != null )
{
try
{
int nValue = Integer.parseInt( aSource );
if ( nValue >= 2 && nValue <= 10 )
aSettings.nMemberCount = nValue;
}
catch ( NumberFormatException e )
{
System.out.println( "Error: caught exception in " +
"ExampleDataPilotSource.initialize!\nException Message = "
+ e.getMessage());
e.printStackTrace();
}
}
if ( aArguments.length >= 1 )
{
String aSource = com.sun.star.uno.AnyConverter.toString(aArguments[0]);
if ( aSource != null && aSource.length() > 0)
{
int nValue = Integer.parseInt( aSource );
if ( nValue >= 2 && nValue <= 10 )
aSettings.nMemberCount = nValue;
}
}
}
catch ( NumberFormatException e )
{
System.out.println( "Error: caught exception in " +
"ExampleDataPilotSource.initialize!\nException Message = "
+ e.getMessage());
e.printStackTrace();
}
catch ( com.sun.star.lang.IllegalArgumentException e )
{
System.out.println( "Error: caught exception in " +
"ExampleDataPilotSource.initialize!\nException Message = "
+ e.getMessage());
e.printStackTrace();
}
}
// XDataPilotResults
@@ -970,12 +977,16 @@ public class ExampleDataPilotSource
return xSingleServiceFactory;
}
public static boolean __writeRegistryServiceInfo(
com.sun.star.registry.XRegistryKey regKey)
{
return com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo(
_ExampleDataPilotSource.aImplName,
_ExampleDataPilotSource.aServiceName, regKey);
}
// This method not longer necessary since OOo 3.4 where the component registration
// was changed to passive component registration. For more details see
// http://wiki.services.openoffice.org/wiki/Passive_Component_Registration
// public static boolean __writeRegistryServiceInfo(
// com.sun.star.registry.XRegistryKey regKey)
// {
// return com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo(
// _ExampleDataPilotSource.aImplName,
// _ExampleDataPilotSource.aServiceName, regKey);
// }
}