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

x33g5p2x  于2022-01-19 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(93)

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

FilterNode.overridesAMethod介绍

[英]Checks whether subclass overrides a method
[中]检查子类是否重写方法

代码示例

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

private boolean overridesGetDisplayName() {
  synchronized (overridesGetDisplayNameCache) {
    Boolean b = overridesGetDisplayNameCache.get(getClass());
    if (b == null) {
      b = overridesAMethod("getDisplayName"); // NOI18N
      overridesGetDisplayNameCache.put(getClass(), b);
    }
    return b;
  }
}

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

/** Overrides package private method of a node that allows us to say
 * that the lookup provided in the constructor should be replaced by
 * something else
 *
 * @param lookup
 * @return lookup or null
 */
@Override
final Lookup replaceProvidedLookup(Lookup lookup) {
  synchronized (replaceProvidedLookupCache) {
    Boolean b = replaceProvidedLookupCache.get(getClass());
    if (b == null) {
      b = !overridesAMethod("getCookie", Class.class); // NOI18N
      replaceProvidedLookupCache.put(getClass(), b);
    }
    return b ? lookup : null;
  }
}

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

@Override
public javax.swing.Action getPreferredAction() {
  javax.swing.Action retValue;
  if (overridesAMethod("getDefaultAction")) { // NOI18N
    retValue = super.getPreferredAction();
  } else {
    retValue = original.getPreferredAction();
  }
  return retValue;
}

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

@Override
public javax.swing.Action[] getActions(boolean context) {
  if (context) {
    if (!delegating(DELEGATE_GET_ACTIONS) || overridesAMethod("getContextActions")) { // NOI18N
      return super.getActions(context);
    }
  } else {
    if (!delegating(DELEGATE_GET_CONTEXT_ACTIONS) || overridesAMethod("getActions")) { // NOI18N
      return super.getActions(context);
    }
  }
  javax.swing.Action[] retValue;
  retValue = original.getActions(context);
  return retValue;
}

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

private boolean overridesGetDisplayName() {
  synchronized (overridesGetDisplayNameCache) {
    Boolean b = (Boolean)overridesGetDisplayNameCache.get (getClass ());
    if (b == null) {
      b = overridesAMethod ("getDisplayName", null) ? Boolean.TRUE : Boolean.FALSE; // NOI18N
      overridesGetDisplayNameCache.put (getClass (), b);
    }
    return b.booleanValue() ? true : false;
  }
}

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

private boolean overridesGetDisplayName() {
  synchronized (overridesGetDisplayNameCache) {
    Boolean b = (Boolean)overridesGetDisplayNameCache.get (getClass ());
    if (b == null) {
      b = overridesAMethod ("getDisplayName", null) ? Boolean.TRUE : Boolean.FALSE; // NOI18N
      overridesGetDisplayNameCache.put (getClass (), b);
    }
    return b.booleanValue() ? true : false;
  }
}

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

/** Overrides package private method of a node that allows us to say 
 * that the lookup provided in the constructor should be replaced by
 * something else
 *
 * @param lookup
 * @return lookup or null
 */
final Lookup replaceProvidedLookup (Lookup lookup) {
  synchronized (replaceProvidedLookupCache) {
    Boolean b = (Boolean)replaceProvidedLookupCache.get (getClass ());
    if (b == null) {
      b = overridesAMethod ("getCookie", new Class[] { Class.class }) ? Boolean.FALSE : Boolean.TRUE; // NOI18N
      replaceProvidedLookupCache.put (getClass (), b);
    }
    return b.booleanValue() ? lookup : null;
  }
}

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

/** Overrides package private method of a node that allows us to say 
 * that the lookup provided in the constructor should be replaced by
 * something else
 *
 * @param lookup
 * @return lookup or null
 */
final Lookup replaceProvidedLookup (Lookup lookup) {
  synchronized (replaceProvidedLookupCache) {
    Boolean b = (Boolean)replaceProvidedLookupCache.get (getClass ());
    if (b == null) {
      b = overridesAMethod ("getCookie", new Class[] { Class.class }) ? Boolean.FALSE : Boolean.TRUE; // NOI18N
      replaceProvidedLookupCache.put (getClass (), b);
    }
    return b.booleanValue() ? lookup : null;
  }
}

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

public javax.swing.Action getPreferredAction() {
  javax.swing.Action retValue;
  
  if (overridesAMethod ("getDefaultAction", new Class[0])) { // NOI18N
    retValue = super.getPreferredAction();
  } else {
    retValue = original.getPreferredAction();
  }
  
  return retValue;
}

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

public javax.swing.Action getPreferredAction() {
  javax.swing.Action retValue;
  
  if (overridesAMethod ("getDefaultAction", new Class[0])) { // NOI18N
    retValue = super.getPreferredAction();
  } else {
    retValue = original.getPreferredAction();
  }
  
  return retValue;
}

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

public javax.swing.Action[] getActions(boolean context) {
  if (context) {
    if (!delegating (DELEGATE_GET_ACTIONS) || overridesAMethod ("getContextActions", new Class[0])) // NOI18N
      return super.getActions (context);
  } else {
    if (!delegating (DELEGATE_GET_CONTEXT_ACTIONS) || overridesAMethod ("getActions", new Class[0])) // NOI18N
      return super.getActions (context);
  }
  
  javax.swing.Action[] retValue;
  retValue = original.getActions(context);
  return retValue;
}

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

public javax.swing.Action[] getActions(boolean context) {
  if (context) {
    if (!delegating (DELEGATE_GET_ACTIONS) || overridesAMethod ("getContextActions", new Class[0])) // NOI18N
      return super.getActions (context);
  } else {
    if (!delegating (DELEGATE_GET_CONTEXT_ACTIONS) || overridesAMethod ("getActions", new Class[0])) // NOI18N
      return super.getActions (context);
  }
  
  javax.swing.Action[] retValue;
  retValue = original.getActions(context);
  return retValue;
}

相关文章

微信公众号

最新文章

更多