Is there any online example on how to create an openoffice toolbar in Java? I found examples in C ++ but not in Java: http://wiki.services.openoffice.org/wiki/Framework/Article/Generic_UNO_Interfaces_for_complex_toolbar_controls
I need an article or tutorial on how to create and add an OO addon that uses a sophisticated toolbar in java
I found this article http://java.dzone.com/news/lets-extend-openofficeorg-java#comment-53245 that implements java PopupMenuController. I tried to execute the same process, but instead of XPoolbarController instead of PopupMenuController. however, I could not get my controller to work. below is my .xcu controller and controller class. can you tell me what i am doing wrong? thanks.
my Controller.xcu:
<?xml version="1.0" encoding="UTF-8"?> <oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="Controller" oor:package="org.openoffice.Office.UI"> <node oor:name="Registered"> <node oor:name="ToolBar"> <node oor:name="c10" oor:op="replace"> <prop oor:name="Command"> <value>.uno:CommandLineToolbar</value> </prop> <prop oor:name="Module"> <value></value> </prop> <prop oor:name="Controller"> <value>com.example.toolbar.Toolbar</value> </prop> </node> </node> </node> </oor:component-data>
my toolbar controller class is:
public final class Toolbar extends ComponentBase implements com.sun.star.util.XUpdatable, com.sun.star.frame.XToolbarController, com.sun.star.frame.XStatusListener, com.sun.star.lang.XServiceInfo, com.sun.star.lang.XInitialization, com.sun.star.frame.XSubToolbarController { private final XComponentContext m_xContext; private static final String m_implementationName = Toolbar.class.getName(); private static final String[] m_serviceNames = { "com.sun.star.frame.ToolbarController" }; private String msInternalName = "i do not now"; private XComponent mxDocument; private XTextComponent fixedText; private XComboBox cBox_xComboBox; private XMultiComponentFactory mxMCF; public XMultiServiceFactory mxMSF; public Toolbar( XComponentContext context ) { m_xContext = context; }; public static XSingleComponentFactory __getComponentFactory( String sImplementationName ) { XSingleComponentFactory xFactory = null; if ( sImplementationName.equals( m_implementationName ) ) xFactory = Factory.createComponentFactory(Toolbar.class, m_serviceNames); return xFactory; } public static boolean __writeRegistryServiceInfo( XRegistryKey xRegistryKey ) { return Factory.writeRegistryServiceInfo(m_implementationName, m_serviceNames, xRegistryKey); }
source share