blob: 32876bbb5f6443cd0047c6cebe7a9a273b72d3be [file] [log] [blame]
/*=============================================================================#
# Copyright (c) 2012, 2021 Edwin Park 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:
# Edwin Park - initial API and implementation
#=============================================================================*/
package org.eclipse.statet.ecommons.waltable.viewport;
import org.eclipse.statet.ecommons.waltable.command.AbstractLayerCommandHandler;
public class ViewportDragCommandHandler extends AbstractLayerCommandHandler<ViewportDragCommand> {
private final ViewportLayer viewportLayer;
public ViewportDragCommandHandler(final ViewportLayer viewportLayer) {
this.viewportLayer= viewportLayer;
}
@Override
public Class<ViewportDragCommand> getCommandClass() {
return ViewportDragCommand.class;
}
@Override
protected boolean doCommand(final ViewportDragCommand command) {
this.viewportLayer.drag(command.getX(), command.getY());
return true;
}
}