| 
| GridEditor problem [message #9411] | Thu, 24 August 2006 06:44  |  | 
| Eclipse User  |  |  |  |  | Originally posted by: shilpa.pramati.com 
 Usage of GridEditor
 
 private static final int NUM = 3;
 
 final Grid grid = new Grid(shell,SWT.BORDER | SWT.V_SCROLL |
 SWT.H_SCROLL);
 grid.setHeaderVisible(true);
 
 GridColumn column = null;
 GridItem item = null;
 GridEditor gridEditor = null;
 
 //Create three columns
 for (int i = 0; i < NUM; i++) {
 column = new GridColumn(grid, SWT.LEFT);
 column.setTree(true);
 column.setText(headers[i]);
 column.setWidth(100);
 }
 
 for (int i=0; i<NUM; i++) {
 item = new GridItem(grid, SWT.NONE);
 }
 
 GridItem [] items = grid.getItems ();
 
 for (int i=0; i<items.length; i++) {
 GridEditor editor = new GridEditor(grid);
 Text text = new Text(grid, SWT.NONE);
 editor.grabHorizontal = true;
 editor.setEditor(text,items[i],0);
 editor.setEditor(text,items[i],1);
 editor.setEditor(text,items[i],2);
 }
 
 I want all the columns of three rows to be editable ie have Text in column
 But the above code gives a different result. The third column of the three
 rows are editable ........
 
 Can someone help ?
 
 Thanks in advance
 Shilpa
 |  |  |  | 
| 
| Re: GridEditor problem [message #9436 is a reply to message #9411] | Thu, 24 August 2006 08:37  |  | 
| Eclipse User  |  |  |  |  | Originally posted by: shilpa.pramati.com 
 I figured out the problem
 
 thanks
 Shilpa
 
 "Shilpa" <shilpa@pramati.com> wrote in message
 news:ecjvuq$5dn$1@utils.eclipse.org...
 > Usage of GridEditor
 >
 >        private static final int NUM = 3;
 >
 >        final Grid grid = new Grid(shell,SWT.BORDER | SWT.V_SCROLL |
 > SWT.H_SCROLL);
 >        grid.setHeaderVisible(true);
 >
 >        GridColumn column = null;
 >        GridItem item = null;
 >        GridEditor gridEditor = null;
 >
 >        //Create three columns
 >        for (int i = 0; i < NUM; i++) {
 >            column = new GridColumn(grid, SWT.LEFT);
 >            column.setTree(true);
 >            column.setText(headers[i]);
 >            column.setWidth(100);
 >        }
 >
 >        for (int i=0; i<NUM; i++) {
 >            item = new GridItem(grid, SWT.NONE);
 >        }
 >
 >        GridItem [] items = grid.getItems ();
 >
 >        for (int i=0; i<items.length; i++) {
 >            GridEditor editor = new GridEditor(grid);
 >            Text text = new Text(grid, SWT.NONE);
 >            editor.grabHorizontal = true;
 >            editor.setEditor(text,items[i],0);
 >            editor.setEditor(text,items[i],1);
 >            editor.setEditor(text,items[i],2);
 >        }
 >
 > I want all the columns of three rows to be editable ie have Text in column
 > But the above code gives a different result. The third column of the three
 > rows are editable ........
 >
 > Can someone help ?
 >
 > Thanks in advance
 > Shilpa
 >
 >
 |  |  |  | 
| 
| Re: GridEditor problem [message #564195 is a reply to message #9411] | Thu, 24 August 2006 08:37  |  | 
| Eclipse User  |  |  |  |  | Originally posted by: shilpa.pramati.com 
 I figured out the problem
 
 thanks
 Shilpa
 
 "Shilpa" <shilpa@pramati.com> wrote in message
 news:ecjvuq$5dn$1@utils.eclipse.org...
 > Usage of GridEditor
 >
 >        private static final int NUM = 3;
 >
 >        final Grid grid = new Grid(shell,SWT.BORDER | SWT.V_SCROLL |
 > SWT.H_SCROLL);
 >        grid.setHeaderVisible(true);
 >
 >        GridColumn column = null;
 >        GridItem item = null;
 >        GridEditor gridEditor = null;
 >
 >        //Create three columns
 >        for (int i = 0; i < NUM; i++) {
 >            column = new GridColumn(grid, SWT.LEFT);
 >            column.setTree(true);
 >            column.setText(headers[i]);
 >            column.setWidth(100);
 >        }
 >
 >        for (int i=0; i<NUM; i++) {
 >            item = new GridItem(grid, SWT.NONE);
 >        }
 >
 >        GridItem [] items = grid.getItems ();
 >
 >        for (int i=0; i<items.length; i++) {
 >            GridEditor editor = new GridEditor(grid);
 >            Text text = new Text(grid, SWT.NONE);
 >            editor.grabHorizontal = true;
 >            editor.setEditor(text,items[i],0);
 >            editor.setEditor(text,items[i],1);
 >            editor.setEditor(text,items[i],2);
 >        }
 >
 > I want all the columns of three rows to be editable ie have Text in column
 > But the above code gives a different result. The third column of the three
 > rows are editable ........
 >
 > Can someone help ?
 >
 > Thanks in advance
 > Shilpa
 >
 >
 |  |  |  | 
Powered by 
FUDForum. Page generated in 0.03585 seconds