blob: 149c48e6bd055f3c1b6c4e253a48f446a77f4f20 [file] [log] [blame]
/*=============================================================================#
# Copyright (c) 2012, 2021 Original NatTable authors and others.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.eclipse.org/legal/epl-2.0.
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Original NatTable authors and others - initial API and implementation
#=============================================================================*/
package org.eclipse.statet.ecommons.waltable.export;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.statet.ecommons.waltable.command.AbstractLayerCommandHandler;
import org.eclipse.statet.ecommons.waltable.config.IConfigRegistry;
import org.eclipse.statet.ecommons.waltable.layer.ILayer;
public class ExportCommandHandler extends AbstractLayerCommandHandler<ExportCommand> {
private final ILayer layer;
public ExportCommandHandler(final ILayer layer) {
this.layer= layer;
}
@Override
public boolean doCommand(final ExportCommand command) {
final Shell shell= command.getShell();
final IConfigRegistry configRegistry= command.getConfigRegistry();
new NatExporter(shell).exportSingleLayer(this.layer, configRegistry);
return true;
}
@Override
public Class<ExportCommand> getCommandClass() {
return ExportCommand.class;
}
}