sdk - LibreOffice OpenOffice Container Window caption text java, C++ -
i working libreoffice sdk. testing open writer , inserting text in it. have not found way accessing window title bar caption using sdk.
public class documentloader { public static void main(string args[]) { if ( args.length < 1 ) { system.out.println( "usage: java -jar documentloader.jar \"<url|path>\"" ); system.out.println( "\ne.g.:" ); system.out.println( "java -jar documentloader.jar \"private:factory/swriter\"" ); system.exit(1); } com.sun.star.uno.xcomponentcontext xcontext = null; try { // remote office component context xcontext = com.sun.star.comp.helper.bootstrap.bootstrap(); system.out.println("connected running office ..."); // remote office service manager com.sun.star.lang.xmulticomponentfactory xmcf = xcontext.getservicemanager(); object odesktop = xmcf.createinstancewithcontext( "com.sun.star.frame.desktop", xcontext); com.sun.star.frame.xcomponentloader xcomploader = unoruntime.queryinterface( com.sun.star.frame.xcomponentloader.class, odesktop); string surl = args[0]; if ( surl.indexof("private:") != 0) { java.io.file sourcefile = new java.io.file(args[0]); stringbuffer sbtmp = new stringbuffer("file:///"); sbtmp.append(sourcefile.getcanonicalpath().replace('\\', '/')); surl = sbtmp.tostring(); } // load writer document, automatically displayed com.sun.star.lang.xcomponent xcomp = xcomploader.loadcomponentfromurl( surl, "_blank", 0, new com.sun.star.beans.propertyvalue[0]); com.sun.star.lang.xcomponent xtextdocument = unoruntime.queryinterface( com.sun.star.frame.xtextdocument.class, xcomp); if ( xcomp != null ) system.exit(0); else system.exit(1); } catch( exception e ) { e.printstacktrace(system.err); system.exit(1); } } }
as have xtextdocument , can size , different attribute. e.g. xtextdocument.getcurrentcontroller().getframe().getcontainerwindow().getpossize();
but way title bar text?
after long experimenting, have found solution.
i have fixed using xtitle. interface used type cast frame of window xtitle. works fine.
Comments
Post a Comment