Package java.awt.datatransfer

Examples of java.awt.datatransfer.StringSelection


                new XMLOutputter().output(elementTypesDef, stringWriter);

                Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
                String data = stringWriter.getBuffer().toString();
                System.out.println(data);
                clipboard.setContents(new StringSelection(data), null);

            } else {
            }

            //warnAmbiguousBranches();
View Full Code Here


                buffer.append(path.getLastPathComponent().toString());
                buffer.append("\n");
            }
            buffer.delete(buffer.length() - 1, buffer.length());

            StringSelection contents = new StringSelection(buffer.toString());
            clip.setContents(contents, null);
        }
    }
View Full Code Here

            }
            sb.append(newline);
        }

        Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
        Transferable transferable = new StringSelection(sb.toString());
        clipboard.setContents(transferable, null);
    }
View Full Code Here

       
        for(final JEditorPane pane : editorCookie.getOpenedPanes()){
            if (pane.isShowing() &&
                    pane.getSelectionEnd() > pane.getSelectionStart() ){
                try{
                    StringSelection content = new StringSelection(selectedSourceAsMinify(pane));
                    Toolkit.getDefaultToolkit().getSystemClipboard().
                            setContents(content, content);
                    return;
                }
                catch (final Throwable e){
View Full Code Here

       
        for(final JEditorPane pane : editorCookie.getOpenedPanes()){
            if (pane.isShowing() &&
                    pane.getSelectionEnd() > pane.getSelectionStart() ){
                try{
                    StringSelection content = new StringSelection(selectedSourceAsMinify(pane));
                    Toolkit.getDefaultToolkit().getSystemClipboard().
                            setContents(content, content);
                    return;
                }
                catch (final Throwable e){
View Full Code Here

    clipboardButton.addActionListener(new ActionListener()
    {
      public void actionPerformed(ActionEvent e)
      {
        Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
        clipboard.setContents(new StringSelection(outputText.getText()), null);
      }
    });

    switchDetailedButton = new JButton(messages.getString("detailedFormat"));
    isDetailedBuildOrder = true;
View Full Code Here

    }  
    public static void toClipboard(String data) {  
      
        Clipboard clipB = Toolkit.getDefaultToolkit().getSystemClipboard();  
      
        StringSelection dataS = new StringSelection(data);  
      
        clipB.setContents(dataS,dataS);  
    }
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

          + " into a browser");
      // is it better to use SwingUtilities2.canAccessSystemClipboard() here?
      Throwable caught = null;
      try {
        Clipboard clipboard = logWindow.getToolkit().getSystemClipboard();
        StringSelection selection = new StringSelection(url.toExternalForm());
        clipboard.setContents(selection, selection);
        return;
      } catch (SecurityException e) {
        caught = e;
      } catch (HeadlessException e) {
View Full Code Here

      if (start != end) {
        clipboard = text.substring(
          Math.min(start, end), Math.max(start, end));
        try {
          getToolkit().getSystemClipboard().setContents(
            new StringSelection(clipboard), null);
        } catch (Exception exc) {}
        if (keycode == KeyEvent.VK_X) { insert = ""; } else { return true; }
      }
    }
    else if (editable && controldown && (keycode == KeyEvent.VK_V)) {
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.