/** * Creates the module area view to display the modules content. * * @param workspaceName * the workspace to create the module area view for. * @return the the module area view to display the modules content. */ protected IView<E> createModuleAreaView(String workspaceName) { IMapView<E> moduleAreaView = (IMapView<E>) viewFactory.createView(createWorkspaceViewDescriptor(), this, getLocale()); workspaceViews.put(workspaceName, moduleAreaView); return moduleAreaView; }
/** * {@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); }
.start(mockBackController, locale, TimeZone.getDefault()); IView<JComponent> view = mockFrontController.getViewFactory().createView( viewDescriptor, mockFrontController, locale);
/** * {@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); }
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 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); }
/** * Creates a workspace navigator based on the workspace definition. * * @param workspaceName * the workspace to create the navigator for. * @param workspaceNavigatorViewDescriptor * the view descriptor of the navigator. * @return the workspace navigator view. */ protected IView<E> createWorkspaceNavigator(final String workspaceName, IViewDescriptor workspaceNavigatorViewDescriptor) { IView<E> workspaceNavigatorView = viewFactory.createView(workspaceNavigatorViewDescriptor, this, getLocale()); IItemSelectable workspaceNavigator; if (workspaceNavigatorView.getConnector() instanceof IItemSelectable) { workspaceNavigator = (IItemSelectable) workspaceNavigatorView.getConnector(); } else { workspaceNavigator = (IItemSelectable) ((ICompositeValueConnector) workspaceNavigatorView.getConnector()) .getChildConnector(ModelRefPropertyConnector.THIS_PROPERTY); } workspaceNavigator.addItemSelectionListener(new IItemSelectionListener() { @Override public void selectedItemChange(ItemSelectionEvent event) { navigatorSelectionChanged(workspaceName, (ICompositeValueConnector) event.getSelectedItem()); } }); workspaceNavigatorConnectors.put(workspaceName, (ICompositeValueConnector) workspaceNavigatorView.getConnector()); return workspaceNavigatorView; }
context.put(ActionContextConstants.DIALOG_ACTIONS, actions); IReferencePropertyDescriptor<IEntity> erqDescriptor = getEntityRefQueryDescriptor(context); IView<ULCComponent> lovView = getViewFactory(context).createView( lovViewDescriptorFactory.createLovViewDescriptor(erqDescriptor), actionHandler, getLocale(context));
if (!alreadyDisplayedSteps.contains(cardName)) { alreadyDisplayedSteps.add(cardName); IView<JComponent> view = getViewFactory(context).createView( wizardStep.getViewDescriptor(), actionHandler, getLocale(context)); cardPanel.add(view.getPeer(), cardName);
context.put(ActionContextConstants.DIALOG_ACTIONS, actions); IReferencePropertyDescriptor<IEntity> erqDescriptor = getEntityRefQueryDescriptor(context); IView<JComponent> lovView = getViewFactory(context).createView( lovViewDescriptorFactory.createLovViewDescriptor(erqDescriptor), actionHandler, getLocale(context));
context.put(ActionContextConstants.DIALOG_ACTIONS, actions); IReferencePropertyDescriptor<IEntity> erqDescriptor = getEntityRefQueryDescriptor(context); IView<SComponent> lovView = getViewFactory(context).createView( lovViewDescriptorFactory.createLovViewDescriptor(erqDescriptor), actionHandler, getLocale(context));
/** * {@inheritDoc} */ @Override public boolean execute(IActionHandler actionHandler, Map<String, Object> context) { List<IDisplayableAction> actions = getDialogActions(context); context.put(ModalDialogAction.DIALOG_ACTIONS, actions); IViewDescriptor editViewDescriptor = getViewDescriptor(context); IView<E> dialogView = getViewFactory(context).createView(editViewDescriptor, actionHandler, getLocale(context)); String dialogTitle = getI18nName(getTranslationProvider(context), getLocale(context)); if (dialogTitle != null && dialogTitle.length() > 0) { context.put(ModalDialogAction.DIALOG_TITLE, dialogTitle); } context.put(ModalDialogAction.DIALOG_VIEW, dialogView); Object component = getComponentToEdit(context); IModelDescriptor modelDescriptor = getEditModelDescriptor(context); if (modelDescriptor == null && editViewDescriptor instanceof ICardViewDescriptor) { ICardViewDescriptor cvd = (ICardViewDescriptor) editViewDescriptor; String cardName = cvd.getCardNameForModel(component, getBackendController(context).getApplicationSession() .getSubject()); IViewDescriptor vd = cvd.getCardViewDescriptor(cardName); modelDescriptor = vd.getModelDescriptor(); } IValueConnector componentConnector = getBackendController(context).createModelConnector(ACTION_MODEL_NAME, modelDescriptor); componentConnector.setConnectorValue(component); getMvcBinder(context).bind(dialogView.getConnector(), componentConnector); return super.execute(actionHandler, context); }
.createView(splitViewDescriptor, this, getLocale()); ((IConnectorSelector) workspaceView.getConnector()) .addConnectorSelectionListener(new IConnectorSelectionListener() {
/** * Creates and binds the login view. * * @return the login view */ protected IView<E> createLoginView() { IViewDescriptor loginViewDescriptor = getLoginViewDescriptor(); BasicViewDescriptor refinedViewDescriptor = ((BasicViewDescriptor) loginViewDescriptor).clone(); refinedViewDescriptor.setActionMap(null); refinedViewDescriptor.setSecondaryActionMap(null); IView<E> loginView = getViewFactory().createView(refinedViewDescriptor, this, getLocale()); IValueConnector loginModelConnector = getBackendController().createModelConnector("login", loginViewDescriptor.getModelDescriptor()); getMvcBinder().bind(loginView.getConnector(), loginModelConnector); loginModelConnector.setConnectorValue(getLoginCallbackHandler()); return loginView; }
IView<E> view = getViewFactory(context).createView( wizardStep.getViewDescriptor(), actionHandler, getLocale(context)); IModelDescriptor modelDescriptor = wizardStep.getViewDescriptor()
if (!alreadyDisplayedSteps.contains(cardName)) { alreadyDisplayedSteps.add(cardName); IView<ULCComponent> view = getViewFactory(context).createView( wizardStep.getViewDescriptor(), actionHandler, getLocale(context)); cardPanel.addCard(cardName, view.getPeer());
if (!alreadyDisplayedSteps.contains(cardName)) { alreadyDisplayedSteps.add(cardName); IView<SComponent> view = getViewFactory(context).createView( wizardStep.getViewDescriptor(), actionHandler, getLocale(context)); view.getPeer().setPreferredSize(WIZARD_DIMENSION);