Package com.sun.star.datatransfer.clipboard

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


      //---------------------------------------------------
      // 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) {
          if (iFirst == 1) {                   
            System.out.println("Change clipboard ownership by putting something into the clipboard!\n");
            System.out.print("Still clipboard owner...");
          } else {
            System.out.println("Still clipboard owner...");
          }
          ++iFirst;
        } else {
          System.out.print(".");
        }
        Thread.sleep(1000);
      }

            // Read ClipBoard again
            readClipBoard(xClipboard);         
           
      //---------------------------------------------------
      // unregistering as clipboard listener
      //---------------------------------------------------
      xClipNotifier.removeClipboardListener(aClipListener);

            // close test document
            com.sun.star.util.XCloseable xCloseable = (com.sun.star.util.XCloseable)
                UnoRuntime.queryInterface(com.sun.star.util.XCloseable.class,
                                          xComponent );
View Full Code Here


      //---------------------------------------------------
      // 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) {
          if (iFirst == 1) {                   
            System.out.println("Change clipboard ownership by putting something into the clipboard!\n");
            System.out.print("Still clipboard owner...");
          } else {
            System.out.println("Still clipboard owner...");
          }
          ++iFirst;
        } else {
          System.out.print(".");
        }
        Thread.sleep(1000);
      }

            // Read ClipBoard again
            readClipBoard(xClipboard);         
           
      //---------------------------------------------------
      // unregistering as clipboard listener
      //---------------------------------------------------
      xClipNotifier.removeClipboardListener(aClipListener);

            // close test document
            com.sun.star.util.XCloseable xCloseable = (com.sun.star.util.XCloseable)
                UnoRuntime.queryInterface(com.sun.star.util.XCloseable.class,
                                          xComponent );
View Full Code Here

      //---------------------------------------------------
      // 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) {
          if (iFirst == 1) {                   
            System.out.println("Change clipboard ownership by putting something into the clipboard!\n");
            System.out.print("Still clipboard owner...");
          } else {
            System.out.println("Still clipboard owner...");
          }
          ++iFirst;
        } else {
          System.out.print(".");
        }
        Thread.sleep(1000);
      }

            // Read ClipBoard again
            readClipBoard(xClipboard);         
           
      //---------------------------------------------------
      // unregistering as clipboard listener
      //---------------------------------------------------
      xClipNotifier.removeClipboardListener(aClipListener);

            // close test document
            com.sun.star.util.XCloseable xCloseable = (com.sun.star.util.XCloseable)
                UnoRuntime.queryInterface(com.sun.star.util.XCloseable.class,
                                          xComponent );
View Full Code Here

      //---------------------------------------------------
      // 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) {
          if (iFirst == 1) {                   
            System.out.println("Change clipboard ownership by putting something into the clipboard!\n");
            System.out.print("Still clipboard owner...");
          } else {
            System.out.println("Still clipboard owner...");
          }
          ++iFirst;
        } else {
          System.out.print(".");
        }
        Thread.sleep(1000);
      }

            // Read ClipBoard again
            readClipBoard(xClipboard);         
           
      //---------------------------------------------------
      // unregistering as clipboard listener
      //---------------------------------------------------
      xClipNotifier.removeClipboardListener(aClipListener);

            // close test document
            com.sun.star.util.XCloseable xCloseable = (com.sun.star.util.XCloseable)
                UnoRuntime.queryInterface(com.sun.star.util.XCloseable.class,
                                          xComponent );
View Full Code Here

TOP

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

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.