/** * Gets the actionFactory. * * @param context * the action context. * @return the actionFactory. */ protected IActionFactory<G, E, F> getActionFactory(Map<String, Object> context) { return getViewFactory(context).getActionFactory(); }
/** * 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; }
/** * Gets the iconFactory. * * @return the iconFactory. */ protected IIconFactory<F> getIconFactory() { return viewFactory.getIconFactory(); }
for (ActionList actionList : loginViewDescriptor.getActionMap().getActionLists(this)) { for (IDisplayableAction action : actionList.getActions()) { JButton button = new JButton(getViewFactory().getActionFactory().createAction(action, getViewFactory().getIconFactory().getSmallIconSize(), this, loginView, getLocale())); buttonBox.add(button); if (i == 0) { exitButton.setAction(getViewFactory().getActionFactory().createAction(getExitAction(), this, null, getLocale())); exitButton.setIcon(getIconFactory().getCancelIcon(getIconFactory().getSmallIconSize())); buttonBox.add(exitButton);
/** * Updates the view factory with the remote peer registry. * <p/> * {@inheritDoc} * * @internal */ @Override public void setViewFactory(IViewFactory<RComponent, RIcon, RAction> viewFactory) { if (viewFactory instanceof AbstractRemoteViewFactory) { ((AbstractRemoteViewFactory) viewFactory).setRemoteCommandHandler(this); ((AbstractRemoteViewFactory) viewFactory).setRemotePeerRegistry(this); } IActionFactory<RAction, RComponent, RIcon> actionFactory = viewFactory.getActionFactory(); if (actionFactory instanceof RemoteActionFactory) { ((RemoteActionFactory) actionFactory).setRemoteCommandHandler(this); ((RemoteActionFactory) actionFactory).setRemotePeerRegistry(this); } IConfigurableConnectorFactory connectorFactory = viewFactory.getConnectorFactory(); if (connectorFactory instanceof RemoteConnectorFactory) { ((RemoteConnectorFactory) connectorFactory).setRemoteCommandHandler(this); ((RemoteConnectorFactory) connectorFactory).setRemotePeerRegistry(this); } super.setViewFactory(viewFactory); }
/** * Delegates to view factory. * <p> * {@inheritDoc} */ @Override public void edit(E component) { getViewFactory().edit(component); }
/** * Delegates to view factory. * <p> * {@inheritDoc} */ @Override public void focus(E component) { getViewFactory().focus(component); }
/** * {@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); }
/** * Gets the actionFactory. * * @param context * the action context. * @return the actionFactory. */ protected IActionFactory<G, E> getActionFactory(Map<String, Object> context) { return getViewFactory(context).getActionFactory(); }
/** * Gets the iconFactory. * * @return the iconFactory. */ protected IIconFactory<F> getIconFactory() { return viewFactory.getIconFactory(); }
/** * {@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); }
private JMenuItem createMenuItem(IDisplayableAction action) { return new JMenuItem(getViewFactory().getActionFactory().createAction( action, this, null, getLocale())); }
/** * Gets the iconFactory. * * @param context * the action context. * @return the iconFactory. */ protected IIconFactory<F> getIconFactory(Map<String, Object> context) { return getViewFactory(context).getIconFactory(); }
/** * {@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); }
private Map<String, Object> getModuleActionContext(String workspaceName) { IMapView<E> moduleAreaView = workspaceViews.get(workspaceName); if (moduleAreaView != null) { IView<E> moduleView = moduleAreaView.getCurrentView(); if (moduleView != null) { return getViewFactory().getActionFactory().createActionContext(this, moduleView, moduleView.getConnector(), null, null); } } return new HashMap<>(); }
/** * Gets the iconFactory. * * @param context * the action context. * @return the iconFactory. */ protected IIconFactory<F> getIconFactory(Map<String, Object> context) { return getViewFactory(context).getIconFactory(); }
.start(mockBackController, locale, TimeZone.getDefault()); IView<JComponent> view = mockFrontController.getViewFactory().createView( viewDescriptor, mockFrontController, locale);
@SuppressWarnings("unchecked") private RAction createRAction(IAction action, Map<String, Object> context) { return getViewFactory().getActionFactory().createAction(wrapAction(action, context), this, (IView<RComponent>) context.get(ActionContextConstants.VIEW), getLocale()); }
/** * Creates the exit action. * * @return the exit action. */ @Override public IDisplayableAction getExitAction() { if (exitAction == null) { ExitAction<E, F, G> action = new ExitAction<>(); action.setName("quit.name"); action.setDescription("quit.description"); action.setIconImageURL(getViewFactory().getIconFactory().getCancelIconImageURL()); exitAction = action; } return exitAction; }
/** * {@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); }