/** Determine which paste operations are allowed when a given transferable is in the clipboard. * Subclasses should override {@link #createPasteTypes}. * * @param t the transferable in the clipboard * @return array of operations that are allowed */ public final PasteType[] getPasteTypes(Transferable t) { List<PasteType> s = new LinkedList<PasteType>(); createPasteTypes(t, s); return s.toArray(NO_PASTE_TYPES); }
/** Default implementation that tries to delegate the implementation * to the createPasteTypes method. Simply calls the method and * tries to take the first provided argument. Ignores the action * argument and index. * * @param t the transferable * @param action the drag'n'drop action to do DnDConstants.ACTION_MOVE, ACTION_COPY, ACTION_LINK * @param index index between children the drop occured at or -1 if not specified * @return null if the transferable cannot be accepted or the paste type * to execute when the drop occures */ public PasteType getDropType(Transferable t, int action, int index) { java.util.List<PasteType> s = new LinkedList<PasteType>(); createPasteTypes(t, s); return s.isEmpty() ? null : s.get(0); }
/** Determine which paste operations are allowed when a given transferable is in the clipboard. * Subclasses should override {@link #createPasteTypes}. * * @param t the transferable in the clipboard * @return array of operations that are allowed */ public final PasteType[] getPasteTypes (Transferable t) { List s = new LinkedList (); createPasteTypes (t, s); return (PasteType[])s.toArray (NO_PASTE_TYPES); }
/** Determine which paste operations are allowed when a given transferable is in the clipboard. * Subclasses should override {@link #createPasteTypes}. * * @param t the transferable in the clipboard * @return array of operations that are allowed */ public final PasteType[] getPasteTypes (Transferable t) { List s = new LinkedList (); createPasteTypes (t, s); return (PasteType[])s.toArray (NO_PASTE_TYPES); }
/** Default implementation that tries to delegate the implementation * to the createPasteTypes method. Simply calls the method and * tries to take the first provided argument. Ignores the action * argument and index. * * @param t the transferable * @param action the drag'n'drop action to do DnDConstants.ACTION_MOVE, ACTION_COPY, ACTION_LINK * @param index index between children the drop occured at or -1 if not specified * @return null if the transferable cannot be accepted or the paste type * to execute when the drop occures */ public PasteType getDropType (Transferable t, int action, int index) { java.util.List s = new LinkedList (); createPasteTypes (t, s); return s.isEmpty () ? null : (PasteType)s.get (0); }
/** Default implementation that tries to delegate the implementation * to the createPasteTypes method. Simply calls the method and * tries to take the first provided argument. Ignores the action * argument and index. * * @param t the transferable * @param action the drag'n'drop action to do DnDConstants.ACTION_MOVE, ACTION_COPY, ACTION_LINK * @param index index between children the drop occured at or -1 if not specified * @return null if the transferable cannot be accepted or the paste type * to execute when the drop occures */ public PasteType getDropType (Transferable t, int action, int index) { java.util.List s = new LinkedList (); createPasteTypes (t, s); return s.isEmpty () ? null : (PasteType)s.get (0); }
super.createPasteTypes(t, s); DesignContext designContext = liveBean.getDesignContext(); LiveUnit liveUnit = (LiveUnit) designContext;