Package net.sourceforge.rtf.document

Examples of net.sourceforge.rtf.document.RTFUserProperty


        page.addRTFString(content);
        currentRTFElement.addRTFElement(page);
    }

    protected void startUserProperty(String content) throws IOException {
        RTFUserProperty userProperty = new RTFUserProperty();
        if (startGroup != null) {
            userProperty.addRTFString(startGroup);
            startGroup = null;
        }
        userProperty.addRTFString(content);
        getCurrentRTFElement().addRTFElement(userProperty);
        currentRTFElement = userProperty;
    }
View Full Code Here


        getCurrentRTFElement().addRTFElement(userProperty);
        currentRTFElement = userProperty;
    }

    protected void endUserProperty(String content) throws IOException {
        RTFUserProperty userProperty = (RTFUserProperty) currentRTFElement;
        if (startGroup != null) {
            userProperty.addRTFString(startGroup);
            startGroup = null;
        }
        userProperty.addRTFString(content);
        userProperty.getName();
        lastRTFElement = userProperty;
        currentRTFElement = currentRTFElement.getRtfElementParent();
    }
View Full Code Here

            case RTF_ELEMENT_PAGE:
                lastPage = (RTFPage) element;
                break;
            case RTF_ELEMENT_USERPROPERTY:
                RTFUserProperty userProperty = (RTFUserProperty) element;
                String userPropertyName = userProperty.getName();
                if (userPropertyName != null
                        && userPropertyName.startsWith("$")) {
                    RTFContextField rtfUserProperty = (RTFContextField) contextFieldsMap
                            .get(userPropertyName);
                    boolean userPropertyIsList = isList(rtfUserProperty);
                    if (userPropertyIsList) {
                        String userPropertyNameWithListInfo = rtfUserProperty
                                .getListInfo();
                        // User property is list
                        // Add item_ after $
                        // Manage \propname
                        String userPropertyContent = userProperty
                                .getRTFContentOfSimpleElement();
                        if (userPropertyName.startsWith("$"))
                            userPropertyName = userPropertyName.substring(1);
                        String newUserpropertyName = getObjectValueList(
                                userPropertyName, userPropertyNameWithListInfo,
                                true);
                        if (newUserpropertyName.startsWith("$"))
                            newUserpropertyName = newUserpropertyName
                                    .substring(1);

                        userPropertyContent = userPropertyContent.replaceAll(
                                userPropertyName, newUserpropertyName);
                        // Add # foreach and send with #end
                        userPropertyContent = getForeach(userPropertyName,
                                userPropertyNameWithListInfo)
                                + userPropertyContent + getMacroEndForEach();// "#end";

                        // Manage \staticval
                        String userPropertyValue = userProperty.getValue();
                        if (userPropertyValue.startsWith("$"))
                            userPropertyValue = userPropertyValue.substring(1);
                        String newUserPropertyValue = getObjectValueList(
                                userPropertyValue,
                                userPropertyNameWithListInfo, true);
                        if (newUserPropertyValue.startsWith("$"))
                            newUserPropertyValue = newUserPropertyValue
                                    .substring(1);
                        userPropertyContent = userPropertyContent.replaceAll(
                                userPropertyValue, newUserPropertyValue);
                        userProperty.replaceElement(userPropertyContent);
                    }
                }
                String userPropertyContent = userProperty
                        .getRTFContentOfSimpleElement();
                userProperty.replaceElement(userPropertyContent);

                break;

            /*
             * case RTF_ELEMENT_ANNOTATION: // TODO : manage start/end loop and
View Full Code Here

TOP

Related Classes of net.sourceforge.rtf.document.RTFUserProperty

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.