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

x33g5p2x  于2022-01-25 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(78)

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

NodeTransfer.findPaste介绍

[英]Find an intelligent source of paste types in a transferable. Note that AbstractNode#createPasteTypes looks for this by default, so cut/copied nodes may specify how they may be pasted to some external node target.
[中]在一个可转移的应用程序中查找粘贴类型的智能源。请注意,AbstractNode#createPasteTypes在默认情况下会查找此选项,因此剪切/复制的节点可能会指定如何将它们粘贴到某个外部节点目标。

代码示例

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

/** Accumulate the paste types that this node can handle
* for a given transferable.
* <P>
* The default implementation simply tests whether the transferable supports
* intelligent pasting via {@link NodeTransfer#findPaste}, and if so, it obtains the paste types
* from the {@link NodeTransfer.Paste transfer data} and inserts them into the set.
* <p>Subclass implementations should typically call super (first or last) so that they
* add to, rather than replace, a superclass's available paste types; especially as the
* default implementation in <code>AbstractNode</code> is generally desirable to retain.
*
* @param t a transferable containing clipboard data
* @param s a list of {@link PasteType}s that will have added to it all types
*    valid for this node (ordered as they will be presented to the user)
*/
protected void createPasteTypes(Transferable t, List<PasteType> s) {
  NodeTransfer.Paste p = NodeTransfer.findPaste(t);
  if (p != null) {
    // adds all its types into the set
    s.addAll(Arrays.asList(p.types(this)));
  }
}

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

/** Accumulate the paste types that this node can handle
* for a given transferable.
* <P>
* The default implementation simply tests whether the transferable supports
* intelligent pasting via {@link NodeTransfer#findPaste}, and if so, it obtains the paste types
* from the {@link NodeTransfer.Paste transfer data} and inserts them into the set.
* <p>Subclass implementations should typically call super (first or last) so that they
* add to, rather than replace, a superclass's available paste types; especially as the
* default implementation in <code>AbstractNode</code> is generally desirable to retain.
*
* @param t a transferable containing clipboard data
* @param s a list of {@link PasteType}s that will have added to it all types
*    valid for this node (ordered as they will be presented to the user)
*/
protected void createPasteTypes (Transferable t, List s) {
  NodeTransfer.Paste p = NodeTransfer.findPaste (t);
  if (p != null) {
    // adds all its types into the set
    s.addAll (Arrays.asList (p.types (this)));
  }
}

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

/** Accumulate the paste types that this node can handle
* for a given transferable.
* <P>
* The default implementation simply tests whether the transferable supports
* intelligent pasting via {@link NodeTransfer#findPaste}, and if so, it obtains the paste types
* from the {@link NodeTransfer.Paste transfer data} and inserts them into the set.
* <p>Subclass implementations should typically call super (first or last) so that they
* add to, rather than replace, a superclass's available paste types; especially as the
* default implementation in <code>AbstractNode</code> is generally desirable to retain.
*
* @param t a transferable containing clipboard data
* @param s a list of {@link PasteType}s that will have added to it all types
*    valid for this node (ordered as they will be presented to the user)
*/
protected void createPasteTypes (Transferable t, List s) {
  NodeTransfer.Paste p = NodeTransfer.findPaste (t);
  if (p != null) {
    // adds all its types into the set
    s.addAll (Arrays.asList (p.types (this)));
  }
}

相关文章