Kaydet (Commit) 360f16b4 authored tarafından Rüdiger Timm's avatar Rüdiger Timm

INTEGRATION: CWS sdksample (1.3.124); FILE MERGED

2004/06/30 09:10:26 jsc 1.3.124.1: #i29308# use of new UNO features
üst fd489e99
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: TestComponentA.java,v $ * $RCSfile: TestComponentA.java,v $
* *
* $Revision: 1.3 $ * $Revision: 1.4 $
* *
* last change: $Author: hr $ $Date: 2003-06-30 15:14:13 $ * last change: $Author: rt $ $Date: 2005-01-31 16:15:10 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* the BSD license. * the BSD license.
...@@ -37,9 +37,6 @@ ...@@ -37,9 +37,6 @@
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
*************************************************************************/ *************************************************************************/
package JavaComp;
import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.lib.uno.helper.WeakBase; import com.sun.star.lib.uno.helper.WeakBase;
import com.sun.star.lang.XServiceInfo; import com.sun.star.lang.XServiceInfo;
...@@ -48,7 +45,7 @@ import com.sun.star.uno.Type; ...@@ -48,7 +45,7 @@ import com.sun.star.uno.Type;
// TestComponentA use the implementation helper WeakBase // TestComponentA use the implementation helper WeakBase
public class TestComponentA extends WeakBase implements XServiceInfo, XSomethingA { public class TestComponentA extends WeakBase implements XServiceInfo, XSomethingA {
static final String __serviceName= "JavaTestComponentA"; static final String __serviceName= "com.sun.star.test.SomethingA";
static byte[] _implementationId; static byte[] _implementationId;
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: TestComponentB.java,v $ * $RCSfile: TestComponentB.java,v $
* *
* $Revision: 1.3 $ * $Revision: 1.4 $
* *
* last change: $Author: hr $ $Date: 2003-06-30 15:14:25 $ * last change: $Author: rt $ $Date: 2005-01-31 16:15:25 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* the BSD license. * the BSD license.
...@@ -37,9 +37,6 @@ ...@@ -37,9 +37,6 @@
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
*************************************************************************/ *************************************************************************/
package JavaComp;
import com.sun.star.uno.XComponentContext; import com.sun.star.uno.XComponentContext;
import com.sun.star.lang.XTypeProvider; import com.sun.star.lang.XTypeProvider;
import com.sun.star.lang.XServiceInfo; import com.sun.star.lang.XServiceInfo;
...@@ -50,7 +47,7 @@ import com.sun.star.uno.Type; ...@@ -50,7 +47,7 @@ import com.sun.star.uno.Type;
// for demonstration. More convenient is to use the impelmentation WeakBase or // for demonstration. More convenient is to use the impelmentation WeakBase or
// ComponentBase, see implementation of TestComponentA. // ComponentBase, see implementation of TestComponentA.
public class TestComponentB implements XTypeProvider, XServiceInfo, XSomethingB { public class TestComponentB implements XTypeProvider, XServiceInfo, XSomethingB {
static final String __serviceName= "JavaTestComponentB"; static final String __serviceName= "com.sun.star.test.SomethingB";
static byte[] _implementationId; static byte[] _implementationId;
private XComponentContext context; private XComponentContext context;
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: TestServiceProvider.java,v $ * $RCSfile: TestServiceProvider.java,v $
* *
* $Revision: 1.3 $ * $Revision: 1.4 $
* *
* last change: $Author: hr $ $Date: 2003-06-30 15:14:37 $ * last change: $Author: rt $ $Date: 2005-01-31 16:15:49 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* the BSD license. * the BSD license.
...@@ -37,9 +37,6 @@ ...@@ -37,9 +37,6 @@
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
*************************************************************************/ *************************************************************************/
package JavaComp;
import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.lang.XSingleServiceFactory; import com.sun.star.lang.XSingleServiceFactory;
import com.sun.star.registry.XRegistryKey; import com.sun.star.registry.XRegistryKey;
...@@ -47,30 +44,34 @@ import com.sun.star.lang.XTypeProvider; ...@@ -47,30 +44,34 @@ import com.sun.star.lang.XTypeProvider;
import com.sun.star.lang.XServiceInfo; import com.sun.star.lang.XServiceInfo;
import com.sun.star.comp.loader.FactoryHelper; import com.sun.star.comp.loader.FactoryHelper;
public class TestServiceProvider public class TestServiceProvider
{ {
public static XSingleServiceFactory __getServiceFactory(String implName, public static XSingleServiceFactory __getServiceFactory(
XMultiServiceFactory multiFactory, String implName,
XRegistryKey regKey) { XMultiServiceFactory multiFactory,
XSingleServiceFactory xSingleServiceFactory = null; XRegistryKey regKey) {
XSingleServiceFactory xSingleServiceFactory = null;
if (implName.equals( TestComponentA.class.getName()) ) if (implName.equals( TestComponentA.class.getName()) )
xSingleServiceFactory = FactoryHelper.getServiceFactory( TestComponentA.class, xSingleServiceFactory = FactoryHelper.getServiceFactory(
TestComponentA.__serviceName, multiFactory, regKey); TestComponentA.class, TestComponentA.__serviceName,
else if (implName.equals(TestComponentB.class.getName())) multiFactory, regKey);
xSingleServiceFactory= FactoryHelper.getServiceFactory( TestComponentB.class, else if (implName.equals(TestComponentB.class.getName()))
TestComponentB.__serviceName, multiFactory, regKey); xSingleServiceFactory= FactoryHelper.getServiceFactory(
return xSingleServiceFactory; TestComponentB.class, TestComponentB.__serviceName,
} multiFactory, regKey);
return xSingleServiceFactory;
}
public static boolean __writeRegistryServiceInfo(XRegistryKey regKey){ public static boolean __writeRegistryServiceInfo(XRegistryKey regKey){
boolean bregA= FactoryHelper.writeRegistryServiceInfo( TestComponentA.class.getName(), boolean bregA= FactoryHelper.writeRegistryServiceInfo(
TestComponentA.__serviceName, regKey); TestComponentA.class.getName(),
boolean bregB= FactoryHelper.writeRegistryServiceInfo( TestComponentB.class.getName(), TestComponentA.__serviceName, regKey);
TestComponentB.__serviceName, regKey); boolean bregB= FactoryHelper.writeRegistryServiceInfo(
return bregA && bregB; TestComponentB.class.getName(),
} TestComponentB.__serviceName, regKey);
return bregA && bregB;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment