当前位置: 首页>>代码示例>>Java>>正文


Java FileCopyPasteUtil.isFileListFlavorSupported方法代码示例

本文整理汇总了Java中com.intellij.ide.dnd.FileCopyPasteUtil.isFileListFlavorSupported方法的典型用法代码示例。如果您正苦于以下问题:Java FileCopyPasteUtil.isFileListFlavorSupported方法的具体用法?Java FileCopyPasteUtil.isFileListFlavorSupported怎么用?Java FileCopyPasteUtil.isFileListFlavorSupported使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.ide.dnd.FileCopyPasteUtil的用法示例。


在下文中一共展示了FileCopyPasteUtil.isFileListFlavorSupported方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getProjectPath

import com.intellij.ide.dnd.FileCopyPasteUtil; //导入方法依赖的package包/类
@Nullable
private static String getProjectPath(final TransferSupport support) {
  if (!FileCopyPasteUtil.isFileListFlavorSupported(support.getDataFlavors())) return null;
  List<File> files = FileCopyPasteUtil.getFileList(support.getTransferable());
  if (files == null) return null;
  File file = ContainerUtil.getFirstItem(files);
  return file != null && isProjectFileOrDir(file) ? file.getAbsolutePath() : null;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:9,代码来源:DefaultWelcomeScreen.java

示例2: handleDrop

import com.intellij.ide.dnd.FileCopyPasteUtil; //导入方法依赖的package包/类
public void handleDrop(@NotNull final Transferable t, @Nullable final Project project, EditorWindow editorWindow) {
  if (project == null || !FileCopyPasteUtil.isFileListFlavorSupported(t)) {
    return;
  }

  final List<File> fileList = FileCopyPasteUtil.getFileList(t);
  if (fileList != null) {
    openFiles(project, fileList, editorWindow);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:11,代码来源:FileDropHandler.java

示例3: canImport

import com.intellij.ide.dnd.FileCopyPasteUtil; //导入方法依赖的package包/类
public boolean canImport(final TransferSupport support) {
  return FileCopyPasteUtil.isFileListFlavorSupported(support.getDataFlavors());
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:4,代码来源:DefaultWelcomeScreen.java

示例4: canHandleDrop

import com.intellij.ide.dnd.FileCopyPasteUtil; //导入方法依赖的package包/类
public boolean canHandleDrop(final DataFlavor[] transferFlavors) {
  return transferFlavors != null && FileCopyPasteUtil.isFileListFlavorSupported(transferFlavors);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:4,代码来源:FileDropHandler.java

示例5: update

import com.intellij.ide.dnd.FileCopyPasteUtil; //导入方法依赖的package包/类
@Override
public boolean update(DnDEvent event) {
  event.setDropPossible(false, "");

  final Object attached = event.getAttachedObject();
  final int dropAction = event.getAction().getActionId();
  final DropHandler dropHandler = getDropHandler(dropAction);
  final TreeNode[] sourceNodes = getSourceNodes(attached);
  final Point point = event.getPoint();
  final TreeNode targetNode = getTargetNode(point);

  if (targetNode == null || (dropAction & DnDConstants.ACTION_COPY_OR_MOVE) == 0) {
    return false;
  }
  else if (sourceNodes == null && !FileCopyPasteUtil.isFileListFlavorSupported(event)) {
    return false;
  }
  else if (sourceNodes != null && ArrayUtilRt.find(sourceNodes, targetNode) != -1) {
    return false;
  }
  else if (sourceNodes != null && !dropHandler.isValidSource(sourceNodes, targetNode)) {
    return false;
  }

  if (sourceNodes != null) {
    boolean redundant = true;
    for (TreeNode sourceNode : sourceNodes) {
      if (!dropHandler.isDropRedundant(sourceNode, targetNode)) {
        redundant = false;
        break;
      }
    }
    if (redundant) return false;
  }
  else {
    // it seems like it's not possible to obtain dragged items _before_ accepting _drop_ on Macs, so just skip this check
    if (!SystemInfo.isMac) {
      final PsiFileSystemItem[] psiFiles = getPsiFiles(FileCopyPasteUtil.getFileListFromAttachedObject(attached));
      if (psiFiles == null || psiFiles.length == 0) return false;
      if (!MoveHandler.isValidTarget(getPsiElement(targetNode), psiFiles)) return false;
    }
  }

  final Rectangle pathBounds = myTree.getPathBounds(myTree.getClosestPathForLocation(point.x, point.y));
  event.setHighlighting(new RelativeRectangle(myTree, pathBounds), DnDEvent.DropTargetHighlightingType.RECTANGLE);
  event.setDropPossible(true);
  return false;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:49,代码来源:ProjectViewDropTarget.java

示例6: isPasteEnabled

import com.intellij.ide.dnd.FileCopyPasteUtil; //导入方法依赖的package包/类
@Override
public boolean isPasteEnabled(@NotNull DataContext dataContext) {
  final Transferable contents = CopyPasteManager.getInstance().getContents();
  final IdeView ideView = LangDataKeys.IDE_VIEW.getData(dataContext);
  return contents != null && FileCopyPasteUtil.isFileListFlavorSupported(contents) && ideView != null;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:7,代码来源:FileListPasteProvider.java

示例7: canImport

import com.intellij.ide.dnd.FileCopyPasteUtil; //导入方法依赖的package包/类
@Override
public boolean canImport(final TransferSupport support) {
  return FileCopyPasteUtil.isFileListFlavorSupported(support.getDataFlavors());
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:5,代码来源:MavenProjectsNavigatorPanel.java


注:本文中的com.intellij.ide.dnd.FileCopyPasteUtil.isFileListFlavorSupported方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。