Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to set id`s to org.eclipse.swt.widgets.Table items and rows (I`m having a situation, where I need to set id`s to rows and columns inside a SWT table to help QA for their automation)
How to set id`s to org.eclipse.swt.widgets.Table items and rows [message #1219530] Wed, 04 December 2013 12:27 Go to next message
Naveen Aechan is currently offline Naveen AechanFriend
Messages: 4
Registered: December 2013
Junior Member
Hi all,

SWT provided us an option to set ID`s to each component in SWT i.e; using a VM argument "-Dorg.eclipse.rap.rwt.enableUITests=true" and setting an a property called "WidgetUtil.CUSTOM_WIDGET_ID"

Button button = new Button(parent,SWT.BORDER);
button.setData(WidgetUtil.CUSTOM_WIDGET_ID,"mybutton");



using this we get html something like <div id="mybutton" ... />. In the same way we need to have id`s to table column and tableitems.

Problem here is using above mentioned approach, I was unable to get id`s, I would really appreciate, if anyone have an approach to get this done.



Table table = new Table(this, SWT.BORDER | SWT.FULL_SELECTION);
this.table.setBounds(0, 0, this.tableWidth, this.tableHeight);
TableColumn tc1 = new TableColumn(table, SWT.CENTER);
tc1.setWidth(120);
tc1.setData(WidgetUtil.CUSTOM_WIDGET_ID, "colId");

TableItem item1 = new TableItem(this.table, SWT.NONE);
item1.setText(0,"one");
item1.setData(WidgetUtil.CUSTOM_WIDGET_ID, "tableitem");

Re: How to set id`s to org.eclipse.swt.widgets.Table items and rows [message #1708603 is a reply to message #1219530] Fri, 18 September 2015 05:07 Go to previous message
Divyank Singh is currently offline Divyank SinghFriend
Messages: 1
Registered: September 2015
Junior Member
I am facing the same problem. I need to set id's to tree items, but not able yo do it using setData(). Could you let me know how you were able to solve this issue.
Previous Topic:FormLayout behaviour on resizing
Next Topic:Realign ragged-left TableEditor after update
Goto Forum:
  


Current Time: Thu Apr 25 04:42:27 GMT 2024

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

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

Back to the top