Lines 88-93
Link Here
|
88 |
* name and display name; they may be independently modified. */ |
88 |
* name and display name; they may be independently modified. */ |
89 |
protected MessageFormat displayFormat; |
89 |
protected MessageFormat displayFormat; |
90 |
|
90 |
|
|
|
91 |
/** Preferred action */ |
92 |
private Action preferredAction; |
93 |
|
91 |
/** default icon base for all nodes */ |
94 |
/** default icon base for all nodes */ |
92 |
private static final String DEFAULT_ICON_BASE = "org/openide/resources/defaultNode"; // NOI18N |
95 |
private static final String DEFAULT_ICON_BASE = "org/openide/resources/defaultNode"; // NOI18N |
93 |
|
96 |
|
Lines 103-110
Link Here
|
103 |
* of this node. |
106 |
* of this node. |
104 |
*/ |
107 |
*/ |
105 |
protected SystemAction[] systemActions; |
108 |
protected SystemAction[] systemActions; |
106 |
/** Preferred action. */ |
|
|
107 |
private Action preferredAction; |
108 |
|
109 |
|
109 |
/** Listener for changes in the sheet and the cookie set. */ |
110 |
/** Listener for changes in the sheet and the cookie set. */ |
110 |
private final class SheetAndCookieListener implements PropertyChangeListener, ChangeListener { |
111 |
private final class SheetAndCookieListener implements PropertyChangeListener, ChangeListener { |
Lines 450-470
Link Here
|
450 |
* By default, null. |
451 |
* By default, null. |
451 |
* @return preferred action |
452 |
* @return preferred action |
452 |
* @see Node#getPreferredAction |
453 |
* @see Node#getPreferredAction |
453 |
* @see #setPreferredAction |
|
|
454 |
* @since 3.29 |
454 |
* @since 3.29 |
455 |
*/ |
455 |
*/ |
456 |
public Action getPreferredAction() { |
456 |
public Action getPreferredAction() { |
457 |
return preferredAction; |
457 |
return null; |
458 |
} |
458 |
} |
459 |
|
459 |
|
460 |
/** Sets preferred action. |
|
|
461 |
* @param preferredAction preferred action |
462 |
* @see #getPreferredAction |
463 |
* @since 3.29 |
464 |
*/ |
465 |
public void setPreferredAction(Action preferredAction) { |
466 |
this.preferredAction = preferredAction; |
467 |
} |
468 |
|
460 |
|
469 |
/** Gets the default action. Overrides superclass method. |
461 |
/** Gets the default action. Overrides superclass method. |
470 |
* @return if there is a default action set, then returns it |
462 |
* @return if there is a default action set, then returns it |
Lines 481-490
Link Here
|
481 |
|
473 |
|
482 |
/** Set a default action for the node. |
474 |
/** Set a default action for the node. |
483 |
* @param action the new default action, or <code>null</code> for none |
475 |
* @param action the new default action, or <code>null</code> for none |
484 |
* @deprecated Use {@link #setPreferredAction} instead. |
|
|
485 |
*/ |
476 |
*/ |
486 |
public void setDefaultAction (SystemAction action) { |
477 |
public void setDefaultAction (SystemAction action) { |
487 |
setPreferredAction(action); |
478 |
preferredAction = action; |
488 |
} |
479 |
} |
489 |
|
480 |
|
490 |
/** Get all actions for the node. |
481 |
/** Get all actions for the node. |