Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » SWT.ICON_SEARCH and SWT.ICON_CANCEL not work in the dialog
SWT.ICON_SEARCH and SWT.ICON_CANCEL not work in the dialog [message #1043679] Wed, 17 April 2013 21:57 Go to next message
ocean xue is currently offline ocean xue
Messages: 105
Registered: November 2011
Senior Member
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 #1046680 is a reply to message #1043679] Mon, 22 April 2013 04:17 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf Sternberg
Messages: 1290
Registered: July 2009
Senior Member

worksforme

--
Ralf Sternberg

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 #1061857 is a reply to message #1046680] Tue, 04 June 2013 07:55 Go to previous messageGo to next message
David Lee is currently offline David Lee
Messages: 22
Registered: May 2013
Junior Member
[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 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1783
Registered: July 2009
Senior Member
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 Go to previous message
David Lee is currently offline David Lee
Messages: 22
Registered: May 2013
Junior Member
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.
Previous Topic:How to obtain browser client's IP Address
Next Topic:Can't launsch as RWT application in eclipse because Maven dependency "javax.servlet"
Goto Forum:
  


Current Time: Fri Aug 01 20:41:47 EDT 2014

Powered by FUDForum. Page generated in 0.12362 seconds