Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » How to close preference dialog?
How to close preference dialog? [message #290465] Thu, 25 August 2005 12:17 Go to next message
Eclipse UserFriend
Originally posted by: cward.go-integral.com

I have a preference page that I have a added a button to. I would like
to do an action, and then close the preferences dialog. How would I do
that. Calling performOk() or performCancel() does't do it.

eg

public void contributeButtons(Composite parent) {
Button login = new Button(parent, SWT.PUSH);
login.setText(" Login ");
login.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
System.out.println("action here");
performOk();
}
});
((GridLayout)parent.getLayout()).numColumns +=1;
}

This will perform the Ok action, but not close the window. What else can
I do?

Chris
Re: How to close preference dialog? [message #290481 is a reply to message #290465] Thu, 25 August 2005 13:10 Go to previous message
Eclipse UserFriend
Originally posted by: sunil_kamath.nohotspammail.com

"Chris Ward" <cward@go-integral.com> wrote in message
news:dekqtu$9p9$1@news.eclipse.org...
>I have a preference page that I have a added a button to. I would like to
>do an action, and then close the preferences dialog. How would I do that.
>Calling performOk() or performCancel() does't do it.
>
> eg
>
> public void contributeButtons(Composite parent) {
> Button login = new Button(parent, SWT.PUSH);
> login.setText(" Login ");
> login.addSelectionListener(new SelectionAdapter() {
> public void widgetSelected(SelectionEvent event) {
> System.out.println("action here");
> performOk();
> }
> });
> ((GridLayout)parent.getLayout()).numColumns +=1;
> }
>
> This will perform the Ok action, but not close the window. What else can I
> do?
>
((PreferenceDialog)getContainer()).close()
---
Sunil
Previous Topic:How can I use the command/handler API?
Next Topic:ClassNotFoundException with new .jar - but old one works???
Goto Forum:
  


Current Time: Mon Jul 14 14:46:13 EDT 2025

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

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

Back to the top