Java Code Examples for org.eclipse.nebula.widgets.grid.GridItem#setRowSpan()
The following examples show how to use
org.eclipse.nebula.widgets.grid.GridItem#setRowSpan() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GridColumnLabelProvider.java From nebula with Eclipse Public License 2.0 | 6 votes |
/** * {@inheritDoc} */ public void update(ViewerCell cell) { super.update(cell); Object element = cell.getElement(); String rowText = getRowHeaderText(element); int colSpan = getColumnSpan(element); int rowSpan = getRowSpan(element); GridItem gridItem = (GridItem)cell.getViewerRow().getItem(); if (rowText != null) { gridItem.setHeaderText(rowText); } gridItem.setColumnSpan(cell.getColumnIndex(), colSpan); gridItem.setRowSpan(cell.getColumnIndex(), rowSpan); }
Example 2
Source File: GridColumnLabelProvider.java From translationstudio8 with GNU General Public License v2.0 | 6 votes |
/** * {@inheritDoc} */ public void update(ViewerCell cell) { super.update(cell); Object element = cell.getElement(); String rowText = getRowHeaderText(element); int colSpan = getColumnSpan(element); int rowSpan = getRowSpan(element); GridItem gridItem = (GridItem)cell.getViewerRow().getItem(); if (rowText != null) { gridItem.setHeaderText(rowText); } gridItem.setColumnSpan(cell.getColumnIndex(), colSpan); gridItem.setRowSpan(cell.getColumnIndex(), rowSpan); }
Example 3
Source File: GridColumnLabelProvider.java From tmxeditor8 with GNU General Public License v2.0 | 6 votes |
/** * {@inheritDoc} */ public void update(ViewerCell cell) { super.update(cell); Object element = cell.getElement(); String rowText = getRowHeaderText(element); int colSpan = getColumnSpan(element); int rowSpan = getRowSpan(element); GridItem gridItem = (GridItem)cell.getViewerRow().getItem(); if (rowText != null) { gridItem.setHeaderText(rowText); } gridItem.setColumnSpan(cell.getColumnIndex(), colSpan); gridItem.setRowSpan(cell.getColumnIndex(), rowSpan); }
Example 4
Source File: TestBug387468.java From nebula with Eclipse Public License 2.0 | 4 votes |
/** * * @param args */ public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new FillLayout()); Grid grid = new Grid(shell, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); grid.setHeaderVisible(true); GridColumn column = new GridColumn(grid, SWT.NONE); column.setText("Employee"); column.setWidth(100); GridColumn column2 = new GridColumn(grid, SWT.NONE); column2.setText("Company"); column2.setWidth(100); GridItem item1 = new GridItem(grid, SWT.NONE); item1.setText("Anne"); item1.setText(1, "Company A"); item1.setRowSpan(1, 2); GridItem item2 = new GridItem(grid, SWT.NONE); item2.setText("Jim"); item1.setText(1, "Company A"); item2.setRowSpan(1, 2); GridItem item3 = new GridItem(grid, SWT.NONE); item3.setText("Sara"); item3.setText(1, "Company A"); item3.setRowSpan(1, 2); GridItem item4 = new GridItem(grid, SWT.NONE); item4.setText("Tom"); item4.setText(1, "Company B"); item4.setRowSpan(1, 1); GridItem item5 = new GridItem(grid, SWT.NONE); item5.setText("Nathalie"); item5.setText(1, "Company B"); item5.setRowSpan(1, 1); GridItem item6 = new GridItem(grid, SWT.NONE); item6.setText("Wim"); item6.setText(1, "Company C"); item6.setRowSpan(1, 1); GridItem item7 = new GridItem(grid, SWT.NONE); item7.setText("Pauline"); item7.setText(1, "Company C"); item7.setRowSpan(1, 1); shell.setSize(300, 300); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }
Example 5
Source File: GridRowSpanSnippet.java From nebula with Eclipse Public License 2.0 | 4 votes |
/** * * @param args */ public static void main (String [] args) { Display display = new Display (); Shell shell = new Shell (display); shell.setLayout(new FillLayout()); Grid grid = new Grid(shell, 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); GridColumn column2 = new GridColumn(grid, SWT.NONE); column2.setText("Column 2"); column2.setWidth(100); GridItem item1 = new GridItem(grid, SWT.NONE); item1.setText("First Item"); item1.setText(1, "xxxxxxx"); GridItem item2 = new GridItem(grid, SWT.NONE); item2.setText("This cell spans two rows"); item2.setText(1, "xxxxxxx"); item2.setRowSpan(0, 1); item2.setColumnSpan(0, 1); GridItem item3 = new GridItem(grid, SWT.NONE); item3.setText("Third Item"); item3.setText(1, "xxxxxxx"); shell.setSize(200,200); shell.open (); while (!shell.isDisposed()) { if (!display.readAndDispatch ()) display.sleep (); } display.dispose (); }