/** * Retrieves the managed collection from the model connector then registers * the selected elements. * <p> * {@inheritDoc} */ @Override public boolean execute(IActionHandler actionHandler, Map<String, Object> context) { List<IComponent> transferedComponents = getSelectedModels(context); getController(context).storeComponents( new ComponentTransferStructure<>(transferedComponents, transferMode)); return super.execute(actionHandler, context); }
/** * Retrieves the managed collection from the model connector then registers * the selected elements. * <p> * {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public boolean execute(IActionHandler actionHandler, Map<String, Object> context) { int[] selectedIndices = getSelectedIndices(context); ICollectionConnector collectionConnector = getModelConnector(context); if (selectedIndices == null || selectedIndices.length == 0 || collectionConnector == null) { return false; } List<Object> transferedComponents = new ArrayList<Object>(); for (int i = 0; i < selectedIndices.length; i++) { transferedComponents.add(collectionConnector.getChildConnector( selectedIndices[i]).getConnectorValue()); } getController(context).storeComponents( new ComponentTransferStructure(getModelDescriptor(context) .getCollectionDescriptor().getElementDescriptor(), transferedComponents, transferMode)); return super.execute(actionHandler, context); }