Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Exception when re-opening PrefenceDialog ?
Exception when re-opening PrefenceDialog ? [message #435025] Tue, 09 August 2005 07:29 Go to next message
Eclipse User
Originally posted by: eclipse.newsgroups.anegma.com

Hello,

working on my RCP application I get a serious problem with the
preference dialog. Once I start it (via an action), everything
is fine. But if I close the dialog and try again to open it
I get an exception:

org.eclipse.jface.util.Assert$AssertionFailedException: null argument;
at org.eclipse.jface.util.Assert.isNotNull(Assert.java:149)
at org.eclipse.jface.util.Assert.isNotNull(Assert.java:125)


This is the source with that I open the dialog:

public void run() {
if (parentWindow != null) {
PreferenceManager pm =
PlatformUI.getWorkbench().getPreferenceManager();

IPreferenceNode[] preferencePages = getPreferencePages();
for (int i = 0; i < preferencePages.length; i++) {
prefManager.addToRoot(preferencePages[i]);
}
if (prefManager != null) {
PreferenceDialog prefDialog =
new PreferenceDialog(parentWindow.getShell(), pm);

prefDialog.setPreferenceStore(
PlatformUI.getPreferenceStore());
prefDialog.create();
prefDialog.open();
}
for (int i = 0; i < preferencePages.length; i++) {
preferencePages[i].disposeResources();
}
}
}

If I remove the PreferenceManager from the Dialog I can open
the Dialog as often I want.

Does anyone knwo what I'm doing wrong here ??

- Gunnar Pietz
Re: Exception when re-opening PrefenceDialog ? [message #734605 is a reply to message #435025] Sat, 08 October 2011 20:51 Go to previous message
Marco Lopes is currently offline Marco Lopes
Messages: 56
Registered: September 2010
Member
You must re-create eveything everytime you open the dialog.
Previous Topic:Re-Use GUI in embedded eclipse viewpart and Standalone RCP application window
Next Topic:[CNF] How to get rid of unwanted popup actions
Goto Forum:
  


Current Time: Thu Oct 23 11:11:24 GMT 2014

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

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