Hi,
I have a widget in a editor. I have set focus on text box and I need to get that widget. i have used Some API to get that widget from UI which it has focus. But i want the text which is present in that text box. Is that possible to get the text from the widget. I cannot use named widgetlocator for that textbox because it has created very generic way across the tool.
I have attached the Snippets. Just go through it and give me ur valuable suggestion...
// Using mouse click key board shortcut i'm somehow setting focus on widgets
this.ui.keyClick(WT.SHIFT + WT.TAB);
this.ui.keyClick(WT.CTRL, 'A');
this.ui.keyClick(WT.DEL);
this.ui.enterText("100");
// In thread I'm trying to access that widget
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
// here getFocusControl() returning the widget which has current focus and i'm getting that widget as text too.. but i don have any API to get text from the widget
Control focusControl = Display.getCurrent().getFocusControl();
//Shell shell = focusControl.getShell();
// String text = shell.getText();
//System.out.println(text);
}
});
Now i need that 100 to assert check... Please give me ur valuable suggestion.