Package org.eclipse.swt.dnd

Examples of org.eclipse.swt.dnd.TextTransfer


*/
public class Utils {
 
  public static String getClipboardText() {
      final Clipboard cb = new Clipboard(SWTThread.getDisplay());
      final TextTransfer transfer = TextTransfer.getInstance();
     
      String data = (String)cb.getContents(transfer);
      if (data==null) return "";
      return data;
  }
View Full Code Here


    dialog.open();
  }
 
  public static void setClipBoardText(String text) {
    final Clipboard cb = new Clipboard(SWTThread.getDisplay());
    final TextTransfer transfer = TextTransfer.getInstance();
   
    cb.setContents(new String[]{text}, new Transfer[]{transfer});
  }
View Full Code Here

      }
    }

    private String getInitialLink() {
      Clipboard cb = new Clipboard(getShell().getDisplay());
      TextTransfer transfer = TextTransfer.getInstance();
      String data = (String) cb.getContents(transfer);
      data = (data != null) ? data.trim() : null;
      cb.dispose();

      if (data != null && URIUtils.looksLikeLink(data)) {
View Full Code Here

  private String loadInitialLinkFromClipboard() {
    String initial = URIUtils.HTTP;

    Clipboard cb = new Clipboard(getShell().getDisplay());
    TextTransfer transfer = TextTransfer.getInstance();
    String data = (String) cb.getContents(transfer);
    data = (data != null) ? data.trim() : null;
    cb.dispose();

    if (URIUtils.looksLikeLink(data))
View Full Code Here

    });
  }

  private String loadInitialLinkFromClipboard(Display display) {
    Clipboard cb = new Clipboard(display);
    TextTransfer transfer = TextTransfer.getInstance();
    String data = (String) cb.getContents(transfer);
    data = (data != null) ? data.trim() : null;
    cb.dispose();

    if (URIUtils.looksLikeLink(data))
View Full Code Here

    String initial = null;
    if (StringUtils.isSet(fPreSetLink))
      initial = fPreSetLink;
    else {
      Clipboard cb = new Clipboard(fShell.getDisplay());
      TextTransfer transfer = TextTransfer.getInstance();
      String data = (String) cb.getContents(transfer);
      data = (data != null) ? data.trim() : fPreSetLink;
      cb.dispose();
      initial = HTTP;
View Full Code Here

    String initial = null;
    if (StringUtils.isSet(fPreSetLink))
      initial = fPreSetLink;
    else {
      Clipboard cb = new Clipboard(fShell.getDisplay());
      TextTransfer transfer = TextTransfer.getInstance();
      String data = (String) cb.getContents(transfer);
      data = (data != null) ? data.trim() : fPreSetLink;
      cb.dispose();
      initial = HTTP;
View Full Code Here

  public static void copyClipboard(String content, Display display) {

    if (_cb == null)
      _cb = new Clipboard(display);

    TextTransfer transfer = TextTransfer.getInstance();
    _cb.setContents(new Object[] { content }, new Transfer[] { transfer });

  }
View Full Code Here

         * buffer.append(unresolvedLabelProvider .getLabel(reason.getResource())); if (iter.hasNext())
         * buffer.append('\n'); } }
         */

        Clipboard clipboard = new Clipboard(sashForm.getDisplay());
        TextTransfer transfer = TextTransfer.getInstance();
        clipboard.setContents(new Object[] {
            builder.toString()
        }, new Transfer[] {
            transfer
        });
View Full Code Here

         * buffer.append(unresolvedLabelProvider .getLabel(reason.getResource())); if (iter.hasNext())
         * buffer.append('\n'); } }
         */

        Clipboard clipboard = new Clipboard(composite.getDisplay());
        TextTransfer transfer = TextTransfer.getInstance();
        clipboard.setContents(new Object[] {
            builder.toString()
        }, new Transfer[] {
            transfer
        });
View Full Code Here

TOP

Related Classes of org.eclipse.swt.dnd.TextTransfer

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.