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

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

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

Node.getActions介绍

[英]Get the set of actions associated with this node. This may be used e.g. in constructing a #getContextMenu.

By default returns the actions in NodeOp#getDefaultActions.
[中]获取与此节点关联的操作集。例如,在构建#getContextMenu时,可以使用此选项。
默认情况下,返回NodeOp#getDefaultActions中的操作。

代码示例

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

  1. /** Get a special set of actions
  2. * for situations when this node is displayed as a context.
  3. * <p>For example, right-clicking on a parent node in a hierarchical view (such as
  4. * the normal Explorer) should use <code>getActions</code>. However, if this node
  5. * is serving as the parent of a (say) a window tab full of icons (e.g., in
  6. * <code>IconView</code>), and the users right-clicks on
  7. * the empty space in this pane, then this method should be used to get
  8. * the appropriate actions for a context menu.
  9. * <p>Note that in the Windows UI system, e.g., these action sets are quite different.
  10. *
  11. * @return actions for a context. In the default implementation, same as {@link #getActions}.
  12. * @deprecated Use getActions (true) instead.
  13. */
  14. @Deprecated
  15. public SystemAction[] getContextActions() {
  16. return getActions();
  17. }

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

  1. @Override
  2. @Deprecated
  3. public SystemAction[] getActions() {
  4. if (delegating(DELEGATE_GET_ACTIONS)) {
  5. return original.getActions();
  6. } else {
  7. return super.getActions();
  8. }
  9. }

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

  1. @Override
  2. public Action[] getActions(boolean context) {
  3. return switchToOriginal().getActions(context);
  4. }

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

  1. /** Get all actions for the node.
  2. * Initialized with {@link #createActions}, or with the superclass's list.
  3. *
  4. * @return actions for the node
  5. * @deprecated Override {@link #getActions(boolean)} instead.
  6. */
  7. @Deprecated
  8. public SystemAction[] getActions() {
  9. if (systemActions == null) {
  10. systemActions = createActions();
  11. if (systemActions == null) {
  12. systemActions = super.getActions();
  13. }
  14. }
  15. return systemActions;
  16. }

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

  1. /** Get the set of actions that are associated with this node.
  2. * This set is used to construct the context menu for the node.
  3. *
  4. * <P>
  5. * By default this method delegates to the deprecated getActions or getContextActions
  6. * method depending on the value of supplied argument.
  7. * <P>
  8. * It is supposed to be overridden by subclasses accordingly.
  9. *
  10. * @param context whether to find actions for context meaning or for the
  11. * node itself
  12. * @return a list of actions (you may include nulls for separators)
  13. * @since 3.29
  14. */
  15. public Action[] getActions(boolean context) {
  16. return context ? getContextActions() : getActions();
  17. }

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

  1. @Override
  2. public javax.swing.Action[] getActions(boolean context) {
  3. if (context) {
  4. if (!delegating(DELEGATE_GET_ACTIONS) || overridesAMethod("getContextActions")) { // NOI18N
  5. return super.getActions(context);
  6. }
  7. } else {
  8. if (!delegating(DELEGATE_GET_CONTEXT_ACTIONS) || overridesAMethod("getActions")) { // NOI18N
  9. return super.getActions(context);
  10. }
  11. }
  12. javax.swing.Action[] retValue;
  13. retValue = original.getActions(context);
  14. return retValue;
  15. }

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

  1. actionsByNode[n] = nodes[n].getActions(false);

代码示例来源:origin: nl.cloudfarming.client/field-shape-type

  1. @Override
  2. public Action[] getActions(boolean context) {
  3. return origional.getActions(context);
  4. }
  5. }

代码示例来源:origin: eu.agrosense.client/io-shape

  1. @Override
  2. public Action[] getActions(boolean context) {
  3. return original.getActions(context);
  4. }

代码示例来源:origin: nl.cloudfarming.client/geometry-shape-type

  1. @Override
  2. public Action[] getActions(boolean context) {
  3. return origional.getActions(context);
  4. }

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

  1. public SystemAction[] getActions () {
  2. if (delegating (DELEGATE_GET_ACTIONS))
  3. return original.getActions ();
  4. else
  5. return super.getActions ();
  6. }

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

  1. public SystemAction[] getActions () {
  2. if (delegating (DELEGATE_GET_ACTIONS))
  3. return original.getActions ();
  4. else
  5. return super.getActions ();
  6. }

代码示例来源:origin: it.tidalwave.netbeans/it-tidalwave-netbeans-visual

  1. @Override @Nonnull
  2. public JPopupMenu getPopupMenu (final @Nonnull Widget widget, final @Nonnull Point localLocation)
  3. {
  4. final JPopupMenu popup = new JPopupMenu();
  5. for (final Action action : node.getActions(true))
  6. {
  7. popup.add(action);
  8. }
  9. return popup;
  10. }
  11. }

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-j2eeserver

  1. public Action[] getActions(boolean context) {
  2. List actions = new ArrayList();
  3. if (extendsActions) {
  4. actions.addAll(Arrays.asList(xnode.getActions(context)));
  5. }
  6. actions.addAll(Arrays.asList(getOriginal().getActions(context)));
  7. return (Action[]) actions.toArray(new Action[actions.size()]);
  8. }

代码示例来源:origin: nl.cloudfarming.client/sensor-api

  1. @Override
  2. public Action[] getActions(boolean arg0) {
  3. Action[] addedActions = {new ChangePaletteAction()};
  4. Action[] originalActions = original.getActions(arg0);
  5. originalActions[0].setEnabled(true);
  6. Action[] actions = Arrays.copyOf(originalActions, originalActions.length + addedActions.length);
  7. int counter = originalActions.length;
  8. for (Action addedAction : addedActions) {
  9. actions[counter] = addedAction;
  10. }
  11. return actions;
  12. }

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

  1. /** Get all actions for the node.
  2. * Initialized with {@link #createActions}, or with the superclass's list.
  3. *
  4. * @return actions for the node
  5. * @deprecated Override {@link #getActions(boolean)} instead.
  6. */
  7. public SystemAction[] getActions () {
  8. if (systemActions == null) {
  9. systemActions = createActions ();
  10. if (systemActions == null) {
  11. systemActions = super.getActions ();
  12. }
  13. }
  14. return systemActions;
  15. }

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-j2eeserver

  1. public javax.swing.Action[] getActions(boolean context) {
  2. List actions = new ArrayList();
  3. actions.addAll(Arrays.asList(getOriginal().getActions(context)));
  4. /*Boolean isRunning = instance.checkRunning();
  5. if (isRunning != null && isRunning.booleanValue()) {*/
  6. if (getServerTarget() != null) {
  7. actions.addAll(Arrays.asList(getDelegateTargetNode().getActions(context)));
  8. }
  9. return (javax.swing.Action[]) actions.toArray(new javax.swing.Action[actions.size()]);
  10. }

代码示例来源:origin: it.tidalwave.semantic/it-tidalwave-semantic-graph

  1. @Override
  2. public Action[] getActions (boolean arg0)
  3. {
  4. final List<Action> actions = new ArrayList<Action>(Arrays.asList(getOriginal().getActions(arg0)));
  5. // FIXME; this action should not stay in this module
  6. actions.add(new ApplyTreeLayoutAction(this));
  7. return actions.toArray(new Action[0]);
  8. }
  9. }

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

  1. public javax.swing.Action[] getActions(boolean context) {
  2. if (context) {
  3. if (!delegating (DELEGATE_GET_ACTIONS) || overridesAMethod ("getContextActions", new Class[0])) // NOI18N
  4. return super.getActions (context);
  5. } else {
  6. if (!delegating (DELEGATE_GET_CONTEXT_ACTIONS) || overridesAMethod ("getActions", new Class[0])) // NOI18N
  7. return super.getActions (context);
  8. }
  9. javax.swing.Action[] retValue;
  10. retValue = original.getActions(context);
  11. return retValue;
  12. }

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

  1. public javax.swing.Action[] getActions(boolean context) {
  2. if (context) {
  3. if (!delegating (DELEGATE_GET_ACTIONS) || overridesAMethod ("getContextActions", new Class[0])) // NOI18N
  4. return super.getActions (context);
  5. } else {
  6. if (!delegating (DELEGATE_GET_CONTEXT_ACTIONS) || overridesAMethod ("getActions", new Class[0])) // NOI18N
  7. return super.getActions (context);
  8. }
  9. javax.swing.Action[] retValue;
  10. retValue = original.getActions(context);
  11. return retValue;
  12. }

相关文章