Search in sources :

Example 1 with IDataModelContextProvider

use of org.jowidgets.cap.ui.api.model.IDataModelContextProvider in project jo-client-platform by jo-source.

the class CreatorActionBuilderImpl method buildAction.

private IAction buildAction() {
    final IBeanFormBluePrint<BEAN_TYPE> formBp = getBeanFormBp();
    Collection<IAttribute<?>> attr = attributes;
    if (attr == null && formBp != null) {
        attr = formBp.getCreateModeAttributes();
    }
    final BeanCreatorCommand<BEAN_TYPE> command = new BeanCreatorCommand<BEAN_TYPE>(beanTypeId, beanType, beanPropertyValidators, model, attr, formBp, enabledCheckers, anySelection, creatorService, parentBeanKeysProvider, getDefaultValueProvider(attr), exceptionConverter, executionInterceptors, creatorInterceptors);
    final IActionBuilder builder = getBuilder();
    if (model instanceof IDataModelContextProvider) {
        builder.setCommand(new DataModelContextCommandWrapper((IDataModelContextProvider) model, DataModelChangeType.SELECTION_CHANGE, command));
    } else {
        builder.setCommand((ICommand) command);
    }
    return builder.build();
}
Also used : IDataModelContextProvider(org.jowidgets.cap.ui.api.model.IDataModelContextProvider) IAttribute(org.jowidgets.cap.ui.api.attribute.IAttribute) DataModelContextCommandWrapper(org.jowidgets.cap.ui.tools.command.DataModelContextCommandWrapper) IActionBuilder(org.jowidgets.api.command.IActionBuilder)

Example 2 with IDataModelContextProvider

use of org.jowidgets.cap.ui.api.model.IDataModelContextProvider in project jo-client-platform by jo-source.

the class DeleterActionBuilder method buildAction.

private IAction buildAction() {
    setDefaultTextIfNecessary();
    setDefaultToolTipTextIfNecessary();
    final BeanDeleterCommand<BEAN_TYPE> command = new BeanDeleterCommand<BEAN_TYPE>(model, enabledCheckers, executableCheckers, deleterService, executionInterceptors, multiSelection, beanModificationStatePolicy, beanMessageStatePolicy, exceptionConverter, autoSelection, deletionConfirmDialog);
    final IActionBuilder builder = getBuilder();
    if (model instanceof IDataModelContextProvider) {
        builder.setCommand(new DataModelContextCommandWrapper((IDataModelContextProvider) model, DataModelChangeType.SELECTION_CHANGE, command));
    } else {
        builder.setCommand((ICommand) command);
    }
    return builder.build();
}
Also used : IDataModelContextProvider(org.jowidgets.cap.ui.api.model.IDataModelContextProvider) DataModelContextCommandWrapper(org.jowidgets.cap.ui.tools.command.DataModelContextCommandWrapper) IActionBuilder(org.jowidgets.api.command.IActionBuilder)

Example 3 with IDataModelContextProvider

use of org.jowidgets.cap.ui.api.model.IDataModelContextProvider in project jo-client-platform by jo-source.

the class PasteBeansActionBuilderImpl method doBuild.

@Override
public IAction doBuild() {
    final BeanPasteCommand<BEAN_TYPE> command = new BeanPasteCommand<BEAN_TYPE>(beanTypeId, beanType, model, disposeObservable, attributes, enabledCheckers, anySelection);
    final IActionBuilder builder = getBuilder();
    if (model instanceof IDataModelContextProvider) {
        builder.setCommand(new DataModelContextCommandWrapper((IDataModelContextProvider) model, DataModelChangeType.SELECTION_CHANGE, command));
    } else {
        builder.setCommand((ICommand) command);
    }
    return builder.build();
}
Also used : IDataModelContextProvider(org.jowidgets.cap.ui.api.model.IDataModelContextProvider) DataModelContextCommandWrapper(org.jowidgets.cap.ui.tools.command.DataModelContextCommandWrapper) IActionBuilder(org.jowidgets.api.command.IActionBuilder)

Aggregations

IActionBuilder (org.jowidgets.api.command.IActionBuilder)3 IDataModelContextProvider (org.jowidgets.cap.ui.api.model.IDataModelContextProvider)3 DataModelContextCommandWrapper (org.jowidgets.cap.ui.tools.command.DataModelContextCommandWrapper)3 IAttribute (org.jowidgets.cap.ui.api.attribute.IAttribute)1