public static Collection<DBPNamedObject> getFromClipboard() {
   Clipboard clipboard = new Clipboard(Display.getDefault());
   try {
     return (Collection<DBPNamedObject>)
         clipboard.getContents(DatabaseObjectTransfer.getInstance());
   } finally {
     clipboard.dispose();
   }
 }
/** Used to move DBSObject around in a database navigator. */
public final class DatabaseObjectTransfer extends LocalObjectTransfer<Collection<DBPNamedObject>> {

  private static final DatabaseObjectTransfer INSTANCE = new DatabaseObjectTransfer();
  private static final String TYPE_NAME =
      "DBSObject Transfer" //$NON-NLS-1$
          + System.currentTimeMillis()
          + ":"
          + INSTANCE.hashCode(); // $NON-NLS-1$
  private static final int TYPEID = registerType(TYPE_NAME);

  /**
   * Returns the singleton instance.
   *
   * @return The singleton instance
   */
  public static DatabaseObjectTransfer getInstance() {
    return INSTANCE;
  }

  private DatabaseObjectTransfer() {}

  /** @see org.eclipse.swt.dnd.Transfer#getTypeIds() */
  @Override
  protected int[] getTypeIds() {
    return new int[] {TYPEID};
  }

  /** @see org.eclipse.swt.dnd.Transfer#getTypeNames() */
  @Override
  protected String[] getTypeNames() {
    return new String[] {TYPE_NAME};
  }

  public static Collection<DBPNamedObject> getFromClipboard() {
    Clipboard clipboard = new Clipboard(Display.getDefault());
    try {
      return (Collection<DBPNamedObject>)
          clipboard.getContents(DatabaseObjectTransfer.getInstance());
    } finally {
      clipboard.dispose();
    }
  }
}