• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DnDDragStartBean类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



DnDDragStartBean类属于com.intellij.ide.dnd包,在下文中一共展示了DnDDragStartBean类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: extractDropFile

import com.intellij.ide.dnd.DnDDragStartBean; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Nullable
private File extractDropFile(@Nonnull final DropTargetDropEvent dtde) throws Exception {
  try {
    java.util.List<File> files = null;
    final Object objectToDrop = dtde.getTransferable().getTransferData(DataFlavor.javaFileListFlavor);
    if (objectToDrop instanceof DnDDragStartBean) {
      final Object wrapper = ((DnDDragStartBean) objectToDrop).getAttachedObject();
      if (wrapper instanceof TransferableWrapper) {
        files = ((TransferableWrapper) wrapper).asFileList();
      }
    } else if (objectToDrop instanceof java.util.List) {
      files = (java.util.List<File>) objectToDrop;
    }

    return files == null || files.isEmpty() ? null : files.get(0);
  } catch (UnsupportedFlavorException ex) {
    return null;
  }
}
 
开发者ID:raydac,项目名称:netbeans-mmd-plugin,代码行数:21,代码来源:MindMapDocumentEditor.java


示例2: installDnD

import com.intellij.ide.dnd.DnDDragStartBean; //导入依赖的package包/类
private void installDnD(final int index, NavBarItem component) {
  DnDSupport.createBuilder(component).setBeanProvider(dnDActionInfo -> new DnDDragStartBean(new TransferableWrapper() {
    @Override
    public List<File> asFileList() {
      Object o = myModel.get(index);
      if (o instanceof PsiElement) {
        VirtualFile vf = o instanceof PsiDirectory ? ((PsiDirectory)o).getVirtualFile() : ((PsiElement)o).getContainingFile().getVirtualFile();
        if (vf != null) {
          return Collections.singletonList(new File(vf.getPath()).getAbsoluteFile());
        }
      }
      return Collections.emptyList();
    }

    @Override
    public TreeNode[] getTreeNodes() {
      return null;
    }

    @Override
    public PsiElement[] getPsiElements() {
      return null;
    }
  })).setDisposableParent(component).install();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:26,代码来源:NavBarPanel.java


示例3: installDnD

import com.intellij.ide.dnd.DnDDragStartBean; //导入依赖的package包/类
private void installDnD(final int index, NavBarItem component) {
  DnDSupport.createBuilder(component)
    .setBeanProvider(new Function<DnDActionInfo, DnDDragStartBean>() {
      @Override
      public DnDDragStartBean fun(DnDActionInfo dnDActionInfo) {
        return new DnDDragStartBean(new TransferableWrapper() {
          @Override
          public List<File> asFileList() {
            final Object o = myModel.get(index);
            if (o instanceof PsiElement) {
              final VirtualFile vf =  o instanceof PsiDirectory ? ((PsiDirectory)o).getVirtualFile()
                                                                : ((PsiElement)o).getContainingFile().getVirtualFile();
              if (vf != null) {
                return Arrays.asList(new File(vf.getPath()).getAbsoluteFile());
              }
            }
            return Collections.emptyList();
          }

          @Override
          public TreeNode[] getTreeNodes() {
            return null;
          }

          @Override
          public PsiElement[] getPsiElements() {
            return null;
          }
        });
      }
    })
    .setDisposableParent(component)
    .install();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:NavBarPanel.java


示例4: startDragging

import com.intellij.ide.dnd.DnDDragStartBean; //导入依赖的package包/类
@Override
public DnDDragStartBean startDragging(DnDAction action, Point dragOrigin)
{
	int index = locationToIndex(dragOrigin);
	if(index < 0)
	{
		return null;
	}
	return myGroup.getItems()[index].startDragging();
}
 
开发者ID:consulo,项目名称:consulo-ui-designer,代码行数:11,代码来源:PaletteComponentList.java


示例5: startDragging

import com.intellij.ide.dnd.DnDDragStartBean; //导入依赖的package包/类
@Override
public DnDDragStartBean startDragging(DnDAction action, Point dragOrigin) {
  return new DnDDragStartBean(new LayoutNodesDraggingObject(myArtifactsEditor, getNodesToDrag()));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:LayoutTree.java


示例6: startDragging

import com.intellij.ide.dnd.DnDDragStartBean; //导入依赖的package包/类
@Override
public DnDDragStartBean startDragging(DnDAction action, Point dragOrigin) {
  List<PackagingSourceItem> items = getSelectedItems();
  return new DnDDragStartBean(new SourceItemsDraggingObject(items.toArray(new PackagingSourceItem[items.size()])));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:SourceItemsTree.java


示例7: startDragging

import com.intellij.ide.dnd.DnDDragStartBean; //导入依赖的package包/类
@Override
public DnDDragStartBean startDragging(final DnDAction action, final Point dragOrigin) {
  return new DnDDragStartBean(getNodesToDrag());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:XDebuggerTreePanel.java


示例8: startDragging

import com.intellij.ide.dnd.DnDDragStartBean; //导入依赖的package包/类
@Nullable public DnDDragStartBean startDragging() {
  if (isAnyComponent()) return null;
  return new DnDDragStartBean(this);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ComponentItem.java


示例9: startDragging

import com.intellij.ide.dnd.DnDDragStartBean; //导入依赖的package包/类
public DnDDragStartBean startDragging(final DnDAction action, final Point dragOrigin) {
  return new DnDDragStartBean(getNodesToDrag());
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:4,代码来源:XDebuggerTreePanel.java


示例10: startDragging

import com.intellij.ide.dnd.DnDDragStartBean; //导入依赖的package包/类
public DnDDragStartBean startDragging(DnDAction action, Point dragOrigin)
{
	return new DnDDragStartBean(new MyDragBean(myIsRow, getSelectedCells(dragOrigin)));
}
 
开发者ID:consulo,项目名称:consulo-ui-designer,代码行数:5,代码来源:GridCaptionPanel.java


示例11: startDragging

import com.intellij.ide.dnd.DnDDragStartBean; //导入依赖的package包/类
/**
 * Processes dragging the item.
 *
 * @return the drag start bean for the drag process, or null if the item cannot be dragged.
 */
@Nullable DnDDragStartBean startDragging();
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:PaletteItem.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ResponsiveUIActivity类代码示例发布时间:2022-05-22
下一篇:
Java GoppaCode类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap