[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: UI controls friendly with the workspace thread

Ok ok...I have such a class for the Parameter Object which I am actually 
using right now, but my point is: since the eclipse code is a reference 
point for writing eclipse plugins and knowing that the New Java Project 
wizard uses those smart controls i'm talking about, i am just tempted to do 
the same. Anywayz, since nobody knows of the existance of such an api, i'll 
surely stick to my current solution.

Thanks,
Andrei.

"Eric Rizzo" <eclipse-news@xxxxxxxxxxxx> wrote in message 
news:fvf95k$th3$1@xxxxxxxxxxxxxxxxxxxx
> Andrei Serea wrote:
>> Ed,
>>
>> Yes, I guess I could easily do that, but I would also hate to do it since 
>> it would look nasty...I would have to pass aproximately 10 objects as 
>> parameters to the background job.
>
> That just sounds like a candidate for the Parameter Object pattern 
> (http://sourcemaking.com/refactoring/introduce-parameter-object)
>
> In wizards, if you are going to do background thread work after the Finish 
> button has been pressed, you have to store the data from the widgets ahead 
> of time; that is just how it works.
> One option is to use Data Binding to help with this. Define a simple model 
> for the data, create and instance of it when initializing the wizard and 
> its pages, and then use Data Binding to automatically bind the widget 
> values into it. That model is accessible from any thread since it is not 
> an SWT or JFace object.
>
> Hope this helps,
> Eric
>
>
>>
>> "Ed Merks" <merks@xxxxxxxxxx> wrote in message 
>> news:fvcigb$40f$1@xxxxxxxxxxxxxxxxxxxx
>>> Andrei,
>>>
>>> Couldn't you just pull the data out of the controls and pass it to the 
>>> background job?  I suppose you could use syncExec, but that seems kind 
>>> of gross...
>>>
>>>
>>> Andrei Serea wrote:
>>>> Hi all,
>>>>
>>>> I have came across a problem and I bet I'm not the only one: while 
>>>> creating a wizard for my own type of project, doing the usual workspace 
>>>> work (create the project and stuff), I wanted to access some controls 
>>>> to get info out of them...and surprize: invalid thread access.
>>>> Now, I have studied the way that the New Java Project Wizard does it 
>>>> and I saw that it uses some cool controls that store the info in a 
>>>> workspace thread friendly object (besides the widget itself). The only 
>>>> problem is that these classes are internal.. :(( (I'm talking about all 
>>>> the classes that extend 
>>>> org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField).
>>>> Here's the question: does anybody know about some controls that do the 
>>>> same but that are public???
>>>>
>>>> PS. If you ask me, I can't find a bloody reason for those classes to be 
>>>> internal in JDT...but that's just my two cents...
>>>>
>>>>
>>