/** * {@inheritDoc} */ @Override public void propertyChange(PropertyChangeEvent evt) { IValueConnector newModelConnector = (IValueConnector) evt.getNewValue(); mvcBinder.bind(detailConnector, newModelConnector); detailConnector.setModelConnector(newModelConnector); } }
@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); } });
/** * {@inheritDoc} */ @Override public void recycle(IMvcBinder mvcBinder) { try { setMute(true); if (mvcBinder != null) { mvcBinder.bind(this, null); } setParentConnector(null); setConnectorValue(null); } finally { setMute(false); } }
/** * {@inheritDoc} */ @Override public boolean execute(IActionHandler actionHandler, Map<String, Object> context) { List<IDisplayableAction> actions = new ArrayList<IDisplayableAction>(); okAction.putInitialContext(ActionContextConstants.SOURCE_VIEW_CONNECTOR, getViewConnector(context)); actions.add(okAction); actions.add(cancelAction); context.put(ActionContextConstants.DIALOG_ACTIONS, actions); IModelValueConnector componentsModelConnector = (IModelValueConnector) context .get(ActionContextConstants.ACTION_PARAM); BasicTableViewDescriptor tableViewDescriptor = new BasicTableViewDescriptor(); tableViewDescriptor.setModelDescriptor(componentsModelConnector .getModelDescriptor()); IView<JComponent> collectionView = getViewFactory(context).createView( tableViewDescriptor, actionHandler, getLocale(context)); context.put(ActionContextConstants.DIALOG_VIEW, collectionView); getMvcBinder(context).bind(collectionView.getConnector(), componentsModelConnector); return super.execute(actionHandler, context); }
/** * {@inheritDoc} */ @Override public boolean execute(IActionHandler actionHandler, Map<String, Object> context) { List<IDisplayableAction> actions = new ArrayList<IDisplayableAction>(); okAction.putInitialContext(ActionContextConstants.SOURCE_VIEW_CONNECTOR, getViewConnector(context)); actions.add(okAction); actions.add(cancelAction); context.put(ActionContextConstants.DIALOG_ACTIONS, actions); IModelValueConnector componentsModelConnector = (IModelValueConnector) context .get(ActionContextConstants.ACTION_PARAM); BasicTableViewDescriptor tableViewDescriptor = new BasicTableViewDescriptor(); tableViewDescriptor.setModelDescriptor(componentsModelConnector .getModelDescriptor()); IView<SComponent> collectionView = getViewFactory(context).createView( tableViewDescriptor, actionHandler, getLocale(context)); context.put(ActionContextConstants.DIALOG_VIEW, collectionView); getMvcBinder(context).bind(collectionView.getConnector(), componentsModelConnector); return super.execute(actionHandler, context); }
/** * {@inheritDoc} */ @Override public boolean execute(IActionHandler actionHandler, Map<String, Object> context) { List<IDisplayableAction> actions = new ArrayList<IDisplayableAction>(); okAction.putInitialContext(ActionContextConstants.SOURCE_VIEW_CONNECTOR, getViewConnector(context)); actions.add(okAction); actions.add(cancelAction); context.put(ActionContextConstants.DIALOG_ACTIONS, actions); IModelValueConnector componentsModelConnector = (IModelValueConnector) context .get(ActionContextConstants.ACTION_PARAM); BasicTableViewDescriptor tableViewDescriptor = new BasicTableViewDescriptor(); tableViewDescriptor.setModelDescriptor(componentsModelConnector .getModelDescriptor()); IView<ULCComponent> collectionView = getViewFactory(context).createView( tableViewDescriptor, actionHandler, getLocale(context)); context.put(ActionContextConstants.DIALOG_VIEW, collectionView); getMvcBinder(context).bind(collectionView.getConnector(), componentsModelConnector); return super.execute(actionHandler, context); }
.getModelDescriptor()).getComponentContract())); mockFrontController.getMvcBinder().bind(view.getConnector(), modelConnector);
try { ((AbstractValueConnector) connector).setMute(true); mvcBinder.bind(connector, nextModelConnector); } finally { ((AbstractValueConnector) connector).setMute(false);
@Override public void valueChange(ValueChangeEvent evt) { ICollectionConnector connector = (ICollectionConnector) evt.getSource(); int targetCount = connector.getChildConnectorCount(); List<RComponent> extraSections = new ArrayList<>(); for (int i = 0; i < targetCount; i++) { IValueConnector elementConnector = connector.getChildConnector(i); int childId = System.identityHashCode(elementConnector); if (!childIds.containsKey(childId)) { IView<RComponent> extraSection = createView(viewDescriptor.getRepeatedViewDescriptor(), actionHandler, locale); extraSection.setParent(repeaterView); RComponent peer = extraSection.getPeer(); RemoteValueState state = ((IRemoteStateOwner) elementConnector).getState(); peer.setState(state); extraSections.add(peer); getMvcBinder().bind(extraSection.getConnector(), elementConnector); childIds.put(childId, extraSection); } } if (!extraSections.isEmpty()) { addRepeatedSections(repeater, extraSections); } } });
/** * {@inheritDoc} */ @Override public boolean execute(IActionHandler actionHandler, Map<String, Object> context) { List<IDisplayableAction> actions = new ArrayList<IDisplayableAction>(); Object component = context.get(ActionContextConstants.ACTION_PARAM); okAction.putInitialContext(ActionContextConstants.SOURCE_VIEW_CONNECTOR, getViewConnector(context)); okAction.putInitialContext(ActionContextConstants.ACTION_PARAM, component); actions.add(okAction); actions.add(cancelAction); context.put(ActionContextConstants.DIALOG_ACTIONS, actions); IView<ULCComponent> componentView = getViewFactory(context).createView( getViewDescriptor(context), actionHandler, getLocale(context)); context.put(ActionContextConstants.DIALOG_VIEW, componentView); IValueConnector componentConnector = modelConnectorFactory .createModelConnector(ACTION_MODEL_NAME, getViewDescriptor(context) .getModelDescriptor()); componentConnector.setConnectorValue(getModel(context)); getMvcBinder(context) .bind(componentView.getConnector(), componentConnector); return super.execute(actionHandler, context); }
/** * {@inheritDoc} */ @Override public boolean execute(IActionHandler actionHandler, Map<String, Object> context) { List<IDisplayableAction> actions = new ArrayList<IDisplayableAction>(); Object component = context.get(ActionContextConstants.ACTION_PARAM); okAction.putInitialContext(ActionContextConstants.SOURCE_VIEW_CONNECTOR, getViewConnector(context)); okAction.putInitialContext(ActionContextConstants.ACTION_PARAM, component); actions.add(okAction); actions.add(cancelAction); context.put(ActionContextConstants.DIALOG_ACTIONS, actions); IView<SComponent> componentView = getViewFactory(context).createView( getViewDescriptor(context), actionHandler, getLocale(context)); context.put(ActionContextConstants.DIALOG_VIEW, componentView); IValueConnector componentConnector = modelConnectorFactory .createModelConnector(ACTION_MODEL_NAME, getViewDescriptor(context) .getModelDescriptor()); componentConnector.setConnectorValue(getModel(context)); getMvcBinder(context) .bind(componentView.getConnector(), componentConnector); return super.execute(actionHandler, context); }
private void rebindDataProvider() { IRepeaterViewDescriptor viewDescriptor = (IRepeaterViewDescriptor) repeaterView.getDescriptor(); ICollectionConnector collectionConnector = (ICollectionConnector) repeaterView.getConnector(); container.removeAll(); for (int i = 0; i < collectionConnector.getChildConnectorCount(); i++) { IValueConnector child = collectionConnector.getChildConnector(i); JComponent component = componentTank.get(child); if (component == null) { IView<JComponent> repeatedView = viewFactory.createView(viewDescriptor.getRepeatedViewDescriptor(), actionHandler, locale); repeatedView.setParent(repeaterView); component = repeatedView.getPeer(); deepAttachListener(component); mvcBinder.bind(repeatedView.getConnector(), child); componentTank.put(child, component); } container.add(component); } }
/** * {@inheritDoc} */ @Override public boolean execute(IActionHandler actionHandler, Map<String, Object> context) { List<IDisplayableAction> actions = new ArrayList<IDisplayableAction>(); Object component = context.get(ActionContextConstants.ACTION_PARAM); okAction.putInitialContext(ActionContextConstants.SOURCE_VIEW_CONNECTOR, getViewConnector(context)); okAction.putInitialContext(ActionContextConstants.ACTION_PARAM, component); actions.add(okAction); actions.add(cancelAction); context.put(ActionContextConstants.DIALOG_ACTIONS, actions); IView<JComponent> componentView = getViewFactory(context).createView( getViewDescriptor(context), actionHandler, getLocale(context)); context.put(ActionContextConstants.DIALOG_VIEW, componentView); IValueConnector componentConnector = modelConnectorFactory .createModelConnector(ACTION_MODEL_NAME, getViewDescriptor(context) .getModelDescriptor()); componentConnector.setConnectorValue(getModel(context)); getMvcBinder(context) .bind(componentView.getConnector(), componentConnector); return super.execute(actionHandler, context); }
/** * {@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)); } }
/** * {@inheritDoc} */ @Override protected void displayWorkspace(String workspaceName) { if (workspaceViews == null) { workspaceViews = new HashSet<String>(); } if (!workspaceViews.contains(workspaceName)) { IViewDescriptor workspaceViewDescriptor = getWorkspace(workspaceName) .getViewDescriptor(); IValueConnector workspaceConnector = getBackendController() .getWorkspaceConnector(workspaceName); IView<SComponent> workspaceView = createWorkspaceView(workspaceName, workspaceViewDescriptor, (Workspace) workspaceConnector .getConnectorValue()); // getViewFactory().decorateWithTitle(moduleView, getLocale()); workspaceViews.add(workspaceName); cardPanel.add(workspaceView.getPeer(), workspaceName); getMvcBinder().bind(workspaceView.getConnector(), workspaceConnector); } setSelectedWorkspaceName(workspaceName); }
IValueConnector queryEntityConnector = (IValueConnector) context .get(ActionContextConstants.QUERY_MODEL_CONNECTOR); getMvcBinder(context).bind(lovView.getConnector(), queryEntityConnector); findAction.putInitialContext(ActionContextConstants.QUERY_MODEL_CONNECTOR, queryEntityConnector);
IValueConnector queryEntityConnector = (IValueConnector) context .get(ActionContextConstants.QUERY_MODEL_CONNECTOR); getMvcBinder(context).bind(lovView.getConnector(), queryEntityConnector); findAction.putInitialContext(ActionContextConstants.QUERY_MODEL_CONNECTOR, queryEntityConnector);
wizardStep.getViewDescriptor(), actionHandler, getLocale(context)); cardPanel.add(view.getPeer(), cardName); getMvcBinder(context).bind(view.getConnector(), modelConnector);
IValueConnector queryEntityConnector = (IValueConnector) context .get(ActionContextConstants.QUERY_MODEL_CONNECTOR); getMvcBinder(context).bind(lovView.getConnector(), queryEntityConnector); findAction.putInitialContext(ActionContextConstants.QUERY_MODEL_CONNECTOR, queryEntityConnector);