Community
Participate
Working Groups
Created attachment 158062 [details] Snippet061FakedNativeCellEditor.java.diff I have a couple of improvements to the checkbox images rendering code of snippet 061. The attached patch provides the following: - class CheckboxImages - independent of singletons (JFaceResources...) - uses Control::print to capture the shots (only tested on the win32 platform, however) - provides images for the disabled and grayed states - class SelectableCheckboxCellEditor - used instead of BooleanCellEditor - provides cell navigation also while editing - does not support a tri-state model which would leverage the grayed state - a couple of additions to the navigation and direct-editing code of the example tree viewer Things to be done: - check whether the Control::print code works on all (or at least most) platforms, perhaps provide a fallback to the capture version used before (which will flash a shell quickly).
Tom, are you still a committer? If not, we'll have to go through the IP process with this.
Yes (albeit not on the Platform-UI project, only platform-text and jdt-text).
Great - as long as you are a committer on the same top-level project (Eclipse project) we're fine. Tom (Schindl), can you have a quick look over the snippet to make sure the changes make sense?
Tom?
I'll take the bug and commit it to CVS today
Hi Tom, would you mind sharing the whole class here? As I tried to merge code from your attachment but what I can see is just a black square instead of nicely looking checkbox in windows platform. Thanks.
(In reply to comment #6) > Hi Tom, would you mind sharing the whole class here? Please see http://tkilla.ch/eclipse/ > As I tried to merge code > from your attachment but what I can see is just a black square instead of > nicely looking checkbox in windows platform. Thanks. No idea here...
Hi Tom, thanks for the sharing. But still, I can't get a proper checkbox image in both windows and linux platform. Would you mind sharing the Snippet061FakedNativeCellEditor.java you have committed? Thanks in advanced.
Created attachment 165265 [details] Updated Patch But it's not working on OS-X-cocoa 3.5.x where the system goes into an endless event-loop spinning while clicking a Cell-Editor (need to to investigate why)
Is the above changes just workable on Mac OS? If not, would you mind sharing the Snippet061FakedNativeCellEditor.java with me so that I can help to test on other platforms like windows and linux? Thanks. By the way, I'm working on an eclipse rcp application which need a native checkbox image. The current approach to generate checkbox images need to open up another shell which is abit weird. Tom's approach is better to print directly on GC.
Check out the sources and apply the patch from above. The problem on OS-X is not the print call but something different (not sure though yet what's the problem)
Created attachment 165308 [details] A screenshot showing wrong checkbox images. I have tried on WinXP, here's the screenshot. The checkboxes are all black. And when I click on any cell which is editable, exception will be thrown. java.lang.NullPointerException at org.eclipse.jface.viewers.ColumnViewerEditor.activateCellEditor(ColumnViewerEditor.java:207) at org.eclipse.jface.viewers.ColumnViewerEditor.handleEditorActivationEvent(ColumnViewerEditor.java:443) at org.eclipse.jface.viewers.ColumnViewer.triggerEditorActivationEvent(ColumnViewer.java:680) at org.eclipse.jface.viewers.ColumnViewer.handleMouseDown(ColumnViewer.java:664) at org.eclipse.jface.viewers.ColumnViewer.access$0(ColumnViewer.java:660) at org.eclipse.jface.viewers.ColumnViewer$1.mouseDown(ColumnViewer.java:89) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:179) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422) at org.eclipse.jface.snippets.viewers.Snippet061FakedNativeCellEditor.main(Snippet061FakedNativeCellEditor.java:678)
Hi Tom Schindl, is the checkbox image correct on Mac OS? If yes, do you have any idea about it?
Please reopen if you plan to provide a Gerrit to improve the snippet