-
Notifications
You must be signed in to change notification settings - Fork 4
/
NatTableDemo1.java
38 lines (30 loc) · 1.42 KB
/
NatTableDemo1.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.xored.q7.quality.mockups.nattable;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.nebula.widgets.nattable.NatTable;
import org.eclipse.nebula.widgets.nattable.grid.GridRegion;
import org.eclipse.nebula.widgets.nattable.grid.data.DummySpanningBodyDataProvider;
import org.eclipse.nebula.widgets.nattable.layer.CompositeLayer;
import org.eclipse.nebula.widgets.nattable.layer.SpanningDataLayer;
import org.eclipse.nebula.widgets.nattable.selection.SelectionLayer;
import org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import com.xored.q7.quality.mockups.issues.BaseMockupPart;
public class NatTableDemo1 extends BaseMockupPart {
@Override
public Control construct(Composite parent) {
Composite content = new Composite(parent, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, true).applyTo(content);
GridLayoutFactory.fillDefaults().numColumns(1).applyTo(content);
CompositeLayer layer = new CompositeLayer(1, 1);
layer.setChildLayer(GridRegion.BODY,
new ViewportLayer(
new SelectionLayer(new SpanningDataLayer(new DummySpanningBodyDataProvider(1000000, 1000000)))),
0, 0);
NatTable table = new NatTable(content, layer);
GridDataFactory.fillDefaults().grab(true, true).applyTo(table);
return content;
}
}