Hi,

 

When I am setting new text for a cell in table, it is not calling the
listener attached to it.

For tree I am using org.eclipse.jface.viewers.TableViewer.java and the
Listener is class that extends
org.eclipse.jface.viewers.ICellModifier.java

 

As can be seen in the following code:

//SpreadsheetCellModifier.java implements ICellModifier

                SpreadsheetCellModifier cellModifier = new
SpreadsheetCellModifier(tableViewer,

                    dataAccessor);

                cellModifier.setColumnMapping(columnNameTab,
colMapping);

                cellModifier.setDataClass(selectedClass);

                tableViewer.setCellModifier(cellModifier);

 

As there is no method available to set text in a cell of a table in
SWTBot, so tried to extend it, but my trial is not at all working. Here
is the code I did:

 

      public void modify (final int row, final int column, final String
value) {

            assertIsLegalCell(row, column);

            // for some reason, it does not work without setting
selection first

            select(row);

            syncExec(new VoidResult() {

                  public void run() {

                        TableItem item = getControl().getItem(row);

                        Rectangle cellBounds = item.getBounds(column);

                        clickXY(cellBounds.x + (cellBounds.width / 2),
cellBounds.y + (cellBounds.height / 2));

                        item.setText(column, value);

                        notifyFocusOut(row, value);

                  }

            });

      }

      protected void notifyFocusOut (final int row, final String text) {

            notify(SWT.FocusOut, selectionEvent(row, text));

      }

      private Event selectionEvent(final int row, final String text) {

            Event event = createEvent();

            event.item = getControl().getItem(row);

            event.text = text;

            return event;

      }

 

Can any one helping this regard?

 

Thanks,

_________________________________________________________

Ankit Jain / Capgemini "India" / Bangalore 
Consultant/ Sogeti
Com1: 080-6656700- extn: 8473 Com2: +919986017572 / www.capgemini.com
<http://www.capgemini.com> 
 Together. Free your energies
_________________________________________________________

 

 







This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is 
intended only for the person to whom it is addressed. If you are not the 
intended recipient, you are not authorized to 
read, print, retain, copy, disseminate, distribute, or use this message or any 
part thereof. If you receive this message 
in error, please notify the sender immediately and delete all copies of this 
message.

<<image001.gif>>

<<image002.gif>>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
SWTBot-users mailing list
SWTBot-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swtbot-users
http://swtbot.org/ - a functional testing tool for SWT/Eclipse

Reply via email to