本文整理汇总了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;
}
}
示例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();
}
示例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();
}
示例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();
}
示例5: startDragging
import com.intellij.ide.dnd.DnDDragStartBean; //导入依赖的package包/类
@Override
public DnDDragStartBean startDragging(DnDAction action, Point dragOrigin) {
return new DnDDragStartBean(new LayoutNodesDraggingObject(myArtifactsEditor, getNodesToDrag()));
}
示例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()])));
}
示例7: startDragging
import com.intellij.ide.dnd.DnDDragStartBean; //导入依赖的package包/类
@Override
public DnDDragStartBean startDragging(final DnDAction action, final Point dragOrigin) {
return new DnDDragStartBean(getNodesToDrag());
}
示例8: startDragging
import com.intellij.ide.dnd.DnDDragStartBean; //导入依赖的package包/类
@Nullable public DnDDragStartBean startDragging() {
if (isAnyComponent()) return null;
return new DnDDragStartBean(this);
}
示例9: startDragging
import com.intellij.ide.dnd.DnDDragStartBean; //导入依赖的package包/类
public DnDDragStartBean startDragging(final DnDAction action, final Point dragOrigin) {
return new DnDDragStartBean(getNodesToDrag());
}
示例10: startDragging
import com.intellij.ide.dnd.DnDDragStartBean; //导入依赖的package包/类
public DnDDragStartBean startDragging(DnDAction action, Point dragOrigin)
{
return new DnDDragStartBean(new MyDragBean(myIsRow, getSelectedCells(dragOrigin)));
}
示例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();