Examples of XDependentTextField


Examples of com.sun.star.text.XDependentTextField

                if (xDependentTextField==null){
                    /* Create text field */
                    name = oooDocument.newResultName(); /* Need to create unique ID number */
                    outputFieldMaster=oooDocument.newFieldMaster(name);
//                    initOutputField(name);
                    XDependentTextField xTextField =
                            oooDocument.createField(outputFieldMaster);

                    // insert into document.  Last argument indicates NOT to replace
                    // the text range text.

View Full Code Here

Examples of com.sun.star.text.XDependentTextField

             * error field */
            if (xDependentTextField==null){
                /* Create text field */
                name = oooDocument.newErrorName(); /* Need to create unique ID number */
                errorFieldMaster=oooDocument.newFieldMaster(name);
                XDependentTextField xTextField =
                        oooDocument.createField(errorFieldMaster);

                // insert into document.  Last argument indicates NOT to replace
                // the text range text.

View Full Code Here

Examples of com.sun.star.text.XDependentTextField

         List docFieldMasterNames =
                 Arrays.asList((xTFS.getTextFieldMasters()).getElementNames());
         /* Create either OOOREsult or OOOError and add to list of OOOElements */
         XEnumeration xEnum = xTFS.getTextFields().createEnumeration();
         while (xEnum.hasMoreElements()){
             XDependentTextField xTF = (XDependentTextField)xEnum.nextElement();
             String name = (String) xTF.getTextFieldMaster().getPropertyValue("Name");


             /* NEED TO INDEX BY THE OOO Object */

             if (name.startsWith("com.sun.star.text.fieldmaster.User.OOOResult")){
View Full Code Here

Examples of com.sun.star.text.XDependentTextField

        }
        catch(com.sun.star.uno.Exception exception){
            /* this should work in OO 2 */
            oTF = (Object) xMSF.createInstance("com.sun.star.text.TextField.User");
        }
        XDependentTextField xTextField = (XDependentTextField)
                UnoRuntime.queryInterface(XDependentTextField.class, oTF);
        /* Attach to fieldmaster */
        xTextField.attachTextFieldMaster(outputFieldMaster);
        return xTextField;
    }
View Full Code Here

Examples of com.sun.star.text.XDependentTextField

            {
                return false;
            }
            else
            {
                XDependentTextField xDependent = (XDependentTextField) UnoRuntime.queryInterface(XDependentTextField.class, oTextField);
                XPropertySet xMaster = xDependent.getTextFieldMaster();
                String UserFieldName = (String) xMaster.getPropertyValue("Name");
                boolean bIsNameCell = false;
                if ((UserFieldName.startsWith(CompString)) || (UserFieldName.equals(CurFieldName)))
                {
                    bIsNameCell = true;
View Full Code Here

Examples of com.sun.star.text.XDependentTextField

            // Insert it at the end of the document
            mxDocText.insertTextContent ( mxDocText.getEnd(), xDateField, false );

            // Use the text document's factory to create a user text field,
            // and access it's XDependentTextField interface
            XDependentTextField xUserField =
                (XDependentTextField) UnoRuntime.queryInterface (
                    XDependentTextField.class, mxDocFactory.createInstance (
                        "com.sun.star.text.TextField.User" ) );

            // Create a fieldmaster for our newly created User Text field, and
            // access it's XPropertySet interface
            XPropertySet xMasterPropSet = (XPropertySet)UnoRuntime.queryInterface(
                XPropertySet.class, mxDocFactory.createInstance (
                    "com.sun.star.text.fieldmaster.User" ) );

            // Set the name and value of the FieldMaster
            xMasterPropSet.setPropertyValue ( "Name", "UserEmperor" );
            xMasterPropSet.setPropertyValue ( "Value", new Integer ( 42 ) );
           
            // Attach the field master to the user field
            xUserField.attachTextFieldMaster ( xMasterPropSet );
           
            // Move the cursor to the end of the document
            mxDocCursor.gotoEnd( false );
            // insert a paragraph break using the XSimpleText interface
            mxDocText.insertControlCharacter (
View Full Code Here

Examples of com.sun.star.text.XDependentTextField

            {
                return "";
            }
            else
            {
                XDependentTextField xDependent = (XDependentTextField) UnoRuntime.queryInterface(XDependentTextField.class, oTextField);
                XPropertySet xMaster = xDependent.getTextFieldMaster();
                String UserFieldContent = (String) xMaster.getPropertyValue("Content");
                return UserFieldContent;
            }
        }
        catch (com.sun.star.uno.Exception exception)
View Full Code Here

Examples of com.sun.star.text.XDependentTextField

    public void insertUserField(XTextCursor xTextCursor, String FieldName, String FieldTitle)
    {
        try
        {
            XInterface xField = (XInterface) xMSFDoc.createInstance("com.sun.star.text.TextField.User");
            XDependentTextField xDepField = (XDependentTextField) UnoRuntime.queryInterface(XDependentTextField.class, xField);
            XTextContent xFieldContent = (XTextContent) UnoRuntime.queryInterface(XTextContent.class, xField);
            if (xTextFieldsSupplier.getTextFieldMasters().hasByName("com.sun.star.text.FieldMaster.User." + FieldName))
            {
                Object oMaster = xTextFieldsSupplier.getTextFieldMasters().getByName("com.sun.star.text.FieldMaster.User." + FieldName);
                XComponent xComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, oMaster);
                xComponent.dispose();
            }
            XPropertySet xPSet = createUserField(FieldName, FieldTitle);
            xDepField.attachTextFieldMaster(xPSet);
            xTextCursor.getText().insertTextContent(xTextCursor, xFieldContent, false);

//            try
//            {
//                XPropertySet xTestProp = xDepField.getTextFieldMaster();
View Full Code Here

Examples of com.sun.star.text.XDependentTextField

            {
                XEnumeration xEnum = xTextFieldsSupplier.getTextFields().createEnumeration();
                while (xEnum.hasMoreElements())
                {
                    Object oTextField = xEnum.nextElement();
                    XDependentTextField xDependent = (XDependentTextField) UnoRuntime.queryInterface(XDependentTextField.class, oTextField);
                    XPropertySet xPropertySet = xDependent.getTextFieldMaster();
                    if (xPropertySet.getPropertySetInfo().hasPropertyByName(_PropertyName))
                    {
                        Object oValue = xPropertySet.getPropertyValue(_PropertyName);
                        // TODO replace the following comparison via com.sun.star.uno.Any.Type
                        if (AnyConverter.isString(oValue))
View Full Code Here

Examples of com.sun.star.text.XDependentTextField

                    // Insert it at the end of the document
                    mxDocText.insertTextContent ( mxDocText.getEnd(), xDateField, false );

                    // Use the text document's factory to create a user text field,
                    // and access it's XDependentTextField interface
                    XDependentTextField xUserField =
                            (XDependentTextField) UnoRuntime.queryInterface (
                                    XDependentTextField.class, mxDocFactory.createInstance (
                                            "com.sun.star.text.TextField.User" ) );

                    // Create a fieldmaster for our newly created User Text field, and access it's
                    // XPropertySet interface
                    XPropertySet xMasterPropSet = (XPropertySet) UnoRuntime.queryInterface (
                            XPropertySet.class, mxDocFactory.createInstance (
                                    "com.sun.star.text.FieldMaster.User" ) );

                    // Set the name and value of the FieldMaster
                    xMasterPropSet.setPropertyValue ( "Name", "UserEmperor" );
                    xMasterPropSet.setPropertyValue ( "Value", new Integer ( 42 ) );

                    // Attach the field master to the user field
                    xUserField.attachTextFieldMaster ( xMasterPropSet );

                    // Move the cursor to the end of the document
                    mxDocCursor.gotoEnd( false );
                    // insert a paragraph break using the XSimpleText interface
                    mxDocText.insertControlCharacter (
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.