Package org.eclipse.swt.dnd

Examples of org.eclipse.swt.dnd.Clipboard


     *      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


     * @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

     * @param text
     *      the Text to copy
     */
    protected void copyToClipboard( String text )
    {
        Clipboard clipboard = null;
        try
        {
            clipboard = new Clipboard( Display.getCurrent() );
            clipboard.setContents( new Object[]
                { text }, new Transfer[]
                { TextTransfer.getInstance() } );
        }
        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

    PrintWriter pw = new PrintWriter(sw, false);
    if (selected != null) {
      appendTreeItemText(pw, selected, 0);
    }
    pw.close();
    Clipboard cb = new Clipboard(tree.getDisplay());

    final Object[] cbText = new Object[] {sw.toString()};
    final Transfer[] cbFormat = new Transfer[] {TextTransfer.getInstance()};
    cb.setContents(cbText, cbFormat);
  }
View Full Code Here

    fContentProvider = new ProvenanceContentProvider.HierarchicalViewContentProvider();
    fViewer.setContentProvider(fContentProvider);
    fViewer.setLabelProvider((IBaseLabelProvider) new DLTreeLabelProvider());
    //viewer.setSorter(new NameSorter());
    fViewer.setInput(getViewSite());
    fClipboard = new Clipboard(parent.getDisplay());

    makeActions();
    hookContextMenu();
    hookViewerEvents();
   
View Full Code Here

   * This is a callback that will allow us
   * to create the viewer and initialize it.
   */
  public void createPartControl(Composite parent) {
   
    fClipboard= new Clipboard(parent.getDisplay());
   
    viewer = new LocationViewer(parent);
    viewer.setContentProvider(new ViewContentProvider());
    viewer.setLabelProvider(new ViewLabelProvider());
    viewer.setSorter(new ColumnBasedSorter(2));
View Full Code Here

    /**
     * This is a callback that will allow us to create the viewer and initialize
     * it.
     */
    public void createPartControl(Composite parent) {
        fClipboard = new Clipboard(parent.getDisplay());
        // viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL |
        // SWT.V_SCROLL);
        viewer = new LocationViewer(parent);
        viewer.setContentProvider(new ViewContentProvider());
        viewer.setLabelProvider(new ViewLabelProvider());
View Full Code Here

  public void dispose() { menu.dispose(); }
 
  protected void putClipBroard(String text) {
    if(text == null || text.isEmpty()) return;
    Clipboard cb = new Clipboard(menu.getDisplay());
    TextTransfer textTransfer = TextTransfer.getInstance();
    cb.setContents(new Object[]{text}, new Transfer[]{textTransfer});
  }
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.