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

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

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

Node.internalLookup介绍

[英]Method that gives access to internal lookup.
[中]方法,该方法允许访问内部查找。

代码示例

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

  1. /** Get a cookie for this node.
  2. * <P>
  3. * The set of cookies can change. If a node changes its set of
  4. * cookies, it fires a property change event with {@link #PROP_COOKIE}.
  5. * <P>
  6. * If the Node was constructed with a <code>Lookup</code> in constructor
  7. * than this method delegates to the provided lookup object.
  8. *
  9. * @param type the representation class of the cookie
  10. * @return a cookie assignable to that class, or <code>null</code> if this node has no such cookie
  11. * @see Lookup
  12. */
  13. public <T extends Node.Cookie> T getCookie(Class<T> type) {
  14. Lookup l = internalLookup(true);
  15. if (l != null) {
  16. Object obj = l.lookup(type);
  17. if (Node.Cookie.class.isInstance(obj)) {
  18. return type.cast(obj);
  19. }
  20. CookieSet.enhancedQueryMode(l, type);
  21. }
  22. return null;
  23. }

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

  1. /** Obtains a Lookup representing additional content of this Node.
  2. * If the lookup was provided in a constructor, it is returned here,
  3. * if not, a lookup based on the content of <link>getCookie</link>
  4. * method is provided.
  5. *
  6. * @return lookup for this node
  7. * @since 3.11
  8. */
  9. public final Lookup getLookup() {
  10. synchronized (listeners) {
  11. Lookup l = internalLookup(true);
  12. if (l != null) {
  13. return l;
  14. }
  15. l = findDelegatingLookup();
  16. if (l != null) {
  17. return l;
  18. }
  19. // create new lookup and use it
  20. NodeLookup nl = new NodeLookup(this);
  21. registerDelegatingLookup(nl);
  22. return nl;
  23. }
  24. }

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

  1. n.listeners = new LookupEventList(internalLookup(false));
  2. } else {
  3. n.listeners = new EventListenerList();

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

  1. /** Get a cookie for this node.
  2. * <P>
  3. * The set of cookies can change. If a node changes its set of
  4. * cookies, it fires a property change event with {@link #PROP_COOKIE}.
  5. * <P>
  6. * If the Node was constructed with a <code>Lookup</code> in constructor
  7. * than this method delegates to the provided lookup object.
  8. *
  9. * @param type the representation class of the cookie
  10. * @return a cookie assignable to that class, or <code>null</code> if this node has no such cookie
  11. * @see Lookup
  12. */
  13. public Node.Cookie getCookie (Class type) {
  14. Lookup l = internalLookup (true);
  15. if (l != null) {
  16. Object o = l.lookup (type);
  17. if (o instanceof Node.Cookie) {
  18. return (Node.Cookie)o;
  19. }
  20. }
  21. return null;
  22. }

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

  1. /** Get a cookie for this node.
  2. * <P>
  3. * The set of cookies can change. If a node changes its set of
  4. * cookies, it fires a property change event with {@link #PROP_COOKIE}.
  5. * <P>
  6. * If the Node was constructed with a <code>Lookup</code> in constructor
  7. * than this method delegates to the provided lookup object.
  8. *
  9. * @param type the representation class of the cookie
  10. * @return a cookie assignable to that class, or <code>null</code> if this node has no such cookie
  11. * @see Lookup
  12. */
  13. public Node.Cookie getCookie (Class type) {
  14. Lookup l = internalLookup (true);
  15. if (l != null) {
  16. Object o = l.lookup (type);
  17. if (o instanceof Node.Cookie) {
  18. return (Node.Cookie)o;
  19. }
  20. }
  21. return null;
  22. }

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

  1. /** Obtains a Lookup represeting additional content of this Node.
  2. * If the lookup was provided in a constructor, it is returned here,
  3. * if not, a lookup based on the content of <link>getCookie</link>
  4. * method is provided.
  5. *
  6. * @return lookup for this node
  7. * @since 3.11
  8. */
  9. public final Lookup getLookup () {
  10. synchronized (listeners) {
  11. Lookup l = internalLookup (true);
  12. if (l != null) {
  13. return l;
  14. }
  15. l = findDelegatingLookup ();
  16. if (l != null) {
  17. return l;
  18. }
  19. // create new lookup and use it
  20. NodeLookup nl = new NodeLookup (this);
  21. registerDelegatingLookup (nl);
  22. return nl;
  23. }
  24. }

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

  1. /** Obtains a Lookup represeting additional content of this Node.
  2. * If the lookup was provided in a constructor, it is returned here,
  3. * if not, a lookup based on the content of <link>getCookie</link>
  4. * method is provided.
  5. *
  6. * @return lookup for this node
  7. * @since 3.11
  8. */
  9. public final Lookup getLookup () {
  10. synchronized (listeners) {
  11. Lookup l = internalLookup (true);
  12. if (l != null) {
  13. return l;
  14. }
  15. l = findDelegatingLookup ();
  16. if (l != null) {
  17. return l;
  18. }
  19. // create new lookup and use it
  20. NodeLookup nl = new NodeLookup (this);
  21. registerDelegatingLookup (nl);
  22. return nl;
  23. }
  24. }

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

  1. n.listeners = new LookupEventList (internalLookup (false));
  2. } else {
  3. n.listeners = new EventListenerList ();

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

  1. n.listeners = new LookupEventList (internalLookup (false));
  2. } else {
  3. n.listeners = new EventListenerList ();

相关文章