Rap how to use the Nebula Grid Widget [message #881166] |
Mon, 04 June 2012 03:14 |
ocean xue Messages: 107 Registered: November 2011 |
Senior Member |
|
|
Rap how to use the Nebula Grid Widget?
add plugin:
org.eclipse.swt.win32.win32.x86_3.7.1.v3738a.jar
org.eclipse.swt_3.7.1.v3738a.jar
----------------------------------------------------------
public void createPartControl(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new FillLayout());
Grid grid = new Grid(composite, SWT.BORDER | SWT.V_SCROLL
| SWT.H_SCROLL);
grid.setHeaderVisible(true);
GridColumn column = new GridColumn(grid, SWT.NONE);
column.setText("Column 1");
column.setWidth(100);
GridColumnGroup columnGroup = new GridColumnGroup(grid, SWT.NONE);
columnGroup.setText("Column Group");
GridColumn column2 = new GridColumn(columnGroup, SWT.NONE);
column2.setText("Column 2");
column2.setWidth(60);
GridColumn column3 = new GridColumn(columnGroup, SWT.NONE);
column3.setText("Column 3");
column3.setWidth(60);
GridItem item1 = new GridItem(grid, SWT.NONE);
item1.setText("First Item");
item1.setText(1, "abc");
GridItem item2 = new GridItem(grid, SWT.NONE);
item2.setText("Second Item");
item2.setText(2, "def");
GridItem item3 = new GridItem(grid, SWT.NONE);
item3.setText("Third Item");
item3.setText(1, "xyz");
// browser = new Browser(parent, SWT.NONE);
// try {
// this.previewReport();
// } catch (EngineException e) {
// e.printStackTrace();
// }
}public void createPartControl(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new FillLayout());
Grid grid = new Grid(composite, SWT.BORDER | SWT.V_SCROLL
| SWT.H_SCROLL);
grid.setHeaderVisible(true);
GridColumn column = new GridColumn(grid, SWT.NONE);
column.setText("Column 1");
column.setWidth(100);
GridColumnGroup columnGroup = new GridColumnGroup(grid, SWT.NONE);
columnGroup.setText("Column Group");
GridColumn column2 = new GridColumn(columnGroup, SWT.NONE);
column2.setText("Column 2");
column2.setWidth(60);
GridColumn column3 = new GridColumn(columnGroup, SWT.NONE);
column3.setText("Column 3");
column3.setWidth(60);
GridItem item1 = new GridItem(grid, SWT.NONE);
item1.setText("First Item");
item1.setText(1, "abc");
GridItem item2 = new GridItem(grid, SWT.NONE);
item2.setText("Second Item");
item2.setText(2, "def");
GridItem item3 = new GridItem(grid, SWT.NONE);
item3.setText("Third Item");
item3.setText(1, "xyz");
}
-------------------------------------------------------
exception:
java.lang.LinkageError: loader constraint violation: when resolving method "org.eclipse.nebula.widgets.grid.Grid.<init>(Lorg/eclipse/swt/widgets/Composite;I)V" the class loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) of the current class, aaa/View, and the class loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) for resolved class, org/eclipse/nebula/widgets/grid/Grid, have different Class objects for the type org/eclipse/swt/widgets/Composite used in the signature
[Updated on: Mon, 04 June 2012 03:45] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03694 seconds