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


Java DnDDragStartBean类代码示例

本文整理汇总了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;未经允许,请勿转载。