Drag and Drop: Moving or Copying when droping the item ?

Hello,
I'm trying to use the drag and drop feature on a JTree. The problem is that depending on wether I'm moving or copying an item, I need to do something different when I'm dropping my item (I have some database id to generate if I'm copying). The only problem is that in the importData method of the TransferHandler Class, I do not have the information of wether I'm moving or copying my item.
I would need something like :
public boolean importData(JComponent component, Transferable t, int action);And I only have:
public boolean importData(JComponent component, Transferable t);Am I misunderstanding something with the drag and drop mechanism ?
Is there a solution to get this "action" information ?
I tried to subclass the DropTargetListener class of the TransferHandler, but I couldn't because of private attribute.
Does anybody has a clue ?

Hello,
I'm trying to use the drag and drop feature on a JTree. The problem is that depending on wether I'm moving or copying an item, I need to do something different when I'm dropping my item (I have some database id to generate if I'm copying). The only problem is that in the importData method of the TransferHandler Class, I do not have the information of wether I'm moving or copying my item.
I would need something like :
public boolean importData(JComponent component, Transferable t, int action);And I only have:
public boolean importData(JComponent component, Transferable t);Am I misunderstanding something with the drag and drop mechanism ?
Is there a solution to get this "action" information ?
I tried to subclass the DropTargetListener class of the TransferHandler, but I couldn't because of private attribute.
Does anybody has a clue ?

Similar Messages

  • Drag and drop not working.  When trying to move a cell or icon the shadow of the cell or icon being moved appears under the cursor but can't be released causing a freeze of function within the program.  Happens in finder numbers and firefox

    Drag and drop not working.  When trying to move a cell or icon the shadow of the cell or icon being moved appears under the cursor but can't be released causing a freeze of function within the program.  Happens in finder numbers, firefox, and when trying to move any file from the downloads folder.
    This is a serious pain.
    Please help.
    WB

    Yes, all I can tell you is that Finder does not have that function in ML. Your system is "working as expected".
    You can file feedback here.

  • Hi - I keep receiving the following error message on a song I purchased from itunes and am now trying to drag and drop to my iPad: "you must download items from icloud before you can copy then to iPad" what does this mean - please help! Thank you

    Hi - I keep receiving the following error message on a song I purchased from itunes and am now trying to drag and drop to my iPad: "you must download items from icloud before you can copy then to iPad" what does this mean - please help! Thank you

    Hi Poonam26c,
    If you do not have a local copy of a song which you have purchased (i.e. it is available via iTunes in the Cloud), you may need to redownload it before you can transfer it to your device. You may find the following article helpful:
    Apple Support: Downloading past purchases from the iTunes Store, App Store, and iBooks Store
    http://support.apple.com/kb/HT2519
    Regards,
    - Brenden

  • Drag and Drop - Incomplete Wireless Copying of Files

    Ever since I upgraded to 10.6.4, I have a problem doing the "drag and drop" method of copying files wirelessly from my Mac to the HP MediaSmart server connected to my Apple AirPort N Base station.
    I used to be able to simply copy files without problems from my FireWire CF card reader to the server fast and with no problems. After the upgrade, the wireless copying has become slow and the transfer is incomplete. For example today I tried to drag and drop 97 photo files and it only copied 30 of those files in random order. So I repeat the process over and over again (without replacing the already copied files) until all 97 files are copied. If I re-copy everything from scratch by over-writing existing copied files, it will only successfully copy a few files again.
    If I copy direct from the card reader to the hard drive in my computer, the copying is lightning fast and with no problem.
    If I copy from the computer hard drive to the server connected to the AirPort, the same inconsistent copying occurs.
    So it's somewhere in the wireless link that has a problem.
    The solution is to use the "Image Capture" app so that it will successfully copy all files from the card reader to the server. But as I mentioned the process is slow.
    I have installed the latest Apple updates at the time they come out. I am at 10.6.5 and have the latest AirPort update that was recently released. I still have the same problem.
    Anyone know about this problem? How do I report issues like this directly to Apple?
    Thanks for any assistance and feedback.

    I am having the same problem. I just bought a USB Hard-drive and was copying a 2.7 M folder from one HD to the USB and it leaves out like 15 files. I tried copying to the desktop and it does the same thing. I can open the folder, cmd-A, cmd-c, then paste and it took all the files. Very strange.

  • When I try to drag and drop to combine events in iPhoto, the drag accelerates out of control when it reaches the top or bottom of the screen. How can I slow it down?

    When I try to drag and drop to combine events in iPhoto, the drag accelerates out of control when it reaches the top or bottom of the screen. How can I slow it down?

    from iphoto  Help
    Album overview
    A photo album in iPhoto is just like one you would create with printed photos: It’s a collection of photos you select from your library and arrange in the order you want.
    You can create photo albums to:
    Focus on a particular subject, such as your favorite nature photos
    Group pictures that you want to send to a friend, post on a webpage, or burn to a CD or DVD
    Gather a decade of anniversary photos
    iPhoto has two kinds of photo albums:
    Standard photo albums: You create these albums (B, shown below) by selecting particular photos. You can add new photos by dragging them to the album (or using the Add To button), and you can remove photos at any time. All adding and removing is done manually; iPhoto doesn’t update standard albums automatically as you import new photos.
    Smart Albums: iPhoto creates these albums for you, based on criteria your specify. iPhoto then updates Smart Albums (A, shown above) for you as your library changes. For example, you could create a Smart Album containing:
    Photos of specific people, such as your family members. As you import new photos, iPhoto uses Faces to detect your family members, and automatically adds new photos of them to the Smart Album (after you’ve confirmed the matches in Faces).
    All the photos of your daughter taken on school field trips in third grade. Use Faces (to name your daughter) and keywords (to mark certain photos or events as “field trips”) to help specify the photos you want iPhoto to place in that Smart Album.
    Only photos taken with a specific camera, or photos matching other Exchangeable Image File (EXIF) information.
    You can make as many albums as you like, and you can include the same photo in several albums without making multiple copies of it.
    After you create an album, such as “Australia Adventures,” it appears in your Source list below Albums.
    In full-screen view, the album appears as a stack of photos below Albums.
    To further organize your library, you can group several albums (along with slideshows and projects) into a folder. For example, you could create a folder containing several years of birthday albums or a collection of albums with photos of your camping trips.
    To create a folder, see “Create a folder in the Source list and move items into it” in “Customize the Source list”.
    Folders appear only in the Source list, not in full-screen view.
    Note: A photo album is different from a photo book, which is a collection of photos you create to get professionally printed and bound. See this topic: Photo book overview.
    Copyright © 2014 Apple Inc. All rights reserved.
    LN

  • How do I drag and drop files between computers when using Home Sharing in ITunes?

    How can I drag music files between computers while using Home Sharing? An older version of ITunes had a Home Sharing icon in the column browser near the playlist so it was easy to drag and drop.

    Hello cacalenni,
    Thanks for using the Apple Support Communities. I understand that you wish to learn how to import songs using Home Sharing in the new iTunes. The following resource should assist you in doing so:
    iTunes 12 for Mac: Use Home Sharing to import items from another iTunes library
    http://support.apple.com/kb/PH19614
    Cheers,
    Matt M.

  • Can you drag and drop programs from 1 computer to the other??

    I have finalcut studio on my dual gig g4 but now I want to work off my laptop and sell the dual gig g4. Only problem is that I have my finalcut studio disks buried in a big stack of boxes in preparation for a move. Is there a way I can transfer the programs to my laptop without haveing to dig in all these boxes for the install disks?
    Thanks

    You do not want to drag and drop - it does copy the program, sure. But it does not bring over over ALL the necessary components and frameworks needed to run. So it no worky.
    Solution - clone off the whole OS, programs, et al to an ext fw drive and boot off that.
    You'll want a pcmcia adapter to give you 2 buses so that one fw disc can hold the media and the other fw disc to hook into the built in bus.
    For the OS fw disc you'll find that using the fw 400 port is fine.

  • Cannot drag and drop in my playlist to rearrange the song order???

    I have created a playlist in my iTunes 10 and all I want to do is change the order up a bit, so that all the same artists are not lumped together.  Help says I should be able to just drag and drop to reorder my songs in the play list.  However, it won't let me do it.  What am I missing?

    By re-arranging the windows, this appears to work.
    i.e. left window to right window.

  • I am using garage band for the first time.  I dragged and dropped a song from itunes into the program and I want to extend the length of the song by repeating the first 28 measures.  I can't figure it out.  Please help

    I am using garage band for the first time.  I dragged and dropped a song from itunes into the program and I want to extend the length of the song by repeating the first 28 measures.  I can't figure it out.  Please help.  I have spent several hours trying to figure it out on my own but have not been successful.  It seems like an easy task.  Can anyone help?

    dewin1or wrote:
    I want to extend the length of the song by repeating the first 28 measures.
    split the region at the 28th measure
    http://www.bulletsandbones.com/GB/GBFAQ.html#split
    (Let the page FULLY load. The link to your answer is at the top of your screen)
    then select only the first region and option-drag it to the end of the song

  • Drag and drop feature stopped working when updated to Aurora 18.0a2. What is the problem?

    Cannot drag and drop letters on Words With Friends on Facebook, or Yahoo Fantasy Football.

    biggsbdavis:
    Try disabling and then re-enabling the Helvetica font. Sometimes that's all it takes.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.

  • The drag and drop feature is not working on the touchpad

    My drag and drop stopped working on my macbook pro, the model number is the
    MB 13.3/2.4/2X1GB/250/SD/BL-KB-USA
    MB467LL/A
    The systems is runnng Snow Leapard, I have in the preferences, drag lock disabled, dragging enabled, the operating system is 10.6.8.
    I also reloaded the system disk, same issue.
    Any help would be appreciated.
    Thanks,
    Tom

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Start up in safe mode and log in to the account with the problem. You must hold down the shift key twice: once when you turn on the computer, and again when you log in.
    Note: If FileVault is enabled, or if a firmware password is set, or if the startup volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to start up and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal startup may also be somewhat slow.
    The login screen appears even if you usually login automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, restart as usual (not in safe mode) and verify that you still have the problem. Post the results of the test.

  • Drag and Drop error - icons are stuck to the cursor

    For the last few days when I try to use drag and drop, the items stick to the cursor and cannot be dislodged without a force quit or a reboot. That is they drag, but they do not drop. This is really sub-optimal.
    Has this happened to anyone else? How do I fix it?

    Idiot question - How do I re-install Leopard? No matter what I do, it kicks the disk out on restart. I have tried using the 'install' command on the disk, nothing. It kicks the disk out and boots from the hard drive. I have tried rebooting holding down the 'c' key to force it to read from the drive, it still kicks the disk out and boots from the hard drive. What else should I do?
    I researched back further and found another thread where people were complaining of the same drag and drop issue: http://discussions.apple.com/thread.jspa?messageID=6446208
    Someone suggested a solution involving permissions. I fixed my permissions. Drag and drop is still not working.
    There was also a set of commands to type into terminal that would supposedly fix the issue, or perhaps it was a Spotlight issue that the thread had morphed into. I did that. Drag and drop is still not working.
    Am I just totally hosed? Help!

  • BUG - Drag and drop an image, only working at the 2nd try

    I use the last version of JDeveloper : 11g R1 : 11.1.1.2.0
    I try to drag and drop an image in a facet of a panelsplitter.
    Once the page is loaded, the first time I try to drag the image, it does not work : the image does not follow the mouse.
    When I try to drag the image again, then it works : the image follow the mouse
    So I don't think it's related to the destination/target.
    I feel it's so simple, since it just requires to add <af:componentDragSource/> inside <af:image/>
    that if it does not work, it can only be a bug in the functionality offered by ADF ...
    Or maybe there is something wrong with the generation of the page ?
    I get this message in blue in the "running log of WebLogic" :
    <FormRenderer><setupEncodingContext> Multiple forms detected on viewId: /myPage.jspx. Rich client currently has some limitations in dealing with multiple forms.
    Please note that I use jsp:include inside f:subview to include fragments (.jsff) so that the source and the destination are not in the same file, the source in a .jsff while the destination is on the main .jspx
    The code related to the drag and drop :
    <af:form id="form">
    <af:panelSplitter orientation="vertical" splitterPosition="70" id="psHeader" clientComponent="true">
    <af:panelAccordion id="paPref" discloseNone="true" styleClass="fullSize">
    <af:showDetailItem id="sdiTemp" text="Templates">
    <af:panelBox>
    <af:panelGroupLayout id="pglTemp" layout="scroll">
    <af:panelList id="plTemp" rows="2">
    <af:image id="imTemp2up" source="/images/anImage.jpg" inlineStyle="" shortDesc="...">
    <af:componentDragSource/>
    </af:image>
    <f:facet name="second">
    <af:dropTarget dropListener="#{dropHandler.handleComponentMove}" actions="MOVE">
    <af:dataFlavor flavorClass="javax.faces.component.UIComponent"/>
    </af:dropTarget>
    Any idea ?
    Thanks in advance,
    JP

    Hi,
    no bug that I can detect here as it works for me with the same setup. How likely is it that the image is too small so that you don't grab it probably the first time?
    Frank

  • Unable to drag and drop mp4 movies into itunes but the file will import and play using home sharing

    Strange problem with my brothers MacBook.
    The movie files were converted to mp4 format ready to be played on an iphone and I imported them into my iTunes on an iMac with no problems.
    Files were also saved onto a flash drive which I passed on to my brother.
    My brother was unable to import files by drag and drop and also by "add to library", we even copied and pasted files from the flash drive to the desktop but that also didn't work.
    Using "home sharing the movies imported and played with no problems.
    Any ideas why this is happening?

    This appears to be a long-standing bug:
    https://bugzilla.mozilla.org/show_bug.cgi?id=634720
    and the accepted workaround is stated in comment 11.
    Oddly, it's possible to do the reverse, i.e. drag multiple eml files from Explorer to a TB folder.

  • Images from my i-pad, stored in i-photo, will randomly refuse a drag and drop attempt. I can move the image to the desktop, and from there to the document (mail etc.) and it will work (display image). As I mentioned, these events are random. ....Help !

    When executing a drag and drop from i-photo to a document, occasional, random, images will refuse  drop onto the document. The work around is to drag the offending image to the desk top, and from there to the document.
    Question:  What is causing these random "rebel" images to misbehave ?

    It is better to use export or to use the media browser form the target program
    See this user tip for details on accessing your photos
    LN

Maybe you are looking for

  • Alternate Sequences in Routing?

    Dear Guru's, In our production process some of the operation we will perform externally by sending it to vendor. For this we are maintaining the alternate sequences in routing. So, when ever we want send the material to vendor to perform the external

  • Cannot download iTunes update 11.3.1. Currently @ 11.3.0.54

    I cannot update iTunes to 11.3.1 from 11.3.0.54 on Windows 8.1 machines.  Nothing happens when I click Download iTunes button.

  • Scripting problem replacing layer contents.

    This is a follow up to the discussion in this thread http://forums.adobe.com/thread/480444?tstart=0. I've virtually completed the script, I attached it as a .txt file rather than .jsx , In a brief nutshell it does the following: Gets a text file name

  • Tips for communicating with managers/executives/non-IT VIPs?

    I came across this article about hackers able to scan for Sprint cellular spectrum use and get the IP address of Chrysler cars with the Uconnect system. This then allows them remotely to rewrite the code and gain full control over the vehicle.http://

  • Execute SAP transaction from Outlook

    Hi, I want to know whether it is possible to open SAP transaction from out look or not. My scenario is when work item triggers from WF to Outlook, which carry a link to open SAP transaction directly from outlook. If it is possibli plz explain me in d