Skip to main content



      Home
Home » Newcomers » Newcomers » Do I need ResourceTransfer class? If so, where is it in Eclipse vrs 3.2.0?
Do I need ResourceTransfer class? If so, where is it in Eclipse vrs 3.2.0? [message #163677] Thu, 03 August 2006 08:14 Go to next message
Eclipse UserFriend
Originally posted by: developerj2.yahoo.gr

Hello,

I am a new user of Eclipse vrs 3.2.0 and I am trying to implement a Drag &
Drop functionality between two trees, where each tree is in a different
view. The elements of my tree are custom objects (of class Node, which is an
implementation of IAdaptable). I have read all about TreeViewer,
ContentProvider, and domain objects and how they work together. What I am
trying to do is quite similar to what has been posted to a thread in the
past, http://dev.eclipse.org/newslists/news.eclipse.tools/msg31775 .html

I am not sure if I should implement ByteArrayTransfer for the transfer of
the Nodes (leaf Nodes), or if it's possible to just use ResourceTransfer to
do the job. Here is the code for my custom Transfer class, which doesn't
really do anything because I didn't implement javaToNative and nativeToJava,
as I am not sure if it's possible to map the data I am converting to a
byte[],:

public class NodeTransfer extends ByteArrayTransfer {


private static final String MYTYPENAME = "my_type_name";

private static final int MYTYPEID = registerType(MYTYPENAME);

private static NodeTransfer _instance = new NodeTransfer();


private NodeTransfer() {}


public static NodeTransfer getInstance () {

return _instance;

}


@Override

protected int[] getTypeIds() {

// TODO Auto-generated method stub

return null;

}


@Override

protected String[] getTypeNames() {

// TODO Auto-generated method stub

return null;

}




}



here is my Node class:



public class Node implements IAdaptable {

private String name;

private ParentNode parent;

.........

}




The question is can I use the ResourceTransfer class to do the job, i.e.

viewer.addDragSupport(operations, new Transfer[] {
ResourceTransfer.getInstance() }, new DragSourceListener() {...

If so, where is the ResourceTransfer class? It seems that it's not at
org.eclipse.ui.part in my IDE, and when I hit Ctrl+Space on the
ResourceTransfer, Eclipse won't find it anything at all for this class!
Re: Do I need ResourceTransfer class? If so, where is it in Eclipse vrs 3.2.0? [message #163685 is a reply to message #163677] Thu, 03 August 2006 08:23 Go to previous message
Eclipse UserFriend
Originally posted by: developerj2.yahoo.gr

Thank in advance for your help!

"Hector K." <developerj2@yahoo.gr> wrote in message
news:easpbt$d08$1@utils.eclipse.org...
> Hello,
>
> I am a new user of Eclipse vrs 3.2.0 and I am trying to implement a Drag &
> Drop functionality between two trees, where each tree is in a different
> view. The elements of my tree are custom objects (of class Node, which is
> an implementation of IAdaptable). I have read all about TreeViewer,
> ContentProvider, and domain objects and how they work together. What I am
> trying to do is quite similar to what has been posted to a thread in the
> past, http://dev.eclipse.org/newslists/news.eclipse.tools/msg31775 .html
>
> I am not sure if I should implement ByteArrayTransfer for the transfer of
> the Nodes (leaf Nodes), or if it's possible to just use ResourceTransfer
> to do the job. Here is the code for my custom Transfer class, which
> doesn't really do anything because I didn't implement javaToNative and
> nativeToJava, as I am not sure if it's possible to map the data I am
> converting to a byte[],:
>
> public class NodeTransfer extends ByteArrayTransfer {
>
>
> private static final String MYTYPENAME = "my_type_name";
>
> private static final int MYTYPEID = registerType(MYTYPENAME);
>
> private static NodeTransfer _instance = new NodeTransfer();
>
>
> private NodeTransfer() {}
>
>
> public static NodeTransfer getInstance () {
>
> return _instance;
>
> }
>
>
> @Override
>
> protected int[] getTypeIds() {
>
> // TODO Auto-generated method stub
>
> return null;
>
> }
>
>
> @Override
>
> protected String[] getTypeNames() {
>
> // TODO Auto-generated method stub
>
> return null;
>
> }
>
>
>
>
> }
>
>
>
> here is my Node class:
>
>
>
> public class Node implements IAdaptable {
>
> private String name;
>
> private ParentNode parent;
>
> ........
>
> }
>
>
>
>
> The question is can I use the ResourceTransfer class to do the job, i.e.
>
> viewer.addDragSupport(operations, new Transfer[] {
> ResourceTransfer.getInstance() }, new DragSourceListener() {...
>
> If so, where is the ResourceTransfer class? It seems that it's not at
> org.eclipse.ui.part in my IDE, and when I hit Ctrl+Space on the
> ResourceTransfer, Eclipse won't find it anything at all for this class!
>
>
Previous Topic:Editor Usage
Next Topic:Re: Eclipes deleted my files. HELP!!!
Goto Forum:
  


Current Time: Sun Jul 27 01:47:18 EDT 2025

Powered by FUDForum. Page generated in 0.40969 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top