Skip to main content


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] Thu, 18 April 2013 01:57 Go to next message
ocean xue is currently offline ocean xueFriend
Messages: 107
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 08:17 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
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 11:55 Go to previous messageGo to next message
David Lee is currently offline David LeeFriend
Messages: 78
Registered: May 2013
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 13:09 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
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 16:20 Go to previous message
David Lee is currently offline David LeeFriend
Messages: 78
Registered: May 2013
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:RAP Client Service Lifecycle
Next Topic:chart tools for RAP
Goto Forum:
  


Current Time: Wed Apr 24 18:09:06 GMT 2024

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

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

Back to the top