SWT.ICON_SEARCH and SWT.ICON_CANCEL not work in the dialog [message #1043679] |
Wed, 17 April 2013 21:57  |
Eclipse User |
|
|
|
SWT.ICON_SEARCH and SWT.ICON_CANCEL not work in the dialog
SWT.ICON_SEARCH and SWT.ICON_CANCEL do work in the view
Text txtName = new Text(compName, SWT.BORDER | SWT.SEARCH | SWT.ICON_SEARCH
| SWT.ICON_CANCEL);
txtName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false,
1, 1));
txtName.addSelectionListener(new SelectionAdapter() {
private static final long serialVersionUID = 1L;
public void widgetDefaultSelected(SelectionEvent e) {
if (e.detail == SWT.ICON_SEARCH) {
searchData();
}
}
});
|
|
|
|
Re: SWT.ICON_SEARCH and SWT.ICON_CANCEL not work in the dialog [message #1061857 is a reply to message #1046680] |
Tue, 04 June 2013 07:55   |
Eclipse User |
|
|
|
[quote title=Ralf Sternberg wrote on Mon, 22 April 2013 04:17]worksforme
Sir,
I am using Windows XP, RAP2.1M2 , Eclipse 4.2.2
--------------
Text text = new Text(compName, SWT.BORDER | SWT.SEARCH | SWT.ICON_SEARCH | SWT.ICON_CANCEL);
text.addSelectionListener(new SelectionListener() {
private static final long serialVersionUID = 1L;
public void widgetDefaultSelected(SelectionEvent e) {
if ( e.detail == SWT.ICON_SEARCH )
MessageDialog.openInformation(null,"message", "clicked ICON_SEARCH");
}
});
--------------
It doesn't work! Also, I tried using "new SelectionAdapter()" instead, doesn't work either! seems the SelectionAdapter or SelectionListener Event cannot be trigged!
This is a usful function for the user to select his desired data to the Text!
Can you please show me some working sample code? Appreciate you in advance!
|
|
|
Re: SWT.ICON_SEARCH and SWT.ICON_CANCEL not work in the dialog [message #1061874 is a reply to message #1061857] |
Tue, 04 June 2013 09:09   |
Eclipse User |
|
|
|
Hi,
it's working for me too. See
http://rap.eclipsesource.com/controlsdemo/controls#Text
Select SEARCH, ICON_SEARCH, ICON_CANCEL and SelectionListener checkboxes
and click on the search/cancel icons.
Which browser are you using?
Best,
Ivan
On 6/4/2013 3:03 PM, David Lee wrote:
> [quote title=Ralf Sternberg wrote on Mon, 22 April 2013 04:17]worksforme
>
> Sir,
>
> I am using Windows XP, RAP2.1M2 , Eclipse 4.2.2
>
> --------------
> Text text = new Text(compName, SWT.BORDER | SWT.SEARCH |
> SWT.ICON_SEARCH | SWT.ICON_CANCEL);
>
> text.addSelectionListener(new SelectionListener() {
> private static final long serialVersionUID = 1L;
> public void widgetDefaultSelected(SelectionEvent e) {
> if ( e.detail == SWT.ICON_SEARCH )
> MessageDialog.openInformation(null,"message", "clicked ICON_SEARCH");
> }
> });
> --------------
>
> It doesn't work! Also, I tried using "new SelectionAdapter()" instead,
> doesn't work either! seems the SelectionAdapter or SelectionListener
> Event cannot be trigged!
> This is a usful function for the user to select his desired data to
> the Text!
>
> Can you please show me some working sample code? Appreciate you in
> advance!
--
Ivan Furnadjiev
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
|
Re: SWT.ICON_SEARCH and SWT.ICON_CANCEL not work in the dialog [message #1061910 is a reply to message #1061874] |
Tue, 04 June 2013 12:20  |
Eclipse User |
|
|
|
Thank Ivan for your quick reply.
It works now!
In View.java, I finally found that if there are a Text with "SWT.SEARCH | SWT.ICON_SEARCH | SWT.ICON_CANCEL" and a Button on the same screen, if set shell's "setDefaultButtonthe" to the Button, like "parent.getShell().setDefaultButton(button)", that'll interfere the search's behavior in Text.
|
|
|
Powered by
FUDForum. Page generated in 0.06474 seconds