Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » respond to user action on a checkbox
respond to user action on a checkbox [message #453665] Tue, 08 August 2006 06:02 Go to next message
Eclipse UserFriend
Originally posted by: vindhyalesh.huawei.com

i have made one popup check box where user can select one ar all the
options,now i need to respond to user action after he has selected optiins
and clicks the ok button,please tell me how to implement this as well as i
have to read the user ipnut......

Thanx in advance

Regards,
Vindhyalesh
Re: respond to user action on a checkbox [message #453667 is a reply to message #453665] Tue, 08 August 2006 09:22 Go to previous messageGo to next message
Jan Lohre is currently offline Jan LohreFriend
Messages: 86
Registered: July 2009
Member
Hi,

that depends on what you mean by popup check box. Did you use any JFace
viewer or plain SWT?

In the SWT case
button.getSelection() should do the job.


Regards,
Jan

vindhyalesh schrieb:
> i have made one popup check box where user can select one ar all the
> options,now i need to respond to user action after he has selected
> optiins and clicks the ok button,please tell me how to implement this as
> well as i have to read the user ipnut......
>
> Thanx in advance
>
> Regards,
> Vindhyalesh
>
Re: respond to user action on a checkbox [message #453668 is a reply to message #453667] Tue, 08 August 2006 09:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vindhyalesh.huawei.com

hi,
i have used swt for the pop up check box,but its outlook is not looking
good,can u please tell me how to implement popup checkbox in jface and
also suggest me the way to read the user input from jface popup checkbox...


Regards,
Vindhyalesh
Re: respond to user action on a checkbox [message #453669 is a reply to message #453668] Tue, 08 August 2006 10:25 Go to previous messageGo to next message
Jan Lohre is currently offline Jan LohreFriend
Messages: 86
Registered: July 2009
Member
Hi,

well I have no exact idea what you mean by popup check box?

First of all, JFace provides some basic Dialog classes. After displaying
a Dialog with dialog.open() you can test the return value for OK or
Cancel. Just have a look at the API Documentation (package
org.eclipse.jface.dialogs)

Second for example the JFace TreeViewer has a checkbox version but I
dont know if tha s useful for you. There is a method
checkboxTreeViewer.getCheckedElements returning an Object[] containing
the checked elements.


Regards
Jan
vindhyalesh schrieb:
> hi,
> i have used swt for the pop up check box,but its outlook is not
> looking good,can u please tell me how to implement popup checkbox in
> jface and also suggest me the way to read the user input from jface
> popup checkbox...
>
>
> Regards,
> Vindhyalesh
>
Re: respond to user action on a checkbox [message #453670 is a reply to message #453669] Tue, 08 August 2006 10:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vindhyalesh.huawei.com

hi jan,
i have one table view and i have written one action for that view
so that when that actionis performed,one check box should pop up so that
user can select the options he wants and i ned to read this response and
act accordingly.please suggest some way in jface/swt. i think there is no
such APi to provide check boxex directly......i need to create
one...suggest me a solution


Regards,
Vindhyalesh
Re: respond to user action on a checkbox [message #453671 is a reply to message #453670] Tue, 08 August 2006 11:01 Go to previous message
Jan Lohre is currently offline Jan LohreFriend
Messages: 86
Registered: July 2009
Member
Hi Vindhyalesh,

let me put it clear:
On the action you want a dialog to popup that contains a certain number
checkboxes representing your options. Correct?

You should read the API for org.eclipse.jface.dialogs.Dialog.

Extend Dialog class.
Implement createContents(Composite parent) and place the Buttons and
Labels on the parent composite.

Add a method getSelectedOptions() that calls getSelection on the
checkboxes and returns whatever you need to know the selected options.

In the Action:
int result = dialog.open();
if (result == Dialog.OK){
dialog.getSelectedOptions()
//Your code
}


Regards,
Jan

vindhyalesh schrieb:
> hi jan,
> i have one table view and i have written one action for that view
> so that when that actionis performed,one check box should pop up so that
> user can select the options he wants and i ned to read this response and
> act accordingly.please suggest some way in jface/swt. i think there is
> no such APi to provide check boxex directly......i need to create
> one...suggest me a solution
>
>
> Regards,
> Vindhyalesh
>
Previous Topic:How to invoke Eclipse operations?
Next Topic:PropertySheetPage context menu
Goto Forum:
  


Current Time: Mon Oct 14 21:17:54 GMT 2024

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

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

Back to the top