Revision 331c7265
Added by Katja Luther over 5 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/DistributionEditor.java | ||
---|---|---|
30 | 30 |
import org.eclipse.nebula.widgets.nattable.NatTable; |
31 | 31 |
import org.eclipse.nebula.widgets.nattable.config.ConfigRegistry; |
32 | 32 |
import org.eclipse.nebula.widgets.nattable.config.DefaultNatTableStyleConfiguration; |
33 |
import org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate; |
|
33 | 34 |
import org.eclipse.nebula.widgets.nattable.data.IDataProvider; |
34 | 35 |
import org.eclipse.nebula.widgets.nattable.data.IRowDataProvider; |
35 | 36 |
import org.eclipse.nebula.widgets.nattable.data.ListDataProvider; |
36 | 37 |
import org.eclipse.nebula.widgets.nattable.extension.e4.selection.E4SelectionListener; |
38 |
import org.eclipse.nebula.widgets.nattable.freeze.CompositeFreezeLayer; |
|
39 |
import org.eclipse.nebula.widgets.nattable.freeze.FreezeHelper; |
|
37 | 40 |
import org.eclipse.nebula.widgets.nattable.freeze.FreezeLayer; |
38 | 41 |
import org.eclipse.nebula.widgets.nattable.grid.GridRegion; |
39 | 42 |
import org.eclipse.nebula.widgets.nattable.grid.data.DefaultColumnHeaderDataProvider; |
... | ... | |
278 | 281 |
* handlers and listeners |
279 | 282 |
*/ |
280 | 283 |
registerHandlersAndListeners(topMostLayer); |
281 |
|
|
284 |
FreezeHelper.freeze(freezeLayer, bodyLayer, |
|
285 |
new PositionCoordinate(bodyLayer, 0, 0), |
|
286 |
new PositionCoordinate(bodyLayer, 0, -1)); |
|
282 | 287 |
//grab all space |
283 | 288 |
GridDataFactory.fillDefaults().grab(true, true).applyTo(natTable); |
284 | 289 |
|
... | ... | |
314 | 319 |
selectionLayer = new SelectionLayer(bodyDataLayer); |
315 | 320 |
bodyLayer = new ViewportLayer(selectionLayer); |
316 | 321 |
|
322 |
freezeLayer = new FreezeLayer(selectionLayer); |
|
323 |
final CompositeFreezeLayer compositeFreezeLayer = new CompositeFreezeLayer( |
|
324 |
freezeLayer, bodyLayer, selectionLayer); |
|
325 |
|
|
317 | 326 |
// as the selection mouse bindings are registered for the region label |
318 | 327 |
// GridRegion.BODY |
319 | 328 |
// we need to set that region label to the viewport so the selection via mouse |
320 | 329 |
// is working correctly |
321 |
bodyLayer.setRegionName(GridRegion.BODY);
|
|
330 |
compositeFreezeLayer.setRegionName(GridRegion.BODY);
|
|
322 | 331 |
|
323 | 332 |
|
324 | 333 |
IDataProvider columnHeaderDataProvider = |
... | ... | |
326 | 335 |
DataLayer columnHeaderDataLayer = new DataLayer(columnHeaderDataProvider); |
327 | 336 |
ILayer columnHeaderLayer = new ColumnHeaderLayer( |
328 | 337 |
columnHeaderDataLayer, |
329 |
bodyLayer,
|
|
338 |
compositeFreezeLayer,
|
|
330 | 339 |
selectionLayer); |
331 | 340 |
|
332 | 341 |
|
... | ... | |
335 | 344 |
DataLayer rowHeaderDataLayer = new DataLayer(rowHeaderDataProvider, 40, 20); |
336 | 345 |
ILayer rowHeaderLayer = new RowHeaderLayer( |
337 | 346 |
rowHeaderDataLayer, |
338 |
bodyLayer,
|
|
347 |
compositeFreezeLayer,
|
|
339 | 348 |
selectionLayer); |
340 | 349 |
|
341 | 350 |
|
... | ... | |
351 | 360 |
columnHeaderLayer); |
352 | 361 |
|
353 | 362 |
GridLayer gridLayer = new GridLayer( |
354 |
bodyLayer,
|
|
363 |
compositeFreezeLayer,
|
|
355 | 364 |
columnHeaderLayer, |
356 | 365 |
rowHeaderLayer, |
357 | 366 |
cornerLayer); |
358 | 367 |
|
359 | 368 |
natTable.setLayer(gridLayer); |
360 | 369 |
|
361 |
topMostLayer = bodyLayer;
|
|
370 |
topMostLayer = compositeFreezeLayer;
|
|
362 | 371 |
|
363 | 372 |
|
364 | 373 |
} |
Also available in: Unified diff
ref #7854: freezing taxon column