Why do "PreferenceNode" trigger the exception ? [message #453817] |
Mon, 11 April 2005 04:18 |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.04043 seconds