Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Why do "PreferenceNode" trigger the exception ?
Why do "PreferenceNode" trigger the exception ? [message #453817] Mon, 11 April 2005 04:18
Eclipse UserFriend
Hi.

With "JFace", the following source works well :

<code_start>
public class MainFrame {
public static void main(String[] args) {
Display display = new Display();
PreferenceManager mgr = new PreferenceManager();

// fragment #1
PreferenceNode one = new PreferenceNode("one", new PageOne());
//

mgr.addToRoot(one);
PreferenceDialog dlg = new PreferenceDialog(null, mgr);
dlg.open();
display.dispose();
}
}
class PageOne extends PreferencePage {
protected Control createContents(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
return composite;
}
}
</code_start>


But, the "NullPointerException" occurs if the fragment #1 above
is replaced with the following one :

///////
PreferenceNode one = new PreferenceNode("one", "One",
null,
PageOne.class.getName());
///////

What wrong ?
Thanks.
Previous Topic:How to get references to views from an editor
Next Topic:eclipse 3.1M6: unable to run a SWT app
Goto Forum:
  


Current Time: Tue Jul 08 06:01:00 EDT 2025

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

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

Back to the top