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

x33g5p2x  于11个月前 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(30)

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

AbstractNode.createPasteTypes介绍

[英]Accumulate the paste types that this node can handle for a given transferable.

The default implementation simply tests whether the transferable supports intelligent pasting via NodeTransfer#findPaste, and if so, it obtains the paste types from the NodeTransfer.Paste and inserts them into the set.

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 AbstractNode is generally desirable to retain.
[中]累积此节点可以为给定时间处理的粘贴类型。
默认实现只是测试transfer是否支持通过NodeTransfer#findPaste进行智能粘贴,如果支持,则从NodeTransfer获取粘贴类型。粘贴并将其插入到集合中。
子类实现通常应该调用super(first或last),以便添加而不是替换超类的可用粘贴类型;尤其是AbstractNode中的默认实现通常需要保留。

代码示例

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

/** Determine which paste operations are allowed when a given transferable is in the clipboard.
* Subclasses should override {@link #createPasteTypes}.
*
* @param t the transferable in the clipboard
* @return array of operations that are allowed
*/
public final PasteType[] getPasteTypes(Transferable t) {
  List<PasteType> s = new LinkedList<PasteType>();
  createPasteTypes(t, s);
  return s.toArray(NO_PASTE_TYPES);
}

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

/** Default implementation that tries to delegate the implementation
* to the createPasteTypes method. Simply calls the method and
* tries to take the first provided argument. Ignores the action
* argument and index.
*
* @param t the transferable
* @param action the drag'n'drop action to do DnDConstants.ACTION_MOVE, ACTION_COPY, ACTION_LINK
* @param index index between children the drop occured at or -1 if not specified
* @return null if the transferable cannot be accepted or the paste type
*    to execute when the drop occures
*/
public PasteType getDropType(Transferable t, int action, int index) {
  java.util.List<PasteType> s = new LinkedList<PasteType>();
  createPasteTypes(t, s);
  return s.isEmpty() ? null : s.get(0);
}

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

/** Determine which paste operations are allowed when a given transferable is in the clipboard.
* Subclasses should override {@link #createPasteTypes}.
*
* @param t the transferable in the clipboard
* @return array of operations that are allowed
*/
public final PasteType[] getPasteTypes (Transferable t) {
  List s = new LinkedList ();
  createPasteTypes (t, s);
  return (PasteType[])s.toArray (NO_PASTE_TYPES);
}

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

/** Determine which paste operations are allowed when a given transferable is in the clipboard.
* Subclasses should override {@link #createPasteTypes}.
*
* @param t the transferable in the clipboard
* @return array of operations that are allowed
*/
public final PasteType[] getPasteTypes (Transferable t) {
  List s = new LinkedList ();
  createPasteTypes (t, s);
  return (PasteType[])s.toArray (NO_PASTE_TYPES);
}

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

/** Default implementation that tries to delegate the implementation
* to the createPasteTypes method. Simply calls the method and 
* tries to take the first provided argument. Ignores the action
* argument and index.
*
* @param t the transferable 
* @param action the drag'n'drop action to do DnDConstants.ACTION_MOVE, ACTION_COPY, ACTION_LINK
* @param index index between children the drop occured at or -1 if not specified
* @return null if the transferable cannot be accepted or the paste type
*    to execute when the drop occures
*/
public PasteType getDropType (Transferable t, int action, int index) {
  java.util.List s = new LinkedList ();
  createPasteTypes (t, s);
  return s.isEmpty () ? null : (PasteType)s.get (0);
}

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

/** Default implementation that tries to delegate the implementation
* to the createPasteTypes method. Simply calls the method and 
* tries to take the first provided argument. Ignores the action
* argument and index.
*
* @param t the transferable 
* @param action the drag'n'drop action to do DnDConstants.ACTION_MOVE, ACTION_COPY, ACTION_LINK
* @param index index between children the drop occured at or -1 if not specified
* @return null if the transferable cannot be accepted or the paste type
*    to execute when the drop occures
*/
public PasteType getDropType (Transferable t, int action, int index) {
  java.util.List s = new LinkedList ();
  createPasteTypes (t, s);
  return s.isEmpty () ? null : (PasteType)s.get (0);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-visualweb-insync

super.createPasteTypes(t, s);
DesignContext designContext = liveBean.getDesignContext();
LiveUnit liveUnit = (LiveUnit) designContext;

相关文章

最新文章

更多