jmri.util.datatransfer
Class RosterEntrySelection

Show UML class diagram
java.lang.Object
  extended by jmri.util.datatransfer.RosterEntrySelection
All Implemented Interfaces:
ClipboardOwner, Transferable

public class RosterEntrySelection
extends Object
implements Transferable, ClipboardOwner

Transfer roster entries either via drag-and-drop or via the clipboard.

Note that roster entries can only be transfered within a single JVM instance, and cannot be shared between programs via this mechanism.


This file is part of JMRI.

JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.

JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.


Field Summary
(package private) static DataFlavor[] flavors
           
(package private) static org.slf4j.Logger log
           
static DataFlavor rosterEntryFlavor
           
 
Constructor Summary
RosterEntrySelection(ArrayList<String> rosterEntries)
          Create the transferable.
 
Method Summary
static RosterEntrySelection createRosterEntrySelection(ArrayList<RosterEntry> rosterEntries)
          Create a transferable with a list of RosterEntries.
static ArrayList<RosterEntry> getRosterEntries(Transferable t)
          Get an ArrayList of RosterEntries from a RosterEntrySelection.
 Object getTransferData(DataFlavor df)
           
 DataFlavor[] getTransferDataFlavors()
           
 boolean isDataFlavorSupported(DataFlavor df)
           
 void lostOwnership(Clipboard clpbrd, Transferable t)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rosterEntryFlavor

public static final DataFlavor rosterEntryFlavor

flavors

static final DataFlavor[] flavors

log

static org.slf4j.Logger log
Constructor Detail

RosterEntrySelection

public RosterEntrySelection(ArrayList<String> rosterEntries)
Create the transferable.

Takes as a parameter an ArrayList containing Strings representing RosterEntry Ids.

Parameters:
rosterEntries - - an ArrayList of RosterEntry Ids
Method Detail

createRosterEntrySelection

public static RosterEntrySelection createRosterEntrySelection(ArrayList<RosterEntry> rosterEntries)
Create a transferable with a list of RosterEntries.

Parameters:
rosterEntries - - an ArrayList of RosterEntries

getTransferDataFlavors

public DataFlavor[] getTransferDataFlavors()
Specified by:
getTransferDataFlavors in interface Transferable

isDataFlavorSupported

public boolean isDataFlavorSupported(DataFlavor df)
Specified by:
isDataFlavorSupported in interface Transferable

getTransferData

public Object getTransferData(DataFlavor df)
                       throws UnsupportedFlavorException,
                              IOException
Specified by:
getTransferData in interface Transferable
Throws:
UnsupportedFlavorException
IOException

lostOwnership

public void lostOwnership(Clipboard clpbrd,
                          Transferable t)
Specified by:
lostOwnership in interface ClipboardOwner

getRosterEntries

public static ArrayList<RosterEntry> getRosterEntries(Transferable t)
                                               throws UnsupportedFlavorException,
                                                      IOException
Get an ArrayList of RosterEntries from a RosterEntrySelection.

Parameters:
t - - a Transferable object. This should be a RosterEntrySelection, but for simplicity, will accept any Transferable object.
Throws:
UnsupportedFlavorException
IOException


Copyright © 1997-2013 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads