Package com.sun.star.beans

Examples of com.sun.star.beans.XPropertySet


            Object oTextField = Helper.getUnoPropertyValue(xTextRange, "TextField");
            if (com.sun.star.uno.AnyConverter.isVoid(oTextField))
                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) {
            exception.printStackTrace(System.out);
            return "";
View Full Code Here


            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);
        } catch (com.sun.star.uno.Exception exception) {
            exception.printStackTrace(System.out);
        }
View Full Code Here

    }


    public XPropertySet createUserField(String FieldName, String FieldTitle) throws com.sun.star.uno.Exception{
        Object oMaster = xMSFDoc.createInstance("com.sun.star.text.FieldMaster.User");
        XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oMaster);
        xPSet.setPropertyValue("Name", FieldName);
        xPSet.setPropertyValue("Content", FieldTitle);
        return xPSet;
    }
View Full Code Here

    private XDependentTextField[] getTextFieldsByProperty(String _PropertyName, Object _aPropertyValue, String _TypeName) throws Exception{
    try {
        XDependentTextField[] xDependentFields;
        Vector xDependentVector = new Vector();
        if (xTextFieldsSupplier.getTextFields().hasElements()) {
            XPropertySet xPSet;
            XEnumeration xEnum = xTextFieldsSupplier.getTextFields().createEnumeration();
            while (xEnum.hasMoreElements()) {
                Object oTextField = xEnum.nextElement();
                XDependentTextField xDependent = (XDependentTextField) UnoRuntime.queryInterface(XDependentTextField.class, oTextField);
                xPSet = xDependent.getTextFieldMaster();
                if (xPSet.getPropertySetInfo().hasPropertyByName(_PropertyName)){
                    Object oValue = xPSet.getPropertyValue(_PropertyName);
                    // TODO replace the following comparison via com.sun.star.uno.Any.Type
                    if(AnyConverter.isString(oValue)){
                        if (_TypeName.equals("String")){
                            String sValue = AnyConverter.toString(oValue);
                            if (sValue.equals(_aPropertyValue))
View Full Code Here

            while (xEnum.hasMoreElements()) {
                Object oTextField = xEnum.nextElement();           
                XServiceInfo xSI = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, oTextField);
               
                if (xSI.supportsService("com.sun.star.text.TextField.DateTime")) {
                    XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oTextField);
                    xPSet.setPropertyValue("IsFixed", Boolean.FALSE);
                    xPSet.setPropertyValue("DateTimeValue", dt);
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
View Full Code Here

        XEnumeration xEnum = xTextFieldsSupplier.getTextFields().createEnumeration();           
        while (xEnum.hasMoreElements()) {
            Object oTextField = xEnum.nextElement();           
            XServiceInfo xSI = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, oTextField);
            if (xSI.supportsService("com.sun.star.text.TextField.DateTime")) {
                XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oTextField);
                xPSet.setPropertyValue("IsFixed", new Boolean(_bSetFixed));
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }}
View Full Code Here

    public int getControlKey(Object EventObject, Hashtable ControlList) {
        int iKey;
        XControl xControl = (XControl) UnoRuntime.queryInterface(XControl.class, EventObject);
        XControlModel xControlModel = xControl.getModel();
        XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xControlModel);
        try {
            String sName = (String) xPSet.getPropertyValue("Name");
            Integer KeyObject = (Integer) ControlList.get(sName);
            iKey = KeyObject.intValue();
        } catch (com.sun.star.uno.Exception exception) {
            exception.printStackTrace(System.out);
            iKey = 2000;
View Full Code Here

        try {
            if (PropertyValue != null) {
                if (xDlgNameAccess.hasByName(ControlName) == false)
                    return;
                Object xControlModel = xDlgNameAccess.getByName(ControlName);
                XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xControlModel);
                if (AnyConverter.isArray(PropertyValue)) {
                    com.sun.star.uno.Type seqType = new com.sun.star.uno.Type(PropertyValue.getClass());
                    PropertyValue = new com.sun.star.uno.Any(seqType, PropertyValue);
                    /*              PropertyValue = Helper.getArrayValue(PropertyValue);
                                    if (PropertyValue == null)
                                        PropertyValue = new short[]{};
                                        */
                }
                xPSet.setPropertyValue(PropertyName, PropertyValue);
            }
        } catch (com.sun.star.uno.Exception exception) {
            exception.printStackTrace(System.out);
        }
    }
View Full Code Here


    public Object getControlProperty(String ControlName, String PropertyName) {
        try {
            Object xControlModel = xDlgNameAccess.getByName(ControlName);
            XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xControlModel);
            Object oPropValue = xPSet.getPropertyValue(PropertyName);
            //      if (AnyConverter.isArray(oPropValue))
            //          return Helper.getArrayValue(oPropValue);
            //      else
            return oPropValue;
        } catch (com.sun.star.uno.Exception exception) { // com.sun.star.container.NoSuchElementException, com.sun.star.beans.UnknownPropertyException,
View Full Code Here

    }

    public void printControlProperties(String ControlName) {
        try {
            Object xControlModel = xDlgNameAccess.getByName(ControlName);
            XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xControlModel);
            Property [] allProps = xPSet.getPropertySetInfo().getProperties();
            for (int i=0;i < allProps.length;i++) {
                System.out.println(allProps[i].Name);
            }
        } catch (com.sun.star.uno.Exception exception) { // com.sun.star.container.NoSuchElementException, com.sun.star.beans.UnknownPropertyException,
            exception.printStackTrace(System.out); // com.sun.star.lang.WrappedTargetException, com.sun.star.beans.PropertyVetoException
View Full Code Here

TOP

Related Classes of com.sun.star.beans.XPropertySet

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.