Package java.awt.datatransfer

Examples of java.awt.datatransfer.ClipboardOwner


    }
    return super.getTreeCellRendererComponent(tree, treeNode, sel, expanded, leaf, row, hasFocus);
  }
 
  private boolean isCut(AWorkspaceTreeNode node) {
    ClipboardOwner owner = DnDController.getSystemClipboardController().getClipboardOwner();
    if(owner != null && owner instanceof IWorspaceClipboardOwner) {
      if(!((IWorspaceClipboardOwner) owner).getTransferable().isCopy() && ((IWorspaceClipboardOwner) owner).getTransferable().contains(node)) {
        return true;
      }
    }
View Full Code Here


                                                    }

                                                    public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
                                                        return logging.getText();
                                                    }
                                                }, new ClipboardOwner() {
                                                    public void lostOwnership(Clipboard clipboard, Transferable contents) {
                                                    }
                                                });
                                            }
                                        }, JFCApplet.this.getRootPane(), UIMessage.UI_TOP_LEFT);
View Full Code Here

            {
                Clipboard clipboard = getToolkit().getSystemClipboard();


                StringSelection clipContents = new StringSelection(testStr);
                clipboard.setContents(clipContents, new ClipboardOwner()
                {

                    @Override
                    public void lostOwnership(Clipboard clipboard, Transferable contents)
                    {
View Full Code Here

        try {
            java.awt.datatransfer.Clipboard awtClipboard =
                Toolkit.getDefaultToolkit().getSystemClipboard();

            LocalManifestAdapter localManifestAdapter = new LocalManifestAdapter(content);
            awtClipboard.setContents(localManifestAdapter, new ClipboardOwner() {
                @Override
                public void lostOwnership(java.awt.datatransfer.Clipboard clipboard,
                    Transferable contents) {
                    LocalManifest previousContent = Clipboard.content;
                    Clipboard.content = null;
View Full Code Here

            throw new NullPointerException("contents");
        }

        initContext();

        final ClipboardOwner oldOwner = this.owner;
        final Transferable oldContents = this.contents;

        try {
            this.owner = owner;
            this.contents = new TransferableProxy(contents, true);

            setContentsNative(contents);
        } finally {
            if (oldOwner != null && oldOwner != owner) {
                EventQueue.invokeLater(new Runnable() {
                    public void run() {
                        oldOwner.lostOwnership(SunClipboard.this, oldContents);
                    }
                });
            }
        }
    }
View Full Code Here

        }

        final Runnable runnable = new Runnable() {
                public void run() {
                    final SunClipboard sunClipboard = SunClipboard.this;
                    ClipboardOwner owner = null;
                    Transferable contents = null;

                    synchronized (sunClipboard) {
                        final AppContext context = sunClipboard.contentsContext;

                        if (context == null) {
                            return;
                        }

                        if (disposedContext == null || context == disposedContext) {
                            owner = sunClipboard.owner;
                            contents = sunClipboard.contents;
                            sunClipboard.contentsContext = null;
                            sunClipboard.owner = null;
                            sunClipboard.contents = null;
                            sunClipboard.clearNativeContext();
                            context.removePropertyChangeListener
                                (AppContext.DISPOSED_PROPERTY_NAME, sunClipboard);
                        } else {
                            return;
                        }
                    }
                    if (owner != null) {
                        owner.lostOwnership(sunClipboard, contents);
                    }
                }
            };

        SunToolkit.postEvent(context, new PeerEvent(this, runnable,
View Full Code Here

        addActionListener(new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            StringSelection stringSelection = new StringSelection(Options.instance.seed + "");
            Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
            clipboard.setContents(stringSelection, new ClipboardOwner() {
              @Override
              public void lostOwnership(Clipboard arg0, Transferable arg1) {
                // TODO Auto-generated method stub
               
              }
View Full Code Here

   */
  public static void setSystemClipboardContents(Component c, String srcData) {
    if (srcData != null) {
      Clipboard clipboard = c.getToolkit().getSystemClipboard();
      StringSelection contents = new StringSelection(srcData);
      clipboard.setContents(contents, new ClipboardOwner() {
        public void lostOwnership(Clipboard clipboard, Transferable contents) {
          // don't care
        }
      });
    }
View Full Code Here

    }
  }

  private void copyDN()
  {
    ClipboardOwner owner = new ClipboardOwner()
    {
      /**
       * {@inheritDoc}
       */
      public void lostOwnership( Clipboard aClipboard,
View Full Code Here

        try {
            java.awt.datatransfer.Clipboard awtClipboard =
                Toolkit.getDefaultToolkit().getSystemClipboard();

            LocalManifestAdapter localManifestAdapter = new LocalManifestAdapter(content);
            awtClipboard.setContents(localManifestAdapter, new ClipboardOwner() {
                public void lostOwnership(java.awt.datatransfer.Clipboard clipboard,
                    Transferable contents) {
                    LocalManifest previousContent = Clipboard.content;
                    Clipboard.content = null;
View Full Code Here

TOP

Related Classes of java.awt.datatransfer.ClipboardOwner

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.