/*******************************************************************************
* Copyright (c) 2012, 2013 Original authors and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Original authors and others - initial API and implementation
******************************************************************************/
package org.eclipse.nebula.widgets.nattable.examples.fixtures;
import org.eclipse.nebula.widgets.nattable.copy.command.CopyDataCommandHandler;
import org.eclipse.nebula.widgets.nattable.hideshow.ColumnHideShowLayer;
import org.eclipse.nebula.widgets.nattable.layer.AbstractIndexLayerTransform;
import org.eclipse.nebula.widgets.nattable.layer.IUniqueIndexLayer;
import org.eclipse.nebula.widgets.nattable.reorder.ColumnReorderLayer;
import org.eclipse.nebula.widgets.nattable.selection.SelectionLayer;
import org.eclipse.nebula.widgets.nattable.util.IClientAreaProvider;
import org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer;
public class SelectionExampleBodyLayerStack extends AbstractIndexLayerTransform {
private final ColumnReorderLayer columnReorderLayer;
private final ColumnHideShowLayer columnHideShowLayer;
private final SelectionLayer selectionLayer;
private final ViewportLayer viewportLayer;
public SelectionExampleBodyLayerStack(IUniqueIndexLayer underlyingLayer) {
this.columnReorderLayer = new ColumnReorderLayer(underlyingLayer);
this.columnHideShowLayer = new ColumnHideShowLayer(this.columnReorderLayer);
// No autoconfig on selection layer
this.selectionLayer = new SelectionLayer(this.columnHideShowLayer, false);
this.viewportLayer = new ViewportLayer(this.selectionLayer);
setUnderlyingLayer(this.viewportLayer);
registerCommandHandler(new CopyDataCommandHandler(this.selectionLayer));
}
@Override
public void setClientAreaProvider(IClientAreaProvider clientAreaProvider) {
super.setClientAreaProvider(clientAreaProvider);
}
public ColumnReorderLayer getColumnReorderLayer() {
return this.columnReorderLayer;
}
public ColumnHideShowLayer getColumnHideShowLayer() {
return this.columnHideShowLayer;
}
public SelectionLayer getSelectionLayer() {
return this.selectionLayer;
}
public ViewportLayer getViewportLayer() {
return this.viewportLayer;
}
}