Package com.sun.star.lang

Examples of com.sun.star.lang.XServiceInfo.supportsService()


            return "";
        } else if (sInfo.supportsService("com.sun.star.sheet.SpreadsheetDocument")) {
        return "scalc";
        } else if (sInfo.supportsService("com.sun.star.text.TextDocument")) {
        return "swriter";
        } else if (sInfo.supportsService("com.sun.star.drawing.DrawingDocument")) {
        return "sdraw";
        } else if (sInfo.supportsService("com.sun.star.formula.FormulaProperties")) {
        return "smath";
        } else {
            return null;
View Full Code Here


        return "scalc";
        } else if (sInfo.supportsService("com.sun.star.text.TextDocument")) {
        return "swriter";
        } else if (sInfo.supportsService("com.sun.star.drawing.DrawingDocument")) {
        return "sdraw";
        } else if (sInfo.supportsService("com.sun.star.formula.FormulaProperties")) {
        return "smath";
        } else {
            return null;
        }
    }
View Full Code Here

                            // doesn't support the
                            // com.sun.star.text.TextTable service, then it is safe to assume that it
                            // really is a paragraph
                            XServiceInfo xInfo = (XServiceInfo) UnoRuntime.queryInterface(
                                    XServiceInfo.class, xParaEnum.nextElement() );
                            if ( !xInfo.supportsService ( "com.sun.star.text.TextTable" ) )
                            {
                                    // Access the paragraph's property set...the properties in this
                                    // property set are listed
                                    // in: com.sun.star.style.ParagraphProperties
                                    XPropertySet xSet = (XPropertySet) UnoRuntime.queryInterface(
View Full Code Here

        // we need to distinguish text and sheet tables:
        // property name for cell colors is different in text and sheet cells
        // we want to apply TableBorder to whole text table, but only to sheet cells with content
        XServiceInfo xServiceInfo = (XServiceInfo)UnoRuntime.queryInterface(
            XServiceInfo.class, xCellRange);
        if (xServiceInfo.supportsService("com.sun.star.sheet.Spreadsheet")) {
            backColorPropertyName = "CellBackColor";
            xSelectedCells = xCellRange.getCellRangeByName("A1:B2");
            xTableProps = (XPropertySet)UnoRuntime.queryInterface(
                XPropertySet.class, xSelectedCells);
        }
View Full Code Here

            backColorPropertyName = "CellBackColor";
            xSelectedCells = xCellRange.getCellRangeByName("A1:B2");
            xTableProps = (XPropertySet)UnoRuntime.queryInterface(
                XPropertySet.class, xSelectedCells);
        }
        else if (xServiceInfo.supportsService("com.sun.star.text.TextTable")) {
            backColorPropertyName = "BackColor";
            xTableProps = (XPropertySet)UnoRuntime.queryInterface(
                XPropertySet.class, xCellRange);
        }
        // set cell background color
View Full Code Here

                    XTextContent.class, xParagraphEnumeration.nextElement());
                XServiceInfo xServiceInfo = (XServiceInfo) UnoRuntime.queryInterface(
                    XServiceInfo.class, xTextElement );
               
                // check ifs the current paragraph really a paragraph or an anchor of a frame or picture
                if( xServiceInfo.supportsService("com.sun.star.text.Paragraph") ) {
                    XTextRange xTextRange = xTextElement.getAnchor();
                    System.out.println( "This is a Paragraph" );
                   
                    // create another enumeration to get all text portions of the paragraph
                    xParaEnumerationAccess = (XEnumerationAccess) UnoRuntime.queryInterface(
View Full Code Here

           
            XServiceInfo xserviceinfo = ( XServiceInfo )
            UnoRuntime.queryInterface( XServiceInfo.class,
            objectSelection );
           
            if ( xserviceinfo.supportsService( "com.sun.star.text.TextRanges" )
            ) {
                XIndexAccess xindexaccess = ( XIndexAccess )
                UnoRuntime.queryInterface(
                XIndexAccess.class, objectSelection );
               
View Full Code Here

                    System.out.println( "You have selected a text range: \""
                    + xtextrange.getString() + "\"." );
                }
            }
           
            if ( xserviceinfo.supportsService(
            "com.sun.star.text.TextGraphicObject" )
            ) {
                System.out.println( "You have selected a graphics." );
            }
           
View Full Code Here

            "com.sun.star.text.TextGraphicObject" )
            ) {
                System.out.println( "You have selected a graphics." );
            }
           
            if ( xserviceinfo.supportsService(
            "com.sun.star.text.TextTableCursor" )
            ) {
                System.out.println( "You have selected a text table." );
            }
           
View Full Code Here

            // check the provider implementation
            XServiceInfo xProviderServices =
                (XServiceInfo) UnoRuntime.queryInterface( XServiceInfo.class, xProvider );

            if (xProviderServices == null ||
                !xProviderServices.supportsService("com.sun.star.configuration.ConfigurationProvider"))
            {
                System.out.println("WARNING: The provider is not a com.sun.star.configuration.ConfigurationProvider");
            }

            if (xProviderServices != null)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.