| Summary: | Handle SWT dialogs style flags in the same way | ||
|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Ivan Furnadjiev <ivan> |
| Component: | Incubator | Assignee: | Project Inbox <rap-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 1.4 | ||
| Target Milestone: | 2.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Ivan Furnadjiev
Couldn't the FileDialog just call Dialog#checkStyle() to handle its style bits? AFAIK Dialog#checkStyle() is in sync with SWT, thus everything would be in order Directly calling Dialog#checkStyle() is not possible in FileDialog due to: java.lang.IllegalAccessError: tried to access method org.eclipse.swt.widgets.Dialog.checkStyle(Lorg/eclipse/swt/widgets/Shell;I)I from class org.eclipse.swt.widgets.FileDialog That's why we have a copy of Dialog#checkStyle method in FileDialog class iteself + some additions - force SWT.TILTLE and remove SWT.MIN styles. In SWT, shell styles (SWT.RESIZE, SWT.MAX etc) specified in Dialog "style" ctor are ignored by OS (not filtered by Dialog#checkStyle) because these dialogs are OS native dialogs. For FontDialog and ColorDialog this is not a big problem as "style" ctor has no sense (no specific dialog styles). This is not the case with FileDialog, because we have a specific SWT.MULTI style. Based on Dialog#checkStyle implementation, the code: new FileDialog( shell, SWT.MULTI ) will create a dialog with trimmings (titlebar + close button) in SWT, but not in RAP. And the question is: do we need to support the dialog shell configuration styles ( SWT.RESIZE, SWT.CLOSE, SWT.MAX etc) as they are not filtered by Dialog#checkStyle, but OS? At least, SWT.RESIZE and SWT.MAX make sense for MULTI FileDialog. And if we agree to support them on FileDialog (the current implementation does this), does it make sense to support them in other standard dialogs (for consistency)? Now I got it, sorry for the confusion. Whatever we decide, we should handle style flags consistently for all kinds of dialogs. To me it seems the least effort to not pass the styles though to the shell (we probably would then want to filter non-Shell styles, etc.) If this is the case I would go that way. If a need for differently styled dialog shells arises we can still implement it. The FileDialog has been completely re-writen before it's moved to RAP core repo. The style flags for FileDialog/ColorDialog/FontDialog are now handled in the same way. |