Search in sources :

Example 1 with IDataModelActionBuilder

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

the class CapWorkbenchActionsProviderImpl method saveAction.

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

Example 2 with IDataModelActionBuilder

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

the class CapWorkbenchActionsProviderImpl method cancelAction.

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

Example 3 with IDataModelActionBuilder

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

the class CapWorkbenchActionsProviderImpl method loadAction.

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

Example 4 with IDataModelActionBuilder

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

the class CapActionFactoryImpl method dataModelCancelActionBuilder.

@Override
public IDataModelActionBuilder dataModelCancelActionBuilder() {
    final IDataModelActionBuilder builder = new DataModelActionBuilderImpl(new DataModelCancelCommand());
    builder.setText(Messages.getString("CapActionFactoryImpl.cancel"));
    builder.setIcon(IconsSmall.CANCEL);
    return builder;
}
Also used : IDataModelActionBuilder(org.jowidgets.cap.ui.api.command.IDataModelActionBuilder)

Example 5 with IDataModelActionBuilder

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

the class CapActionFactoryImpl method dataModelUndoActionBuilder.

@Override
public IDataModelActionBuilder dataModelUndoActionBuilder() {
    final IDataModelActionBuilder builder = new DataModelActionBuilderImpl(new DataModelUndoCommand());
    builder.setText(Messages.getString("CapActionFactoryImpl.undo"));
    builder.setAccelerator(VirtualKey.Z, Modifier.CTRL);
    builder.setIcon(IconsSmall.UNDO);
    return builder;
}
Also used : IDataModelActionBuilder(org.jowidgets.cap.ui.api.command.IDataModelActionBuilder)

Aggregations

IDataModelActionBuilder (org.jowidgets.cap.ui.api.command.IDataModelActionBuilder)8 IDataModelAction (org.jowidgets.cap.ui.api.command.IDataModelAction)4 IWorkbenchMenuInterceptorPlugin (org.jowidgets.cap.ui.api.plugin.IWorkbenchMenuInterceptorPlugin)4