Package com.sun.star.document

Examples of com.sun.star.document.XDocumentInfoSupplier


        xWindowPeer = (XWindowPeer) UnoRuntime.queryInterface(XWindowPeer.class, xFrame.getComponentWindow());
        xMSFDoc = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDocument);
        xNumberFormatsSupplier = (XNumberFormatsSupplier) UnoRuntime.queryInterface(XNumberFormatsSupplier.class, xTextDocument);

        XDocumentInfoSupplier xDocInfoSuppl = (XDocumentInfoSupplier) UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xTextDocument);
        xDocInfo = xDocInfoSuppl.getDocumentInfo();
        CharLocale = (Locale) Helper.getUnoStructValue((Object) xComponent, "CharLocale");
    }
View Full Code Here


            currentDate.Year = (short)year;
            DateUtils du = new DateUtils(xMSF, this.xTextDocument);
            int ff = du.getFormat( NumberFormatIndex.DATE_SYS_DDMMYY );
            String myDate = du.format(ff, currentDate);

            XDocumentInfoSupplier xDocInfoSuppl = (XDocumentInfoSupplier) UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xTextDocument);
            XDocumentInfo xDocInfo = xDocInfoSuppl.getDocumentInfo();
            Helper.setUnoPropertyValue(xDocInfo, "Author", fullname);
            Helper.setUnoPropertyValue(xDocInfo, "ModifiedBy", fullname);
            String description = (String)Helper.getUnoPropertyValue(xDocInfo, "Description");
            description = description + " " + TemplateDescription;
            description = JavaTools.replaceSubString(description, WizardName, "<wizard_name>");
View Full Code Here

        TextFieldHandler myFieldHandler = new TextFieldHandler(myLetterDoc.xMSF, xTextDocument);
        myFieldHandler.changeUserFieldContent("State", txtSenderState.getText());
    }
   
    public void txtTemplateNameTextChanged() {
        XDocumentInfoSupplier xDocInfoSuppl = (XDocumentInfoSupplier) UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xTextDocument);
        XDocumentInfo xDocInfo = xDocInfoSuppl.getDocumentInfo();
        String TitleName = txtTemplateName.getText();
        Helper.setUnoPropertyValue(xDocInfo, "Title", TitleName);
    }
View Full Code Here

                {"end", "office:meta"},
            {"end", "office:document-meta"}} ;

        tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;

        XDocumentInfoSupplier infoSup = (XDocumentInfoSupplier)
            UnoRuntime.queryInterface
            (XDocumentInfoSupplier.class, xImpressDoc) ;
        final XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface
            (XPropertySet.class, infoSup.getDocumentInfo()) ;
        final PrintWriter logF = log ;

        tEnv.addObjRelation("XDocumentHandler.ImportChecker",
            new ifc.xml.sax._XDocumentHandler.ImportChecker() {
                public boolean checkImport() {
View Full Code Here

    }
   
    protected static String GetDocTitle( XModel xDoc )
    {
        String sTitle = "";
        XDocumentInfoSupplier xDocInfoSup = ( XDocumentInfoSupplier ) UnoRuntime.queryInterface( XDocumentInfoSupplier.class, xDoc );
        XPropertySet xPropSet = ( XPropertySet ) UnoRuntime.queryInterface( XPropertySet.class, xDocInfoSup.getDocumentInfo() );
        try
        {
            sTitle = ( String ) xPropSet.getPropertyValue( "Title" );
        } catch ( Exception ex )
        {
View Full Code Here

        return sTitle;
    }
   
    protected static void SetDocTitle( XModel xDoc, String sTitle )
    {
        XDocumentInfoSupplier xDocInfoSup = ( XDocumentInfoSupplier ) UnoRuntime.queryInterface( XDocumentInfoSupplier.class, xDoc );
        if ( xDocInfoSup != null )
        {
            XPropertySet xPropSet = ( XPropertySet ) UnoRuntime.queryInterface( XPropertySet.class, xDocInfoSup.getDocumentInfo() );
            if ( xPropSet != null )
            {
                try
                {
                    xPropSet.setPropertyValue( "Title", sTitle );
View Full Code Here

            XExporter xEx = (XExporter) UnoRuntime.queryInterface
                (XExporter.class,oObj);
            xEx.setSourceDocument(xMathDoc);

            // setting a new name and value for user info field
            XDocumentInfoSupplier xDocInfoSup = (XDocumentInfoSupplier)
                UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xMathDoc) ;
            XDocumentInfo xDocInfo = xDocInfoSup.getDocumentInfo() ;
            xDocInfo.setUserFieldName((short) 0, expName) ;
            xDocInfo.setUserFieldValue((short) 0, expValue) ;
        } catch (com.sun.star.uno.Exception e) {
            e.printStackTrace(log) ;
            throw new StatusException("Can't create component.", e) ;
View Full Code Here

            XExporter xEx = (XExporter)
                UnoRuntime.queryInterface(XExporter.class,oObj);
            xEx.setSourceDocument(xImpressDoc);

        //change title name
            XDocumentInfoSupplier infoSup = (XDocumentInfoSupplier)
                UnoRuntime.queryInterface
                (XDocumentInfoSupplier.class, xImpressDoc) ;
            XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface
                (XPropertySet.class, infoSup.getDocumentInfo()) ;
            docInfo.setPropertyValue("Title", NAME);

        } catch (com.sun.star.uno.Exception e) {
            e.printStackTrace(log) ;
            throw new StatusException("Can't create component.", e) ;
View Full Code Here

            {"end", "office:document-meta"}} ;

        tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;

        //set some meta data
        XDocumentInfoSupplier infoSup = (XDocumentInfoSupplier)
            UnoRuntime.queryInterface
            (XDocumentInfoSupplier.class, xDrawDoc);
        final XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface
                        (XPropertySet.class, infoSup.getDocumentInfo());
        final PrintWriter logF = log ;

        tEnv.addObjRelation("XDocumentHandler.ImportChecker",
            new ifc.xml.sax._XDocumentHandler.ImportChecker() {
                public boolean checkImport() {
View Full Code Here

        XInterface oObj = null;
        final String impName = "XMLMetaImporter" ;
        final String impValue = "XMLMetaImporter_Value" ;
        final String impTitle = "XMLMetaImporter Title" ;

        final XDocumentInfoSupplier xDocInfoSup ;
        try {
            oObj = (XInterface)xMSF.createInstance(
                    "com.sun.star.comp.Math.XMLMetaImporter");

            xDocInfoSup = (XDocumentInfoSupplier) UnoRuntime.queryInterface
                (XDocumentInfoSupplier.class, xMathDoc) ;
        } catch (com.sun.star.uno.Exception e) {
            e.printStackTrace(log);
            throw new StatusException("Unexpected exception", e);
        }

        TestEnvironment tEnv = new TestEnvironment(oObj);

        tEnv.addObjRelation("TargetDocument",xMathDoc);

        String[][] xml = new String[][] {
            {"start", "office:document-meta",
                "xmlns:office", "CDATA", "http://openoffice.org/2000/office",
                "xmlns:meta", "CDATA", "http://openoffice.org/2000/meta",
                "xmlns:xlink", "CDATA", "http://www.w3.org/1999/xlink",
                "xmlns:dc", "CDATA", "http://purl.org/dc/elements/1.1/"
            },
            {"start", "office:meta"},
            {"start", "dc:title"},
            {"chars", impTitle},
            {"end", "dc:title"},
            {"start", "meta:user-defined",
                "meta:name", "CDATA", impName},
            {"chars", impValue},
            {"end", "meta:user-defined"},
            {"end", "office:meta"},
            {"end", "office:document-meta"}} ;

        tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;

        final PrintWriter logF = log ;

        tEnv.addObjRelation("XDocumentHandler.ImportChecker",
            new ifc.xml.sax._XDocumentHandler.ImportChecker() {
                public boolean checkImport() {
                    try {
                        XDocumentInfo xDocInfo = xDocInfoSup.getDocumentInfo() ;
                        XPropertySet xDocInfoProp = (XPropertySet)
                            UnoRuntime.queryInterface
                            (XPropertySet.class, xDocInfo) ;
                        boolean result = false ;
                        for (short i = 0; i < xDocInfo.getUserFieldCount(); i++) {
View Full Code Here

TOP

Related Classes of com.sun.star.document.XDocumentInfoSupplier

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.