Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 350033 - [FileDialog] Remove setAutoUpload(boolean) and isAutoUpload public methods
Summary: [FileDialog] Remove setAutoUpload(boolean) and isAutoUpload public methods
Status: RESOLVED WONTFIX
Alias: None
Product: RAP
Classification: RT
Component: Incubator (show other bugs)
Version: 1.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-22 07:01 EDT by Ivan Furnadjiev CLA
Modified: 2011-10-10 06:25 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Furnadjiev CLA 2011-06-22 07:01:47 EDT
In SWT implementation of FileDialog there are *no* such public methods:
FileDialog#setAutoUpload(boolean)
FileDialog#isAutoUpload
We have to remove them and use other way to set and get the autoUpload flag - setData for example.
Comment 1 Ivan Furnadjiev CLA 2011-06-22 12:56:14 EDT
Currently we have two ideas for replacement of these methods:
1. using setData
2. using style flag
Both ideas require a new public constant (in FileDialog or somewhere else - RWT for example).
What do you think?
Comment 2 Austin Riddle CLA 2011-06-22 13:20:24 EDT
+1 for using style flag
Comment 3 Austin Riddle CLA 2011-06-22 13:34:06 EDT
(In reply to comment #1)
> 1. using setData

The use of setData() seems more compatible with single sourcing, except that if one were using the new flag it would not be, unless a raw string was specified.
If a raw string were specified it would not conflict with the SWT version of FileDialog.

> 2. using style flag

This seems a little more elegant, but the same single sourcing issue here. If one used the constant, it would not be single sourced unless we used a constant already in SWT like SWT.DEFER for the non-autoupload case. If one were to use a raw number instead of the constant, it might be more single source compatible, but could potentially conflict with the consumption of the style bits in the SWT version.
Comment 4 Ivan Furnadjiev CLA 2011-06-23 04:51:18 EDT
As we discussed auto upload to be the default mode in FileDialog, SWT.DEFER style flag for removing the default auto upload mode sounds good to me. Ralf what do you think?
Comment 5 Cole Markham CLA 2011-06-23 15:01:21 EDT
I would rather see the setData method because that is guaranteed to not break the SWT implementation. Using a style bit sounds elegant, but many SWT classes check the style bits and complain if they get one they don't understand. Using the setData would be much like custom variants, it would just get ignored by the SWT versions and the RWT ones would know what to do with it. The constant itself can be defined in an appropriate place, and one of the standard methods for dealing with single-sourcing can be used.
Comment 6 Rüdiger Herrmann CLA 2011-06-24 07:46:14 EDT
I have a tendency towards setData(), simply because setData() aligns with how things can be achieved where there is no API for in SWT (e.g. CUSTOM_VARIANT).
Comment 7 Ralf Sternberg CLA 2011-06-24 10:58:41 EDT
I agree that the extra style flag is an elegant idea, but I'd prefer to use one pattern consistently wherever we have to extend the SWT API. And since we already started using setData() elsewhere, I'd prefer to continue with this. After all, setData() is flexible enough to cover all future needs (the only issue I have with it is that it's not suitable for settings that must not change after construction).

Moreover, some widgets have somewhat magical checkData() code that resets or adds some bits. We probably make our lifes easier if we don't mess around with these constants ;-)
Comment 8 Ivan Furnadjiev CLA 2011-08-05 01:55:14 EDT
Please note that FileDialog is not a widget and there is not setData() method available.
Comment 9 Ivan Furnadjiev CLA 2011-10-10 03:19:26 EDT
As there are no other alternatives, we agreed to leave it as is.
Comment 10 Ralf Sternberg CLA 2011-10-10 06:25:22 EDT
I added a warning to the JavaDoc of the non-SWT methods. My preference would still be to make auto-upload the default but that would be the topic of another bug...

I also renamed isAutoUpload() to getAutoUpload() in order to align the method to the SWT naming pattern.