/** 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; }
/** 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; }
/** 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; }
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(); }
/** 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; } }