/** * This is a utility method which is able to retrieve the model connector this * action has been executed on from its context. It uses well-known context * keys of the action context which are: * <ul> * <li> <code>ActionContextConstants.VIEW_CONNECTOR</code> to get the model * value connector of the connector hierarchy. * </ul> * <p> * The returned connector mainly serves for retrieving the domain object the * action has to be triggered on. * * @param context * the action context. * @return the value connector this model action was triggered on. */ public IValueConnector getModelConnector(Map<String, Object> context) { return ((IValueConnector) context .get(ActionContextConstants.VIEW_CONNECTOR)).getModelConnector(); }
/** * This is a utility method which is able to retrieve the source model * connector this action has been executed on from its context. It uses * well-known context keys of the action context which are: * <ul> * <li> <code>ActionContextConstants.SOURCE_VIEW_CONNECTOR</code> to get the * model value connector of the connector hierarchy. * </ul> * <p> * The returned connector mainly serves for retrieving the domain object the * action has to be triggered on. * * @param context * the action context. * @return the value connector this model action was triggered on. */ public IValueConnector getSourceModelConnector(Map<String, Object> context) { if (context.get(ActionContextConstants.SOURCE_VIEW_CONNECTOR) != null) { return ((IValueConnector) context .get(ActionContextConstants.SOURCE_VIEW_CONNECTOR)) .getModelConnector(); } return null; }
IValueConnector viewConnector = getViewConnector(viewPath, context); if (viewConnector != null) { IValueConnector modelConnector = viewConnector.getModelConnector(); if (modelConnector != null) { while (modelConnector.getModelConnector() != null) { modelConnector = modelConnector.getModelConnector();
/** * {@inheritDoc} */ @Override public void selectedItemChange(ItemSelectionEvent event) { if (event.getSelectedItem() != null) { mvcBinder.bind(detailConnector, ((IValueConnector) event.getSelectedItem()).getModelConnector()); } else { mvcBinder.bind(detailConnector, null); } } }
@Override public void selectionChange(SelectionChangeEvent evt) { int leadingIndex = evt.getLeadingIndex(); IValueConnector selectedModelConnector = null; if (leadingIndex >= 0) { IValueConnector selectedViewConnector = connector.getChildConnector(leadingIndex); if (selectedViewConnector != null) { selectedModelConnector = selectedViewConnector.getModelConnector(); } } getMvcBinder().bind(rowConnectorPrototype, selectedModelConnector); } });
List<IValueConnector> existingConnectors = existingConnectorsByModel.get(childConnector.getModelConnector()); if (existingConnectors == null) { existingConnectors = new ArrayList<>(); existingConnectorsByModel.put(childConnector.getModelConnector(), existingConnectors);
private boolean isRecycling(IValueConnector connector) { if (connector instanceof AbstractValueConnector) { return ((AbstractValueConnector) connector).isMute() || isCollectionConnectorDescendant(connector) && isRecycling( connector.getModelConnector()) || isRecycling(connector.getParentConnector()); } else { return false; } }
} else { selectableConnector = selectableConnector.getModelConnector();
/** * {@inheritDoc} */ @Override public void bind(IValueConnector masterConnector, final IValueConnector detailConnector) { if (masterConnector instanceof IItemSelectable) { ((IItemSelectable) masterConnector) .addItemSelectionListener(new BoundConnectorSelectionListener( detailConnector)); } else { // Do not simply add the detail connector since it will propagate // writability of the master to the detail which is wrong. see bug#342. // } else if (masterConnector instanceof ICompositeValueConnector) { // ((ICompositeValueConnector) masterConnector) // .addChildConnector(detailConnector); mvcBinder.bind(detailConnector, masterConnector.getModelConnector()); masterConnector.addPropertyChangeListener( IValueConnector.MODEL_CONNECTOR_PROPERTY, new BoundConnectorModelListener(detailConnector)); } }
if (viewConnector.getModelConnector() == modelConnector) { return;
.getModelConnector()).getModelDescriptor().getClass() .isAssignableFrom( childCardView.getDescriptor().getModelDescriptor() .getClass())) { ((IModelValueConnector) cardView.getConnector() .getModelConnector()) .setModelDescriptor(childCardView.getDescriptor() .getModelDescriptor()); .getModelConnector());
.getModelConnector()).getModelDescriptor().getClass() .isAssignableFrom( childCardView.getDescriptor().getModelDescriptor() .getClass())) { ((IModelValueConnector) cardView.getConnector() .getModelConnector()) .setModelDescriptor(childCardView.getDescriptor() .getModelDescriptor()); .getModelConnector());
.getModelConnector()).getModelDescriptor().getClass() .isAssignableFrom( childCardView.getDescriptor().getModelDescriptor() .getClass())) { ((IModelValueConnector) cardView.getConnector() .getModelConnector()) .setModelDescriptor(childCardView.getDescriptor() .getModelDescriptor()); .getModelConnector());