Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » Moving GridColumnGroup in Grid
Moving GridColumnGroup in Grid [message #1485780] Mon, 24 November 2014 14:40 Go to next message
Kris Slowinski is currently offline Kris SlowinskiFriend
Messages: 18
Registered: August 2011
Junior Member
Is it possible to move the entire GridColumnGroup? I can move GridColumn if they are marked as movable ( GridColumn#setMovable(true) ), but I cannot find a corresponding method of doing that for the column group. I have a working example:

import org.eclipse.nebula.widgets.grid.Grid;
import org.eclipse.nebula.widgets.grid.GridColumn;
import org.eclipse.nebula.widgets.grid.GridColumnGroup;
import org.eclipse.nebula.widgets.grid.GridItem;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

/*
 * Simple column grouping example
 */
public class ColumnGrouping {

	private final static int ROWS = 1000;

	private final Grid grid;

	private ColumnGrouping(Shell shell) {
		grid = new Grid(shell,SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
		grid.setHeaderVisible(true);
		createColumn("Column 1");
		GridColumnGroup columnGroup = createColumnGroup("Column 2");
		createColumn(columnGroup, "Column 2.1");
		createColumn(columnGroup, "Column 2.2");
		createColumn("Column 3");
		createCoordinateItems();
	}

	private void createColumn(String title) {
		GridColumn column = new GridColumn(grid,SWT.NONE);
		column.setText(title);
		column.setWidth(100);
		column.setMoveable(true);
	}

	private void createColumn(GridColumnGroup columnGroup, String title) {
		GridColumn column = new GridColumn(columnGroup,SWT.NONE);
		column.setText(title);
		column.setWidth(100);
		column.setMoveable(true);
	}

	private GridColumnGroup createColumnGroup(String title) {
		GridColumnGroup columnGroup = new GridColumnGroup(grid,SWT.NONE);
		columnGroup.setText(title);
		return columnGroup;
	}
	
	private void createCoordinateItems() {
		for (int i = 0; i < ROWS; i++) {
			GridItem item = new GridItem(grid,SWT.NONE);
			for (int j = 0; j < grid.getColumnCount(); j++) {
				item.setText(j,(i+1) + "," + (j+1));
			}
		}
	}

	public static void main (String [] args) {
		Display display = new Display ();
		Shell shell = new Shell (display);
		shell.setLayout(new FillLayout());
		new ColumnGrouping(shell);
		shell.setSize(500,500);
		shell.open ();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch ()) display.sleep ();
		}
		display.dispose ();
	}
} 

[Updated on: Mon, 24 November 2014 14:46]

Report message to a moderator

Re: Moving GridColumnGroup in Grid [message #1488064 is a reply to message #1485780] Wed, 26 November 2014 09:32 Go to previous messageGo to next message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 493
Registered: July 2009
Senior Member

Hi Kris,

Looks like a great idea but it is probably not implemented.

Please file a bug in bugzilla.

Best regards,

Wim
Re: Moving GridColumnGroup in Grid [message #1488106 is a reply to message #1488064] Wed, 26 November 2014 10:15 Go to previous message
Kris Slowinski is currently offline Kris SlowinskiFriend
Messages: 18
Registered: August 2011
Junior Member
I have created a bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=453282
Previous Topic:Trace Type SOLID_LANE join all points
Next Topic:Multiple Gantt Charts?
Goto Forum:
  


Current Time: Sat Nov 09 04:22:55 GMT 2024

Powered by FUDForum. Page generated in 0.03618 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top