Examples of XTransferable


Examples of com.sun.star.datatransfer.XTransferable

                                          XComponentSupplier.class,
                                          m_xEmbedObj );
          if ( xCompProv != null )
          {
            XComponent xComp = xCompProv.getComponent();
            XTransferable xTransfer = (XTransferable)UnoRuntime.queryInterface(
                                          XTransferable.class,
                                          xComp );
            if ( xTransfer != null )
            {
              DataFlavor aFlavor = new DataFlavor();
              aFlavor.MimeType = "image/png";
              aFlavor.HumanPresentableName = "Portable Network Graphics";
              aFlavor.DataType = new Type( byte[].class );
 
              byte[] aPNGData = (byte[])AnyConverter.toArray( xTransfer.getTransferData( aFlavor ) );
              if ( aPNGData != null && aPNGData.length != 0 )
              {
                synchronized( this )
                {
                  m_aImage = m_aToolkit.createImage( aPNGData );
View Full Code Here

Examples of com.sun.star.datatransfer.XTransferable

                                          XComponentSupplier.class,
                                          m_xEmbedObj );
          if ( xCompProv != null )
          {
            XCloseable xCloseable = xCompProv.getComponent();
            XTransferable xTransfer = (XTransferable)UnoRuntime.queryInterface(
                                          XTransferable.class,
                                          xCloseable );
            if ( xTransfer != null )
            {
              DataFlavor aFlavor = new DataFlavor();
              aFlavor.MimeType = "application/x-openoffice;windows_formatname=\"Bitmap\"";
              aFlavor.HumanPresentableName = "Bitmap";
              aFlavor.DataType = new Type( byte[].class );

              Object aAny = xTransfer.getTransferData( aFlavor );
              if ( aAny != null && AnyConverter.isArray( aAny ) )
              {
                synchronized( m_oImageLock )
                {
                  m_xBitmap = WindowHelper.getVCLBitmapFromBytes( m_xServiceFactory, aAny );
View Full Code Here

Examples of com.sun.star.datatransfer.XTransferable

                                          XComponentSupplier.class,
                                          m_xEmbedObj );
          if ( xCompProv != null )
          {
            XComponent xComp = xCompProv.getComponent();
            XTransferable xTransfer = (XTransferable)UnoRuntime.queryInterface(
                                          XTransferable.class,
                                          xComp );
            if ( xTransfer != null )
            {
              DataFlavor aFlavor = new DataFlavor();
              aFlavor.MimeType = "image/png";
              aFlavor.HumanPresentableName = "Portable Network Graphics";
              aFlavor.DataType = new Type( byte[].class );
 
              byte[] aPNGData = (byte[])AnyConverter.toArray( xTransfer.getTransferData( aFlavor ) );
              if ( aPNGData != null && aPNGData.length != 0 )
              {
                synchronized( this )
                {
                  m_aImage = m_aToolkit.createImage( aPNGData );
View Full Code Here

Examples of com.sun.star.datatransfer.XTransferable

    {
        //---------------------------------------------------
        // get a list of formats currently on the clipboard
        //---------------------------------------------------
       
        XTransferable xTransferable = xClipboard.getContents();
       
        DataFlavor[] aDflvArr = xTransferable.getTransferDataFlavors();
       
        // print all available formats
       
        System.out.println("Reading the clipboard...");
        System.out.println("Available clipboard formats:");
           
        DataFlavor aUniFlv = null;
       
        for (int i=0;i<aDflvArr.length;i++)
        {
            System.out.println( "MimeType: " +
                                aDflvArr[i].MimeType +
                                " HumanPresentableName: " +
                                aDflvArr[i].HumanPresentableName );       

            // if there is the format unicode text on the clipboard save the
            // corresponding DataFlavor so that we can later output the string
           
            if ( aDflvArr[i].MimeType.equals("text/plain;charset=utf-16") )
            {         
                aUniFlv = aDflvArr[i];
            }
        }
       
        System.out.println("");
       
        try 
        {
            if (aUniFlv != null)
            {
                System.out.print("Unicode text on the clipboard ...\nYour selected text \"");
                Object aData = xTransferable.getTransferData(aUniFlv);         
                System.out.println(AnyConverter.toString(aData)
                                   + "\" is now in the clipboard.\n");
            }
        }
        catch( UnsupportedFlavorException ex )
View Full Code Here

Examples of com.sun.star.datatransfer.XTransferable

    {
        //---------------------------------------------------
        // get a list of formats currently on the clipboard
        //---------------------------------------------------
       
        XTransferable xTransferable = xClipboard.getContents();
       
        DataFlavor[] aDflvArr = xTransferable.getTransferDataFlavors();
       
        // print all available formats
       
        System.out.println("Reading the clipboard...");
        System.out.println("Available clipboard formats:");
           
        DataFlavor aUniFlv = null;
       
        for (int i=0;i<aDflvArr.length;i++)
        {
            System.out.println( "MimeType: " +
                                aDflvArr[i].MimeType +
                                " HumanPresentableName: " +
                                aDflvArr[i].HumanPresentableName );       

            // if there is the format unicode text on the clipboard save the
            // corresponding DataFlavor so that we can later output the string
           
            if ( aDflvArr[i].MimeType.equals("text/plain;charset=utf-16") )
            {         
                aUniFlv = aDflvArr[i];
            }
        }
       
        System.out.println("");
       
        try 
        {
            if (aUniFlv != null)
            {
                System.out.print("Unicode text on the clipboard ...\nYour selected text \"");
                Object aData = xTransferable.getTransferData(aUniFlv);         
                System.out.println(AnyConverter.toString(aData)
                                   + "\" is now in the clipboard.\n");
            }
        }
        catch( UnsupportedFlavorException ex )
View Full Code Here

Examples of com.sun.star.datatransfer.XTransferable

                                          XComponentSupplier.class,
                                          m_xEmbedObj );
          if ( xCompProv != null )
          {
            XCloseable xCloseable = xCompProv.getComponent();
            XTransferable xTransfer = (XTransferable)UnoRuntime.queryInterface(
                                          XTransferable.class,
                                          xCloseable );
            if ( xTransfer != null )
            {
              DataFlavor aFlavor = new DataFlavor();
              aFlavor.MimeType = "application/x-openoffice;windows_formatname=\"Bitmap\"";
              aFlavor.HumanPresentableName = "Bitmap";
              aFlavor.DataType = new Type( byte[].class );

              Object aAny = xTransfer.getTransferData( aFlavor );
              if ( aAny != null && AnyConverter.isArray( aAny ) )
              {
                synchronized( m_oImageLock )
                {
                  m_xBitmap = WindowHelper.getVCLBitmapFromBytes( m_xServiceFactory, aAny );
View Full Code Here

Examples of com.sun.star.datatransfer.XTransferable

    {
        //---------------------------------------------------
        // get a list of formats currently on the clipboard
        //---------------------------------------------------
       
        XTransferable xTransferable = xClipboard.getContents();
       
        DataFlavor[] aDflvArr = xTransferable.getTransferDataFlavors();
       
        // print all available formats
       
        System.out.println("Reading the clipboard...");
        System.out.println("Available clipboard formats:");
           
        DataFlavor aUniFlv = null;
       
        for (int i=0;i<aDflvArr.length;i++)
        {
            System.out.println( "MimeType: " +
                                aDflvArr[i].MimeType +
                                " HumanPresentableName: " +
                                aDflvArr[i].HumanPresentableName );       

            // if there is the format unicode text on the clipboard save the
            // corresponding DataFlavor so that we can later output the string
           
            if ( aDflvArr[i].MimeType.equals("text/plain;charset=utf-16") )
            {         
                aUniFlv = aDflvArr[i];
            }
        }
       
        System.out.println("");
       
        try 
        {
            if (aUniFlv != null)
            {
                System.out.print("Unicode text on the clipboard ...\nYour selected text \"");
                Object aData = xTransferable.getTransferData(aUniFlv);         
                System.out.println(AnyConverter.toString(aData)
                                   + "\" is now in the clipboard.\n");
            }
        }
        catch( UnsupportedFlavorException ex )
View Full Code Here

Examples of com.sun.star.datatransfer.XTransferable

    {
        //---------------------------------------------------
        // get a list of formats currently on the clipboard
        //---------------------------------------------------
       
        XTransferable xTransferable = xClipboard.getContents();
       
        DataFlavor[] aDflvArr = xTransferable.getTransferDataFlavors();
       
        // print all available formats
       
        System.out.println("Reading the clipboard...");
        System.out.println("Available clipboard formats:");
           
        DataFlavor aUniFlv = null;
       
        for (int i=0;i<aDflvArr.length;i++)
        {
            System.out.println( "MimeType: " +
                                aDflvArr[i].MimeType +
                                " HumanPresentableName: " +
                                aDflvArr[i].HumanPresentableName );       

            // if there is the format unicode text on the clipboard save the
            // corresponding DataFlavor so that we can later output the string
           
            if ( aDflvArr[i].MimeType.equals("text/plain;charset=utf-16") )
            {         
                aUniFlv = aDflvArr[i];
            }
        }
       
        System.out.println("");
       
        try 
        {
            if (aUniFlv != null)
            {
                System.out.print("Unicode text on the clipboard ...\nYour selected text \"");
                Object aData = xTransferable.getTransferData(aUniFlv);         
                System.out.println(AnyConverter.toString(aData)
                                   + "\" is now in the clipboard.\n");
            }
        }
        catch( UnsupportedFlavorException ex )
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.