Hi! In one of our refactorings (extract method), we'd like to give the user the ability to modify the selected code in the dialog of the refactoring. It would be nice if this selection widget had the same appearance as the other editor windows, or like the formatting-preferences page. I came up with this code:
Map<String, String> map = new HashMap<String, String>(); selectionPreview = new RubyScriptPreview(map, modifySelectionEditorComposite); FormData textLData = new FormData(0, 0); textLData.right = new FormAttachment(1000, 1000, -80); textLData.left = new FormAttachment(0, 1000, 0); textLData.top = new FormAttachment(0, 1000, 0); textLData.bottom = new FormAttachment(1000, 1000, 0); selectionPreview.getControl().setLayoutData(textLData); selectionPreview.setPreviewText("class Test\ndef test\nend\nend"); And it works so far, but I get this exception when the widget is used: Exception in thread "org.rubypeople.rdt.internal.ui.text.RubyReconciler" java.lang.NullPointerException at org.rubypeople.rdt.internal.ui.text.ruby.RubyReconcilingStrategy.reconcile(RubyReconcilingStrategy.java:71) at org.rubypeople.rdt.internal.ui.text.ruby.RubyReconcilingStrategy.initialReconcile(RubyReconcilingStrategy.java:154) at org.eclipse.jface.text.reconciler.MonoReconciler.initialProcess(MonoReconciler.java:103) at org.rubypeople.rdt.internal.ui.text.RubyReconciler.initialProcess(RubyReconciler.java:126) at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:170) What is the right way to use this widget? Or am I using the wrong one? Regards Mirko ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Rubyeclipse-development mailing list Rubyeclipse-development@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rubyeclipse-development