protected void loadActions(ActionsHolder actionsHolder, Element element) { Element actionsEl = element.element("actions"); if (actionsEl == null) return; for (Element actionEl : actionsEl.elements("action")) { actionsHolder.addAction(loadDeclarativeAction(actionsHolder, actionEl)); } }
@Override protected void addAction(Action action) { ActionsHolder actionsHolder = (ActionsHolder) component; List<Action> existingActions = new ArrayList<>(actionsHolder.getActions()); for (Action existingAction : existingActions) { // Comparing the id of an existing action with the full Id (including path) of the action to be added if (Objects.equals(existingAction.getId(), actionId)) { int index = existingActions.indexOf(existingAction); actionsHolder.removeAction(existingAction); actionsHolder.addAction(action, index); break; } } } }
@Override protected void loadActions(ActionsHolder actionsHolder, Element element) { Element actionsEl = element.element("actions"); if (actionsEl == null) return; for (Element actionEl : Dom4j.elements(actionsEl, "action")) { actionsHolder.addAction(loadDeclarativeAction(actionsHolder, actionEl)); String actionId = actionEl.attributeValue("id"); context.addPostInitTask(new ActionHolderAssignActionPostInitTask(actionsHolder, actionId, context.getFrame())); } }