Package org.eclipse.swt.dnd

Examples of org.eclipse.swt.dnd.Clipboard


    }
    return sb.toString();
  }
 
  public void copyLogToClipboard() {
    Clipboard cb = new Clipboard(PlatformUI.getWorkbench().getDisplay());
    String textData = getMessages();
    if (textData.length() > 0) {
      TextTransfer textTransfer = TextTransfer.getInstance();
      cb.setContents(new Object[]{textData}, new Transfer[]{textTransfer});
    }

  }
View Full Code Here


     * @param shell
     * @param window
     */
    @SuppressWarnings("deprecation")
    RefactorGroup(Shell shell, IWorkbenchWindow window) {
    mClipboard = new Clipboard(shell.getDisplay());

    // copy action
        mCopyAction = new CopyAction(mClipboard);

        mRetargetCopyAction = ActionFactory.COPY.create(window);
View Full Code Here

  /**
   * @return the clip board data
   */
  public Object getClipboardData() {
    Clipboard clipboard = new Clipboard(_control.getDisplay());

    final Object cuted = clipboard.getContents(TemplateTransfer.getInstance());
    if (cuted instanceof Node[] || cuted instanceof Vector) {
      return cuted;
    }
        return clipboard.getContents(TextTransfer.getInstance());
  }
View Full Code Here

   */
  public boolean isEnabled() {
    IHTMLGraphicalViewer viewer = getViewer();
    if (viewer != null && viewer.isInRangeMode()
        && viewer.getRangeSelection().isValid()) {
      Clipboard clipboard = new Clipboard(viewer.getControl()
          .getDisplay());
      return clipboard.getContents(TemplateTransfer.getInstance()) != null
          || clipboard.getContents(TextTransfer.getInstance()) != null;
    }
    return false;
  }
View Full Code Here

  /**
   * @return the clipboard
   */
  protected Clipboard getClipboard() {
    return new Clipboard(_viewer.getControl().getDisplay());
  }
View Full Code Here

    StringBuffer sb = new StringBuffer();
    for (int i = 0, size = nodes.length; i < size; i++) {
      DOMUtil.nodeToString(nodes[i], sb);
    }
    // TemplateTransfer.getInstance().setObject(result);
    Clipboard board = new Clipboard(_viewer.getControl().getDisplay());
    board.setContents(new Object[] { result, sb.toString() },
        new Transfer[] { TemplateTransfer.getInstance(),
            TextTransfer.getInstance() });
  }
View Full Code Here

    StringBuffer sb = new StringBuffer();
    for (int i = 0, size = nodes.length; i < size; i++) {
      DOMUtil.nodeToString(nodes[i], sb);
    }
    // TemplateTransfer.getInstance().setObject(result);
    Clipboard board = new Clipboard(_viewer.getControl().getDisplay());
    board.setContents(new Object[] { result, sb.toString() },
        new Transfer[] { TemplateTransfer.getInstance(),
            TextTransfer.getInstance() });
  }
View Full Code Here

    if (getSite().getId() != null
        && getSite().getId().equals(SIMULATION_ENGINE_VIEW_ID)) {
      createToolbar();
    }

    clipboard = new Clipboard(display);

    viewer.getTable().addKeyListener(new KeyListener() {

      public void keyReleased(KeyEvent e) {
View Full Code Here

     * @return
     *      the data obtained from the clipboard or null if no data of this type is available
     */
    protected Object getFromClipboard( Transfer dataType )
    {
        Clipboard clipboard = null;
        try
        {
            clipboard = new Clipboard( Display.getCurrent() );
            return clipboard.getContents( dataType );
        }
        finally
        {
            if ( clipboard != null )
                clipboard.dispose();
        }
    }
View Full Code Here

     *      the transfer agents that will convert the data to its platform specific format;
     *      each entry in the data array must have a corresponding dataType
     */
    public static void copyToClipboard( Object[] data, Transfer[] dataTypes )
    {
        Clipboard clipboard = null;
        try
        {
            clipboard = new Clipboard( Display.getCurrent() );
            clipboard.setContents( data, dataTypes );
        }
        finally
        {
            if ( clipboard != null )
                clipboard.dispose();
        }
    }
View Full Code Here

TOP

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

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.