Package com.sun.star.datatransfer.clipboard

Examples of com.sun.star.datatransfer.clipboard.XClipboard


    * Has <b> OK </b> status if the listener was called on contents changing.
    */
    public void _addClipboardListener() {
        oObj.addClipboardListener(myListener = new MyClipboardListener());

        XClipboard board = (XClipboard)UnoRuntime.queryInterface(
                XClipboard.class, tEnv.getTestObject());

        board.setContents(new MyTransferable(), new MyOwner());

        log.println("sleeping for 1 second");

        try {
            Thread.sleep(1000);
View Full Code Here


            myListener.called = false;
        } finally {
            oObj.removeClipboardListener(myListener);
        }

        XClipboard board = (XClipboard)UnoRuntime.queryInterface(
                XClipboard.class, oObj);

        board.setContents(new MyTransferable(), new MyOwner());

        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            log.println("interrupted");
View Full Code Here

    * Has <b> OK </b> status if not <code>null</code> value returned.
    */
    public void _getClipboard() {

        boolean result = true ;
        XClipboard cb = oObj.getClipboard("") ;

        result = cb != null ;

        tRes.tested("getClipboard()", result) ;
    }
View Full Code Here

    * Has <b> OK </b> status if the listener was called on contents changing.
    */
    public void _addClipboardListener() {
        oObj.addClipboardListener(myListener = new MyClipboardListener());

        XClipboard board = (XClipboard)UnoRuntime.queryInterface(
                XClipboard.class, tEnv.getTestObject());

        board.setContents(new MyTransferable(), new MyOwner());

        log.println("sleeping for 1 second");

        try {
            Thread.sleep(1000);
View Full Code Here

            myListener.called = false;
        } finally {
            oObj.removeClipboardListener(myListener);
        }

        XClipboard board = (XClipboard)UnoRuntime.queryInterface(
                XClipboard.class, oObj);

        board.setContents(new MyTransferable(), new MyOwner());

        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            log.println("interrupted");
View Full Code Here

    * Has <b> OK </b> status if not <code>null</code> value returned.
    */
    public void _getClipboard() {

        boolean result = true ;
        XClipboard cb = oObj.getClipboard("") ;

        result = cb != null ;

        tRes.tested("getClipboard()", result) ;
    }
View Full Code Here

    * Has <b> OK </b> status if not <code>null</code> value returned.
    */
    public void _getClipboard() {

        boolean result = true ;
        XClipboard cb = oObj.getClipboard("") ;

        result = cb != null ;

        tRes.tested("getClipboard()", result) ;
    }
View Full Code Here

           
      Object oClipboard = xServiceManager.createInstanceWithContext(
                "com.sun.star.datatransfer.clipboard.SystemClipboard",
                xOfficeContext);

      XClipboard xClipboard = (XClipboard)
        UnoRuntime.queryInterface(XClipboard.class, oClipboard);

      //---------------------------------------------------
      // registering as clipboard listener
      //---------------------------------------------------

      XClipboardNotifier xClipNotifier = (XClipboardNotifier)
        UnoRuntime.queryInterface(XClipboardNotifier.class, oClipboard);

      ClipboardListener aClipListener= new ClipboardListener();
     
      xClipNotifier.addClipboardListener(aClipListener);

            // Read ClipBoard
            readClipBoard(xClipboard);         

      //---------------------------------------------------
      // becoming a clipboard owner
      //---------------------------------------------------
     
      System.out.println("Becoming a clipboard owner...");
      System.out.println("");

      ClipboardOwner aClipOwner = new ClipboardOwner();
      xClipboard.setContents(new TextTransferable("Hello World!"), aClipOwner);
      int iFirst = 0;
           
      while (aClipOwner.isClipboardOwner())
      {
        if (iFirst != 2) {
View Full Code Here

           
      Object oClipboard = xServiceManager.createInstanceWithContext(
                "com.sun.star.datatransfer.clipboard.SystemClipboard",
                xOfficeContext);

      XClipboard xClipboard = (XClipboard)
        UnoRuntime.queryInterface(XClipboard.class, oClipboard);

      //---------------------------------------------------
      // registering as clipboard listener
      //---------------------------------------------------

      XClipboardNotifier xClipNotifier = (XClipboardNotifier)
        UnoRuntime.queryInterface(XClipboardNotifier.class, oClipboard);

      ClipboardListener aClipListener= new ClipboardListener();
     
      xClipNotifier.addClipboardListener(aClipListener);

            // Read ClipBoard
            readClipBoard(xClipboard);         

      //---------------------------------------------------
      // becoming a clipboard owner
      //---------------------------------------------------
     
      System.out.println("Becoming a clipboard owner...");
      System.out.println("");

      ClipboardOwner aClipOwner = new ClipboardOwner();
      xClipboard.setContents(new TextTransferable("Hello World!"), aClipOwner);
      int iFirst = 0;
           
      while (aClipOwner.isClipboardOwner())
      {
        if (iFirst != 2) {
View Full Code Here

    * Has <b> OK </b> status if the listener was called on contents changing.
    */
    public void _addClipboardListener() {
        oObj.addClipboardListener(myListener = new MyClipboardListener());

        XClipboard board = (XClipboard)UnoRuntime.queryInterface(
                XClipboard.class, tEnv.getTestObject());

        board.setContents(new MyTransferable(), new MyOwner());

        log.println("sleeping for 1 second");

        try {
            Thread.sleep(1000);
View Full Code Here

TOP

Related Classes of com.sun.star.datatransfer.clipboard.XClipboard

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.