Package com.sun.star.util

Examples of com.sun.star.util.XReplaceable


     *
     * @throws com.haulmont.yarg.exception.ReportingException If there is not appropriate band or alias is bad
     */
    protected void replaceAllAliasesInDocument() {
        XTextDocument xTextDocument = as(XTextDocument.class, xComponent);
        XReplaceable xReplaceable = as(XReplaceable.class, xTextDocument);
        XSearchDescriptor searchDescriptor = xReplaceable.createSearchDescriptor();
        searchDescriptor.setSearchString(ALIAS_WITH_BAND_NAME_REGEXP);
        try {
            searchDescriptor.setPropertyValue(SEARCH_REGULAR_EXPRESSION, true);
        } catch (Exception e) {
            throw new OpenOfficeException("An error occurred while setting search properties in Open office", e);
        }

        XIndexAccess indexAccess = xReplaceable.findAll(searchDescriptor);
        for (int i = 0; i < indexAccess.getCount(); i++) {
            try {
                XTextRange textRange = as(XTextRange.class, indexAccess.getByIndex(i));
                String alias = unwrapParameterName(textRange.getString());

View Full Code Here

TOP

Related Classes of com.sun.star.util.XReplaceable

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.