/** {@inheritDoc} */
 public void dragEnter(DropTargetDragEvent evt) {
   target = (JComponent) evt.getDropTargetContext().getComponent();
   TransferHandler th = target.getTransferHandler();
   canImport = th.canImport(target, evt.getCurrentDataFlavors());
   if (canImport) {
     saveComponentState(target);
     lastPosition = evt.getLocation();
   }
 }
예제 #2
0
    @Override
    public boolean canImport(TransferSupport support) {
      if (support.isDrop() && !mDropEnabled) return false;

      if (support.getComponent() == mTextArea && mTextHandler.canImport(support)) return true;

      for (DataFlavor flavor : support.getDataFlavors()) {
        if (flavor.isFlavorJavaFileListType()) {
          return true;
        }
      }

      return false;
    }
 @Override
 public boolean canImport(TransferSupport support) {
   for (TransferHandler handler : handlers) if (handler.canImport(support)) return true;
   return false;
 }