org.openide.nodes.Node.drag()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(92)

本文整理了Java中org.openide.nodes.Node.drag()方法的一些代码示例,展示了Node.drag()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.drag()方法的具体详情如下:
包路径:org.openide.nodes.Node
类名称:Node
方法名:drag

Node.drag介绍

[英]Called when a drag is started with this node. The node can attach a transfer listener to ExTransferable and will be then notified about progress of the drag (accept/reject).
[中]使用此节点开始拖动时调用。该节点可以将传输侦听器附加到ExTransferable,然后会收到有关拖动进度的通知(接受/拒绝)。

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-nodes

public Transferable drag() throws IOException {
  return original.drag();
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

public Transferable drag () throws IOException {
  return original.drag ();
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

public Transferable drag () throws IOException {
  return original.drag ();
}

代码示例来源:origin: org.netbeans.api/org-openide-explorer

/** Gets right transferable of given nodes (according to given
* drag action) and also converts the transferable.<br>
* Can be called only with correct action constant.
* @return The transferable.
*/
static Transferable getNodeTransferable(Node[] nodes, int dragAction)
throws IOException {
  Transferable[] tArray = new Transferable[nodes.length];
  for (int i = 0; i < nodes.length; i++) {
    if ((dragAction & DnDConstants.ACTION_MOVE) != 0) {
      tArray[i] = nodes[i].clipboardCut();
    } else {
      tArray[i] = nodes[i].drag ();
    }
  }
  Transferable result;
  if (tArray.length == 1) {
    // only one node, so return regular single transferable
    result = tArray[0];
  } else {
    // enclose the transferables into multi transferable
    result = ExternalDragAndDrop.maybeAddExternalFileDnd( new Multi(tArray) );
  }
  Clipboard c = getClipboard();
  if (c instanceof ExClipboard) {
    return ((ExClipboard) c).convert(result);
  } else {
    return result;
  }
}

代码示例来源:origin: org.netbeans.api/org-openide-explorer

} else {
  transferable = Node.EMPTY.drag();
  exDnD.setDraggedTransferable(transferable, false);

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

} else {
  transferable = Node.EMPTY.drag ();
  exDnD.setDraggedTransferable (transferable, false);

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

} else {
  transferable = Node.EMPTY.drag ();
  exDnD.setDraggedTransferable (transferable, false);

相关文章

微信公众号

最新文章

更多