I have added the "com.sun.star.frame.ProtocolHandler" and implemented the interfaces
com.sun.star.lang.XInitialization,
com.sun.star.frame.XDispatchProvider, XDispatch
But only the original service seems to work the "org.libreoffice.example.StarterProject". I don't get any error messages, it is just that none of the newly added methods are ever called.

Is it not possible to implement two services in the same class?
The beginning of the code:
Code: Select all
package org.libreoffice.example.comp;
import com.sun.star.uno.XComponentContext;
import com.sun.star.lib.uno.helper.Factory;
import org.libreoffice.example.dialog.ActionOneDialog;
import org.libreoffice.example.helper.DialogHelper;
import com.sun.star.frame.XFrame;
import com.sun.star.frame.XController;
import com.sun.star.frame.XDispatch;
import com.sun.star.frame.XModel;
import com.sun.star.lang.XMultiComponentFactory;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.lang.XSingleComponentFactory;
import com.sun.star.registry.XRegistryKey;
import com.sun.star.lib.uno.helper.WeakBase;
import com.sun.star.beans.NamedValue;
import com.sun.star.beans.PropertyValue;
import com.sun.star.frame.XController;
import com.sun.star.ui.XContextMenuInterceptor;
import com.sun.star.ui.XContextMenuInterception;
import com.sun.star.uno.AnyConverter;
import com.sun.star.uno.Type;
import com.sun.star.uno.UnoRuntime;
public final class StarterProjectImpl extends WeakBase
implements com.sun.star.lang.XServiceInfo,
com.sun.star.task.XJobExecutor,
com.sun.star.lang.XInitialization,
com.sun.star.frame.XDispatchProvider, XDispatch
{
private final XComponentContext m_xContext;
private XFrame m_xFrame;
private static final String m_implementationName = StarterProjectImpl.class.getName();
private static final String[] m_serviceNames = {
"org.libreoffice.example.StarterProject","com.sun.star.frame.ProtocolHandler" };
public StarterProjectImpl( XComponentContext context )
{
m_xContext = context;
};
public static XSingleComponentFactory __getComponentFactory( String sImplementationName ) {
XSingleComponentFactory xFactory = null;
if ( sImplementationName.equals( m_implementationName ) )
xFactory = Factory.createComponentFactory(StarterProjectImpl.class, m_serviceNames);
return xFactory;
}
public static boolean __writeRegistryServiceInfo( XRegistryKey xRegistryKey ) {
return Factory.writeRegistryServiceInfo(m_implementationName,
m_serviceNames,
xRegistryKey);
}
// com.sun.star.lang.XServiceInfo:
public String getImplementationName() {
return m_implementationName;
}
public boolean supportsService( String sService ) {
int len = m_serviceNames.length;
for( int i=0; i < len; i++) {
if (sService.equals(m_serviceNames[i]))
return true;
}
return false;
}
public String[] getSupportedServiceNames() {
return m_serviceNames;
}