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

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

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

AbstractNode.getPreferredAction介绍

[英]Gets preferred action. By default, null.
[中]获取首选操作。默认情况下,null。

代码示例

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

/** Gets the default action. Overrides superclass method.
* @return if there is a default action set, then returns it
 * @deprecated Use {@link #getPreferredAction} instead.
*/
@Deprecated
public SystemAction getDefaultAction() {
  Action a = getPreferredAction();
  if (a instanceof SystemAction) {
    return (SystemAction) a;
  }
  return null;
}

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

/** Gets the default action. Overrides superclass method.
* @return if there is a default action set, then returns it
 * @deprecated Use {@link #getPreferredAction} instead.
*/
public SystemAction getDefaultAction () {
  Action a = getPreferredAction();
  if(a instanceof SystemAction) {
    return (SystemAction)a;
  }
  
  return null;
}

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

/** Gets the default action. Overrides superclass method.
* @return if there is a default action set, then returns it
 * @deprecated Use {@link #getPreferredAction} instead.
*/
public SystemAction getDefaultAction () {
  Action a = getPreferredAction();
  if(a instanceof SystemAction) {
    return (SystemAction)a;
  }
  
  return null;
}

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

public Action getPreferredAction() {
  // #6465174 Make customize action the preferred one if is present.
  Action[] actions = getActions(false);
  Action customizeAction = SystemAction.get(CustomizeAction.class);
  List actionList = Arrays.asList(actions);
  if (actionList.contains(customizeAction)) {
    return customizeAction;
  } else {
    for (Iterator it = actionList.iterator(); it.hasNext(); ) {
      Action action = (Action)it.next();
      if (action != null) {
        return action;
      }
    }
  }
  return super.getPreferredAction();
}

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

/** Get default action. In the current implementation the 
*<code>null</code> is returned in case the underlying data 
* object is a template. The templates should not have any default 
* action.
* @return no action if the underlying data object is a template. 
*    Otherwise the abstract node's default action is returned, if <code>null</code> then
*    the first action returned from getActions (false) method is used.
*/
public Action getPreferredAction () {
  if (obj.isTemplate ()) {
    return null;
  } else {
    Action action = super.getPreferredAction ();
    if (action != null) {
      return action;
    }
    Action[] arr = getActions(false);
    if (arr != null && arr.length > 0) {
      return arr[0];
    }
    return null;
  }
}

相关文章

最新文章

更多