Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » GridEditor problem
GridEditor problem [message #9411] Thu, 24 August 2006 10:44 Go to next message
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 12:37 Go to previous message
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 12:37 Go to previous message
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
>
>
Previous Topic:GridEditor problem
Next Topic:Re: Blank view when implementing CTableTree
Goto Forum:
  


Current Time: Thu Oct 23 08:03:46 GMT 2014

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

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