Search in sources :

Example 11 with IAction

use of org.jowidgets.api.command.IAction in project jo-client-platform by jo-source.

the class CapWorkbenchActionsProviderImpl method refreshLookUpsAction.

@Override
public IAction refreshLookUpsAction() {
    IAction result = Toolkit.getValue(REFRESH_LOOKUPS_ACTION_KEY);
    if (result == null) {
        IRefreshLookUpsActionBuilder builder = actionFactory.refreshLookUpsActionBuilder();
        for (final IWorkbenchMenuInterceptorPlugin plugin : PluginProvider.getPlugins(IWorkbenchMenuInterceptorPlugin.ID)) {
            builder = plugin.getMenuInterceptor().refreshLookUpsAction(builder);
            if (builder == null) {
                break;
            }
        }
        if (builder != null) {
            result = builder.build();
        } else {
            result = null;
        }
        Toolkit.setValue(REFRESH_LOOKUPS_ACTION_KEY, result);
    }
    return result;
}
Also used : IAction(org.jowidgets.api.command.IAction) IRefreshLookUpsActionBuilder(org.jowidgets.cap.ui.api.command.IRefreshLookUpsActionBuilder) IWorkbenchMenuInterceptorPlugin(org.jowidgets.cap.ui.api.plugin.IWorkbenchMenuInterceptorPlugin)

Example 12 with IAction

use of org.jowidgets.api.command.IAction in project jo-client-platform by jo-source.

the class EntityComponent method getDataModelActions.

private List<IDataModelAction> getDataModelActions(final IComponentNodeModel componentNodeModel) {
    final IToolBarModel toolBar = componentNodeModel.getApplication().getWorkbench().getToolBar();
    final List<IDataModelAction> result = new LinkedList<IDataModelAction>();
    for (final IToolBarItemModel item : toolBar.getItems()) {
        if (item instanceof IActionItemModel) {
            final IAction action = ((IActionItemModel) item).getAction();
            if (action instanceof IDataModelAction) {
                result.add((IDataModelAction) action);
            }
        }
    }
    return result;
}
Also used : IAction(org.jowidgets.api.command.IAction) IToolBarItemModel(org.jowidgets.api.model.item.IToolBarItemModel) IToolBarModel(org.jowidgets.api.model.item.IToolBarModel) IDataModelAction(org.jowidgets.cap.ui.api.command.IDataModelAction) LinkedList(java.util.LinkedList) IActionItemModel(org.jowidgets.api.model.item.IActionItemModel)

Example 13 with IAction

use of org.jowidgets.api.command.IAction in project jo-client-platform by jo-source.

the class EntityComponentMasterTableToolBarPlugin method onInitialize.

@Override
public void onInitialize(final IPluginProperties properties, final IViewContext context, final IBeanTable<?> table, final Collection<IAction> linkCreatorActions) {
    final IToolBarModel toolBar = context.getToolBar();
    if (table.getDefaultCreatorAction() != null) {
        toolBar.addAction(table.getDefaultCreatorAction());
    }
    final IMenuModel toolBarMenu = context.getToolBarMenu();
    for (final IAction action : linkCreatorActions) {
        toolBarMenu.addAction(action);
    }
}
Also used : IMenuModel(org.jowidgets.api.model.item.IMenuModel) IAction(org.jowidgets.api.command.IAction) IToolBarModel(org.jowidgets.api.model.item.IToolBarModel)

Example 14 with IAction

use of org.jowidgets.api.command.IAction in project jo-client-platform by jo-source.

the class EntityComponentRelationTreeToolBarPlugin method onInitialize.

@Override
public void onInitialize(final IPluginProperties properties, final IViewContext context, final IBeanTable<?> rootTable, final IBeanRelationTree<?> relationTree, final Collection<IAction> linkCreatorActions) {
    final IToolBarModel toolBar = context.getToolBar();
    if (relationTree.getAddAction() != null) {
        toolBar.addAction(relationTree.getAddAction());
    }
    final IMenuModel toolBarMenu = context.getToolBarMenu();
    for (final IAction action : linkCreatorActions) {
        toolBarMenu.addAction(action);
    }
}
Also used : IMenuModel(org.jowidgets.api.model.item.IMenuModel) IAction(org.jowidgets.api.command.IAction) IToolBarModel(org.jowidgets.api.model.item.IToolBarModel)

Aggregations

IAction (org.jowidgets.api.command.IAction)14 IServiceActionDecoratorPlugin (org.jowidgets.cap.ui.api.plugin.IServiceActionDecoratorPlugin)6 IPluginProperties (org.jowidgets.plugin.api.IPluginProperties)6 IMenuModel (org.jowidgets.api.model.item.IMenuModel)4 IToolBarModel (org.jowidgets.api.model.item.IToolBarModel)3 IDataModelAction (org.jowidgets.cap.ui.api.command.IDataModelAction)3 IActionItemModel (org.jowidgets.api.model.item.IActionItemModel)2 IMenuItemModel (org.jowidgets.api.model.item.IMenuItemModel)2 IEntityLinkDescriptor (org.jowidgets.cap.common.api.entity.IEntityLinkDescriptor)2 IWorkbenchMenuInterceptorPlugin (org.jowidgets.cap.ui.api.plugin.IWorkbenchMenuInterceptorPlugin)2 MenuModel (org.jowidgets.tools.model.item.MenuModel)2 LinkedList (java.util.LinkedList)1 ISeparatorItemModel (org.jowidgets.api.model.item.ISeparatorItemModel)1 IToolBarItemModel (org.jowidgets.api.model.item.IToolBarItemModel)1 IEntityService (org.jowidgets.cap.common.api.service.IEntityService)1 IExecutorService (org.jowidgets.cap.common.api.service.IExecutorService)1 IRefreshLookUpsActionBuilder (org.jowidgets.cap.ui.api.command.IRefreshLookUpsActionBuilder)1 IBeanRelationTreeDetailBluePrint (org.jowidgets.cap.ui.api.widgets.IBeanRelationTreeDetailBluePrint)1 IBeanTableBluePrint (org.jowidgets.cap.ui.api.widgets.IBeanTableBluePrint)1