Package com.sun.star.beans

Examples of com.sun.star.beans.XPropertySetInfo


    }

    public static Map toMap(XPropertySet props) {
        Hashtable result = new Hashtable(10);

        XPropertySetInfo setInfo = props.getPropertySetInfo();
        Property[] properties = setInfo.getProperties();

        for (int i = 0; i < properties.length; i++) {
            String name = properties[i].Name;
            Object value;
View Full Code Here


  public void handle( Object aFormComponent ) throws com.sun.star.uno.Exception
  {
    // check if it's a button
    XPropertySet xProps = UNO.queryPropertySet( aFormComponent );
    XPropertySetInfo xPI = null;
    if ( null != xProps )
      xPI = xProps.getPropertySetInfo();
    if ( ( null != xPI ) && xPI.hasPropertyByName( "ClassId" ) )
    {
      Short nClassId = (Short)xProps.getPropertyValue( "ClassId" );
      if ( FormComponentType.COMMANDBUTTON == nClassId.shortValue() )
      {
        // yes, it is
View Full Code Here

            System.out.println("*** print all properties that are supported by the controller");
            XController xController = xModel.getCurrentController();
            XPropertySet xPropSet =
                (XPropertySet)UnoRuntime.queryInterface(
                    XPropertySet.class, xController );
            XPropertySetInfo xPropSetInfo = xPropSet.getPropertySetInfo();
            Property[] aPropSeq = xPropSetInfo.getProperties();
            for( int i = 0; i < aPropSeq.length; i++ )
            {
                System.out.println( aPropSeq[ i ].Name );
            }
            System.out.println("*** change into masterpage mode");
View Full Code Here

                            com.sun.star.style.XStyle.class, aStyleObj );
          // now we have the XStyle Interface and the CharColor for
          // all styles is exemplary be set to red.
          XPropertySet xStylePropSet = (XPropertySet)
            UnoRuntime.queryInterface( XPropertySet.class, xStyle );
          XPropertySetInfo xStylePropSetInfo =
                        xStylePropSet.getPropertySetInfo();
          if ( xStylePropSetInfo.hasPropertyByName( "CharColor" ) )
          {
            xStylePropSet.setPropertyValue( "CharColor",
                                                        new Integer( 0xff0000 ) );
          }
        }
View Full Code Here

            final XPropertySet xImage = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class,
                    m_xGraphicProvider.queryGraphic(value));

            if (xImage != null)
            {
                final XPropertySetInfo xInfo = xImage.getPropertySetInfo();
                if (xInfo.hasPropertyByName("Size100thMM"))
                {
                    Size imageSize = (Size) xImage.getPropertyValue("Size100thMM");
                    dim.setSize(imageSize.Width, imageSize.Height);
                    if (dim.height == 0 && dim.width == 0)
                    {
                        imageSize = (Size) xImage.getPropertyValue("SizePixel");
                        final int dpi = java.awt.Toolkit.getDefaultToolkit().getScreenResolution();
                        final double fac = 2540 / (double)dpi;
                        dim.setSize(imageSize.Width * fac, imageSize.Height * fac);
                    }
                }
                else if (xInfo.hasPropertyByName("SizePixel"))
                {
                    final Size imageSize = (Size) xImage.getPropertyValue("SizePixel");
                    final int dpi = java.awt.Toolkit.getDefaultToolkit().getScreenResolution();
                    final double fac = 2540 / dpi;
                    dim.setSize(imageSize.Width * fac, imageSize.Height * fac);
 
View Full Code Here

            final XPropertySet xImage = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class,
                    m_xGraphicProvider.queryGraphic(value));

            if (xImage != null)
            {
                final XPropertySetInfo xInfo = xImage.getPropertySetInfo();
                if (xInfo.hasPropertyByName("MimeType"))
                {
                    return (String) xImage.getPropertyValue("MimeType");
                }
            }
        }
View Full Code Here

     */
    protected boolean checkResult(XPropertySet set, String propName,
                                  Object oldValue, Object newValue,
                                  Object resValue, Exception exception)
                           throws Exception {
        XPropertySetInfo info = set.getPropertySetInfo();
        Property prop = info.getPropertyByName(propName);

        oldValue = getRealValue(oldValue);
        newValue = getRealValue(newValue);
        resValue = getRealValue(resValue);

View Full Code Here

        propContainer.addProperty( "SomeBoundText", PropertyAttribute.BOUND, "InitialBoundText" );
        propContainer.addProperty( "SomeTransientText", PropertyAttribute.TRANSIENT, "InitialTransientProperty" );
        propContainer.addProperty( "SomeReadonlyText", PropertyAttribute.READONLY, "InitialReadonlyText" );
        propContainer.addProperty( "SomeNumericValue", PropertyAttribute.BOUND, new Integer( 42 ) );

        XPropertySetInfo propertyInfo = textFieldModel.getPropertySetInfo();
        assure( "Per service definition, dynamic properties are expected to be forced to be removeable",
            ( propertyInfo.getPropertyByName("SomeBoundText").Attributes & PropertyAttribute.REMOVEABLE ) != 0 );

        // a second addition of a property with an existent name should be rejected
        boolean caughtExpected = false;
        try { propContainer.addProperty( "SomeBoundText", PropertyAttribute.BOUND, "InitialBoundText" ); }
        catch( PropertyExistException e ) { caughtExpected = true; }
View Full Code Here

            XServiceInfo xServiceInfo = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, m_xPropertySet);
            if (xServiceInfo != null)
            {
                sName = xServiceInfo.getImplementationName();
            }
            XPropertySetInfo xInfo = m_xPropertySet.getPropertySetInfo();
            Property[] aAllProperties = xInfo.getProperties();
            DebugHelper.writeInfo("Show all properties of Implementation of :'" + sName + "'");
            for (int i = 0; i < aAllProperties.length; i++)
            {
                DebugHelper.writeInfo(" - " + aAllProperties[i].Name);
            }
View Full Code Here

     */
    public void _FillBitmap() {

        String propName = "FillBitmap";

        XPropertySetInfo info = oObj.getPropertySetInfo();

        if (!info.hasPropertyByName(propName)) {
            if (isOptional(propName)) {
                // skipping optional property test
                log.println("Property '" + propName + "' is optional and not supported");
                tRes.tested(propName, true);
                return;
View Full Code Here

TOP

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

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.