Package java.awt.datatransfer

Examples of java.awt.datatransfer.StringSelection


    if (clipboard == null) {
      return;
    }
    StringBuilder text = new StringBuilder();
    treeLogTraverse(text, node, 0);
    StringSelection selection = new StringSelection(text.toString());
    clipboard.setContents(selection, selection);
  }
View Full Code Here


                        try {
                            path = new File(URLDecoder.decode(url.getPath(), "UTF-8")).getAbsolutePath();
                        } catch (UnsupportedEncodingException ex) {
                        }
                        try {
                            StringSelection contents = new StringSelection(path);
                            Toolkit.getDefaultToolkit().getSystemClipboard().setContents(contents, contents);
                        } catch (Exception e1) {
                        }
                        JOptionPane.showMessageDialog(PreferencesFrame.this,
                                "The plugin could not be uninstalled automatically.\n\n" +
View Full Code Here

          cbuff[i] = iter.next();
      }
      label = new String(cbuff);
        }
        Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
        StringSelection selection = new StringSelection(label);
        clipboard.setContents(selection, selection);
    }
      }
  }.start();
    }
View Full Code Here

    public void dragGestureRecognized(DragGestureEvent e)
    {
      try
        {
          Transferable t = new StringSelection(getText());
          e.startDrag(DragSource.DefaultCopyNoDrop, t, this);
          dragGestRec = true;
        }
      catch (InvalidDnDOperationException e2)
        {
View Full Code Here

          }
        }
        buffer.append('\n');
      }
    }
    final StringSelection ss = new StringSelection(buffer.toString());
    final Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard();
    cb.setContents(ss, ss);

  }
View Full Code Here

    protected Transferable createTransferable( JComponent c )
    {
//      return new StringSelection( doc.getAudioFileDescr().file.getAbsolutePath() + File.pathSeparator +
//        doc.timeline.getSelectionSpan().getStart() + File.pathSeparator +
//        doc.timeline.getSelectionSpan().getStop() );
      return new StringSelection( doc.getDisplayDescr().file.getAbsolutePath() + File.pathSeparator +
        doc.timeline.getSelectionSpan().getStart() + File.pathSeparator +
        doc.timeline.getSelectionSpan().getStop() );
   
//      System.err.println( "createTransferable" );
//      return new AudioFileRegion( new File( "haschimoto" ), new Span( 42, 43 ));
View Full Code Here

              + "\n");
        }
      }
    }

    final StringSelection fieldContent = new StringSelection(copiedText
        .toString());

    VisualEditor.clipboard.setContents(fieldContent, this);
  }
View Full Code Here

        jMenuItemCopier.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent e) {
                String selection = adressejTextField.getText();
                if(selection == null)
                  return;
                StringSelection clipString = new StringSelection(selection);
                clipbd.setContents(clipString,clipString);
            }
        });
    } catch (java.lang.Throwable e) {}
      }
View Full Code Here

            if (text == null || text.equals("")) {
                details.selectAll();
                text = details.getSelectedText();
                details.select(-1, -1);
            }
            return new StringSelection(text);
        }
View Full Code Here

                }

            }
            copyIn.append("\n");
        }
        StringSelection stsel = new StringSelection(copyIn.toString());
        Clipboard system = Toolkit.getDefaultToolkit().getSystemClipboard();

        system.setContents(stsel, stsel);
    }
View Full Code Here

TOP

Related Classes of java.awt.datatransfer.StringSelection

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.